#bugkiller.
1 messages ยท Page 1 of 1 (latest)
One lists Source objects, and the other lists Payment Methods.
so source and payment methods are different?
I'm migrating old checkout to new checkout for our system because users reported failing subscription due to 3DS
Correct. They're functionally similar, but the summary is: Sources are the legacy version of Payment Methods
if user makes subscription by stripe subscription checkout session link, payment methods will be added to the customer object automatically?
Yes
but what if old users
who made subscription with old legacy checkout
I think in that caes,
customer.sources.list(limit=10, object='card')
this will give us result
but not this
cards = stripe.PaymentMethod.list(
customer=stripe_customer.id,
type="card",
)
I don't understand the question. Can you be more specific?
we have users who has active subscription with stripe
they made taht subscription with old checkout
(stripe popup)
customer.sources.list(limit=10, object='card')
so this will give some cards for specific customer
I'm migrating to new stripe checkout , and your support stripe.PaymentMethod.list instead of customer.sources.list
but as I said our existing users made subscription with your (stripe) old api
so
to get cards for customer (stripe),
customer.sources.list(limit=10, object='card')
this will give few cards
but this is not
stripe.PaymentMethod.list
Am I wrong?
I still have no idea what you're asking. Can you try to be more concise?
I have another question
when we need to create subscription, we will do in this way
create stripe subscription checkout session in backend
and pass id to the frontend
frontend will make redirect to the stripe
am I right?
Hi there
You can just return the url to the frontend and redirect them there. See: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout#create-session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
??
Do what's done in the guide I linked above
What is?
Create the session, that returns a session object which has a url param. Then, just return that to the frontend and redirect to that url
Hm yeah I suppose that doc shows the deprecated function
Recommend doing what is done in the guide I linked instead
I'll flag this to the team
wait a moment.
ok, then let's talk again
create stripe subscription checkout session in the backend, and pass the url to the frontend
and in the frontend will make redirect to that url
Am I correct?
Yep
ok good this is the case to create subscription
what I need to do to upgrade/downgrade subscription?
like you have subscriptoin for
You want stripe-hosted solution?
$30/month now
and user wanted to downgrade to the $20/month
what I need to do?
it's better to use our own
because we have user interface liek below
is it possible?
I'm asking this especially user wanted to upgrade/downgrade subscription with new card info
--
this link?
yep
You asked how to upgrade/downgrade a subscription
That guide shows you how
If you read it all and are still confused, happy to answer specific questions
I'm asking this especially user wanted to upgrade/downgrade subscription with new card info
this is my question
Yeah you can do that
You'd collect new payment method via a setupintent
Then set the payment intent as the sub's default
In the update subscription call, you could both update the sub to have a new default payment method and update its price:
https://stripe.com/docs/api/subscriptions/update#update_subscription-default_payment_method
https://stripe.com/docs/api/subscriptions/update#update_subscription-items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
No problem
when did you migrate? from old checkout to new?
I think long time ago
but our system made more long times, and we used yoru legacy checkout version (popup to collection token or source)
we live with it for a long time, but these days users are saying 3DS failure
Yeah it's been a few years. Not sure exactly
Have the user select which one they want as the default
so no api?
if user has several cards, which one will be used to get charge for active subscription?
If they have several cards, you need to have a way for the user to indicate which one they want to charge
You shouldn't blindly pick one
A user can have several cards, but this section shows how to indicate which one to use as the sub's default: https://stripe.com/docs/api/subscriptions/update#update_subscription-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I sent it previously
my question is when I make checkout session for mode 'setup'
if I pass subscription id into setup_intent_data
Oh you never mentioned you wanted to use checkout
that subscription's default payment method will be updated auto?
Earlier you told me you didn't want a stripe hosted flow
That's not a valid param for setup_intent_data. See: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-setup_intent_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
After you collect card details through the session, you can call the api I linked above to update the user's sub to have the new card as the default payment method
ok
wrong??
What?
Oh you're passing it within metadata
Totally missed that my bad. It was the indentation
yeah,
Yeah you can do that
so in that case, that passed subscription's default payment method will be updated?
and also card will be added as a payment method to the stripe customer?
No scroll down further in the guide
You still need to manually make that api call: https://stripe.com/docs/payments/checkout/subscriptions/update-payment-details#set-default-payment-method
Always recommend reading the whole guide before asking us questions
haha, now I'm so hurring to finish this because many users waiting
ok, got it.
metadata is just for saving some data into the session. nothing else besides it maybe
Correct
You're the best. thanks a lot. will ask you a question again afterin readin all links (whole doc) provided by you.
this is why I love stripe very much over paypal. your dev support is amazing
Happy to help. Let us know if you have further questions after reading the integration guide
where can I see all available brand
stripe.PaymentMethod.list will give cards
it has field called brand. but I need know what names might available there
exactly with case sensitive
like visa, mastercard.
sorry never mind. found it.
"""Card brand. Can be amex, diners, discover, eftpos_au, jcb, mastercard, unionpay, visa, or unknown."""