stripe-samples / checkout-single-subscription

Learn how to combine Checkout and Billing for fast subscription pages

Home Page:https://checkout.stripe.dev/?mode=subscription

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create new customers all the time when a subscription is created

lijoev opened this issue · comments

I am trying out Stripe checkout client-only integration. I am facing an issue which actually creates a new customer after checkout even though a customer with the same email id exists. Is there a way to handle it in a way that if a customer already exists with the same name add the subscription to the existing customer or create a new customer and add the subscription to the new customer

Hi @lijoev! If you want to reuse a Stripe customer you need to use the client-server integration, e.g. https://stripe.com/docs/payments/checkout/subscriptions/starting#handling-existing-customers

The client-only integration will make a new customer for each transaction

Hi @adreyfus-stripe! Thanks for the help. Again saving card details for future purpose is having an issue. Card is getting saved but how can I use the saved card during checkout. I am using python client-server integration. I need to show the users their saved cards and if they enter another card details it should be saved. I need to list all the saved cards of the user if possible. Is there any way for that.

@lijoev This isn't perfect, but we have a sample that shows listing a couple saved cards in a dropdown and then charging it offline: https://github.com/stripe-samples/charging-a-saved-card

Basically you can list all the PaymentMethods saved to your Customer: https://stripe.com/docs/api/payment_methods/list
and then charge the PaymentMethod the Customer selects.

This sample talks about charging a customer when they are "off-session" aka not in your app and available to authenticate. In this case your customers are "on-session" and able to authenticate if the bank requires it, so be sure to check the status of the PaymentIntent and call confirmCardPayment if the PaymentIntent requires it.

If they want to pay with a new card, you can kick them into the Checkout flow and pass in their Customer.

Also sharing (to you and to anyone else reading this!) that we have an active IRC channel with developers ready to answer questions specific to your integration, I think they'll really help when you get in the weeds. The channel name is #stripe and an easy client to access it is available on the web at https://webchat.freenode.net/