Skip to content

Instantly share code, notes, and snippets.

@miodeqqq
Created September 2, 2020 13:05
Show Gist options
  • Save miodeqqq/21526d6717373e1db5ff9c2ffdda8c4c to your computer and use it in GitHub Desktop.
Save miodeqqq/21526d6717373e1db5ff9c2ffdda8c4c to your computer and use it in GitHub Desktop.
Django & Stripe - add_customer_card.py
new_card_source = stripe.Customer.create_source(user1.stripe_id, source=token)
stripe.SetupIntent.create(
payment_method_types=["card"],
customer=user1.stripe_id,
description="some description",
payment_method=new_card_source.id,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment