So I just implemented the first webhook for our account, and I’ve got some questions/concerns.
I created two applications, one that corresponds to my local development machine (“development”), and one for our publicly-accessible staging website (“staging”):
I created a webhook subscription for each application. For my local development machine (“development” application) I used ngrok to proxy requests from my localhost to a publicly-resolvable address that Dwolla could access. The “staging” application is already publicly-accessible so no problems there.
My concern is that the sandbox environment is global between both applications - if I perform an action in one environment that generates Dwolla events, I get webhook events in the other environment for Dwolla resources that the other environment isn’t aware of.
For example, if I create and verify a Customer on my local development machine (using my “development” application credentials), there are
customer_verified events that get sent to both my “development” application’s webhook and our “staging” application’s webhook. My development application processes the events successfully, but my staging application doesn’t recognize this Customer as there are no corresponding records in our staging SQL database for that Customer (since we obviously need to store our custom business records in our own database and not simply use Dwolla’s APIs for everything).
I’m curious how people deal with this scenario? I don’t actually see a way in the APIs to get from an Event back to the Webhook subscription or application that generated it (but even so having to call an API on every webhook event in order to decide to process or discard it would be pretty onerous).
I’m sure it would be really hard to implement but I wish that each application would have its own sandbox, so that Customers, Events, and so on exist only in that application and not in a shared global context. This is how I’ve seen it done in another competing payments platform.
Anything I’m missing here on how to deal with this scenario of multiple applications in the sandbox trying not to step on eachothers’ toes?