Question

How do I add an email input so that Stripe can send out receipts? It looks like it's not a valid Charge argument, as from

try: 
    charge = stripe.Charge.create(
      amount=1000, #cents
      email=email,
      currency="usd",
      card=token
    )
except stripe.CardError, e: #card declined
    pass

I get an error saying

Received unknown parameter: email

How do I send the email argument to Stripe?

Was it helpful?

Solution

You need to create a customer with the email address and card and then pass the customer to the charge:

customer = stripe.Customer.create(
  card=token,
  email=email
)
charge = stripe.Charge.create(
  customer=customer.id,
  amount=1000,
  currency="usd"
)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top