public function statusCapture() { Veritrans_Config::$serverKey = "VT-server-tHdPoLZ5B9msOwJBt-tN7jOE"; Veritrans_Config::$isProduction = false; // Use transaction_id from Pre-authorization process $transaction_id = '65d4d943-49c4-40b8-b746-ba634900aa48'; $amount = 9000000.0; $result = Veritrans_VtDirect::capture($transaction_id, $amount); pr($result); }
public function testCapture() { VT_Tests::$stubHttp = true; VT_Tests::$stubHttpResponse = '{ "status_code": "200", "status_message": "Success, Credit Card capture transaction is successful", "transaction_id": "1ac1a089d-a587-40f1-a936-a7770667d6dd", "order_id": "A27550", "payment_type": "credit_card", "transaction_time": "2014-08-25 10:20:54", "transaction_status": "capture", "fraud_status": "accept", "masked_card": "481111-1114", "bank": "bni", "approval_code": "1408937217061", "gross_amount": "55000.00" }'; $capture = Veritrans_VtDirect::capture("A27550"); $this->assertEquals($capture->status_code, "200"); $this->assertEquals(VT_Tests::$lastHttpRequest["url"], "https://api.sandbox.veritrans.co.id/v2/capture"); $fields = VT_Tests::lastReqOptions(); $this->assertEquals($fields["POST"], 1); $this->assertEquals($fields["POSTFIELDS"], '{"transaction_id":"A27550"}'); }