#icurrytheteam

1 messages · Page 1 of 1 (latest)

robust eagleBOT
upbeat radish
#

By the way, I ask this question because while I can list a customer's subscriptions using Stripe's api, I need a way to show which subscription "matches" with the right vendor. Like I can get the sub_id and prod_id but not who the user is subscribed to. Does this make sense?

ember forum
#

Hi! Let me help you with this.
Yes this is a good place for this question, and yes it makes sense.

#

Both ways are valid, metadata or your own database. Depends on how much info do you need to store. The simplest solution is to store vendors on your database and add a vendor ID in Subscription metadata. You could also store vendors as Products maybe?
You could also store all the relations in your own database but you will need to makes sure it is in sync with Stripe data.

upbeat radish
#

We have unique vendor id's, yes. May I ask something else?

ember forum
#

Sure!

upbeat radish
#

Ok, great. If a user wants to cancel a subscription immediately, there exists stripe.Subscription.delete('sub_id'). However, to cancel a sub effective end of billing cycle I'd have to use something like stripe.Subscription.modify('sub_id', cancel_at_period_end=True). That being said, what happens if I use the second command but then try reactivating the subscription halfway through the billing cycle. Would I use something like stripe.Subscription.modify(subscription.id, cancel_at_period_end=False, ..) or do I have to create a new subscription by running stripe.Subscription.create(...)?

ember forum
upbeat radish
#

I see. So consider the following example: if a user subscribes to a vendor and after a couple months, they unsubscribe but subscribe again after another month. Would I have to check if theyve previously subscribed while they go through the subscription process because I am not creating a new subscription but rather updating one?

young cliff
#

yep

upbeat radish
#

Ah, ok.

#

May I ask another unrelated question?

young cliff
#

sure

upbeat radish
#

What happens if I reactivate the subscription for the user but the original payment method they used when they first bought the subscription no longer exists?

young cliff
#

ultimately, the payment attempts on that subscription will fail, that's what would happen. Details depend on what exact APIs you're using and in which ways

upbeat radish
#

Noted.

#

And may I ask another question?

young cliff
#

just ask them please, don't ask to ask

upbeat radish
#

I am creating a setupintent to collect payment information for future purchases. However, I want that newly created payment method to be the default method. How would I access the payment method id after the setupintent is succesful and the user enters their payment details? If i try to access the payment method from the setupintent then it would just return null (because the user has not yet entered their payment information).

young cliff
#

you can access it after the SetupIntent succeeds, possibly as part of your webhook handler for setup_intent.succeeded, or by sending a message to your backend from the frontend when the confirmSetup Promise resolves

upbeat radish
#

That makes sense, yes.