Closed sjelfull closed 3 years ago
Hi @sjelfull
I am unable to replicate this issue. Could you please provide more information.
What did the cart look like? Products, shipping, adjustments etc.
Thanks.
Closing this issue due to no further information.
Thanks.
I've tested the flow with test creds and everything was good but then I've tried the live credentials (the gateway was still in test mode) and I've got the aforementioned alert too when I clicked the PayPal button.
I found this related network request:
POST /index.php?p=actions/commerce/payments/pay
cart: {number: "d1c7cd18c8c00b559e9b74ac33ccbd0a", reference: null, couponCode: null, isCompleted: false,…}
error: "{"error":"invalid_client","error_description":"Client Authentication failed"}"
paymentFormErrors: []
While the alert was right it was misleading. Having a better error message would help devs to debug this issue faster (if it occures).
I'm seeing this exact situation @orosznyet Searching through the code base, I can only find "invalid_client" within the Stripe gateway code (I am using 2 different gateways - Stripe and this PayPal one). It seems like for the request to /index.php?p=actions/commerce/payments/pay
it's using the wrong gateway.
Also, I am only seeing this in my live environment (i.e. not in PayPal sandbox), dev works OK.
Hi
As @orosznyet mentioned it seems like this issue is coming from a situation where the wrong credentials are being used (live credentials but with test mode enabled) or an issue with the PayPal account.
@rob-baker-ar if the payments controller pay action is using the wrong gateway that would seem to suggest an issue elsewhere with your code rather than the PayPal plugin. It would be worth checking to see which gateway is being passed/which is set on the cart.
Thanks.
Sorry, should have updated this. My issue with PayPal disappeared when I ditched the older PayPal integration plugin in favour of the new. Some templates were looking at the gateway handle to decide what to do / show, which stayed the same during the transfer between plugins, hence the confusion. I resolved it in the end by removing all the PayPal specific gateway / payment stage of checkout customisations that it turned out were not needed with the new gateway implementation anyway.
Settings seems fine - test mode is enabled: