#david-elestio_api

1 messages · Page 1 of 1 (latest)

weak oceanBOT
#

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

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

brave tundra
#

Those events are expected to come all at once, they all relate to the invoice payment succeeding

#

The 1 hour delay is normal default behaviour for invoice auto advancement. If you want to force the invoice payment to happen immediately, you can call /pay for that invoice:
https://docs.stripe.com/api/invoices/pay

zinc swan
#

Thanks @brave tundra

I want to simulate the real process of a SEPA payment, where the payment request is sent first, and after 5-6 days, the funds are received.

For my test, I'd like to shorten this delay from 5-6 days to 3 minutes.

Am I correct in assuming that when Stripe initiates the payment request, I should receive the payment_intent.processing event? And when the funds are actually received, I should get the invoice.payment_succeeded and charge.succeeded events?

If I call the pay endpoint, will it immediately trigger payment_intent.processing without waiting 1 hour? Since I'm using an IBAN with a 3-minute delay, should I expect to receive invoice.payment_succeeded and charge.succeeded after 3 minutes?

For production, should I also use the /pay endpoint, or will the SEPA payment process automatically proceed without having to manually trigger /pay?

I mean if the /pay call is necessary in production or if the process continues on its own without using it?

#

The reason is that I want to use webhooks to send an email when the payment request is initiated (invoice_intent.processing), and then send another email when the funds are actually received after the delay (when I receive invoice.payment_succeeded and charge.succeeded).

brave tundra
#

Since I'm using an IBAN with a 3-minute delay
What do you mean by this?
In test mode, the test payment methods will typically advance more or less immediately.

For production, should I also use the /pay endpoint, or will the SEPA payment process automatically proceed without having to manually trigger /pay?
If finalized and set for auto advance, the invoice will advance after an hour, or your can call pay, its up to you

weak oceanBOT
zinc swan
sharp root
#

Hi there 👋 jumping in as my teammate needs to step away soon. Can you share the ID of the Events that you saw during your testing that you expected to see a larger delay between? Those IDs should have an evt_ prefix.

zinc swan
#

sorry I used another IBAN number but now I’m running a new test using IBAN DE08370400440532013003. I received the payment_intent.processing event at 5:10:50 PM, but it’s been 7 minutes, and I still haven’t received the invoice.payment_succeeded or charge.succeeded events.

#

Wow, I just received them:

invoice.payment_succeeded 5:19:58 PM
charge.succeeded 5:19:57 PM
payment_intent.succeeded 5:19:57 PM
payment_intent.processing 5:10:50 PM

Since this is a SEPA payment, it's in EUR, but I usually receive payments in USD. I would like to receive the exchange rate when I get the invoice.payment_succeeded webhook. Could you please let me know how to achieve this?

#

Hello @sharp root 🙂

sharp root
#

To find exchange rates you'll need to find the Balance Transaction object associated with the Invoice.
https://docs.stripe.com/api/balance_transactions/object#balance_transaction_object-exchange_rate

The order of objects you need to step through is:
Invoice -> Charge:
https://docs.stripe.com/api/invoices/object#invoice_object-charge
then Charge -> Balance Transaction:
https://docs.stripe.com/api/charges/object#charge_object-balance_transaction

You can leverage expand to get those in a single request while retrieving the Charge:
https://docs.stripe.com/api/expanding_objects

zinc swan
#

thanks a lot @sharp root