Questions / possible feature request on multiple applications and the shared global sandbox

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_created and 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?

Hi @abe, I can hopefully provide some additional context and a potential workaround. The data that is created via the API, such as Customers and any relational resources like Funding Sources or Transfers belong to your primary Dwolla Account. Even though you may have separate environments that you manage different sets of data out there’s not currently a way to segment this out on the Dwolla side by creating multiple applications. Webhooks and Events will belong to a application that you create on the Dwolla side. So if you have multiple applications that have their own webhook subscription then you’d essentially get double the amount of Events recorded and delivered on those apps.

As a workaround, you could look into creating separate Dwolla accounts with their own unique set of data. I’ve done this by creating a Sandbox account with the email spencer+dev@dwolla.com and spencer+staging@dwolla.com. Those accounts would then have their own applications with their own webhook subscription.

I’ll be sure to record this as a Product enhancement for our Sandbox environment as it would provide value to other developers in the Dwolla ecosystem! Please let me know if you have any follow up questions based on my response. :slight_smile:

1 Like

Ah actually that workaround works great! For some reason I didn’t realize you could create sandbox accounts instantly now, I thought you had to go through a sales process with a Dwolla rep to get access.

In that case I don’t see a pressing need for the multi-environment feature, this works fine.

1 Like