#JDPT - invoice

1 messages ยท Page 1 of 1 (latest)

serene pewter
#

Hi there!

leaden nymph
#

req_oFLhhzwOo1LJSb

serene pewter
#

That invoice is for an amount of $0, so it's expected that there is no PaymentIntent or Charge.

leaden nymph
#

Ah okay, was that changed in the latest api update? The test case was working before upgrading.

serene pewter
#

What API version were you using before?

leaden nymph
#

2020-08-27

#

I can find an example request for that

#

Oh sorry, no I can't, we delete the connected account after running the test suite

serene pewter
#

Give me a few minutes to run some tests on my end.

leaden nymph
#

I'll run the test suite on a different branch and I can get you an example.

serene pewter
#

Even better, thanks!

leaden nymph
#

req_zfCnslBX0vD4Eo

#

That's actually got an invoice line item

#

Weird. I wonder whether the issue is elsewhere then

serene pewter
#

That invoice has a non-zero amount, so it's different.

#

I'm pretty sure we didn't change this in this API version. If the amount is $0, then there's no PaymentIntent, which makes sense.

leaden nymph
#

Still very weird, as the only difference between the two branches is the Stripe API version and JS package. I'll do a bit more digging and let you know if I find anything you might need to be aware of

#

I believe it's to do with the behaviour around attaching invoice items to invoices implicitly based on the customer.

#

ii_1LUUFtQDqCHFpskc79Ismx6D

#

This invoice item is attached to the customer

#

But it is not attached to the invoice

#

in_1LUUFuQDqCHFpskcNlGnHO8p

serene pewter
#

Your original question was about getting a payment_intent or a charge when paying a $0 invoice. Did you manage to reproduce this behavior? If so can you share the request ID?

leaden nymph
#

I think that's intended behaviour across both API versions. The reason why it was happening between the two versions was because the invoice item isn't getting attached to the invoice on the new API version, resulting in a $0 invoice being created, and therefore no payment_intent being created.

#

The docs specify that If no invoice is specified, the item will be on the next invoice created for the customer specified. but that's not happening for the invoice item and the invoice specified above

leaden nymph
#

@serene pewter Any updates on this?

serene pewter
#

Sorry for the delay, Discord is busy. Give me a few minutes.

leaden nymph
#

No problem ๐Ÿ‘ Just wanted to make sure this wasn't forgotten about!

modern badger
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

leaden nymph
#

Thanks! Let me know if you need more information

modern badger
#

basically the 1st line of this Change log explains what's happening in your case

leaden nymph
#

Ah I see, default behaviour has been changed. Should've noticed that. My bad

modern badger
#

The pending_invoice_items_behavior parameter on create Invoice no longer supports the include_and_require value. When the parameter is omitted the default value of pending_invoice_items_behavior is now exclude.
Meaning that unless you specify so, the pending_invoice_items from the customer will no longer be attached automatically

#

no, no worries, it happens with API version upgrades

#

let me know if you need any more help

leaden nymph
#

Nope, that's fine, this should allow the test to pass so we can upgrade to the latest API version. Thanks for the information!

modern badger
#

sure my pleasure