#D4reDev1l.
1 messages · Page 1 of 1 (latest)
If the payment method has already been collected, you may set it directly to default_payment_method when creating the subscription: https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method, so that you don't have to update it later
This is the best way to do it. Is there anything that doesn't work well?
nothing
only I concern is I retrieve customer info and his payment info separately
can you explain more what you’re trying to do with retrieving customer and payment info separately?
sure
I want to show some basic info of customer, offer them to select payment method for subscription, show what they want to add to subscription.
I see! In this case, two separate retrievals will be required. Alternatively, you may save customer information in your own database instead of retrieving them from Stripe to save one retrieval
and add payment and add coupon(in the future) should be added and removed easily
I saved customerId in the firebase db
Yup! I meant you may also save customer information such as name and email address in your database, so that no customer retrieval has to be made
email, name, and other info might changed by user in the future
so I only save cusId in it
You may also update them in your database in the future. If you wish to save all those customer information with Stripe, then two retrieval requests with customer and payment information will be required
ok, the first time I use stripe. I thought I can retrieve customer with expand option to expand his payment methods. In that case, I can get customer info and payment info with one request. But not I think may that is not possible
thank you sir!
Yup! That won’t be possible even with expand option