#Am I the only one with a stripe checkout issue?

7 messages · Page 1 of 1 (latest)

patent sail
#

I don't know why and how it happens but every time I try to complete a checkout, the order sometimes goes through but a lot of times it fails with a stripe error that I am sure is generated by medusa.

Sometimes if I clear the workflow table it works again, other times it doesn't. But I can't do that in production.

I am using medusa v2 with a custom storefront.

Am I missing something?

#

The error can be something like this, but not always:

{
  "error": {
    "code": "payment_intent_unexpected_state",
    "doc_url": "https://stripe.com/docs/error-codes/payment-intent-unexpected-state",
    "message": "This PaymentIntent's payment_method could not be updated because it has a status of canceled. You may only update the payment_method of a PaymentIntent with one of the following statuses: requires_payment_method, requires_confirmation, requires_action.",
    "param": "payment_method",
    "payment_intent": {
      "id": "pi_3Rb4YLCA43rfreFLGwyf",
      "object": "payment_intent",
      "amount": 1200,
      "amount_details": {
        "tip": {}
      },
      "automatic_payment_methods": {
        "allow_redirects": "always",
        "enabled": true
      },
      "canceled_at": 1750186105,
      "cancellation_reason": null,
      "capture_method": "manual",
      "client_secret": "pi_3Rb4YLCApbmHflHx1OFLGrr5t",
      "confirmation_method": "automatic",
      "created": 1750186093,
      "currency": "eur",
      "description": null,
      "last_payment_error": null,
      "livemode": false,
      "next_action": null,
      "payment_method": null,
      "payment_method_configuration_details": {
        "id": "pmc_1N2yZiCApbmHflHxY34434u",
        "parent": null
      },
      "payment_method_types": [
        "card",
        "link",
        "paypal"
      ],
      "processing": null,
      "receipt_email": null,
      "setup_future_usage": null,
      "shipping": null,
      "source": null,
      "status": "canceled"
    },
    "request_log_url": "https://dashboard.stripe.com/test/logs/req_PotnmylP3terScb?t=1750186151",
    "type": "invalid_request_error"
  }
}
kind comet
#

Sounds like your implementation on the front end is the issue.

patent sail
#

It could be, but it worked fine until now. I don't know how to debug. From the stripe console the payment is completed and then immediately canceled.

kind comet
#

Just look at the nextjs implementation of stripe and copy that

patent sail
#

you mean the nextjs starter?

kind comet
#

Yeah, it has the stripe implementation