#dopeboyz

1 messages · Page 1 of 1 (latest)

golden mapleBOT
unique river
#

Hi there, can you share with me the subscription ID?

past canopy
#

Yepp sure give me sec, I'll also share the stackoverflow thread too

#

sub_1M467pGYvC6CYP5GqgiotwmL

unique river
#

How do you update the default card? is there a request ID that you can share with me?

past canopy
#

Yeah but when i check the stripe dashboard it doesn't get updated

unique river
#

Oh, I think you want to update the customer's the default_payment_method, not just this particular subscription, am I right?

past canopy
#

Yepp so everytime a customer pays it gets charged by that card

#

Either it's subscription or normal payments

unique river
past canopy
#

Im doing that

#

But still nothing

unique river
#

Share with me the request ID?

past canopy
#

Im sending this id to update payment method

unique river
#

I need the request ID so that I can see what data is sent in the request

#

Or can you copy and paste the customer ID here?

past canopy
#

Yepp sure coz im not sure what request id you're talking about

#

cus_MnhUkX4eOZGoVp

unique river
past canopy
#

Yeah but im trying to update new card the mastercard one

unique river
#

What request did you make to update the default_payment_method?

past canopy
#

The visa card with 4242 is set during when subscription is created

#

Could you please check the above stackoverflow link i have provided

unique river
#

Yes I saw. But I don't understand what you mean by nothing updates in stripe ?

past canopy
#

Let me explain

#

In my app we are saving cards and user have an option to choose any saved card and set them as their default card

#

But when i try to update the card to set as default card the api response with success but the card doesn't change it still shows the old card that being used while creating the subscription

unique river
#

The card doesn't change it still shows the old card that being used while creating the subscription -> can you give me an example?

past canopy
#

Okay

#

Can you see there are two cards?

unique river
#

For customer cus_MnhUkX4eOZGoVp? yes

past canopy
#

Right now all the subscriptions will get charged from that 4242 visa card

unique river
#

Yes, because it's the default card

past canopy
#

Cool

#

But now i wanna change that card to mastercard

#

So upcoming payments will get charged by the mastercard not by visa

unique river
#

upcoming payments -> you mean the new subscriptions, or the upcoming invoices generated by the existing subscriptions ?

past canopy
#

And i don't want to change it from dashboard i want end user to have that functionality so they can change to any credit cards they've saved

#

Lets say my subscription end this December and i want that next payment get deduct via my new mastercard

unique river
#

So I assume you mean new subscriptions?

past canopy
#

It's the existing subscription when it get renewed

unique river
#

OK, the subscription end here means renewals, not cancellation, am I right?

past canopy
#

The customer doesn't cancel the plan or anything he just want that upcoming subscription payment for existing subscription get charged by new card that he has setup in our app

unique river
past canopy
#

That's what im doin but it doesn't seem to work

unique river
#

The subscription's default_payment_method is still the 4242 card, not 4444 yet.

past canopy
#

That's the problem

#

It's doesn't get updated

unique river
past canopy
#

So the payment_methods does it start with "card..." Or "pm.."

unique river
#

pm_, and PaymentMethods API is backward-compatible with card_ objects as well.

past canopy
#

But how do i get the pm id

unique river
past canopy
#

Im creating the token from createtoken in frontend

#

Then im creating source from that token

#

And that saves the new card

unique river
past canopy
#

Let me check

#

I have just retrieved all paymentmethods

#

4242 - pm_1M465IGYvC6CYP5GNHlLMvLw
Mastercard - card_1M502vGYvC6CYP5GVPmrItks

#

These are the two ids im getting in response

#

I think this is the issue coz somehow it's not accepting payment_methods which starts with "card"

unique river
#

Have you tried updating the default_payment_method with card_1M502vGYvC6CYP5GVPmrItks ?

past canopy
#

That's what im doin for a while now

unique river
#

But I don't see any request to update default_payment_method with card_1M502vGYvC6CYP5GVPmrItks in your logs

past canopy
#

Can you check again?

#

I have just updated the request

unique river
#

OK. I saw you updated the default_payment_method to other subscription, not the original subscription that we discussed earlier

past canopy
#

That means its got updated?

unique river
#

It's updated to the subscription that you specified, but it's not the subscription that we discussed earlier.

past canopy
#

Yepp so what's the issue?

unique river
#

I don't see an issue here. Did you check the new subscription and see if the invoices are paid with the new card?

past canopy
#

Yepp it's working

unique river
#

Great!

past canopy
#

Now im facing another issue

#

Thanks mate

#

Can i ask you something