#chase-checkout

1 messages · Page 1 of 1 (latest)

tepid zenith
#

hello, reading one sec

tepid zenith
#

just clarifying -

which removes all other payment methods, so there can only be one-at-a-time.
don't think setup mode Checkout removes any existing PaymentMethods from a Customer. It just sets up and attaches a PaymentMethod to a Customer

#

reading the rest too

#

does the stripe checkout window already allow users to select an existing payment method? if so, this may complicate my "one singular linked payment method" model?
yeah so if a Customer already has n attache PaymentMethods, Checkout surfaces them

I am not a 100% on whether this only works for mode: payment or also mode: subscription

lemme check

river oasis
#

my intention is for my backend to enforce the one-payment-method-at-a-time rule in the checkout.session.completed webhook.

tepid zenith
#

it seems like i might be able to use paymentIntents for the purchases of digital products, since payment intents accept a payment_method. however, paymentIntents do NOT seem to accept a price — only an amount — and so i cannot specify a recurring subscription there.
since you're creating Subscriptions, don't use PaymentIntents for that, those are for one time payments.

river oasis
#

understood — i can use PaymentIntents for the one-time digital product payments.

#

okay, so if stripe checkout surfaces all the customer's payment methods, and allows the customer to select an existing payment method or enter a new payment method — i suppose my webhook for checkout.session.completed can find the payment_method on the setup_intent, see if it's a new payment method, and then enforce the one-at-a-time thing by detaching old payment methods and updating existing subscriptions.
➡️ in this case, i suppose all my created checkout sessions will specify payment_intent.setup_future_usage.

tepid zenith
#

ok checked, yeah subscription mode does work with saved PaymentMethods on a Customer and also surfaces the invoice_settings.default_payment_method on a Customer (if that field is set )

#

i suppose my webhook for checkout.session.completed can find the payment_method on the setup_intent, see if it's a new payment method, and then enforce the one-at-a-time thing by detaching old payment methods and updating existing subscriptions.
correct yes

river oasis
#

so whenever the payment method changes, either by a checkout session in "setup" mode or by a checkout session in "subscription" mode, i should set the customer.invoice_settings.default_payment_method to the new payment method, and also enforce my one-at-a-time rule by detaching the obsolete payment methods.

#

i've also noticed that PaymentIntents do not accept a price id, and so i do not need to model my digital content as stripe products or prices.

#

does this sound correct?

#

➡️ so for the purchase of digital products, i only engage a checkout session in "setup" mode when the customer does not already have a default_payment_method — and then, once the customer has a default_payment_method, i can proceed to create a PaymentIntent
➡️ and for subscription purchases, i always create a new checkout session in "subscription" mode with payment_intent.setup_future_usage set to off_session, always saving the resulting setup_intent.payment_method as the default_payment_method

tepid zenith
#

reading now one sec

#

i've also noticed that PaymentIntents do not accept a price id, and so i do not need to model my digital content as stripe products or prices.
yes you wont use PaymentIntents since you are not creating a one time payment

#

so for the purchase of digital products
is this a one timepayment? a recurring paymetn?

if so, why are you using Checkout in setup mode then?

#

and then, once the customer has a default_payment_method, i can proceed to create a PaymentIntent
➡️ and for subscription purchases, i always create a new checkout session in "subscription" mode with payment_intent.setup_future_usage set to off_session, always saving the resulting setup_intent.payment_method as the default_payment_method

wait I'm confused

#

why not use Checkout directly

#

for the Subscription and one time payment

and Not do the setup mode CHeckout

river oasis
#

hello, so on my stripe connect platform, merchants will be selling both subscription memberships and also one-time-payment digital products.

tepid zenith
#

yeah so why not use Checkout directly in that case

river oasis
#

the plan is to have a "billing" panel, where users can link their credit card, and update it, and remove it.
after they've linked a card, they can purchase items with one click.

tepid zenith
#

ah ok

#

in that case, Checkout in setup mode works

river oasis
#

if they try to purchase a digital item before they have a linked payment method, they will be prompted with a "setup" checkout.

#

for subscriptions, checkout in "subscription" mode is the only way, whether they have a payment method already linked or not. after they checkout a subscription, my system will set whichever payment method they use as the "current" payment method, which will be displayed in the billing panel.

tepid zenith
#

ok hold one

#

once the card is set up

#

you will not be creating another CheckoutSession in subscription mode

#

you already have the card saved

#

so you just create a Subscription via the API

river oasis
#

oh okay -- this is new information, i originally thought i had to create a paymentintent to utilize an existing payment method --

#

but if i can just create a new subscription object, and provide it an existing payment method -- without prompting a checkout -- that would be great

#

➡️ it looks like i can create a new subscription object, directly, and specify subscription.default_payment_method with the customer.invoice_settings.default_payment_method -- does that sound correct?

tepid zenith
#

oh okay -- this is new information, i originally thought i had to create a paymentintent to utilize an existing payment method --

you still can do that for a one-time payment

#

but if i can just create a new subscription object, and provide it an existing payment method -- without prompting a checkout -- that would be great
but yes absolutely, this works and you should do this, no need to create Checkout a second time

#

➡️ it looks like i can create a new subscription object, directly, and specify subscription.default_payment_method with the customer.invoice_settings.default_payment_method -- does that sound correct?

yes

river oasis
#

will that action immediately charge the card for the first payment cycle? or is another action required?

tepid zenith
#

which action

river oasis
#

creating the subscription object

tepid zenith
#

well there is a whole guide on that

#

it could or could not immediately succeed , all depends on whether a bank allows or declines a payment

#

recommend going through this thoroughly

#

your case might be a bit simpler cause you do set up cards via Checkout ahead of time

#

but you still have to handle Subscription payments requiring authentication OR declining (hence adding a new card)

river oasis
#

understood

#

thanks so much for hashing this out with me, i'm certain you just prevented a whole lot of unnecessary checkout windows for customers 👍👍

#

cheers 🍻🍻

tepid zenith
#

no worries!

#

we're here if you wanna chat through more things