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
