#nobody4322
1 messages · Page 1 of 1 (latest)
invoice_item = stripe.InvoiceItem.create(
customer=customer.id,
price=plan.plan_id,
currency='usd',
quantity=len(location_ids),
description="Directory Sync",
)
invoice = stripe.Invoice.create(
customer=customer.id,
auto_advance=False,
# discounts=[{"coupon": "coup77"}],
metadata={
'plan_id': plan.plan_id,
'quantity': len(location_ids),
'type': 'directory_sync',
'reason': 'one_time'
},
)
invoice.pay()
i have a scenario in which i don't need to use attached card with customer instead i want to use card entered at run time.
is there any way i can send the payment method detail while charging one time invoice.
Yes, you can finalize the Invoice, take it's PaymentIntent's client_secret, and use it for payment.
are you referring to this docs
https://stripe.com/docs/payments/accept-a-payment?ui=elements
Yes