4

Foreword: Okay I've used APIs in the past such as TwitterAPI but I always used a library and some documentation to assist me with connections, and retrieving tokens. I have a basic understanding of how API's work.

Okay so I've tried multiple ways of requesting the dwolla API with PHP I've tried making a

<form action="https://www.dwolla.com/payment/pay" method="post">
<input type="hidden" name="key" value="soMeVerYLongAcsiiKey"/>
<input type="hidden" name="secret" value="soMeVerYLongAcsiiseCret"/>
</form>

I actually got a json reponse from the above code but i could never get it to accept my credentials.

I also tried doing something like string queries such as https://www.dwolla.com/payment/pay?key=someverylongAcssikey&secret=someverylonAcessisecret

I've attempted at signing up at the Dwolla.org/d website for their official forums by they are taking for ever to accept me. I also tried the "Developer Forums" link which took me here http://getsatisfaction.com/dwolla and I posted my dilemma on there too no response.

I just need some quick and dirty php pseudo code to make a request so customers can quickly just pay for their merchandise.

I would like to use the oAuth2.0 method

If you are a Bitcoiner, please post your Bitcoin address and I will accommodate you for your help. Thanks everyone!

Eric Tjossem
  • 2,536
  • 1
  • 15
  • 18
Xenland
  • 510
  • 1
  • 6
  • 19

3 Answers3

3

Finally got a respone from the Dwolla Developers and they are saying this way of doing it is deprecated as the SOAP API for Dwolla is deprecated and the recommended way for using the API is the REST API.

Xenland
  • 510
  • 1
  • 6
  • 19
1

You use the SOAP protocol to communicate with their API.

Here is a link to a discussion on the API: http://www.dwolla.org/d/showthread.php?3-SOAP-API

Here is a link to the php.net database on SOAP, and how to implement it: http://www.php.net/manual/en/class.soapclient.php

This is the address that you use to communicate with the API:

https://www.dwolla.com/api/API.svc?wsdl

You authenticate with an API key, generated in your dwolla API settings, I believe. Then you can use the other functions of the API.

Sorry can't be more specific right now, it's pretty late here right now. But it's pretty easy to do, just read through the documentation on both of those links, and you should figure it out.

mjcmurfy
  • 11
  • 1
  • Those are some great resources! I did not know Dwolla relied on the SOAP protocol I think they should emphasize this a lot more in their docs. $client = new SoapClient("https://www.dwolla.com/api/API.svc?wsdl"); //Attempt to buy something with dwolla form $client->RequestPaymentKey("0AwevY8CPVHiT2wxoxIF0o2U8sszyCj2NA+r0QUFnTeofqvRPl", "oDz1XJ1bjbaTk0i5RMcoEq5A8FWtBGQJA/3VqaC/Vwga7qbWoL", "1.50", "Testing testing testing", "812-504-6527"); print_r($client); var_dump($client->__getFunctions()); – Xenland Sep 25 '11 at 05:42
1

Have you defined all your parameters properly? Also, you can call the methods directly. For a full method list, uncomment the three lines after SoapClient is instanciated.

$client = new SoapClient("https://www.dwolla.com/api/TestAPI.svc?wsdl");
# header('content-type: text/plain');
# var_dump($client->__getFunctions());
# exit;

$params = array(
  'ApiKey' => $apiKey,
  'ApiCode' => $apiCode,
  'Amount' => 1.00,
  'Description' => $description,
  'CustomerID' => $customerId
);

var_dump($client->RequestPaymentKey($params));

//RequestPaymentKey returns a boolean: true if the request was successfully processed, False or exception otherwise

http://payb.tc/nuri

Nuri Hodges
  • 868
  • 6
  • 13
  • This didn't quite work either, This looks like a good solution but I checked the variables names and then rechecked just to make sure everything was being inputted and I'm still getting an odd error:SoapFault exception: [a:DeserializationFailed] The formatter threw an exception while trying to deserialize the message: Here is the pastebin of the error message: http://pastebin.com/TymWxg0v – Xenland Sep 27 '11 at 00:16
  • Hey, I've updated my post with a working example. I get a successful response from their test API. – Nuri Hodges Sep 27 '11 at 07:47