I had Installed Cyclos 3.7.3 Release on my Local and I need to make transaction via PHP. I am using this PHP Library => http://www.cyclos.org/dev/4.2/cyclos-php-library.zip
Now when ever I try to make transaction, I got Error with code UNKNOWN while performing the payment
Please guide me where I am doing it Wrong or provide me any working example of same.
Thanks!!
(PHP CODE BELOW)
require_once 'configureCyclos.php';
$transactionService = new Cyclos\TransactionService();
$paymentService = new Cyclos\PaymentService();
try {
$data = $transactionService->getPaymentData(array('username' => 'c1'), array('username' => 'c2'));
$parameters = new stdclass();
$parameters->from = $data->from;
$parameters->to = $data->to;
$parameters->type = $data->paymentTypes[0];
$parameters->amount = 5;
$parameters->description = "Test payment to user";
$paymentResult = $paymentService->perform($parameters);
if ($paymentResult->authorizationStatus == 'PENDING_AUTHORIZATION') {
echo("Not yet authorized\n");
} else {
echo("Payment done with id $paymentResult->id\n");
}
} catch (Cyclos\ServiceException $e) {
switch ($e->errorCode) {
case "VALIDATION":
echo("Some of the parameters is invalid\n");
var_dump($e->error);
break;
case "INSUFFICIENT_BALANCE":
echo("Insufficient balance to perform the payment\n");
break;
case "MAX_AMOUNT_PER_DAY_EXCEEDED":
echo("Maximum amount exeeded today\n");
break;
default:
echo("Error with code $e->errorCode while performing the payment\n");
break;
}
}
UNKNOWN error while make transaction with php
Moderators: hugo, alexandre, rmvanarkel
Re: UNKNOWN error while make transaction with php
4.2 is not compatible with 3.7.