#josula_basil-invoice-payment-intent

1 messages · Page 1 of 1 (latest)

ember monolithBOT
#

👋 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.

rich swift
#

HI 👋

We describe this in our docs here

plucky python
#
  Object literal may only specify known properties, and 'template' does not exist in type 'Rendering'.
```
rich swift
plucky python
#

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

rich swift
#

What version of Stripe Node are you using?

plucky python
#

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?

rich swift
#

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.

plucky python
#

Okay, got it but I still don’t understand how I just associate the invoice with the payment intent.

rich swift
#

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

plucky python
#

Okay, how are you supposed to pay invoice then?

rich swift
#

Those InvoicePayment objects have the relationship to the Payment Intent.

plucky python
#

OK, what is the advantage making this change?

rich swift
#

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