Payment error due to incorrect POST body request
-
Hi,
I use Woocommerce in connection with Woocommerce stripe gateway and I am experiencing a problem that prevents customers from paying. I allow customers to make a deposit and a second payment of the rest of the amount 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.”. The set up worked perfectly for years, the issue is relatively recent.
Either Woocommerce or Stripe gateway changed the way that POST body request for payment request for the same order are sent. This is the POST body request for the second payment of a few months ago (which was working):
{
“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”
}While this is the one that is used today:
{
“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 because of the request POST body is not correct.
This is the error that I receive 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 don’t know if this is due to Woocomerce or Woocommerce Stripe Gateway, hope you can dig into it. It’s causing major issues to my store! ??
PS. I already spoke with Stripe technical team and they confirmed that the error is due to the request made from Woocommerce. Hope you can help!
- The topic ‘Payment error due to incorrect POST body request’ is closed to new replies.