#josula_basil-invoice-payment-intent
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1372240356602810468
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Object literal may only specify known properties, and 'template' does not exist in type 'Rendering'.
```
Can you share an API request ID that throws this error? It will start with req_
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
const invoice = await stripe.invoices.create({
customer: stripeCustomer.id,
default_payment_method: undefined,
collection_method: "send_invoice",
auto_advance: false,
currency: "eur",
days_until_due: new Decimal(30).toNumber(),
rendering: {
template: "inrtem_myID",
},
Its not a request, its a type error
What version of Stripe Node are you using?
I just updated to the latest version but now I cannot retrieve the payment intent ID from the finalizsed invlice anymore?
const finalizedInvoice = await stripe.invoices.finalizeInvoice(
invoice.id as string
);
console.log("finalizedInvoice", finalizedInvoice);
await stripe.paymentIntents.update(
finalizedInvoice.payments?.data[0].id as string,
{
We used to get the payment intent from the finalised invoice like this and then just opened a new payment intent that we was then paid by the customer. How can I do this?
The payments object on the finalisedInvoice is just not existing?
I did not tell you to update your node version. But yes, that is a breaking change that occurred in the most recent API version. We document that here.
All our SDK versions now pin Stripe API versions as well.
Okay, got it but I still don’t understand how I just associate the invoice with the payment intent.
The current Stripe Node SDK pins to our latest API version. In this API version there is no longer a direct link between payment intents and Invoices.
What you can do is find the InvoicePayment objects related to a specific Invoice via the API
Okay, how are you supposed to pay invoice then?
Those InvoicePayment objects have the relationship to the Payment Intent.
OK, what is the advantage making this change?
IT is part of our move to allow multiple separate payments for a single Invoice.
So there is no longer a 1 - 1 relationship between Invoices and Payment Intents
BUT for your question specifically
We now have a property on the Invoice called confirmation_secret. This is where you can retrieve the client_secret value to use with the Payment Element.
We updated our canonical Subscription integration guide to use this approach