#dragon.frost
1 messages ยท Page 1 of 1 (latest)
Hi there!
Tokens are a very old way to implement Stripe. We strongly recommend to not use this, and instead use PaymentIntent and PaymentMethod.
These are our recommended flow: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout and https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Oh thanks. This means the paymentIntent flow replaces the need for token.
Yes we don't use tokens at all. Instead is PaymentIntents and PaymentMethods.
Also, previously we were attaching payment methods to an existing stripe customer like this during the subscription flow.
How do I update this according to the new recommendations?
Can yiou clarify your flow? Do you want to start a new Subscription for a customer that already has a payment method saved, or do you want to start a subscription and also collect a new payment method?
So, consider a situation where a user had already purchased a subscription from us previously. So they are registered as a stripe user upon purchase. So say in the future they again want to purchase a subscription again but using another card details. How should I update their card information during the subscription purchase?
If the customer already has a payment method set, then simply create a new subscription and make sur to set the default_payment_method parameter: https://stripe.com/docs/api/subscriptions/create?lang=node#create_subscription-default_payment_method
If you want to collect a newx payment method, then follow one of these guides: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout or https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
Doesn't payment_settings: { save_default_payment_method: 'on_subscription' }, when creating subscription save the customer's payment method when creating a subscription?
Also, I was actually wondering if we have to update a customer's card info on after customer makes another purchase with a different card. Since I might want to retrieve the card info in another page.
Also since we are in the topic could you please let me know the differences between using default_payment_method and payment_settings: { save_default_payment_method: 'on_subscription' }
Doesn't payment_settings: { save_default_payment_method: 'on_subscription' }, when creating subscription save the customer's payment method when creating a subscription?
Yes, if you collect a new Payment Method.
Also, I was actually wondering if we have to update a customer's card info on after customer makes another purchase with a different card.
What exactly do you want to update on the payment method?
What exactly do you want to update on the payment method?
Card details for now
Also since we are in the topic could you please let me know the differences between using default_payment_method and payment_settings: { save_default_payment_method: 'on_subscription' }
This first one is if you already have a PaymentMethod object saved on the customer. The second is if you are collecting a new PaymentMethod and want to save it as the default going foward.
Card details for now
What does that mean? If you mean the card numbers, then it's not about updating a card but creating a new one.
Thank you for the response. One last thing I want to confirm with you.
Lets say if a stripe customer that already has purchased a subscription and they would like to purchase another one should we make a call to create stripe customer everytime we purchase a subscription or check if the customer already exists and if it does, use that customer object on the subsequent flow?
Yes it better to reuse the same Customer object if you can, this way if they already have a payment method saved you can reuse it for the new Subscription.
Otherwise if you create a new customer object you'll have to collect new payment method details.
Thanks a bunch. You clarified many of my confusions on this.
Happy to help ๐
I swear this is the last one today ๐
is value for default_payment_method is set as :
default_payment_method:
stripeUser.invoice_settings.default_payment_method
is this the correct value to be set here?
Yes that should work. However note that if the Customer object already has invoice_settings.default_payment_method set, then there's no need to set the subscription.default_payment_method. That's because, by default, the subscription will use the invoice_settings.default_payment_method.
payment_settings: { save_default_payment_method: 'on_subscription' } on subscription object should do that job right?
There are two places where you can save a default payment method:
- On the Customer object (
invoice_settings.default_payment_method) - On the Subscription object (
default_payment_method)
Only one needs to be set for things to work.
payment_settings: { save_default_payment_method: 'on_subscription' } on subscription object should do that job right?
This will save the new payment method as the default on the Subscription (default_payment_method)
This will save the new payment method as the default on the Subscription (default_payment_method)
Does this mean that it will not be attached to a customer but to a subscription only?
it's attached to the Customer object in general, but is only the default payment method for that specific Subscription, other subscriptions that Customer might have would not use it
to further expand on that ^^ , when we need to do a payment, we first look to see if the Subscription-level default is set and use that if it is, otherwise we look at the Customer-level default.
So, if I only have one category of subscription on my platform and my only usecases are if the customer wants to update the subscription or update their card that charges for that subscription. I don't think its necessary to worry about default payment method on the customer object. Did I assume this correctly?
sounds reasonable
๐ can you please let me know when saving/updating the default payment method of a customer object can be useful?
for subscriptions flow
if you have multiple subscriptions on the same customer
but if there is already a default set on subscription object then that takes priority before the customers object right?
yes