#kratos6753

1 messages · Page 1 of 1 (latest)

slim robinBOT
barren dragon
fiery basalt
#

we are not using this option, but still were able to add pending invoiceitems implicitly, how come this instance (req_uYt95sF4JIcw3R) we were not able to do that implicitly?

slim robinBOT
barren dragon
#

I think the default behavior on the pending_invoice_item is exclude. Can you share an example request where this worked automatically?

fiery basalt
#

stripe.InvoiceItem.create(customer='xxxx', currency='eur', amount=1800, description='invoice 1234xxx')
stripe.Invoice.create(**{
"description": "xxxxxx1234",
"application_fee_amount": "12",
"auto_advance": "True",
"statement_descriptor": "xxxxx12",
"default_payment_method": "pm_1MZpqxA7BWdKIiAU2fg6Wbyf",
"customer": "cus_NKUqcGyttAQU8n",
"transfer_data": {
"destination": "acct_16nyiVHY17xxxxx"
}
})

#

I understand that as per documentation, the default behavior is exclude, but we got it to work without explicitly using that option. we are using the below API version - 2020-08-27

#

does this version make any difference, may be the documentation is not applicable for this api version

barren dragon
#

I think the issue here was a race condition between the creation request for the invoice item and invoice

Looking at the invoice item creation timestamp, it

#

was created on 2023-04-12 11:44:11 UTC

#

Assuming the invoice create request landed first, there were no invoice items at that point to invoice the customer for

fiery basalt
#

but we are running this code in sequence, how come it will be asynchronous? if it can be asynchronous - is there some guideline to write code handling the race condition?

barren dragon
fiery basalt
#

if two pending invoice items are of different currency and we create invoice without passing currency param, would this cause any issue? for example - one item is in usd & other one in eur

sullen verge
#

I think it would only pick up one of those types of items, likely the one for the customer's default currency. But I don't have time to test this at the moment. Would you be able to try that in test mode to see what happens?

fiery basalt
#

ok, will check. Thanks for the help.

slim robinBOT