@@ -25,6 +25,7 @@ class DirectAuthorizeRequest extends AbstractRequest
2525 protected function getBaseAuthorizeData ()
2626 {
2727 $ this ->validate ('amount ' , 'card ' , 'transactionId ' );
28+ $ card = $ this ->getCard ();
2829
2930 $ data = $ this ->getBaseData ();
3031 $ data ['Description ' ] = $ this ->getDescription ();
@@ -36,27 +37,27 @@ protected function getBaseAuthorizeData()
3637 $ data ['Apply3DSecure ' ] = 0 ; // use account setting
3738
3839 // billing details
39- $ data ['BillingFirstnames ' ] = $ this -> getCard () ->getFirstName ();
40- $ data ['BillingSurname ' ] = $ this -> getCard () ->getLastName ();
41- $ data ['BillingAddress1 ' ] = $ this -> getCard () ->getBillingAddress1 ();
42- $ data ['BillingAddress2 ' ] = $ this -> getCard () ->getBillingAddress2 ();
43- $ data ['BillingCity ' ] = $ this -> getCard () ->getBillingCity ();
44- $ data ['BillingPostCode ' ] = $ this -> getCard () ->getBillingPostcode ();
45- $ data ['BillingState ' ] = $ this -> getCard () ->getBillingState ();
46- $ data ['BillingCountry ' ] = $ this -> getCard () ->getBillingCountry ();
47- $ data ['BillingPhone ' ] = $ this -> getCard () ->getBillingPhone ();
40+ $ data ['BillingFirstnames ' ] = $ card ->getFirstName ();
41+ $ data ['BillingSurname ' ] = $ card ->getLastName ();
42+ $ data ['BillingAddress1 ' ] = $ card ->getBillingAddress1 ();
43+ $ data ['BillingAddress2 ' ] = $ card ->getBillingAddress2 ();
44+ $ data ['BillingCity ' ] = $ card ->getBillingCity ();
45+ $ data ['BillingPostCode ' ] = $ card ->getBillingPostcode ();
46+ $ data ['BillingState ' ] = $ card -> getBillingCountry () === ' US ' ? $ card ->getBillingState () : null ;
47+ $ data ['BillingCountry ' ] = $ card ->getBillingCountry ();
48+ $ data ['BillingPhone ' ] = $ card ->getBillingPhone ();
4849
4950 // shipping details
50- $ data ['DeliveryFirstnames ' ] = $ this -> getCard () ->getFirstName ();
51- $ data ['DeliverySurname ' ] = $ this -> getCard () ->getLastName ();
52- $ data ['DeliveryAddress1 ' ] = $ this -> getCard () ->getShippingAddress1 ();
53- $ data ['DeliveryAddress2 ' ] = $ this -> getCard () ->getShippingAddress2 ();
54- $ data ['DeliveryCity ' ] = $ this -> getCard () ->getShippingCity ();
55- $ data ['DeliveryPostCode ' ] = $ this -> getCard () ->getShippingPostcode ();
56- $ data ['DeliveryState ' ] = $ this -> getCard () ->getShippingState ();
57- $ data ['DeliveryCountry ' ] = $ this -> getCard () ->getShippingCountry ();
58- $ data ['DeliveryPhone ' ] = $ this -> getCard () ->getShippingPhone ();
59- $ data ['CustomerEMail ' ] = $ this -> getCard () ->getEmail ();
51+ $ data ['DeliveryFirstnames ' ] = $ card ->getFirstName ();
52+ $ data ['DeliverySurname ' ] = $ card ->getLastName ();
53+ $ data ['DeliveryAddress1 ' ] = $ card ->getShippingAddress1 ();
54+ $ data ['DeliveryAddress2 ' ] = $ card ->getShippingAddress2 ();
55+ $ data ['DeliveryCity ' ] = $ card ->getShippingCity ();
56+ $ data ['DeliveryPostCode ' ] = $ card ->getShippingPostcode ();
57+ $ data ['DeliveryState ' ] = $ card -> getShippingCountry () === ' US ' ? $ card ->getShippingState () : null ;
58+ $ data ['DeliveryCountry ' ] = $ card ->getShippingCountry ();
59+ $ data ['DeliveryPhone ' ] = $ card ->getShippingPhone ();
60+ $ data ['CustomerEMail ' ] = $ card ->getEmail ();
6061
6162 return $ data ;
6263 }
0 commit comments