#boundless_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1260096325366583337
đ Have more to share? Add details, code, screenshots, videos, etc. below.
- Yes Stripe checkout support subscription, even if the initial payment is not required.
Oh? That's interesting, I tried to use the checkout sessions API with mode: subscription and payment_intent_data: { capture_method: "manual" } but the API response stated that these options are incompatable. Is there a recommended way to setup such a flow with a subscription that had a deferred payment?
Apologies, this appears to be delving into the #API section now haha
No, you can't set payment_intent_data in a subscription mode checkout session
Gotcha, hit that one too. Do you have a best practice for setting up a checkout session for a subscription with a deferred payment? I didn't spot the correct combos in https://docs.stripe.com/api/checkout/sessions/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What do you mean by " a subscription with a deferred payment" ? can you give me an example?
Sure! So the ideal (but not sure if possible) scenario is that we submit a checkout session using the checkout session API (mode: subscription) and have the user checkout as normal. However, the checkout should not immediately capture funds, just authorize them (like the capture_method: "manual" option would offer, but isn't supported directly). Then, at some later time (within the window of the payment verification) we would capture the funds.
The flow would look like:
- Customer on our site clicks "checkout"
- Customer is redirected to Stripe for payment collection and on "buy" only authorize, not collect
- Customer does actions
- Funds are collected some time later and subscription starts
It looks more like a payment mode checkout session to me, why do you want to use subscirption mode?
The core product is a subscription service, the customer only needs to do to an action once and once we confirm everything works, then payment should be collected. In the case that it makes more sense as a payment mode checkout session, would #2 (in my original post) be a reasonable solution?
Sure you can do that by using the subscriptions API to create a subscription, with the payment method that you collected from the payment mode checkout session.
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage you can set this to save a payment method during a checkout payment
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Sweet! So in that case, since our actual charge is going to come from the subscription, we could just cancel the payment authorization from the checkout session? And if so, would Stripe recognize the funds we freed from the cancelled payment authorization immediately or is there a lag time?
I've seen an odd situation where a customer had something like 1.5 * (item_price) liquid and I wanted to confirm cancelling a payment authorization, then immediately setting up a subscription would only tie up 1 * (item_price) instead of 2 * (item_price) [1 from the lag on the cancelled payment authorization initially and 1 from the newly created subscription]
No, I'm not talking about subscription mode checkout. I'm saying you should use payment mode checkout session with manual capture and setup_future_usage.
RIght, we'd use the subscriptions API to setup the actual recurring subscription. However, that payment mode checkout session creates a payment authorization for customers that I don't want to tie their funds up with
Or you want to use setup mode checkout to collect a payment method without charging your customer?
The setup mode was a consideration, but the prospect of Stripe auto-magically handling fund verification as well (in the same page) was an attractive prospect. If we lose fund verification, shifting towards a completely custom flow is likely going to be our best bet it sounds like.
What do you mean by "fund verification" ?
In the sense that we could utilize capture_mode: manual primarily to confirm the customer has the funds available in their account
Ok. I'd strongly suggest you implement something in your integration to properly handle card declines. It's very common and there's no way to avoid it.
Ack, thanks so much for the insight, I think we've got enough info to work on
https://docs.stripe.com/declines/card you can learn more about card declines here
Sounds good, I'll take a look at that as well. Thanks again!