Is the old API broken? I get "[Error] => Invalid application credentials."

(Zachary Sprague) #1

I had some API keys configured that I used with to have a button for a payment.
It worked 2 years ago, but checking it again it no longer works.

I thought maybe the older API broke, so I set up a new API access key with all permissions checked and tried using
However, in the most basic example I get the error “Array ( [Error] => Invalid application credentials. )”.

So it just seems like my old API keys are now broken, are so are new ones I make. Why would that old button not work to begin with?

I can’t figure out what’s going on here. I just want a simple checkout where people can enter an amount of money, checkout, and I get a callback to my server with the details.

The full code I’m using, after installing the PHP API via composer, is:

require 'vendor/autoload.php';
$Account = new Dwolla\Account();
$Account->settings->client_id = "Wi3QY8eVypOblunLeFW2GOLz9CGWOTmrmY8nmaT8dBd04...etc";
$Account->settings->client_secret = "e8H63ReJaYYEFwCMevxjMCAP1SxBIrmgq4pkyImhwofJn...etc";
$Account->settings->sandbox = true;

which prints the aforementioned “Array ( [Error] => Invalid application credentials. )” error.

That’s the code right from the github page, just with the require changed to load it from composer, and it’s not working for me.

(Spencer Hunter) #2

Hi @Zachary_Sprague! From the code you provided it looks like you may be setting the sandbox flag to true which points to UAT. Are you passing in credentials generated from your Sandbox application( or your Production application(

The submit directly option of the Off-site Gateway is a great solution for what you’re describing. For more information, checkout the forum thread below.

An alternative to the direct submit option, I’d recommend taking a look at checkouts in dwolla-php.

(Zachary Sprague) #3

It happens with “$Account->settings->sandbox = false;” set. I’ll look into that other thing, though.

(Zachary Sprague) #4

Ah I see. On my submit directly form that uses the gateway, I had it changed the dwolla URL to uat. Woops.

The Dwolla PHP API example still doesn’t work with sandbox set to false, using a key that works with the form, but ah well I suppose I don’t need it.

(Spencer Hunter) #5

@Zachary_Sprague, Let us know if you have any questions about integrating with the gateway! The docs for the gateway can be found here.

(Zachary Sprague) #6

edit: nevermind. answered my question.

(Zachary Sprague) #7

Well, I’m trying to use the dwolla-php API again.

Trying the example from

require 'vendor/autoload.php';

$Checkouts = new Dwolla\Checkouts();
$Checkouts->settings->client_id = $dwollaKey;
$Checkouts->settings->client_secret = $dwollaSecret;
$Checkouts->settings->sandbox = false;

$purchaseOrder = [
   'destinationId' => '812-742-3301',
   'total' => '33.99'

$result = $Checkouts->create($purchaseOrder, [
  'redirect' => 'http://www.'.DOMAIN.'/'.$_SERVER['PHP_SELF'].'?thanks'


And I get:

Fatal error: Call to undefined method GuzzleHttp\Psr7\Response::json() in /home/user/public/vendor/dwolla/dwolla-php/lib/client.php on line 182

The only thing that came up when looking it up was PHP OAuth->get returns undefined method with Guzzle PSR-7 which is dated and fixed.

(Zachary Sprague) #8

Hm nevermind I see it’s some problem on my end from another test. I’ll figure it out.