@@ -13,74 +13,85 @@ public function setUp()
1313
1414 public function testGenerateResponseFingerprint ()
1515 {
16- $ this ->request ->initialize (array (
17- 'amount ' => '465.18 ' ,
18- 'transactionPassword ' => 'abc123 ' ,
19- ));
16+ $ this ->request ->initialize (
17+ array (
18+ 'amount ' => '465.18 ' ,
19+ 'transactionPassword ' => 'abcd1234 ' ,
20+ )
21+ );
2022
2123 $ data = array (
22- 'timestamp ' => '20130602102927 ' ,
23- 'merchant ' => 'ABC0030 ' ,
24- 'refid ' => '222 ' ,
24+ 'timestamp ' => '20161125123332 ' ,
25+ 'merchant ' => 'XYZ0010 ' ,
26+ 'refid ' => '222 ' ,
2527 'summarycode ' => '2 ' ,
2628 );
2729
28- $ this ->assertSame ('0516a31bf96ad89c354266afb9bd4be43aaf853f ' , $ this ->request ->generateResponseFingerprint ($ data ));
30+ $ this ->assertSame ('79200d1df5dc3f914a90ce476fdef317d224629f ' ,
31+ $ this ->request ->generateResponseFingerprint ($ data ));
2932 }
3033
3134 public function testSuccess ()
3235 {
33- $ this ->request ->initialize (array (
34- 'amount ' => '355.00 ' ,
35- 'transactionPassword ' => 'abc123 ' ,
36- ));
36+ $ this ->request ->initialize (
37+ array (
38+ 'amount ' => '12.00 ' ,
39+ 'transactionPassword ' => 'abcd1234 ' ,
40+ 'transactionId ' => 'ORDER-ZYX8 ' ,
41+ )
42+ );
3743
38- $ this ->getHttpRequest ()->query ->replace (array (
39- 'timestamp ' => '20130602112954 ' ,
40- 'callback_status_code ' => '' ,
41- 'fingerprint ' => 'd9b40fc6f841f41ef3475220fe6316406a5256ce ' ,
42- 'txnid ' => '205861 ' ,
43- 'merchant ' => 'ABC0030 ' ,
44- 'restext ' => 'Approved ' ,
45- 'rescode ' => '00 ' ,
46- 'expirydate ' => '032016 ' ,
47- 'settdate ' => '20130602 ' ,
48- 'refid ' => '226 ' ,
49- 'pan ' => '444433...111 ' ,
50- 'summarycode ' => '1 ' ,
51- ));
44+ $ this ->getHttpRequest ()->query ->replace (
45+ array (
46+ 'timestamp ' => '20161125130241 ' ,
47+ 'callback_status_code ' => '-1 ' ,
48+ 'fingerprint ' => 'e30eb8381bc41201fbdf54a021d8228a3fbb6a6f ' ,
49+ 'txnid ' => '271337 ' ,
50+ 'merchant ' => 'XYZ0010 ' ,
51+ 'restext ' => 'Approved ' ,
52+ 'rescode ' => '00 ' ,
53+ 'expirydate ' => '20161126 ' ,
54+ 'settdate ' => '20161126 ' ,
55+ 'refid ' => 'ORDER-ZYX8 ' ,
56+ 'pan ' => '444433...111 ' ,
57+ 'summarycode ' => '1 ' ,
58+ )
59+ );
5260
5361 $ response = $ this ->request ->send ();
5462
55- $ this ->assertInstanceOf ('Omnipay\NABTransact\Message\DirectPostCompletePurchaseResponse ' , $ response );
63+ $ this ->assertInstanceOf (
64+ 'Omnipay\NABTransact\Message\DirectPostCompletePurchaseResponse ' ,
65+ $ response
66+ );
5667
5768 $ this ->assertTrue ($ response ->isSuccessful ());
5869 $ this ->assertFalse ($ response ->isRedirect ());
59- $ this ->assertSame ('205861 ' , $ response ->getTransactionReference ());
70+ $ this ->assertSame ('271337 ' , $ response ->getTransactionReference ());
6071 $ this ->assertSame ('Approved ' , $ response ->getMessage ());
6172 $ this ->assertSame ('00 ' , $ response ->getCode ());
6273 }
6374
6475 public function testFailure ()
6576 {
6677 $ this ->request ->initialize (array (
67- 'amount ' => '465.18 ' ,
78+ 'amount ' => '465.18 ' ,
6879 'transactionPassword ' => 'abc123 ' ,
6980 ));
7081
7182 $ this ->getHttpRequest ()->query ->replace (array (
72- 'timestamp ' => '20130602102927 ' ,
83+ 'timestamp ' => '20130602102927 ' ,
7384 'callback_status_code ' => '' ,
74- 'fingerprint ' => '0516a31bf96ad89c354266afb9bd4be43aaf853f ' ,
75- 'txnid ' => '205833 ' ,
76- 'merchant ' => 'ABC0030 ' ,
77- 'restext ' => 'Customer Dispute ' ,
78- 'rescode ' => '18 ' ,
79- 'expirydate ' => '052016 ' ,
80- 'settdate ' => '20130602 ' ,
81- 'refid ' => '222 ' ,
82- 'pan ' => '444433...111 ' ,
83- 'summarycode ' => '2 ' ,
85+ 'fingerprint ' => '0516a31bf96ad89c354266afb9bd4be43aaf853f ' ,
86+ 'txnid ' => '205833 ' ,
87+ 'merchant ' => 'ABC0030 ' ,
88+ 'restext ' => 'Customer Dispute ' ,
89+ 'rescode ' => '18 ' ,
90+ 'expirydate ' => '052016 ' ,
91+ 'settdate ' => '20130602 ' ,
92+ 'refid ' => '222 ' ,
93+ 'pan ' => '444433...111 ' ,
94+ 'summarycode ' => '2 ' ,
8495 ));
8596
8697 $ response = $ this ->request ->send ();
0 commit comments