Skip to content

Instantly share code, notes, and snippets.

@chrisbolman
Created December 21, 2019 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisbolman/804c82f53fd564f4af31a0b803618a95 to your computer and use it in GitHub Desktop.
Save chrisbolman/804c82f53fd564f4af31a0b803618a95 to your computer and use it in GitHub Desktop.
if form.is_valid():
customer = Customer.objects.get_or_create_for_user(request.user)
token = form.cleaned_data['stripeToken']
card = Card(customer=customer, stripe_card_id=token)
try:
card.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment