#laurentluce_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
âąď¸ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1212163094172934265
đ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!
Request IDs:
req_xqbfLL7KkXObvK
req_tjTlN144qQQbJi
req_lKa3gPhuBJ9EgQ
req_DJXVgYnxeJij6o
I read through the flow you described but I'm a bit confused. When are you creating a subscription?
Also, what are you trying to show me with the list of request IDs?
I first set the payment method as the default one and then i create the subscription.
The list of request IDs matches the flow I described above: SetupIntent with mandate (server) -> PaymentElement (client) -> confirmSetup (client) -> Set payment method as default (server) -> Create subscription.
req_xqbfLL7KkXObvK - creating a SetupIntent
req_tjTlN144qQQbJi - confirming a SetupIntent
req_lKa3gPhuBJ9EgQ - creating a SetupIntent
req_DJXVgYnxeJij6o - detaching a PaymentMethod
But let's take a step back first. Is there a specific reason why you're creating a SetupIntent and collecting payment details instead of creating a Subscription from the start?
That is how our UI works. The user inputs a payment method and we run those steps.
Here is the request ID for subscription create: req_pGSnBllJDrgpGM
and here is the one to set the default payment method: req_GXRhS6aMDthKiV
I cleaned up the list of requests, here it should match the flow above:
req_o4H3EZeg2QdgZ3
req_gn8axdvrB3griV
req_SmpN6rwCx1TcXl
req_pGSnBllJDrgpGM
Apologies for the earlier incorrect list.
I don't recommend you do this. There's no need to create a SetupIntent if you're creating a Subscription immediately after. Instead, you should follow this flow: https://docs.stripe.com/billing/subscriptions/build-subscriptions?ui=elements
When you create the Subscription, use payment_behavior=default_incomplete, and render the PaymentElement using latest_invoice.payment_intent.client_secret
Thanks for the link. The thing is that I don't know the customer state before they enter their payment method. I vaguely remember that you cannot create a subscription if the user does not have a state. Or would the payment_behavior=default_incomplete help with that?
Customer address, the state is used for tax collection.
Ah, gotcha. A PaymentMethod's billing address is totally separate from customer.address though
Got it. I probably got confused. I thought the address was updated based on the first payment method added.
I am going through the link you sent me.
and I would need to pass the mandate info as part of the Subscription create request.
In this case, we'd try to create the mandate automatically: https://docs.stripe.com/india-recurring-payments?integration=subscriptions#subscription-creation
and that is because you have the price / product info as part of the subscription request?
Mandates would be created if a customer tries to pay with a supported India-issued card and if the subscription attempts to charge automatically
I will try that flow out. Thank you for your help!