File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/Omnipay/SagePay/Message Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -62,11 +62,23 @@ public function getData()
62
62
$ data = $ this ->getBaseAuthorizeData ();
63
63
$ this ->getCard ()->validate ();
64
64
65
+ $ cardType = $ this ->getCard ()->getBrand ();
66
+
67
+ // list of brands SagePay names differently
68
+ $ brands = array (
69
+ 'mastercard ' => 'mc ' ,
70
+ 'diners_club ' => 'dc '
71
+ );
72
+
73
+ if (isset ($ brands [$ cardType ])) {
74
+ $ cardType = $ brands [$ cardType ];
75
+ }
76
+
65
77
$ data ['CardHolder ' ] = $ this ->getCard ()->getName ();
66
78
$ data ['CardNumber ' ] = $ this ->getCard ()->getNumber ();
67
79
$ data ['CV2 ' ] = $ this ->getCard ()->getCvv ();
68
80
$ data ['ExpiryDate ' ] = $ this ->getCard ()->getExpiryDate ('my ' );
69
- $ data ['CardType ' ] = $ this -> getCard ()-> getBrand () ;
81
+ $ data ['CardType ' ] = $ cardType ;
70
82
71
83
if ($ this ->getCard ()->getStartMonth () and $ this ->getCard ()->getStartYear ()) {
72
84
$ data ['StartDate ' ] = $ this ->getCard ()->getStartDate ('my ' );
You can’t perform that action at this time.
0 commit comments