#boundless_best-practices

1 messages ¡ Page 1 of 1 (latest)

signal lanceBOT
#

👋 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.

shy shard
#
  1. Yes Stripe checkout support subscription, even if the initial payment is not required.
acoustic dune
#

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

shy shard
#

No, you can't set payment_intent_data in a subscription mode checkout session

acoustic dune
shy shard
#

What do you mean by " a subscription with a deferred payment" ? can you give me an example?

acoustic dune
#

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:

  1. Customer on our site clicks "checkout"
  2. Customer is redirected to Stripe for payment collection and on "buy" only authorize, not collect
  3. Customer does actions
  4. Funds are collected some time later and subscription starts
shy shard
#

It looks more like a payment mode checkout session to me, why do you want to use subscirption mode?

acoustic dune
#

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?

shy shard
#

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.

acoustic dune
#

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]

shy shard
#

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.

acoustic dune
#

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

shy shard
#

Or you want to use setup mode checkout to collect a payment method without charging your customer?

acoustic dune
#

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.

shy shard
#

What do you mean by "fund verification" ?

acoustic dune
#

In the sense that we could utilize capture_mode: manual primarily to confirm the customer has the funds available in their account

shy shard
#

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.

acoustic dune
#

Ack, thanks so much for the insight, I think we've got enough info to work on

shy shard
acoustic dune
#

Sounds good, I'll take a look at that as well. Thanks again!