#alecpope
1 messages · Page 1 of 1 (latest)
You can retrieve the subscription from the invoice object (https://stripe.com/docs/api/invoices/object?lang=node#invoice_object-subscription), so I think you can use thise information to update your DB when handling invoice.paid
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You mean, I fetch the subscription and look on the status (if it is active e.g.)?
Yes
Okay thanks, I will test out. Give me a moment
Thanks!
I tested it and it works. Now I wanted to test if it still works, when the invoice is not instantly paid. Is there a way to test this? My customer has a default payment method of the 4242... card
https://stripe.com/docs/testing#declined-payments you can use one of the declined cards
Hmm, can I add them as a default payment method? I can't with 4000000000009995 for example
Ah it works with 4000000000000341. Sorry
One problem: I added the payment method as default:
But when retreiving the user, there is no default payment method:
Customer is: cus_ORoCtoV2g5K953
How are you doing that?
Adding the payment method via dashboard and retrieving it currently with Stripe CLI
Yeah that won't set it as the default PM automatically AFAIK
Oh what? I will try with SetupIntent, one moment
That won't either, you need to update the Customer object after the fact and set the field