Swagger PHP SDK for ACH - Transfer API Fails error 400

(Sam Samimi) #1

We have a created a Dowlla ACH sandbox and trying to use Swagger PHP SDK to test out the core feature. We have created and added 2 accounts and attach those 2 accounts to banks . However, any attempts to make transfer work fails. We are keep getting error 400 or 401 and there seems to be a documentation issue ( see screen shot attachments)

$transfersApi = new \DwollaSwagger\TransfersApi($apiClient);
$new_xfer = $transfersApi->create(array (
’_links’ =>
array (
‘destination’ =>
array (

			        'href' => 'https://api-sandbox.dwolla.com/customers/615137d9-d463-4f72-8578-03f0b410f8de',		//jane
			      'source' => 
			      array (

			         'href' => 'https://api.dwolla.com/funding-sources/a7afee62-e058-4c69-b417-d0187a3a053f',
			        // 'href' => 'https://api-sandbox.dwolla.com/funding-sources/880da238-d6cb-4c24-bd8c-c791b87478f2',	
			  'amount' => 
			    array (
			      'currency' => 'USD',
			      'value' => '0.50',
			    'metadata' => 
			    array (
			      'foo' => 'bar',
			      'baz' => 'boo',


response that comes back:
"[400] Error connecting to the API (https://api-sandbox.dwolla.com//transfers)",

Calling GET https://api.dwolla.com/transfers/{400}/failure

tells that: {
“code”: “InvalidCredentials”,
“message”: “Missing or invalid Authorization header.”

(Sam Samimi) #2

Can anyone reply to my queries?

(Stephen Ausman) #3

Hey Sam,

The code you posted looks good to me. Did you remember to set a token by doing:

DwollaSwagger\Configuration::$access_token = 'a token';

The error you’re getting leads me to believe the token isn’t getting set correctly.

(Sam Samimi) #4

YES, off course. The sandbox generates a 60 minutes token and I have tried several different ones. It is not a token issue because other API’s such as adding users and so forth seems to work. It fails transfer and only after I register a user, add a payment type, do a direct micro deposit ,verification .

\DwollaSwagger\Configuration::$access_token = ‘IZf0o2M8XS9PnaGgBYshxFcCxe9PJdZkVfnxMI4mi8NYZJuChb’;

(Stephen Ausman) #5

I just noticed the source funding source in the request you posted links to a production funding source and the destination is a sandbox url. Does changing that help?

(Cory Anderson) #6

(Cory Anderson) #7