#bugkiller.

1 messages ยท Page 1 of 1 (latest)

fleet smeltBOT
surreal tinsel
#

One lists Source objects, and the other lists Payment Methods.

smoky cliff
#

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

surreal tinsel
#

Correct. They're functionally similar, but the summary is: Sources are the legacy version of Payment Methods

smoky cliff
#

if user makes subscription by stripe subscription checkout session link, payment methods will be added to the customer object automatically?

surreal tinsel
#

Yes

smoky cliff
#

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",
)

surreal tinsel
#

I don't understand the question. Can you be more specific?

smoky cliff
#

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?

surreal tinsel
#

I still have no idea what you're asking. Can you try to be more concise?

smoky cliff
#

wait a moment

#

never mind for this question

#

๐Ÿ™‚

fleet smeltBOT
smoky cliff
#

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?

safe laurel
#

Hi there

smoky cliff
#

yeah, same return url or session id

#

if session id is passed to the frontend

safe laurel
smoky cliff
#

then I can do stripe.redirectToCheckout({ sessionnId: xxx })

#

right?

#

?

safe laurel
#

No that's deprecated

smoky cliff
#

??

safe laurel
#

Do what's done in the guide I linked above

smoky cliff
#

really confusing

#

I'm following your guide

safe laurel
#

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

smoky cliff
#

then your doc explains deprecated way?

safe laurel
#

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

smoky cliff
#

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?

safe laurel
#

Yep

smoky cliff
#

ok good this is the case to create subscription

#

what I need to do to upgrade/downgrade subscription?

#

like you have subscriptoin for

safe laurel
#

You want stripe-hosted solution?

smoky cliff
#

$30/month now

#

and user wanted to downgrade to the $20/month

#

what I need to do?

#

it's better to use our own

safe laurel
smoky cliff
#

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

#

--

safe laurel
#

Did you see the link I sent above?

safe laurel
#

yep

smoky cliff
#

hmm, everyhing is there what I've asked?

#

then let me try it out more

safe laurel
#

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

smoky cliff
#

I'm asking this especially user wanted to upgrade/downgrade subscription with new card info

#

this is my question

safe laurel
#

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

smoky cliff
#

ok, thank. probably I need to read the doc carefully ๐Ÿ™‚

#

but got an idea. thanks

safe laurel
#

No problem

smoky cliff
#

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

safe laurel
#

Yeah it's been a few years. Not sure exactly

smoky cliff
#

how to update customer's default payment method?

#

if user has few cards

safe laurel
#

Have the user select which one they want as the default

smoky cliff
#

so no api?

#

if user has several cards, which one will be used to get charge for active subscription?

safe laurel
#

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

#

I sent it previously

smoky cliff
#

we have this ui

#

when user add new card, we want it to be default payment method

safe laurel
#

Ok

#

So use the api endpoint I linked above

smoky cliff
#

my question is when I make checkout session for mode 'setup'

#

if I pass subscription id into setup_intent_data

safe laurel
#

Oh you never mentioned you wanted to use checkout

smoky cliff
#

that subscription's default payment method will be updated auto?

safe laurel
#

Earlier you told me you didn't want a stripe hosted flow

#

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

smoky cliff
#

ok

safe laurel
#

What?

smoky cliff
safe laurel
#

Oh you're passing it within metadata

#

Totally missed that my bad. It was the indentation

smoky cliff
#

yeah,

safe laurel
#

Yeah you can do that

smoky cliff
#

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?

safe laurel
#

No scroll down further in the guide

#

Always recommend reading the whole guide before asking us questions

smoky cliff
#

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

safe laurel
#

Correct

smoky cliff
#

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

safe laurel
#

Happy to help. Let us know if you have further questions after reading the integration guide

smoky cliff
#

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."""