#mayhu-subscription-default

1 messages · Page 1 of 1 (latest)

pure sable
#

@steady viper yes you can set it globally if you want

#

no need to override on the subscription if the customer already has a default

steady viper
#

perfect, thanks!

molten zephyr
#

(unless the customer WANTS more than one subscription, AND wants them to be on different cards...)

pure sable
#

sure but that is kinda obvious in itself

molten zephyr
#

(...and you want to support that. You don't have to)

steady viper
#

Are there are any docs on what the flow typically looks like for charging a customer a second time, after they already have a payment method set up?

We currently use the new Stripe payment element to charge users within our platform, and we save their card for future use. If the user wanted to buy a 2nd product on our platform, we ideally don't want to show them a Stripe payment element again, because we already have their card on file. What should we be showing them instead?

pure sable
#

@steady viper the default payment method is purely for Invoices and Subscriptions. It doesn't work for normal one-time payment

#

PaymentElement today doesn't have any UI/flow for showing a previously saved card/payment method really so you have to build this yourself

#

It's something we want to fix in the future, but it'll take a while

steady viper
#

Got it. Our platform supports a mix of one time payments & subscriptions so this is how I'm thinking about it:

  1. User selects product/price
  2. If they are a first time customer, show them payment element (this is what we curr have implemented)
  3. If they already have a payment method on file, display a custom UI that shows them we're about to charge their existing card on file (with the option to change if needed, which would then direct them to the payment element)
  4. If the repeat customer is buying a one-time purchase, create & immediately confirm the payment intent on our server (https://stripe.com/docs/payments/save-and-reuse?platform=web#charge-saved-payment-method)
  5. If the repeat customer is purchasing a new subscription, create the new subscription (which will immediately charge them the first invoice?)
#

So I guess my question is, what kind of UI should we showing our users if step 4 or 5 results in an error? If we attempt to charge a saved payment method, and it results in an error, do we show them the entire payment element again?

I've noticed on other sites I've used, they sometimes ask for JUST my CVV if they already have my card on file. Is that something we should be doing?

pure sable
#

yes I would show the PaymentElement again in that case

steady viper
#

It seems like with this flow, it doesn't really matter which one we choose. Because we're not "taking advantage" of the fact that the customer is in the middle of our checkout flow when we charge their card a second time

pure sable
#

There is a real difference yes on many levels

#

You are not supposed to use off_session: true at your step 4 if the customer is on session since that breaks various rules such as SCA for card payments in Europe

#

so really you have to choose what is relevant to your business model. Will you charge customers off session in the future, where they are not on your website/application and you charge them, like recurring payments for example are off session

steady viper
#

Well for us, if the user purchases a subscription, then we need off session to be true (because we need to charge their card every month). But if the user just purchases a one time thing, then we don't need off session to be true. Because we only charge users for one time purchases while they are on session

pure sable
#

correct so since both might happen I'd do setup_future_usage: 'off_session'

#

but you can't pass off_session: true on PaymentIntent creation if the customer is on session in your app or on your website attempting to pay

steady viper
#

I see, so during our step 4, when we create the payment intent for the repeat customer, we should do confirm=true & off_session=false?

pure sable
#

yes, or just don't pass off_session at all, it's the default

steady viper
#

So the docs say this: "Set off_session to true to indicate that the customer is not in your checkout flow during this payment attempt—this causes the PaymentIntent to throw an error if authentication is required."

If off_session is set to false, what happens if authenticated is required?

pure sable
#

it goes to next_action and you handle client-side

molten zephyr
#

(Incidentally, my app does exactly this, and it works fine - the customer is sent an email to return, and the paymentIntent is recreated (re-used, really) with off-session: false to specifically generate the client secret and the needed state for when the customer does get back to the site)

steady viper
#

Are there any docs on how to handle next_action? Since the only method we support right now is cards, I imagine the most common next_action type would be "use_stripe_sdk" or "redirect_to_url". If the type for next_action is "use_stripe_sdk", how/where do we pass that to Stripe.js?

pure sable
#

You use confirmCardPayment() client-side

steady viper
#

Oh so is "next_action.use_stripe_sdk" essentially the same thing as the payment client secret?

pure sable
#

maybe? 😅 that sentence as is doesn't really make sense unfortunately

#

but mostly if it says "use_stripe_sdk" then you go client-side and confirm it the same way you would have if you were collecting new card details, just you don't need the card element

steady viper
#

oh I see, so the client-side confirmation doesn't require any input from the user?

pure sable
#

no input, but it might require an action like entering the 2FA code they got for 3D Secure for example

#

and it can still be declined, in which case you'd show the PaymentElement again

steady viper
#

Got it, I think that makes sense. Will test it out and see if it all connects! Thanks so much for all the help, i really appreciate it

pure sable
#

Happy to help! Going to add @candid badger to take over as I have to run in case you have follow up questions