#bhanu365-reuse_card
1 messages · Page 1 of 1 (latest)
hello! yes, you can save the card details and submit the the saved card next time instead.
There's two options here :
- you can make use of Link : https://stripe.com/docs/payments/link
- or you can build your own implementation to display the saved PaymentMethods on a customer for them to select and submit it via the frontend using
stripe.confirmCardPayment: https://stripe.com/docs/js/payment_intents/confirm_card_payment. You would pass the existing PaymentMethod id in https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-data-payment_method
When I submit the payment the subscription has been created successfully but what I need to do for auto-renewal? When the subscription ends after a month.
I am using payment element
can you share the subscription id?
sub_1LZTwJFmM52WOkSoVnwPSmiB
it'll automatically charge the payment method which the customer made payment with on the invoice's PaymentIntent
you can use test clocks to test subscriptions if you want to see what happens after a period of time : https://stripe.com/docs/api/test_clocks
Ok if in future customer need to update their payment card details because older card have expired or lost
?
you can either setup the Stripe hosted customer portal : https://stripe.com/docs/billing/subscriptions/integrating-customer-portal, or you can depend on Stripe to send emails to customers to update their failed payment method via a link
So I need to setup on our website portal, what I need to do for the setup and what API i can use for it
you can take a look at the guide here : https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#start
I have changed the setting according to the doc now what I need to do for user can update their card details
Do I need to add external link of stripe on our website where customer can go through the link to the stripe UI portal and can update their card details?
yes, you should add your website link where the customer can go to and update their card details
But I want that customer can only update their card details from our website not from stripe. Why customer will go out on stripe for update their card details if customers are on our website. Can we make a feature on our website so we can ask the card number expiry and cvv and can save in the customer object via API?
what will happen is that when payment fails for a subscription, Stripe will send an email to your customer with that link. If that link is for your website, then the Customer will go to your website to update their card details.
To allow customers to update their card details on your website, you can retrieve the client_secret of the invoice's PaymentIntent, then display the Payment Element for the customer to make payment. I believe the PaymentMethod will automatically be saved to the customer
Ok got it
So at the moment customers can be paid for that subscription also and it will automatically save their card details as well
?
But I think that only will work by link that customer have visit
But if the subscription is not expired and customers want to update their card details in the mid of the subscription before it expires, what?
then you can either integrate the customer portal : https://stripe.com/docs/billing/subscriptions/integrating-customer-portal, or if you want to implement your own logic : collect the customer's payment method using SetupIntents and then update the subscription's default_payment_method [0] or the customer's invoice_settings.default_payment_method [1]
[0] https://stripe.com/docs/api/subscriptions/object#subscription_object-default_payment_method
[1] https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method