#FallenBlade
1 messages · Page 1 of 1 (latest)
Is this in a 3rd party connector/plugin? Or did you code the Stripe Element yourself?
I think you need to set setup_future_usage: "off_session" on the Payment Intent
How do you do that in invoice? I am using Invoice.
// Create an Invoice
$invoice = $this->stripe->invoices->create([
'customer' => $customer->id,
]);
// Create an Invoice Item with the Price, and Customer you want to charge
$this->stripe->invoiceItems->create([
'customer' => $customer->id,
'price' => Constants::STRIPE_PRICES_ID['ONE_REPORT'],
'invoice' => $invoice->id,
]);
//Finalized the Invoice
$finalizeInvoice = $this->stripe->invoices->finalizeInvoice(
$invoice->id,
[
'expand' => ['payment_intent'],
]
);
You would need to get the Payment Intent from the Invoice here: https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent
Then you could set setup_future_usage on the Payment Intent using this Payment Intent update API call: https://stripe.com/docs/api/payment_intents/update#update_payment_intent-setup_future_usage
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.
Sure thing!