@@ -21,6 +21,7 @@ public function setUp()
2121
2222 $ this ->captureOptions = array (
2323 'amount ' => '10.00 ' ,
24+ 'transactionId ' => '123 ' ,
2425 'transactionReference ' => '{"SecurityKey":"JEUPDN1N7E","TxAuthNo":"4255","VPSTxId":"{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}","VendorTxCode":"438791"} ' ,
2526 );
2627 }
@@ -45,7 +46,7 @@ public function testAuthorizeFailure()
4546
4647 $ this ->assertFalse ($ response ->isSuccessful ());
4748 $ this ->assertFalse ($ response ->isRedirect ());
48- $ this ->assertNull ( $ response ->getTransactionReference ());
49+ $ this ->assertSame ( ' {"VendorTxCode":"123"} ' , $ response ->getTransactionReference ());
4950 $ this ->assertSame ('The VendorTxCode \'984297 \' has been used before. Each transaction you send should have a unique VendorTxCode. ' , $ response ->getMessage ());
5051 }
5152
@@ -57,7 +58,7 @@ public function testAuthorize3dSecure()
5758
5859 $ this ->assertFalse ($ response ->isSuccessful ());
5960 $ this ->assertTrue ($ response ->isRedirect ());
60- $ this ->assertNull ( $ response ->getTransactionReference ());
61+ $ this ->assertSame ( ' {"VendorTxCode":"123"} ' , $ response ->getTransactionReference ());
6162 $ this ->assertNull ($ response ->getMessage ());
6263 $ this ->assertSame ('https://test.sagepay.com/Simulator/3DAuthPage.asp ' , $ response ->getRedirectUrl ());
6364
@@ -87,7 +88,7 @@ public function testPurchaseFailure()
8788
8889 $ this ->assertFalse ($ response ->isSuccessful ());
8990 $ this ->assertFalse ($ response ->isRedirect ());
90- $ this ->assertNull ( $ response ->getTransactionReference ());
91+ $ this ->assertSame ( ' {"VendorTxCode":"123"} ' , $ response ->getTransactionReference ());
9192 $ this ->assertSame ('The VendorTxCode \'984297 \' has been used before. Each transaction you send should have a unique VendorTxCode. ' , $ response ->getMessage ());
9293 }
9394
@@ -99,7 +100,7 @@ public function testPurchase3dSecure()
99100
100101 $ this ->assertFalse ($ response ->isSuccessful ());
101102 $ this ->assertTrue ($ response ->isRedirect ());
102- $ this ->assertNull ( $ response ->getTransactionReference ());
103+ $ this ->assertSame ( ' {"VendorTxCode":"123"} ' , $ response ->getTransactionReference ());
103104 $ this ->assertNull ($ response ->getMessage ());
104105 $ this ->assertSame ('https://test.sagepay.com/Simulator/3DAuthPage.asp ' , $ response ->getRedirectUrl ());
105106
@@ -116,7 +117,7 @@ public function testCaptureSuccess()
116117 $ response = $ this ->gateway ->capture ($ this ->captureOptions )->send ();
117118
118119 $ this ->assertTrue ($ response ->isSuccessful ());
119- $ this ->assertNull ( $ response ->getTransactionReference ());
120+ $ this ->assertSame ( ' {"VendorTxCode":"123"} ' , $ response ->getTransactionReference ());
120121 $ this ->assertSame ('The transaction was RELEASEed successfully. ' , $ response ->getMessage ());
121122 }
122123
@@ -127,7 +128,7 @@ public function testCaptureFailure()
127128 $ response = $ this ->gateway ->capture ($ this ->captureOptions )->send ();
128129
129130 $ this ->assertFalse ($ response ->isSuccessful ());
130- $ this ->assertNull ( $ response ->getTransactionReference ());
131+ $ this ->assertSame ( ' {"VendorTxCode":"123"} ' , $ response ->getTransactionReference ());
131132 $ this ->assertSame ('You are trying to RELEASE a transaction that has already been RELEASEd or ABORTed. ' , $ response ->getMessage ());
132133 }
133134
@@ -138,7 +139,7 @@ public function testRefundSuccess()
138139 $ response = $ this ->gateway ->refund ($ this ->captureOptions )->send ();
139140
140141 $ this ->assertTrue ($ response ->isSuccessful ());
141- $ this ->assertNull ( $ response ->getTransactionReference ());
142+ $ this ->assertSame ( ' {"VendorTxCode":"123"} ' , $ response ->getTransactionReference ());
142143 $ this ->assertSame ('The transaction was RELEASEed successfully. ' , $ response ->getMessage ());
143144 }
144145
@@ -149,7 +150,7 @@ public function testRefundFailure()
149150 $ response = $ this ->gateway ->refund ($ this ->captureOptions )->send ();
150151
151152 $ this ->assertFalse ($ response ->isSuccessful ());
152- $ this ->assertNull ( $ response ->getTransactionReference ());
153+ $ this ->assertSame ( ' {"VendorTxCode":"123"} ' , $ response ->getTransactionReference ());
153154 $ this ->assertSame ('You are trying to RELEASE a transaction that has already been RELEASEd or ABORTed. ' , $ response ->getMessage ());
154155 }
155156}
0 commit comments