#N0xB0DY
1 messages ยท Page 1 of 1 (latest)
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.
No I'm using Direct Charges because I have an amount to be divided by more than one account.
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?
Sure, can you provide me a link to docs while I look for a transfer id?
Sure thing, this is the guide that walks through that flow:
https://stripe.com/docs/connect/charges-transfers
Thank you, pulling that up
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.
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?
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.
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
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
Apologies, I had meant to include a link to that:
https://stripe.com/docs/api/idempotent_requests?lang=dotnet
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The key is not provided as parameter, but is instead provided as an option.
Awesome, that's good to hear!