Customer payment to external source

In sandbox, I’m making a payment from verified customer A to (unverified) customer B

verified customer A 1c3aa447-c36c-4a05-81ed-d2c3fc03d86e
verified source id 3b6f2e45-60d2-424f-b66b-5eb1beea3ff9

unverified customer B e1a86c30-7610-4c54-bc97-fb7de5ef48a4
to unverified source id 9f899e8c-37ee-494d-8203-ed5529d59152

I got a transferID 5adea004-8aa0-ee11-ac47-06f818744a9d, but I’m getting two webhook callbacks for the same transfer id. I get a customer_bank_transfer_created event and a customer_transfer_created. Like I said, they both have the same transferID, but the fact that I’m getting two callbacks on the same transfer is unexpected. Why is this happening?

Hi @lucio,

This behavior is expected and is due to the way Dwolla handles transfers. When a transfer is created, an event is triggered for both the sender and the receiver. This means that you may receive customer_transfer_created twice with a different event ID but the same resource ID.

In your case, the customer_bank_transfer_created event is likely triggered when the funds are moved from Customer A’s bank to their balance in the Dwolla Network. The customer_transfer_created event is likely triggered when the funds are moved from Customer A’s Dwolla Balance to Customer B’s balance in the Dwolla Network.

It’s important to note that you should check webhooks against their event ID, not by their resource ID or topic. This is because multiple events can fire for the same resource while still remaining unique.

To avoid processing the same business logic multiple times, it’s recommended to maintain an internal database that keeps track of all of the events that are processed. Then, when a new webhook is received, your application ensures that the event (checked against its ID) has not already been processed previously. Once your application finishes processing an event, its ID is appended to your database, ensuring that if your application receives another webhook with the same event ID, it will not get processed a second time.

For more information, you can refer to the Dwolla documentation on processing and validating webhooks.