#g105b
1 messages · Page 1 of 1 (latest)
You can't achieve this via payment intents unfortunately. They don't support $0 amounts at all. Really I'd just recommend keeping track of this in your system as you suggested
so they can be reconsiled in the dashboard at a later date?
What do you mean by this? What's the usecase exactly?
In the dashboard, the coupons show the number of times they've been redeemed.
Wait how are you redeeming coupons via payment intents?
Previously the code had been using the Orders API which has been discontinued. I would like to continue with this functionality.
Oh ok. Yeah coupons can't be used with payment intents. You'd need to use invoices: https://stripe.com/docs/api/invoices/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Which actually should be able to support $0 amounts
Alternatively you could switch to stripe checkout to use coupons w/ 1 time payments
OK, thanks - I didn't know about invoices, I'll look into what it takes to implement them.
Are they compatible with Stripe Elements?
You can use the underlying payment intent to collect details via the payment element, but one advantage of invoices is that you don't need that. They come with a stripe-hosted invoice payment page
OK, can I confirm the workflow with you?
- Create an invoice, whether the total cost is £15.00 or £0.00
- To take payment, continue as usual with the Payment Intent and somehow link the intent to the invoice.
- For zero costs, somehow mark the invoice as paid, or apply the coupon to the invoice?
Not exactly
Invoices have underlying payment intents: https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent except when they're for $0. You'd use that payment intent to collect payment details if the amount > 0 using the payment element
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If you have a coupon that discounts the invoice to $0, then just don't collect payment details. Invoice will be paid
OK, thank you for your time and insight. Have a great day.