Issue with Integration


#1

Hi,

We’re having some issues with integration the API with PHP. The last support we received was:

For this specific request, you’ll want to pass in arguments as ->micro_deposits($body, $id). Which will look something like the following:

$res = $fsApimicro->micro_deposits([
'amount1' => [
'value' => '0.03',
'currency' => 'USD'
],
'amount2' => [
'value' => '0.07',
'currency' => 'USD'
]
], $fund_source);
print_r($res);

Below is the code we’re using, although we are still running into issues. Can you please advise:

include('dwolla/vendor/autoload.php');
$curl = curl_init();
	curl_setopt($curl, CURLOPT_URL,DWOLLA_POST_URL_TOKEN);  
	curl_setopt($curl, CURLOPT_FAILONERROR, true);
	curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
	curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
	 
	 $postData = array(
	 	'client_id' => DWOLLA_CLIENT_ID,
	 	'client_secret' => DWOLLA_CLIENT_SECRET,
	 	'grant_type' => 'client_credentials'
	 );
	 curl_setopt($curl, CURLOPT_POST, true);
	 curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
	curl_setopt($curl,CURLOPT_HTTPHEADER, array('Content-Type:application/x-www-form-urlencoded' )); // send JSON and expect JSON 
	//// Timeout in seconds
	 curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
	 curl_setopt($curl, CURLOPT_TIMEOUT, 60);
	//// Dont verify SSL certificate (eg. self-signed cert in testsystem)
	 curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
	 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
	 $output = curl_exec($curl);
	if ($output === FALSE) {
		echo 'An error has occurred: ' . curl_error($curl) . PHP_EOL;
	}
	else {
		$output = json_decode($output) ;
		
		$token = $output->access_token;
	}	 	
	DwollaSwagger\Configuration::$access_token = $token;
	DwollaSwagger\Configuration::$debug = 1;
	$apiClient = new DwollaSwagger\ApiClient(DWOLLA_API_CLIENT);
	
	$fund_source =  'https://api-sandbox.dwolla.com/funding-sources/7071a398-6dca-4f95-b5da-daae7b939023';	 

	$fsApi = new DwollaSwagger\FundingsourcesApi($apiClient);	
	$retrieved = $fsApi->id($fund_source);
	if($retrieved->name!="")
	{
 	 $fsApimicro = new DwollaSwagger\FundingsourcesApi($apiClient);
	$res = $fsApimicro->micro_deposits( [ 
	 'amount1' => [
    'value' => '0.03',
    'currency' => 'USD'
  ],
  'amount2' => [
    'value' => '0.07',
    'currency' => 'USD'
  ]	],$fund_source );
print_r($res );
Error received = PHP Fatal error:  Uncaught Error: Call to undefined method DwollaSwagger\FundingsourcesApi::micro_deposits() in /home/rxpost/public_html/user-area/verifymicro.php:57
Stack trace:
#0 {main}  thrown in /home/rxpost/public_html/user-area/verifymicro.php on line 57

(Spencer Hunter) #2

@sunlightmedia, As referenced here, that method should be $res = $fsApimicro->microDeposits()


#3

Thanks, @spencer.

We’ve used microDeposits() are now receiving a new error:


    $apiClient = new DwollaSwagger\ApiClient(DWOLLA_API_CLIENT);	
	$fund_source = $dwallo_funding_source;	 
	$fsApi = new DwollaSwagger\FundingsourcesApi($apiClient);	
	$retrieved = $fsApi->id($fund_source);
	if($retrieved->name!="")
	{
  	 $fsApimicro = new DwollaSwagger\FundingsourcesApi($apiClient);
	 $res = $fsApimicro->microDeposits(  [ 
	    'amount1' => [
		'value' => '0.03',
		'currency' => 'USD'
		],
		'amount2' => [
		'value' => '0.07',
		'currency' => 'USD'
		]
	] , $fund_source);
* Connection #0 to host api-sandbox.dwolla.com left intact [DEBUG] HTTP Request body  ~BEGIN~
{"amount1":{"value":"0.03","currency":"USD"},"amount2":{"value":"0.07","currency":"USD"}}
~END~
[DEBUG] HTTP Response body ~BEGIN~
{"code":"NotFound","message":"The requested resource was not found."}

Error on PHP
 PHP Fatal error:  Uncaught DwollaSwagger\ApiException: [404] Error connecting to the API (https://api-sandbox.dwolla.com/funding-sources/7071a398-6dca-4f95-b5da-daae7b939023/micro-deposits) in /home/rxpost/public_html/dwolla/lib/ApiClient.php:313
Stack trace:
#0 /home/rxpost/public_html/dwolla/lib/FundingsourcesApi.php(728): DwollaSwagger\ApiClient->callApi('/funding-source...', 'POST', Array, '{"amount1":{"va...', Array, Array)
#1 /home/rxpost/public_html/user-area/verifymicro.php(67): DwollaSwagger\FundingsourcesApi->microDeposits(Array, '7071a398-6dca-4...')
#2 {main}
  thrown in /home/rxpost/public_html/dwolla/lib/ApiClient.php on line 313

(Spencer Hunter) #4

It doesn’t appear that micro-deposits have been initiated yet to that particular funding sources. Micro-deposit amounts aren’t verifiable until they’ve been initiated and processed to a particular funding source. If you make that same request with an empty request body then it should initiate micro-deposits and they’ll then be verifiable. Something like the following:

$res = $fsApimicro->microDeposits($fund_source);

#5

We got this error while create a transaction –

{"code":"ValidationError","message":"Validation error(s) present. See embedded errors list for more details.","_embedded":{"errors":[{"code":"Restricted","message":"Sender restricted.","path":"/_links/source/href","_links":{}}]}}

We have created a bank account and verified the account with a micro deposit using the API. But we can’t see the deposit amount in the sandbox account of the customer profile. Is any other verification required?

Below is the Code -

$transfersApi = new DwollaSwagger\TransfersApi($apiClient);
 
    $transfer = $transfersApi->create([
      '_links' => [
        'source' => [
          'href' =>   "dwallo_funding_source of user"
        ],
        'destination' => [
          'href' =>  "dwallo_funding_source of seller"
        ]
      ],
      'amount' => [
        'currency' => 'USD',
        'value' =>  '5.00'      ],
      'fees' =>[
 
            '_links' => [
              'charge-to' => [
                'href' =>  "dwallo_funding_source of user"              ]
              ],
            'amount' => [
              'value' => '1.00',
              'currency' => "USD"
            ]
 
        ],
      'metadata' => [
        'paymentId' => "ADAJI32323",
        'note' => 'payment for ADAJI32323' ,
      ],
      'clearing' => [
        'destination' => 'next-available'
      ],
      'correlationId' => session_id()
    ]);
echo '<pre>'.print_r($transfer ,true).'</pre>';

(Spencer Hunter) #6

Hi @sunlightmedia, what is the status of the source Funding Source? Can you reply back with both funding source Ids?


#7

Account is displaying as verified (see screenshot).

How do we add a balance to the customer’s account via API?

How do we enable customers to activate their account for sending funds? We created these customer accounts through the API. We did not find any developer samples to reactivate the account for sending money.

"source": { "href":"https://api-sandbox.dwolla.com/funding-sources/e5478164-f902-449c-869a-57b7827a257c" }, 
"destination": { "href":"https://api-sandbox.dwolla.com/funding-sources/669175eb-ee3f-44e9-94ed-60e1e4311995" } 
}, 

#8

Just following up on this


(Spencer Hunter) #9

Hi @sunlightmedia, It looks like the source Customer account (as well as destination Customer) hasn’t completed the requirements which makes them eligible to send funds. In order for business Verified Customers to be eligible to send funds they must:

  1. ensure that the overall legal entity Customer which includes the business and Controller of the business has completed the identity verification process successfully and that they have a verified status.
  2. All applicable Beneficial Owners have been attached to the legal entity Customer and that those individual owners have completed the identity verification process and have a verified status.
  3. The account admin (individual signing up for the account) has certified ownership which verifies that information submitted for the legal entity Customer is complete and accurate.

This process outlined above for creating this particular Customer type is explained in more depth in this developer guide: https://developers.dwolla.com/resources/business-verified-customer.html. Once you’ve added additional owners, verified those owners, and certified ownership then you should be all set to transfer funds! Please don’t hesitate to post back if you run into issues with on-boarding this particular Customer type or how to determine if an account is eligible to send funds.