#lokis
1 messages ยท Page 1 of 1 (latest)
If the payment method has been created, following steps can be performed:
- set the payment method ID in
default_payment_methodof invoice creation request: https://stripe.com/docs/api/invoices/create#create_invoice-default_payment_method and setcollection_methodto'charge_automatically' - finalise the invoice after adding the invoice items: https://stripe.com/docs/api/invoices/finalize
- pay the invoice: https://stripe.com/docs/api/invoices/pay
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks. It's unclear from the docs what finalising an invoice item means. Is this step needed, or can we directly call invoices.pay after adding the invoice items?
Ah right! Finalising invoice is not necessary. The invoice will be moved to finalised and charged to the payment method with invoices.pay
Great. Will invoices.pay return an error if the payment fails?
Yup, it will return error
๐ . Can you please point me to the docs on what the response would look like?
We don't have a docs for that. In case of any error, this is the specs of the response: https://stripe.com/docs/api/errors
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.