#dopeboyz
1 messages · Page 1 of 1 (latest)
Hi there, can you share with me the subscription ID?
Yepp sure give me sec, I'll also share the stackoverflow thread too
sub_1M467pGYvC6CYP5GqgiotwmL
How do you update the default card? is there a request ID that you can share with me?
https://dashboard.stripe.com/test/logs/req_N5hycDKsrgBc0D I found this in your logs. the default_payment_method update was successful
Yeah but when i check the stripe dashboard it doesn't get updated
Oh, I think you want to update the customer's the default_payment_method, not just this particular subscription, am I right?
Yepp so everytime a customer pays it gets charged by that card
Either it's subscription or normal payments
Got it. In this case, you should update customer's invoice_settings.default_payment_method. https://stripe.com/docs/api/customers/update?lang=ruby#update_customer-invoice_settings-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.
Share with me the request ID?
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?
OK. Here is the request you made to update the customer's default_payment_method https://dashboard.stripe.com/test/logs/req_ugejo7xEqk4WCe
https://dashboard.stripe.com/test/customers/cus_MnhUkX4eOZGoVp and if you go back to your Dashboard, you can find the 4242 card is already set as default
Yeah but im trying to update new card the mastercard one
What request did you make to update the default_payment_method?
The visa card with 4242 is set during when subscription is created
Could you please check the above stackoverflow link i have provided
Yes I saw. But I don't understand what you mean by nothing updates in stripe ?
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
The card doesn't change it still shows the old card that being used while creating the subscription -> can you give me an example?
For customer cus_MnhUkX4eOZGoVp? yes
Right now all the subscriptions will get charged from that 4242 visa card
Yes, because it's the default card
Cool
But now i wanna change that card to mastercard
So upcoming payments will get charged by the mastercard not by visa
upcoming payments -> you mean the new subscriptions, or the upcoming invoices generated by the existing subscriptions ?
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
So I assume you mean new subscriptions?
It's the existing subscription when it get renewed
OK, the subscription end here means renewals, not cancellation, am I right?
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
Then you just need to update the subscription's default_payment_method, and it's will be used for the upcoming invoice https://stripe.com/docs/api/subscriptions/object?lang=ruby#subscription_object-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.
That's what im doin but it doesn't seem to work
The subscription's default_payment_method is still the 4242 card, not 4444 yet.
https://dashboard.stripe.com/test/logs/req_SfUoUX2x3PXTYm that's because you updated it with 4242 card, not 4444. you can check this request log
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So the payment_methods does it start with "card..." Or "pm.."
pm_, and PaymentMethods API is backward-compatible with card_ objects as well.
You just need to do the same thing again (https://dashboard.stripe.com/test/logs/req_SfUoUX2x3PXTYm) but this time pass the PM ID of the 4444 card.
But how do i get the pm id
How did you do this request (
https://dashboard.stripe.com/test/logs/req_SfUoUX2x3PXTYm ) in the first place?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Im creating the token from createtoken in frontend
Then im creating source from that token
And that saves the new card
https://stripe.com/docs/api/payment_methods/customer_list?lang=ruby#list_customer_payment_methods you can use this API to retrieve a list of PaymentMethods that are attached to a customer. You can find PaymentMethod IDs there.
https://stripe.com/docs/customer-management I'd also recommend you using the customer billing portal, you customer can use this portal to manage the existing subscriptions, including payment_methods.
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"
Have you tried updating the default_payment_method with card_1M502vGYvC6CYP5GVPmrItks ?
That's what im doin for a while now
But I don't see any request to update default_payment_method with card_1M502vGYvC6CYP5GVPmrItks in your logs
OK. I saw you updated the default_payment_method to other subscription, not the original subscription that we discussed earlier
That means its got updated?
It's updated to the subscription that you specified, but it's not the subscription that we discussed earlier.
Yepp so what's the issue?
I don't see an issue here. Did you check the new subscription and see if the invoices are paid with the new card?
Yepp it's working
Great!