#shnikola_invoice-partialpayments

1 messages ¡ Page 1 of 1 (latest)

lethal shardBOT
#

👋 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/1387460354467954819

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

viral tide
#

Hi there, can you provide an account ID?

vale cosmos
#

Sure, it's kmrkwwvhQcvQD2AmFIUu79CRBHqS49Qi

#

example of events I am trying to get the invoice ID of (test env):

  • evt_2RduRWkmrkwwvhQc10mW7cWE
  • evt_2RdpYckmrkwwvhQc1hF7nF23
viral tide
#

Thanks, I'm still looking into this.

#

I'm looking at evt_2RduRWkmrkwwvhQc10mW7cWE and this charge was created directly via the API (req_qE9ECjLNndSmYt).

vale cosmos
#

Correct, I use the API to initiate refunds

viral tide
#

The API was used to initiate the Charge as well. So It's not tied to a Payment Intent.

vale cosmos
#

Correct, but the other event is tied to a Subscription, so should have it

#

I have 2 types of payments - one with manual charges, and another for subscriptions. Both can be refunded

viral tide
#

Right, however, you're looking for an Invoice to be returned with the event.

vale cosmos
#

Correct

#

I just want to be able to get to the invoice from the charge

viral tide
#

This specific example, the Charge was create directly via the API and was not tied to a Invoice or Subscription.

vale cosmos
#

I used to be able to do

if charge.invoice
#

but this method does not exist anymore

vale cosmos
viral tide
vale cosmos
#

Bit this API takes an invoice ID and returns payments. I don't have the invoice id

viral tide
vale cosmos
#

Ah, I see. Thank you.
On a related note, my business logic was supposing that one invoice = one charge. Now that an invoice can have multiple payments, I usually just do invoice.payments[0]

#

Are there any scenarios where an invoice would have multiple payments?

lethal shardBOT
deft jay
vale cosmos
#

Can this happen in the usual subscription process with card payments?

deft jay
#

From the context above, it does not sounds like it as you're attemting to charge the customer the full amount on the invoice.

lethal shardBOT