#.nicobzz

1 messages ยท Page 1 of 1 (latest)

south wyvernBOT
frail glen
#

Hello ๐Ÿ‘‹
Can you share the invoice ID you're working with?

drifting needle
#

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

drifting needle
#

yes

frail glen
#

Can you share the invoice ID?

drifting needle
#

$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

frail glen
drifting needle
#

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']]
);

frail glen
#

Glad you figured it out ๐Ÿ‘

drifting needle
#

because $invoice reffer to the previous invoice object

#

thank you

#

sorry for the time taken