@@ -168,24 +168,16 @@ public function __construct(
168
168
*/
169
169
public function execute ()
170
170
{
171
- $ externalBusinessId = $ this ->httpRequest ->getParam ('external_business_id ' );
171
+ $ ebid = $ this ->httpRequest ->getParam ('ebid ' );
172
172
$ products = explode (', ' , $ this ->httpRequest ->getParam ('products ' ));
173
173
$ coupon = $ this ->httpRequest ->getParam ('coupon ' );
174
174
$ redirect = $ this ->httpRequest ->getParam ('redirect ' );
175
175
$ signature = $ this ->httpRequest ->getParam ('signature ' );
176
176
177
- $ storeId = $ this ->orderHelper ->getStoreIdByExternalBusinessId ($ externalBusinessId );
177
+ $ storeId = $ this ->orderHelper ->getStoreIdByExternalBusinessId ($ ebid );
178
178
179
179
// Verify signature
180
- $ uri = $ this ->httpRequest ->getRequestUri ();
181
- $ query_string = parse_url ($ uri , PHP_URL_QUERY );
182
- $ params = [];
183
- parse_str ($ query_string , $ params );
184
- unset($ params ['signature ' ]);
185
- $ new_query_string = http_build_query ($ params );
186
- $ validation_uri = urldecode (str_replace ($ query_string , $ new_query_string , $ uri ));
187
-
188
- if (!$ this ->authenticator ->verifySignature ($ validation_uri , $ signature )) {
180
+ if (!$ this ->authenticator ->verifySignature ($ ebid , $ signature )) {
189
181
$ e = new LocalizedException (__ ('RSA Signature Validation Failed ' ));
190
182
$ this ->fbeHelper ->logExceptionImmediatelyToMeta (
191
183
$ e ,
@@ -194,9 +186,9 @@ public function execute()
194
186
'event ' => 'meta_checkout_url ' ,
195
187
'event_type ' => 'rsa_signature_validation_error ' ,
196
188
'extra_data ' => [
197
- 'request_uri ' => $ uri ,
189
+ 'request_uri ' => $ this -> httpRequest -> getRequestUri () ,
198
190
'request_signature ' => $ signature ,
199
- 'validation_uri ' => $ validation_uri
191
+ 'ebid ' => $ ebid
200
192
]
201
193
]
202
194
);
0 commit comments