File tree 2 files changed +18
-5
lines changed
2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -340,4 +340,14 @@ public function getEndpoint()
340
340
{
341
341
return $ this ->endpoint ;
342
342
}
343
+
344
+ public function getPaymentToken ()
345
+ {
346
+ return $ this ->getParameter ('payment_token ' );
347
+ }
348
+
349
+ public function setPaymentToken ($ value )
350
+ {
351
+ return $ this ->setParameter ('payment_token ' , $ value );
352
+ }
343
353
}
Original file line number Diff line number Diff line change @@ -11,13 +11,16 @@ class DirectPostCreateCardRequest extends AbstractRequest
11
11
12
12
public function getData ()
13
13
{
14
- $ this ->validate ('card ' );
15
- $ this ->getCard ()->validate ();
16
-
14
+ $ this ->validate ('card ' );
17
15
$ data = $ this ->getBaseData ();
18
16
19
- $ data ['ccnumber ' ] = $ this ->getCard ()->getNumber ();
20
- $ data ['ccexp ' ] = $ this ->getCard ()->getExpiryDate ('my ' );
17
+ if ($ paymentToken = $ this ->getPaymentToken ()) {
18
+ $ data ['payment_token ' ] = $ paymentToken ;
19
+ } else {
20
+ $ this ->getCard ()->validate ();
21
+ $ data ['ccnumber ' ] = $ this ->getCard ()->getNumber ();
22
+ $ data ['ccexp ' ] = $ this ->getCard ()->getExpiryDate ('my ' );
23
+ }
21
24
$ data ['payment ' ] = 'creditcard ' ;
22
25
23
26
if ('update_customer ' === $ this ->customer_vault ) {
You can’t perform that action at this time.
0 commit comments