Trying to use the 2.0 SDK for PHP with Dwolla (Swagger).
And I am trying to get an application token.
The Docs are no help since they simply say:
No support for this language yet. We recommend using an external REST client for making OAuth requests.
I have tried the following:
$client_id = ‘myclientid’;
$client_secret = ‘mysecret’;
$basic_credentials = base64_encode($client_id.’:’.$client_secret);
$ch = curl_init(‘https://sandbox.dwolla.com/oauth/v2/token’);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Basic '.$basic_credentials, ‘Content-Type: application/x-www-form-urlencoded;charset=UTF-8’));
curl_setopt($ch, CURLOPT_POSTFIELDS, ‘grant_type=client_credentials’);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch));
And this returns a token. But that token does not work. It gives an ID of null in the SDK when making a call.
Uncaught InvalidArgumentException: Missing the required parameter $id when calling id in \vendor\dwolla\dwollaswagger\lib\AccountsApi.php:72
If I use a token generated in the Sandbox, then it DOES work (calling Root).
Many other people seem to have posted this issue, with no response:
I have studied this page:
And I can’t find what I am doing wrong. If anyone has a working example of code, or can lend any assistance I would be grateful.