Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-9097] MobilePay incidental error component.handleReject() is not a function #2552

Open
kweij opened this issue Mar 12, 2024 · 1 comment
Assignees
Labels
Bug report Indicates that issue has been marked as a possible bug

Comments

@kweij
Copy link
Contributor

kweij commented Mar 12, 2024

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:

  1. 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"}
  2. 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 the component 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 the handleReject() method.

As a matter of fact, after decompiling the the adyen.js.map file, I can that see the handleReject() method is only implemented by the PayPal payment method (in ../src/components/PayPal/Paypal.tsx).

To Reproduce
Steps to reproduce the behavior:

  1. We can't reproduce the issue

Expected behavior

  • A successfully captured MobilePay payment finished the order on the checkout and continues to the order success page.
  • Whatever causes the "ReCaptcha validation failed, please try again" is not preventing the payment from being successfully captured, it should also not yield a failing response back to on the placeOrderAction() method (though, this might be only Magento code)
  • If the handleReject() method is not available on the component, 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):

  • N/A

Smartphone (please complete the following information):

  • Device: iPhone
  • OS: unknown
  • Browser: Safari
  • Version: unknown
@kweij kweij added the Bug report Indicates that issue has been marked as a possible bug label Mar 12, 2024
@candemiralp candemiralp changed the title MobilePay incidental error component.handleReject() is not a function [ECP-9097] MobilePay incidental error component.handleReject() is not a function Apr 2, 2024
@candemiralp
Copy link
Member

Hello @kweij,

Thank you for reporting this issue. We have created an internal investigation ticket to solve this issue.

Best Regards,
Can

@candemiralp candemiralp self-assigned this Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Indicates that issue has been marked as a possible bug
Projects
None yet
Development

No branches or pull requests

2 participants