@@ -11,42 +11,24 @@ public function setUp()
1111 $ this ->request = new SecureXMLAuthorizeRequest ($ this ->getHttpClient (), $ this ->getHttpRequest ());
1212
1313 $ this ->request ->initialize ([
14- 'merchantId ' => 'XYZ0010 ' ,
14+ 'merchantId ' => 'XYZ0010 ' ,
1515 'transactionPassword ' => 'abcd1234 ' ,
16- 'testMode ' => true ,
17- 'amount ' => '12.00 ' ,
18- 'transactionId ' => '1234 ' ,
19- 'card ' => [
20- 'number ' => '4444333322221111 ' ,
21- 'expiryMonth ' => '10 ' ,
22- 'expiryYear ' => '2030 ' ,
23- 'cvv ' => '123 ' ,
16+ 'testMode ' => true ,
17+ 'amount ' => '12.00 ' ,
18+ 'transactionId ' => '1234 ' ,
19+ 'card ' => [
20+ 'number ' => '4444333322221111 ' ,
21+ 'expiryMonth ' => '10 ' ,
22+ 'expiryYear ' => '2030 ' ,
23+ 'cvv ' => '123 ' ,
2424 'cardHolderName ' => 'Sujip Thapa ' ,
2525 ],
2626 ]);
2727 }
2828
2929 public function testSendSuccess ()
3030 {
31- $ data = [];
32-
33- $ data ['RequestType ' ] = 'Payment ' ;
34- $ data ['statusDescription ' ] = 'Normal ' ;
35- $ data ['statusCode ' ] = '000 ' ;
36- $ data ['apiVersion ' ] = 'xml-4.2 ' ;
37- $ data ['txnType ' ] = '10 ' ;
38- $ data ['txnSource ' ] = '23 ' ;
39- $ data ['amount ' ] = '12.00 ' ;
40- $ data ['currency ' ] = 'AUD ' ;
41- $ data ['approved ' ] = 'Yes ' ;
42- $ data ['responseCode ' ] = '00 ' ;
43- $ data ['responseText ' ] = 'Approved ' ;
44- $ data ['txnID ' ] = '1234 ' ;
45- $ data ['cardDescription ' ] = 'Visa ' ;
46- $ data ['expiryDate ' ] = '10/30 ' ;
47- $ data ['cardType ' ] = '6 ' ;
48-
49- $ response = new SecureXMLResponse ($ this ->getMockRequest (), $ data );
31+ $ this ->setMockHttpResponse ('SecureXMLAuthorizeRequestSuccess.txt ' );
5032
5133 $ response = $ this ->request ->send ();
5234
@@ -63,7 +45,7 @@ public function testSendSuccess()
6345 $ this ->assertNotNull ($ response ->getTransactionId ());
6446 $ this ->assertSame ('Approved ' , $ response ->getMessage ());
6547 $ this ->assertSame ('00 ' , $ response ->getCode ());
66- $ this ->assertSame ('10 ' , (string ) $ data ->Payment ->TxnList ->Txn ->txnType );
48+ $ this ->assertSame ('0 ' , (string ) $ data ->Payment ->TxnList ->Txn ->txnType );
6749 }
6850
6951 public function testSendFailure ()
0 commit comments