Reputation: 1223
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?
Upvotes: 1
Views: 1432
Reputation: 1021
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"
)
Upvotes: 2