@@ -64,6 +64,25 @@ class AuthorizeRequest extends DirectAuthorizeRequest
6464 'FIRecipientDoB ' => false ,
6565 ];
6666
67+ /**
68+ * Add the Form-specific details to the base data.
69+ * @reurn array
70+ */
71+ public function getData ()
72+ {
73+ $ this ->validate ('currency ' , 'description ' , 'encryptionKey ' );
74+
75+ // The test mode is included to determine the redirect URL.
76+
77+ return [
78+ 'VPSProtocol ' => $ this ->VPSProtocol ,
79+ 'TxType ' => $ this ->getTxType (),
80+ 'Vendor ' => $ this ->getVendor (),
81+ 'Crypt ' => $ this ->generateCrypt ($ this ->getCryptData ()),
82+ 'TestMode ' => $ this ->getTestMode (),
83+ ];
84+ }
85+
6786 /**
6887 * @return array the data required to be encoded into the form crypt field.
6988 */
@@ -107,8 +126,8 @@ public function getCryptData()
107126 // Two conditional checks on the "state" fields.
108127 // We don't check if it is a valid two-character state code.
109128
110- if ($ data ['BillingCountry ' ] === 'US ' && empty ($ data ['BillingState ' ])
111- || $ data ['DeliveryCountry ' ] === 'US ' && empty ($ data ['DeliveryState ' ])
129+ if ($ data ['BillingCountry ' ] === 'US ' && empty ($ data ['BillingState ' ])
130+ || $ data ['DeliveryCountry ' ] === 'US ' && empty ($ data ['DeliveryState ' ])
112131 ) {
113132 throw new InvalidRequestException (
114133 'Missing state code for billing or shipping address '
@@ -118,25 +137,6 @@ public function getCryptData()
118137 return $ data ;
119138 }
120139
121- /**
122- * Add the Form-specific details to the base data.
123- * @reurn array
124- */
125- public function getData ()
126- {
127- $ this ->validate ('currency ' , 'description ' );
128-
129- // The test mode is included to determine the redirect URL.
130-
131- return [
132- 'VPSProtocol ' => $ this ->VPSProtocol ,
133- 'TxType ' => $ this ->getTxType (),
134- 'Vendor ' => $ this ->getVendor (),
135- 'Crypt ' => $ this ->generateCrypt ($ this ->getCryptData ()),
136- 'TestMode ' => $ this ->getTestMode (),
137- ];
138- }
139-
140140 /**
141141 * Generate the crypt field from the source data.
142142 * @param array $data the name/value pairs to be encrypted
0 commit comments