Hello,
I am trying to test the Dwolla PHP SKD with simple steps provided in documentation but I am getting timeout error when trying to get Oauth token. Here is the php code and error I am getting. Any help?
<?php
//Configuring a client
require_once("./private/vendor/autoload.php");
DwollaSwagger\Configuration::$username = '[remove]';
DwollaSwagger\Configuration::$password = 'removed';
// For Sandbox
$apiClient = new DwollaSwagger\ApiClient("https://api-sandbox.dwolla.com");
var_dump($apiClient) ;
// Obtaining an access token
$tokensApi = new DwollaSwagger\TokensApi($apiClient);
$appToken = $tokensApi->token();
var_dump($appToken);
?>
Hi @rizwanalam --Is this persistent? Are you able to wrap the request in a try/catch and catch the error and get the JSON response-body by calling the getResponseBody() method? That will show you the exact error response from the API.
Here is the info I got from my capture. The first part is a dump of my header and the 2nd part is info after the post. At the end I also added the fiddler dump.
Hey @rizwanalam – apologies for the late reply. It sounds like the Authorization header value is where the issue is at. Are you able to confirm that the $username and $password are being set up correctly below as the key and secret respectively? I’d also check that you’re using the correct Sandbox credentials for your application as well.
The Authorization header value is "Basic " followed by the base64-encoded string of your key and secret in this format key:secret.
That might be worth exploring. For what it’s worth, I tried the exact code you have above in my machine and I wasn’t able to recreate the issue. You could adding the following line to your file to get a debug output log that shows the SSL connection -