#bugkiller.

1 messages · Page 1 of 1 (latest)

polar pumiceBOT
heavy nimbus
#

This isn't really a question. Can you rephrase what you need help with?

jagged pulsar
#

we're migrating a old checkout api (popup ) to new checkout version

#

so once user create a subscription, used stripe subscription checkout session and redirect to stripe to pay

#

my question is about upgrading/downgrading existing subscription to another pricing

#

of course need to use stripe.Subscription.modify

#

but I think it will happen if user do it with card which is added to the strpe customer

#
  1. then stripe.Subscription.modify will be used
#
  1. if user clicks 2, no idea how to do it.
    in old checkout, displayed stripe checkout popup and got token, and then passing that token to the backend
#

now how to do it if user wanted to upgrade/downgrade with another card which is not added to stripe customer object before 😦

heavy nimbus
#

So Checkout should only be used to create net-new Subscriptions (or for immediate payments). If you're looking for a no-code/low-code way for an existing subscription customer to update the card they use for subscriptions, I recommend using the Customer Portal

jagged pulsar
#

how to do it without using Customer Portal?

#

because in our case, user will pick new pricing in our website

#

I'm not looking for a no-code solution

#

just want to know how to do it

heavy nimbus
#

Got it, I see. I recommend using SetupIntents to collect new payment details. Once the new PaymentMethod is created, you can update the customer's invoice_settings.default_payment_method value to use the newly-created PM

jagged pulsar
#

could you please give me a link for it?

heavy nimbus
jagged pulsar
#

PaymentIntent is diffrent to creating stripe checkout session ( mode='setup') ?

heavy nimbus
#

Yes, exactly. PaymentIntents are used to track a specific payment/charge, while SetupIntents are used to only collect payment details from a customer if you plan on using those payment details for future charges

jagged pulsar
#

your link is what I'm saying

#

anyway, got it. maybe we need to force user to add card in another UI to use different card

#

we have that kind of UI

#

separtely

#

for the default payment method, which one is more high priority

#

between subscription's defualt payment VS customer's default payment

heavy nimbus
#

It's really hard to follow your questions when you send one-off messages like this. Just so I'm sure, are you unblocked? You can use the PaymentElement with a SetupIntent's client secret to collect new payment details from a customer. If you want to update the payment method for a specific subscription, you can update the subscription (instead of updating the customer): https://stripe.com/docs/api/subscriptions/update#update_subscription-default_payment_method

jagged pulsar
#

ok, forget about it.

#

I want to ask different question

#

stripe customer has default payment method

#

and stripe subscription also ahs default paymen tmethod

#

in my check,

#

so if stripe customer default payment mehtod is "pm_1" and subscription's default payment method is "pm_2"

#

then which one will be used for the subscription? (on next time billing)

heavy nimbus
#

This is covered in the link above

#

a subscription's default_payment_method takes precedence if it is set.

#

If default_payment_method or default_source are not set on the subscription, the customer’s invoice_settings.default_payment_method will be used

jagged pulsar
#

makes sense

#

what if we failed to charge with subscription's default payment method, then stripe will try with customer's default payment method?

heavy nimbus
#

No, we'll only retry with the same payment method. We won't retry the payment with another saved payment method for that customer.

jagged pulsar
#

got it.

jagged pulsar
#

the main reason we started to migrate checkout to new version is because 3ds

heavy nimbus
#

Yep!

polar pumiceBOT
jagged pulsar
#

hi

#

what will happen if user tries to add card which is already registered as payment method for him (his stripe customer)

midnight gale
#

Hello! I'm taking over and catching up...

jagged pulsar
#

will be duplicated

midnight gale
jagged pulsar
#

Is there any way to prevent different customers to use same card?

midnight gale
#

Yes, you can do that on your end by looking at the fingerprints.

jagged pulsar
#

it means, we need to save all the fingerprints?

#

100 users ( each user has 2 cards) for example

#

then we need to store fingerprints on our end?

#

I'm asking about getting customer by fingerprint from yoru api

midnight gale
#

If you want to prevent people from using the same card twice across those users, yes.

jagged pulsar
#

how to get customer object from fingerprints

midnight gale
#

The fingerprint property is on the Payment Method, not on Customers.

#

You can't.

jagged pulsar
#

yes, customer will have paymentmethods

#

so if I have one fingerprint, how to get which customer has that card as one of the payment method

midnight gale
#

If you want to prevent the same card from being used across Customers you should store the fingerprints and associated Customer IDs on your end so you can determine when a new Payment Method + Customer combo is one you don't want to allow.

jagged pulsar
#

yeah, it's fine.

#

but no way to do it for

#

stripe subscription checkout session (like creating subscription)

#

because I can only know after session is done