#uh oh
1 messages · Page 1 of 1 (latest)
Just curious, what guide are you following? Is there a reason you're creating the Payment Methods first then creating and confirming Payment Intents on the backend? Our recommended flow is here and accounts for requires action: https://stripe.com/docs/payments/accept-a-payment
Aren't we supposed to collect the Payment Method information on the frontend first?
The reason is because I have some logic that happens on the backend that calculates what the amount of the payment intent should be
That's not the recommended flow. See above link
What does the amount depend on?
You might could still use the recommended flow depending on how you calculate it
The amount depends on some other logic in my backend
It's not something I can use "line_items" for
It depends on every transaction
Which is why I create the payment intent on the backend and confirm it
This was what I was following
and this
So my flow would be:
- User enters their card information on the frontend
- The payment method ID is sent to the backend
- The backend creates a payment intent with the payment method ID and immediately confirms it
- The payment intent succeeds
However, if the payment intent falls in "requires_action" state, I'm not sure what to do. I was thinking of using errors_on_requires_action when creating the payment intent. But I'm wondering if there is a better way
Hello 👋
Taking over as codename_duchess needs to step away
Give me a moment to catch up here
- The payment method ID is sent to the backend
How exactly are you sending the PaymentMethod ID to your backend? If its a POST request then you can wait for the PaymentIntent confirmation request to respond. if the status isrequires_actionthen you can usehandleCardActionfunction on client-side to allow your customer to perform 3DS auth
@scarlet goblet does that help?