File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,16 @@ public function setTaxExempt($value)
269
269
return $ this ->setParameter ('taxExempt ' , (bool ) $ value );
270
270
}
271
271
272
+ public function getUsePaymentMethodToken ()
273
+ {
274
+ return $ this ->getParameter ('usePaymentMethodToken ' );
275
+ }
276
+
277
+ public function setUsePaymentMethodToken ($ value )
278
+ {
279
+ return $ this ->setParameter ('usePaymentMethodToken ' , (bool )$ value );
280
+ }
281
+
272
282
/**
273
283
* @return array
274
284
*/
Original file line number Diff line number Diff line change @@ -33,14 +33,19 @@ public function getData()
33
33
'submitForSettlement ' => false ,
34
34
],
35
35
'orderId ' => $ this ->getTransactionId (),
36
- 'paymentMethodNonce ' => $ this ->getToken (),
37
36
'purchaseOrderNumber ' => $ this ->getPurchaseOrderNumber (),
38
37
'recurring ' => $ this ->getRecurring (),
39
38
'shippingAddressId ' => $ this ->getShippingAddressId (),
40
39
'taxAmount ' => $ this ->getTaxAmount (),
41
40
'taxExempt ' => $ this ->getTaxExempt (),
42
41
];
43
42
43
+ if ($ this ->getUsePaymentMethodToken () === true ) {
44
+ $ data ['paymentMethodToken ' ] = $ this ->getToken ();
45
+ } else {
46
+ $ data ['paymentMethodNonce ' ] = $ this ->getToken ();
47
+ }
48
+
44
49
// Remove null values
45
50
$ data = array_filter ($ data , function ($ value ){
46
51
return ! is_null ($ value );
You can’t perform that action at this time.
0 commit comments