質問

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?

役に立ちましたか?

解決

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"
)
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top