Integrating Dwolla with PHP with their API

别说谁变了你拦得住时间么 提交于 2019-12-23 12:26:24

问题


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!


回答1:


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.




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/7543582/integrating-dwolla-with-php-with-their-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!