Try something along these lines:
$apiKey='xyz';
$apiCode='xyz';
$description='test';
//ENTER NUMBER, NOT STRING
$amount=123;
$client = new SoapClient("
https://www.dwolla.com/api/TestAPI.svc?wsdl");
$client->__soapCall("RequestPaymentKey", array($apiKey, $apiCode, $amount, $description));
//RequestPaymentKey returns a boolean: true if the request was successfully processed, False or exception otherwise
if($client)
{
//function executed succesfully
}
else
{
//it didn't
}
?>
for testing purposes, it says on the dwolla site:
You are able to test Dwolla’s API by using the following WSDL:
https://www.dwolla.com/api/TestAPI.svc?wsdlTest API calls will not hit Dwolla’s database & no action save the responses defined are undertaken. For example, the normal generation of an email containing a secure payment key when RequestPaymentKey() is called does not take place. To simulate success or failure of each method, the amount parameter’s value is changed to one of the following values:
Amount Result
$1.00 Causes the operation to be successful
$3.00 Amount too large (SOAP fault)
$4.00 User is invalid (SOAP fault)
Other Amount invalid (SOAP fault)
So I think if you change the amount value to those test values, and it will simulate a success ($1), a too large failure ($3), a user invalid failure ($4) or an amount invalid failure (any other value).