No response - Null Message


#1

Hello,

My team is working within the sandbox, as we are trying to get the white label AP payment gateway to function on our website. We need to facilitate ACH transfers between our users, but we do not need the users to make Dwolla customer accounts. The PHP code we are using is not working. We are only getting a NULL message, which can be seen here: https://epimoniapp.com/dwolla/ Is this because we are using an old script? After looking in the Sandbox, I found a new script. Should we be using this one instead?

I tried to paste each script below but the system will not let me do it since new users can only post 2 links.

Thanks.


(Spencer Hunter) #2

Hi @epimoni, I updated your status from a new user. Are you able to reply back and share some of your code that is returning this null response? That will help us pinpoint where the issue is and allow us to debug further. Thanks!

(Note: please omit any private credentials)


#3

Thanks, @spencer. I will paste the code below:

OLD SCRIPT

<?php
//Define variables
$key = ‘’;
$secret = ‘’;
$dwolla_client_id = urlencode($key);
$dwolla_secret_key = urlencode($secret);
// access token :
code = urlencode(_GET[“code”]);
//get token
// $retireve_token = file_get_contents("
https://www.dwolla.com/oauth/v2/token?client_id=
“.$dwolla_client_id.”&client_secret=".$dwolla_secret_key."&grant_type=authorization_code&redirect_uri=
http://netmaxims.in/projects/dwolla/index.php&code=".$code);

// $decoded_json = json_decode($retireve_token, true);

// var_dump($decoded_json);
$arr = ‘{
“oauth_token”:
“”,
“fundsSource”: “balance”,
“pin”: “1111”,
“notes”: “Payment for services rendered”,
“amount”: 1.01,
“destinationId”: “812-111-1111”,
“assumeCosts”: false,
“facilitatorAmount”: 0,
“destinationType”: “dwolla”
}’;
$opts =
array(‘http’=>array(‘method’=>“POST”,‘content’=> $arr, ‘header’ =>
‘Content-Type: application/json’));

$ctx = stream_context_create($opts);
$send_request = file_get_contents(’
https://www.dwolla.com/oauth/rest/accountapi/send’, false, $ctx);
print_r($send_request);
var_dump(json_decode($send_request));

?>

NEW SCRIPT

<?php

DwollaSwagger\Configuration::$auth_token = ‘’;

$apiClient = new DwollaSwagger\ApiClient(“https://api-sandbox.dwolla.com/”);

$transfer_request = array (

‘_links’ =>

array (

'source' =&gt;

array (

  'href' =&gt; 'https://api-sandbox.dwolla.com/funding-sources/118b08b9-e1eb-48b7-94ad-866989b0764e',

),

'destination' =&gt;

array (

  'href' =&gt; 'https://api-sandbox.dwolla.com/funding-sources/2fa64102-185d-443d-9001-dda9bc37651d',

),

),

‘amount’ =>

array (

'currency' =&gt; 'USD',

'value' =&gt; '9.00',

),

);

$transferApi = new DwollaSwagger\TransfersApi($apiClient);

$myAccount = $transferApi->create($transfer_request);

print($xfer); # => https://api-sandbox.dwolla.com/transfers/d76265cd-0951-e511-80da-0aa34a9b2388

?>


(Spencer Hunter) #4

Hi @epimoni, are you looking to migrate from our v1 API to the Dwolla platform? These are two completely different APIs where the underlying product is different, so I want to better understand what you’re looking to accomplish and how you’re looking to integrate with Dwolla.


#5

@spencer We need to facilitate fund transfers between our users. We were originally introduced to the v1 API and have not yet finished integrating it. I did not even know the Dwolla Platform was something new. Would it be better to use the new platform? Our users will have access through our website and mobile application.


(Spencer Hunter) #6

@epimoni, The v1 API and related co-branded product will be going away at the end of this year unfortunately. Our developer portal, product page, and pricing reflect functionality that is available as part of the Dwolla Platform. If you have any questions after reading through the documentation, please don’t hesitate to reach out!