0
votes

I am trying to charge an existing Stripe customer with an updated credit card (Stripe token) for a new subscription plan. Most of the examples given are for creating a new customer and charging the customer for a new plan, but I want to charge an existing customer.

new_customer = stripe.Customer.create(
                email=request.POST['stripeEmail'],
                plan = 'plan_DgV0NXZk7vlMMG',
                card=request.POST['stripeToken']
            )
1

1 Answers

2
votes

Subscriptions use the default_source by default. So you would Create a new Customer Card Source and set it to the default or simply replace the default source by setting the source-attribute when you use the Update Customer API Endpoint. Finally, you can Create a new Subscription.