@@ -25,6 +25,7 @@ class DirectAuthorizeRequest extends AbstractRequest
25
25
protected function getBaseAuthorizeData ()
26
26
{
27
27
$ this ->validate ('amount ' , 'card ' , 'transactionId ' );
28
+ $ card = $ this ->getCard ();
28
29
29
30
$ data = $ this ->getBaseData ();
30
31
$ data ['Description ' ] = $ this ->getDescription ();
@@ -36,27 +37,27 @@ protected function getBaseAuthorizeData()
36
37
$ data ['Apply3DSecure ' ] = 0 ; // use account setting
37
38
38
39
// 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 ();
48
49
49
50
// 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 ();
60
61
61
62
return $ data ;
62
63
}
0 commit comments