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()
6262 $ data = $ this ->getBaseAuthorizeData ();
6363 $ this ->getCard ()->validate ();
6464
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+
6577 $ data ['CardHolder ' ] = $ this ->getCard ()->getName ();
6678 $ data ['CardNumber ' ] = $ this ->getCard ()->getNumber ();
6779 $ data ['CV2 ' ] = $ this ->getCard ()->getCvv ();
6880 $ data ['ExpiryDate ' ] = $ this ->getCard ()->getExpiryDate ('my ' );
69- $ data ['CardType ' ] = $ this -> getCard ()-> getBrand () ;
81+ $ data ['CardType ' ] = $ cardType ;
7082
7183 if ($ this ->getCard ()->getStartMonth () and $ this ->getCard ()->getStartYear ()) {
7284 $ data ['StartDate ' ] = $ this ->getCard ()->getStartDate ('my ' );
You can’t perform that action at this time.
0 commit comments