#.nicobzz
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Can you share the invoice ID you're working with?
sorry i made a little mistake beacause i send the message to early
i push enter button to soon
hello, i followed this tutoral to make an invoice which should be payed by payment intent and element payment: https://stripe.com/docs/invoicing/integration?locale=fr-FR
But now, i cant get client secret with $invoice->payment_intent->client_secret;
$invoice = $stripe->invoices->create([
'customer' => $customer_id,
'collection_method' => 'send_invoice',
'days_until_due' => 30,
]);
thats what I wanted to put
The PaymentIntent is generated when the invoice is finalized
https://stripe.com/docs/invoicing/integration?locale=fr-FR&method=elements#:~:text=When the invoice is finalized%2C a PaymentIntent is generated and associated with the invoice. Use Stripe Elements to collect payment information and confirm the invoice's PaymentIntent.
has the invoice been finalized yet?
yes
Can you share the invoice ID?
$stripe->invoices->finalizeInvoice(
$invoice->id,
['expand' => ['payment_intent']]
);
yes
i find that
Maybe I shoud have put :
$invoice = $stripe->invoices->finalizeInvoice(
$invoice->id,
['expand' => ['payment_intent']]
);
?
I immediatly find the invoice id
in_1NZx7VLThTVSAZouxWbCohSk
Looking at the response from finalizeInvoice call, it seems like the payment intent ID is present
https://dashboard.stripe.com/test/logs/req_KL1xn1zh23kAAI
it seems that I resolved the problem: I should write:
$invoice = $stripe->invoices->finalizeInvoice(
$invoice->id,
['expand' => ['payment_intent']]
);
rather than $stripe->invoices->finalizeInvoice(
$invoice->id,
['expand' => ['payment_intent']]
);
Glad you figured it out ๐