#N0xB0DY

1 messages ยท Page 1 of 1 (latest)

merry rockBOT
rapid forum
#

Hi ๐Ÿ‘‹ are you using Destination Charges? If so, it is expected for the Payment Intent to automatically trigger the creation of a Transfer and you do not need to explicitly do that portion.

uneven blade
#

No I'm using Direct Charges because I have an amount to be divided by more than one account.

rapid forum
#

Separate Charges and Transfers is the charge flow we recommend using when you need to make Transfers to multiple Connected Accounts for a single payment.

Could you provide an example of a Payment Intent and the associated Transfers that you were using while testing this flow?

uneven blade
rapid forum
uneven blade
#

Thanks

#

Sorry, this is the original payment: pi_3MDvIJJ2jdpll4D61I8pudsl

rapid forum
#

Thank you, pulling that up

uneven blade
#

These are all transfers made for this payment intent. There should be only two, instead, I had them duplicating when I processed them manually instead of using web hook.

rapid forum
#

Sorry, I was rereading your original message and feel like I may have originally misunderstood your question. I see that these Transfers appear to have been created by your integration. So if you were only expecting your integration to create two Transfers, do you know why it instead seemed to create 8?

uneven blade
#

Initially, it made 8 transfers because I processed the transfers after redirecting user to success url, so if the user hits refresh, transfers are created again.
So I moved the process of creating transfers to be handled inside my Session Completed Webhook handler, So it's only created after the session is completed and successful

#

But I still need a solid way to avoid this from happening. Since I'm using a local dev env, the webhook request sometimes closes before getting a response, so it's resent again.

rapid forum
#

Using idempotency keys to reissue the same request would be a good option here.

The more ideal approach would be to restructure your flow a bit. When we send a request to your webhook endpoint, there is a 20-second window for us to receive a response, and if we do not receive one in time we presume the request couldn't be delivered and queue the event to be resent.

The acknowledgement that you send to us when you receive a webhook event is to acknowledge receipt of the event, not that your system was able to fully process the event as expected. This is why we recommend that you do not have webhook event handler code try to complete too many tasks before acknowledging that it received the event. Instead we recommend queueing up any heavier tasks, and then promptly acknowledging you received the event successfully.
https://stripe.com/docs/webhooks#acknowledge-events-immediately

uneven blade
#

Thanks, I'll look into it.
But as for idempotency keys, I don't seem finding a way to use with .Net

#

Looking at the options here, there's no IdempotencyKey property

rapid forum
#

The key is not provided as parameter, but is instead provided as an option.

uneven blade
#

Oh, I see

#

Thanks a lot

#

That will solve the issue for me.

rapid forum
#

Awesome, that's good to hear!