#bugkiller.
1 messages · Page 1 of 1 (latest)
This isn't really a question. Can you rephrase what you need help with?
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
- then stripe.Subscription.modify will be used
- 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 😦
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
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
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
could you please give me a link for it?
PaymentIntent is diffrent to creating stripe checkout session ( mode='setup') ?
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
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
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
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)
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
makes sense
what if we failed to charge with subscription's default payment method, then stripe will try with customer's default payment method?
No, we'll only retry with the same payment method. We won't retry the payment with another saved payment method for that customer.
got it.
this supports 3DS right?
the main reason we started to migrate checkout to new version is because 3ds
Yep!
hi
what will happen if user tries to add card which is already registered as payment method for him (his stripe customer)
Hello! I'm taking over and catching up...
Yeah, we don't do any deduplication on our end. If you want to deduplicate you can use the fingerprint to determine if two Payment Methods represent the same card or not: https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-fingerprint
Is there any way to prevent different customers to use same card?
Yes, you can do that on your end by looking at the fingerprints.
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
If you want to prevent people from using the same card twice across those users, yes.
how to get customer object from fingerprints
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
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.