Error connecting to the API


(milotimbol@gmail.com) #1

I am trying out transfers.

  try{
    DwollaSwagger\Configuration::$access_token = 'Sp9v84btXsVUve8QiDG2djrUjgzhII65tKTEkqvLl3FqnyeAOl';
    $apiClient = new DwollaSwagger\ApiClient("https://api-sandbox.dwolla.com/");    
    $transfersApi = new DwollaSwagger\TransfersApi($apiClient);

    $transfer = $transfersApi->create([
      '_links' => [
        'source' => [
          'href' => 'https://api-sandbox.dwolla.com/funding-sources/e3cc28b4-e6d0-4ace-ba20-a5dd203b60fe',
        ],
        'destination' => [
          'href' => 'https://api-sandbox.dwolla.com/funding-sources/14a8a0d7-1b70-4212-8cdb-7569ec3d8da7'
        ]
      ],
      'amount' => [
        'currency' => 'USD',
        'value' => '1.00'
      ],
      'metadata' => [
        'paymentId' => '12345678',
        'note' => 'payment for completed work Dec. 1',
      ],
      'clearing' => [
        'destination' => 'next-available'
      ]
    ]);
    $transfer; # => "https://api-sandbox.dwolla.com/transfers/74c9129b-d14a-e511-80da-0aa34a9b2388"    
  }
  catch(Exception $e){
    $isValid = false;
    array_push($errors, $e->getMessage());
  }

I am getting

[400] Error connecting to the API (https://api-sandbox.dwolla.com/transfers)

Using almost the same format of code I am able to create a customer, and add a funding resource but with transfers I am getting an error.

What am i doing wrong? The source href and destination href are from the test customers I created. I wanted to transfer to my own bank account in the test environment but dont know how. Even if my href’s are incorrect I should get a different error message


(Spencer Hunter) #2

Are you able to add the following after you set your access token?
DwollaSwagger\Configuration::$debug = 1;

^^ This should log out the raw request and response body, which should give information that may be helpful in debugging.


(Cory Anderson) #3

(Cory Anderson) #4

(Cory Anderson) #5

(Cory Anderson) #6

(Cory Anderson) #7

(Cory Anderson) #8