[ECP-9097] MobilePay incidental error component.handleReject() is not a function
#2552
Labels
Bug report
Indicates that issue has been marked as a possible bug
Describe the bug
On our client's webshop, incidentally a successful captured MobilePay payment fails to continue the checkout and place the order. This results in customers retrying finishing the order and thus creating multiple orders. After some investigation we found that it coincides with the following JS errors:
Error: Unhandled Promise Rejection: {"readyState":4,"responseText":"{\"message\":\"ReCaptcha validation failed, please try again\"}","responseJSON":{"message":"ReCaptcha validation failed, please try again"},"status":400,"statusText":"error"}
Error: component.handleReject is not a function. (In 'component.handleReject(response)', 'component.handleReject' is undefined)
It appears that first a ReCaptcha validation fails. I can only find this exact message in Magento's codebase in the Rest & GraphQL API validation, but I cannot connect the dots to the Adyen payment with my limited knowledge of this process. If this message doesn't come from Magento's API endpoint(s), then I can but only guess the origin of this error message.
What happens next is that the
component.handleReject()
is called in Adyen code (view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
), but this method does not exist on thecomponent
object (this concerns MobilePay). This could be fixed in the Adyen code (I'm going to make a patch) by first checking the availability of thehandleReject()
method.As a matter of fact, after decompiling the the
adyen.js.map
file, I can that see thehandleReject()
method is only implemented by the PayPal payment method (in../src/components/PayPal/Paypal.tsx
).To Reproduce
Steps to reproduce the behavior:
Expected behavior
placeOrderAction()
method (though, this might be only Magento code)handleReject()
method is not available on thecomponent
, it should not be called, to prevent an error.Magento version
Enterprise 2.4.5-p4
Plugin version
8.14.0
Desktop (please complete the following information):
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: