File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,16 @@ public function getCardReference($serialize = true)
150
150
return $ value ;
151
151
}
152
152
153
+ public function getInvoiceNumber ()
154
+ {
155
+ return $ this ->getParameter ('invoiceNumber ' );
156
+ }
157
+
158
+ public function setInvoiceNumber ($ value )
159
+ {
160
+ return $ this ->setParameter ('invoiceNumber ' , $ value );
161
+ }
162
+
153
163
public function sendData ($ data )
154
164
{
155
165
$ headers = array ('Content-Type ' => 'text/xml; charset=utf-8 ' );
@@ -213,12 +223,18 @@ protected function addBillingData(\SimpleXMLElement $data)
213
223
/** @var mixed $req */
214
224
$ req = $ data ->transactionRequest ;
215
225
226
+ // The order must come before the customer ID.
227
+ $ req ->order ->invoiceNumber = $ this ->getInvoiceNumber ();
228
+ $ req ->order ->description = $ this ->getDescription ();
229
+
216
230
// Merchant assigned customer ID
217
231
$ customer = $ this ->getCustomerId ();
218
232
if (!empty ($ customer )) {
219
233
$ req ->customer ->id = $ customer ;
220
234
}
221
235
236
+ //$req->order->description = $this->getDescription();
237
+
222
238
/** @var CreditCard $card */
223
239
if ($ card = $ this ->getCard ()) {
224
240
// A card is present, so include billing and shipping details
Original file line number Diff line number Diff line change @@ -22,21 +22,25 @@ public function setUp()
22
22
$ this ->purchaseOptions = array (
23
23
'amount ' => '10.00 ' ,
24
24
'card ' => $ this ->getValidCard (),
25
+ 'description ' => 'purchase ' ,
25
26
);
26
27
27
28
$ this ->captureOptions = array (
28
29
'amount ' => '10.00 ' ,
29
30
'transactionReference ' => '12345 ' ,
31
+ 'description ' => 'capture ' ,
30
32
);
31
33
32
34
$ this ->voidOptions = array (
33
35
'transactionReference ' => '12345 ' ,
36
+ 'description ' => 'void ' ,
34
37
);
35
38
36
39
$ this ->refundOptions = array (
37
40
'amount ' => '10.00 ' ,
38
41
'transactionReference ' => '12345 ' ,
39
- 'card ' => $ this ->getValidCard ()
42
+ 'card ' => $ this ->getValidCard (),
43
+ 'description ' => 'refund ' ,
40
44
);
41
45
}
42
46
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ public function testGetData()
43
43
"transactionType " ,
44
44
"amount " ,
45
45
"payment " ,
46
+ "order " ,
46
47
"customer " ,
47
48
"billTo " ,
48
49
"shipTo " ,
You can’t perform that action at this time.
0 commit comments