#thebeard_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ 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.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ 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/1283529302029238366
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
hey
Yeah if you aren't going to create the Subscription while your customer is in your checkout flow, but instead want to do this later on, then using a SetupIntent to collect their PaymentMethod is the correct way to go.
ok, that sorts out my second flow where user user will add a payment method but will subscribe later.
but what about the case, where user is on checkout page and as soon as they complete checkout, they should be subscribed. would setup intent with webhooks the best way to do it?
No you just create the Subscription to do this
Are you using Stripe Checkout here?
Or a Custom flow?
would that work with sca if needed?
Yes
You use payment_behavior: 'default_incomplete': https://docs.stripe.com/api/subscriptions/create#create_subscription-payment_behavior
That allows you to confirm on the frontend so that 3DS is handled if it is required
yes
Oh okay well then Stripe Checkout handles everything for you
You just create a Checkout Session with mode: subscription
nvm, our client is still poc. was trying to figure out from servers perspective
ok, so then it should be good for future payments for monthly subscription and any usage based subscription?
Yep
There is always a chance an issuer requests 3DS on a future payment as that is their prerogative. But this is generally unlikely and the PaymentMethod will be properly set up for future payments in this flow.
i just want to re iterate the checkout method so if i understand correcly
- the client creates a payment method with some card details
- the client calls this endpoint with payment method id and customer. the server attaches that payment method to customer and create a subscription for that customer
but again this becomes a 2 step process, client adding the payment mthod to stripe and getting payment method id and then calling subscribe. could this one step where client enter card details and hit subscribe?
If you are using Stripe Checkout all you do is create a Checkout Session with the proper mode
You do this on your backend
Then you redirect your client to the session.url
That is an example with mode: subscription which collects a payment method and starts a Subscription
If you use mode: setup then only a payment method will be collected and later on you create a Subscription from your backend for that Customer and use that previously collected payment method