File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,9 @@ public function getData()
239
239
240
240
if ($ this ->getCardReference ()) {
241
241
$ data ['ORIGID ' ] = $ this ->getCardReference ();
242
+ if ($ this ->getCard ()) {
243
+ $ data ['CVV2 ' ] = $ this ->getCard ()->getCvv ();
244
+ }
242
245
} else {
243
246
$ this ->validate ('card ' );
244
247
$ this ->getCard ()->validate ();
Original file line number Diff line number Diff line change @@ -86,6 +86,26 @@ public function testReferencePurchaseSuccess()
86
86
$ this ->assertEquals ('A10A6AE7042E ' , $ response ->getTransactionReference ());
87
87
}
88
88
89
+ public function testReferencePurchaseWithCvvSuccess ()
90
+ {
91
+ $ options = array (
92
+ 'amount ' => '10.00 ' ,
93
+ 'cardReference ' => 'abc123 ' ,
94
+ 'card ' => new CreditCard (array (
95
+ 'cvv ' => '123 ' ,
96
+ )),
97
+ );
98
+
99
+ $ this ->setMockHttpResponse ('PurchaseSuccess.txt ' );
100
+
101
+ $ request = $ this ->gateway ->purchase ($ options );
102
+ $ response = $ request ->send ();
103
+
104
+ $ this ->assertArrayHasKey ('CVV2 ' , $ request ->getData ());
105
+ $ this ->assertTrue ($ response ->isSuccessful ());
106
+ $ this ->assertEquals ('A10A6AE7042E ' , $ response ->getTransactionReference ());
107
+ }
108
+
89
109
public function testPurchaseError ()
90
110
{
91
111
$ this ->setMockHttpResponse ('PurchaseFailure.txt ' );
You can’t perform that action at this time.
0 commit comments