Skip to content

Slow POS payments cause proxy timeout #2867

Open
@pmzandbergen

Description

@pmzandbergen

Already working on a fix, please await the PR

Describe the bug
When initiating a POS payment using one of the following endpoints:

  • /V1/adyen/orders/guest-carts/:cartId/pos-payment
  • /V1/adyen/orders/carts/mine/pos-payment

The browser might receive a timeout if the POS payment takes a bit of time and the webserver (or proxy) is configured with a reasonable (shorter) timeout period. Cloudflare for example has a timeout of 100 seconds, a value which only can modified when using one of the Enterprise plans. This could be fixed using some kind of polling mechanism. Actually the frontend code already seems to include logic for this purpose:

if (response.responseText.indexOf("In Progress") > -1) {

When the browser encounters a (proxy) timeout the response will generally not include "In Progress" and this solution is also not working out-of-the-box for PWA's.

To Reproduce
Steps to reproduce the behavior:

  1. Ensure the webserver or proxy is configured with a timeout of, for example, 60 seconds
  2. Start a POS / terminal payment
  3. Wait for a minute before finishing the payment
  4. See error

Expected behavior
The payment should be polled as long as the POS payment status isn't final.

Magento version
2.4.7-p3

Plugin version
Tested on 9.6.0, the logic is the same at the current version (9.14.0).

Screenshots
Image

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Firefox
  • Version: 134.0.2

Smartphone (please complete the following information):
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug reportIndicates that issue has been marked as a possible bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions