How deposit funds to test funding sources


(Vladimir Grischenko) #1

I am writing tests.
Now I want to test different cases for transfers.

I create customer by API.
I create funding source for this customer by API.

All funding sources created with zero balance.
So, I can’t use them to test transfers.
How I can deposit funds to these test funding sources?

I know about testing balance $1000 of sandbox account.
But how I can use this account to transfer funds to my testing funding sources?

Thanks, Vladimir


(Spencer Hunter) #2

@vladigris, Before walking through the process of adding funds to a balance that belongs to a Customer I want to mention that you don’t have pre-load the balance in order to pay other users. You can send money directly from a funding source (bank account) to another user.

Step 1: You didn’t mention verifying the funding source that you attached to the customer. The first step would be to verify the funding source (Bank Account) that you want to send money from. Once the funding source is verified either with micro-deposits or IAV then you’re ready to move funds to the balance from the bank funding source.

Step 2: List funding sources attached to the Customer. At this point you should see the balance and and bank funding sources attached, like in this example (Request and Response):

GET https://api-uat.dwolla.com/customers/9bc9c1be-3546-46d7-b883-49be0a9b0df3/funding-sources?removed=false
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer {Your access token}
{
  "_links": {
    "self": {
      "href": "https://api-uat.dwolla.com/customers/9bc9c1be-3546-46d7-b883-49be0a9b0df3/funding-sources?removed=false",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "funding-source"
    },
    "customer": {
      "href": "https://api-uat.dwolla.com/customers/9bc9c1be-3546-46d7-b883-49be0a9b0df3",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "customer"
    }
  },
  "_embedded": {
    "funding-sources": [
      {
        "_links": {
          "self": {
            "href": "https://api-uat.dwolla.com/funding-sources/14ddbf7b-af6a-4fcd-9b22-45da12f9f1d7",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "customer": {
            "href": "https://api-uat.dwolla.com/customers/9bc9c1be-3546-46d7-b883-49be0a9b0df3",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "customer"
          }
        },
        "id": "14ddbf7b-af6a-4fcd-9b22-45da12f9f1d7",
        "status": "verified",
        "type": "bank",
        "name": "Test checking account",
        "created": "2016-12-27T20:33:59.000Z",
        "removed": false,
        "channels": [
          "ach"
        ],
        "bankName": "SANDBOX TEST BANK"
      },
      {
        "_links": {
          "self": {
            "href": "https://api-uat.dwolla.com/funding-sources/c2eb3f03-1b0e-4d18-a4a2-e552cc111418",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "customer": {
            "href": "https://api-uat.dwolla.com/customers/9bc9c1be-3546-46d7-b883-49be0a9b0df3",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "customer"
          },
          "with-available-balance": {
            "href": "https://api-uat.dwolla.com/funding-sources/c2eb3f03-1b0e-4d18-a4a2-e552cc111418",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "balance": {
            "href": "https://api-uat.dwolla.com/funding-sources/c2eb3f03-1b0e-4d18-a4a2-e552cc111418/balance",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "balance"
          }
        },
        "id": "c2eb3f03-1b0e-4d18-a4a2-e552cc111418",
        "status": "verified",
        "type": "balance",
        "name": "Balance",
        "created": "2016-12-08T20:27:02.000Z",
        "removed": false,
        "channels": []
      }
    ]
  }
}

Step 3: Create the transfer to move money from the bank funding source to the balance.

POST https://api-uat.dwolla.com/transfers 
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer {Your access token}
Content-Type: application/json

{
    "_links": {
        "source": {
            "href": "https://api-uat.dwolla.com/funding-sources/14ddbf7b-af6a-4fcd-9b22-45da12f9f1d7"
        },
        "destination": {
            "href": "https://api-uat.dwolla.com/funding-sources/c2eb3f03-1b0e-4d18-a4a2-e552cc111418"
        }
    },
    "amount": {
        "currency": "USD",
        "value": "1000.00"
    }
}

Step 4: The Sandbox environment does not replicate any ACH processes, so a pending transfer will not clear or fail automatically after a few business days as it would in production. It will simply remain in the pending state indefinitely. You’ll want to login the the Sandbox Dashboard with your main Sandbox account and click the “Process bank transfers” button. Read more on the process bank transfers button. This will process any pending bank transfers that occur on your account or the Customers you manage.

That’s it! At this point you should see funds in the Customer’s balance. The other method would be to initiate a Transfer from the balance attached to your Sandbox account to the Customer you wish to receive funds.


(Vladimir Grischenko) #3

When I create Customer and funding source by testing API, funding source already with status: verified.
I already created lot’s of customers and verified funding sources and checked balance: all of them with 0 balance.

When I try to transfer, I get error: Insufficient funds. I try to send from verified funding source with 0 balance to sandbox company’s email. Few times it worked.

Probably it worked from accounts when I did micro deposit verification.

I’ll try to go through the all steps.
Thanks!