Open dekefake opened 1 week ago
Hi @dekefake, thanks for filing the detailed issue description.
Following the stacktrace you provided, it appears this error occurs for customers using express payment buttons (Google Pay / Apple Pay), the payment intent object returned from Stripe has a "retryable" error and that's causing the Stripe Plugin to reattempt the payment request.
The code responsible for retrying the payment has a bug when called in this express payment request context, as it attempts to locate a saved payment method token, however there is no saved token at that point yet. We'll get that fixed up.
[!NOTE] 📓 For the dev that works on this, it looks like our
retry_after_error()
function in the UPE gateway class usesprocess_payment_with_saved_payment_method()
to process the retry attempts. That function assumes that there is a saved WC token ID in the$_POST
. The base gateway'sretry_after_error()
function uses the baselineprocess_payment()
function instead. I'm not sure yet on the reason why the UPE version callsprocess_payment_with_saved_payment_method()
and assumes there's a saved token.
This bug caused shoppers to do chargebacks for "Duplicate"
@dekefake, can you confirm if this error caused duplicate charges? As I mentioned above, the stack trace indicates that we would only reattempt the payment if Stripe responded with a retryable error. Retryable errors are invalid_request_error
, idempotency_error
, rate_limit_error
, api_connection_error
or api_error
and so should only occur if the original charge request was unsuccessful. If you can provide more details on that, I'd be happy to look into that further. You should be able to find the reason for the failures in your Stripe dashboard on the individual Transaction pages (https://dashboard.stripe.com/test/payments). See example below.
Example of a insufficient funds error in the Stripe Dashboard |
Payment intent (transaction) event logs |
---|
Hi @james-allan , thank you for your quick feedback,
The bug itself does not appear to have caused duplicate charges, but it seems to make shoppers try multiple times and ultimately create duplicate orders. I am currently starting to doubt if this is directly related to this bug mentioned earlier
This is a duplicate of https://github.com/woocommerce/woocommerce-gateway-stripe/issues/3503, I'll close that other issue and continue the conversation here.
https://wordpress.org/support/topic/call-to-a-member-function-get_token-on-null/
It seems the plugin is sometimes causing issues with shoppers trying to pay for an order using a saved payment method. Here is the full stack trace. We’d appreciate if someone from the team could have a look, in order to get this part more stable.
Thanks in advance
This bug caused shoppers to do chargebacks for "Duplicate" and it lead to my account
acct_1H4UDbA4E9tWwRaZ
being closed for "high risk". This isn't fair, I'd appreciate if you guys could push for reactivation.