I am working on the implementing Subscription*(which is SCA ready) using Stripe. I try to handle https://stripe.com/docs/billing/subscriptions/payment#handling-action-required. After the subscription is created on Stripe side, I have got the answer like in documentation above:
{
"id": "sub_XXXXXXXXXXXXXXXXXXX",
"object": "subscription",
"status": "incomplete",
...
"latest_invoice": {
...
"payment_intent": {
"status": "requires_action",
...
"next_action": {
"type": "use_stripe_sdk",
...
},
...
}
}
}
According to the documentation https://stripe.com/docs/api/payment_intents/object#payment_intent_object-next_action-type
next_action.type
can have two values redirect_to_url
and use_stripe_sdk
So my question is how to get next_action.type = redirect_to_url
(instead of use_stripe_sdk
) and how to force stripe to fill next_action.redirect_to_url
(Because I want to handle it on my own in my UI)?
*There is already a similar question on SO: https://stackguides.com/questions/56490033/how-to-handle-use-stripe-sdk-through-php but my case is to create Subscription where I don't have control over PaymentIntent
latest_invoice.payment_intent.id
) and passreturn_url
. That will give you an updated PaymentIntent with theredirect_to_url
action. – karllekkoLocation url
but stripe return404
HTTP status for OPTION request(Preflight CORS request). Is it intentional? – snieguuwindow.location.href
in JS instead – karllekko