����
One Hat Cyber Team
One Hat Cyber Team
Your IP :
3.144.2.213
Server IP :
192.185.194.254
Server :
Linux raider.websitewelcome.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
Server Software :
Apache
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home2
/
glenar
/
shop.glenar.com
/
app
/
midtrans
/
tests
/
View File Name :
MidtransNotificationTest.php
<?php namespace Midtrans; require_once dirname(__FILE__) . '/../Midtrans.php'; define( 'TEST_CAPTURE_JSON', '{ "status_code" : "200", "status_message" : "Midtrans payment notification", "transaction_id" : "826acc53-14e0-4ae7-95e2-845bf0311579", "order_id" : "2014040745", "payment_type" : "credit_card", "transaction_time" : "2014-04-07 16:22:36", "transaction_status" : "capture", "fraud_status" : "accept", "masked_card" : "411111-1111", "gross_amount" : "2700" }' ); class MidtransNotificationTest extends \PHPUnit_Framework_TestCase { public function testCanWorkWithJSON() { $tmpfname = tempnam(sys_get_temp_dir(), "midtrans_test"); file_put_contents($tmpfname, TEST_CAPTURE_JSON); VT_Tests::$stubHttp = true; VT_Tests::$stubHttpResponse = TEST_CAPTURE_JSON; $notif = new Notification($tmpfname); $this->assertEquals($notif->transaction_status, "capture"); $this->assertEquals($notif->payment_type, "credit_card"); $this->assertEquals($notif->order_id, "2014040745"); $this->assertEquals($notif->gross_amount, "2700"); unlink($tmpfname); } public function tearDown() { VT_Tests::reset(); } }