Invalid request error
-
Hi,
I used Woocommerce stripe gateway for a while, but now I am experiencing a problem that prevents customers from paying. I allow customers to make a deposit and a second payment of the rest for each order, and the second payment systematically fails and gives this error:”Sorry, we are unable to process your payment at this time. Please retry later.”
This is the error that I receive in the response body from Stripe:
“error”: {
“code”: “payment_intent_unexpected_state”,
“doc_url”: “https://stripe.com/docs/error-codes/payment-intent-unexpected-state”,
“message”: “This PaymentIntent’s source could not be updated because it has a status of succeeded. You may only update the source of a PaymentIntent with one of the following statuses: requires_payment_method, requires_confirmation, requires_action.”,
“payment_intent”: {
………information related to the 1st payment, removed for privacy…..
},
“type”: “invalid_request_error”
}I investigated and noted that now the Stripe gateway sends a different request POST body, compared to the one that used to work a few months ago. This is the request that it sends now and that gives back the error:
{
“source”: “xxxxxxxxxxxxxxxx”,
“amount”: “xxxxx”
}Note that the amount is the correct amount required by the second payment but Stripe interprets the request as trying to change the original 1st payment and gives back the error.
This is instead a request POST body of a successful second payment done a few months ago:
{
“statement_descriptor”: “UCPA Vacanze”,
“amount”: “xxxxx”,
“expand”: [
“balance_transaction”
],
“metadata”: {
“customer_email”: “xxxxxxxxxx”,
“customer_name”: “xxxxxx xxxxxxx”,
“order_id”: “xxxx”
},
“description”: “UCPA Vacanze – Order xxxx”,
“capture”: “true”,
“currency”: “eur”,
“source”: “xxxxxxxxxxxxxxxxxx”
}Can you dig into this? It’s causing major issues to my store ??
I already spoke with Stripe technical team and it looks like the error is connected with the request POST being wrong, related either with Woocommerce Stripe Gateway or Woocommerce. Hope you can help!
- The topic ‘Invalid request error’ is closed to new replies.