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

Google Pay REQUEST_TIMEOUT error #3113

Open
ayubov opened this issue Feb 5, 2025 · 16 comments
Open

Google Pay REQUEST_TIMEOUT error #3113

ayubov opened this issue Feb 5, 2025 · 16 comments
Labels
Needs more info Further information is requested

Comments

@ayubov
Copy link

ayubov commented Feb 5, 2025

Describe the bug
When testing the Google Pay payment, I sometimes get a REQUEST_TIMEOUT error in the Google Pay modal, but the payment is still authorised. The problem doesn't happen every time, so I don't have clear steps to reproduce it. I'm using version 6.6.0 of the package. Please help me understand why this issue is occurring and whether it could happen in production.

To Reproduce
Steps to reproduce the behavior:

  1. Pay with Google Pay in testing environment

Expected behavior
No errors

Screenshots

Image
@sarunvodafone
Copy link

Hi ayubov

I am also facing the same issue, after initiate the payment google sheet get open with "Pay" button.
And after click on it, we got a response of googlePayToken, but the Google Sheet is not closing automatically which we expect.

If this is the issue from the Google pay side, then how it works for the Adyen version 5.6X. I observe this issue we get only if we use the Adyen 6.X version.

I believe this issue is from the Adyen side itself only

@ribeiroguilherme
Copy link
Contributor

ribeiroguilherme commented Feb 13, 2025

Hi @ayubov @sarunvodafone ,

I believe this issue originates from Google, as Google Pay has been functioning properly from the release of adyen-web v6 until now. The error has only recently started appearing, and it comes directly from the Google Pay UI.

I’ve already reached out to them and will update this thread as soon as I have more information.

Just for context, there is a difference in GooglePay overlay when comparing the v5 and v6 versions. That happens because v6 uses callbackIntents to process the payment, and it leads to a different GooglePay modal when clicking in the button (That could be the reason that we don't see any errors on v5 but for v6 we do).

Cheers,

@ayubov
Copy link
Author

ayubov commented Feb 17, 2025

Thanks @ribeiroguilherme! Please let us know if there are any updates or a workaround for this problem.

@ragnarfrosti
Copy link

I think that we are having the same issue as well.

We are using v6.1.1 and are planning to enable Google Pay for one of our customers, but we get the same issue as @sarunvodafone where the Google pay overlay does not disappear after the purchase, even though the purchase was successful.

The customer gets redirected to the order confirmation page behind the "Google Pay"-overlay as can be seen in screenshot 2 and 3:

Image

If the customer clicks on cancel or retry the overlay disappears and they can see the order confirmation page.

@dmengelt
Copy link

dmengelt commented Feb 19, 2025

Hi all. Thanks for reporting this. As of now the issues might be similar but still are two different ones I believe:

  1. REQUEST_TIMEOUT error in the Google Pay modal - reported by @ayubov
  2. Google pay sheet does not disappear after the purchase - reported by @sarunvodafone and @ragnarfrosti

REQUEST_TIMEOUT error in the Google Pay modal
Adyen does the payments call in onPaymentAuthorized. Are you adding any other logic to the callback handler? The callback gets invoked, but if the callback does not return a value in time, the pay sheet will display the error and not close even though the callback returns "success". Timeout is 30 seconds.

Google pay sheet does not disappear after the purchase
Do you ever see a REQUEST_TIMEOUT on the Google Pay sheet?

@ayubov
Copy link
Author

ayubov commented Feb 19, 2025

Hi @dmengelt, thanks for your response!

We don’t use that handler at all. I believe, in this case, the promise should be resolved immediately:

private async handleAuthorization(): Promise<void> {
return new Promise<void>((resolve, reject) => {
if (!this.props.onAuthorized) {
resolve();
}
const { authorizedEvent, billingAddress, deliveryAddress } = this.state;
this.props.onAuthorized(
{
authorizedEvent,
...(billingAddress && { billingAddress }),
...(deliveryAddress && { deliveryAddress })
},
{ resolve, reject }
);
}).catch((error?: google.payments.api.PaymentDataError | string) => {
// Format error in a way that the 'catch' of the 'onPaymentAuthorize' block accepts it
const data = { error: { googlePayError: error } };
return Promise.reject(data);
});
}

@dmengelt
Copy link

dmengelt commented Feb 19, 2025

@ayubov interesting. is there a way for me to reproduce this? because right now I can only reproduce it if I make the onPaymentAuthorized callback to not return anything for > 30s.

@ayubov
Copy link
Author

ayubov commented Feb 20, 2025

Unfortunately, I'm not sure how to reproduce it. We simply follow the documentation, create an instance of GooglePay and mount it. It's also worth mentioning that the issue doesn't occur with every payment but happens quite often.

@ribeiroguilherme
Copy link
Contributor

@ayubov so you are not using the onAuthorized callback in this case.

Are you making the /payments call by yourself or are you using Sessions flow? If you are doing it by yourself, are you calling actions.resolve inside the onSubmit callback passing the resultCode to it?

@ayubov
Copy link
Author

ayubov commented Feb 20, 2025

@ribeiroguilherme we are making the /payments call ourselves and not calling actions.resolve inside the onSubmit callback. Should we do that?

@ribeiroguilherme
Copy link
Contributor

For v6, it is required. You can check the code sample here in our documentation. Calling actions.resolve will inform Google about the transaction status.

Have you migrated from v5 to v6 or did you implement v6 directly? The migration guide also mentions this

@ayubov
Copy link
Author

ayubov commented Feb 20, 2025

Oh, looks like we missed that. Thank you! We will try to implement it, and I will get back to you.

@ribeiroguilherme
Copy link
Contributor

@ragnarfrosti @sarunvodafone could you guys please take a look and check if you have implemented payments call according to our documentation?

@ragnarfrosti
Copy link

@ribeiroguilherme We missed this as well after migrating to v6. In our case, the customer is redirected to the order confirmation page on success and is not handled via actions.resolve(...) in the JavaScript. So this might be the issue in our case. I'll get back to you when we have more info about this.

@ribeiroguilherme
Copy link
Contributor

@ragnarfrosti understood. I suggest you to redirect the shopper inside the onPaymentCompleted callback and not inside the onSubmit.

@ragnarfrosti
Copy link

Hi @ribeiroguilherme

I made a quick change to how we handle the "Google Pay"-payments by calling actions.resolve({...}) from the onSubmit function. This makes the Google Pay sheet close before the redirect.

We will do a proper implementation now, but this seems to be the way forward for us.

@ribeiroguilherme ribeiroguilherme added Needs more info Further information is requested and removed To be investigated labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs more info Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants