문제

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