payment system to user error

Any issue about Cyclos 4 scripting and Webservices

Moderators: hugo, alexandre, rmvanarkel

Post Reply
nakataf1
Posts: 3
Joined: Mon Nov 28, 2016 10:27 am

payment system to user error

Post by nakataf1 » Sun Feb 12, 2017 6:01 am

hello everyone.
i'm using cyclos 4.7, i have problem when i try to make a payment from system to user.
"error calling payementservice.perform VALIDATION"
the script is

Code: Select all

<?php
require_once 'configureCyclos.php';

$transactionService = new Cyclos\TransactionService();
$paymentService = new Cyclos\PaymentService();

$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);
$paymentId = $paymentResult->id;
$transferId = $paymentResult->transferId;
if ($transferId == NULL) {
    echo("Not yet authorized\n");
} else {
    echo("Payment done!\n");
}

Post Reply