How can I set a schedule payment by webservice using php?
For a simple payment from system to user we have this:
<?php
require_once 'configureCyclos.php';
$transactionService = new Cyclos\TransactionService();
$paymentService = new Cyclos\PaymentService();
try {
$data = $transactionService->getPaymentData('SYSTEM', array('username' => 'c1'));
$parameters = new stdclass();
$parameters->from = $data->from;
$parameters->to = $data->to;
$parameters->type = $data->paymentTypes[0];
$parameters->amount = 5;
$parameters->description = "Test from system 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) {
echo("Error while calling $e->service.$e->operation: $e->errorCode");
}
Schedule payment webservice
Moderators: hugo, alexandre, rmvanarkel