For the billed users, the payment against the invoices appear in the transactions tab at the enduser panel.
In the event of any adhoc payment from the user, the admin can create transaction entry for that payment using the Add Transaction API which would appear in the enduser panel as "paid".
The API response will contain "done" as the transaction ID of the newly added transaction.
HTTP Request
https://hostname:4085/index.php?act=addtransaction
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | addtransaction | The action will return done as transaction ID on success | Yes |
uid | POST | Int | The user ID of the user making the transaction | Yes |
date | POST | text | The date on which the transaction was made, should be in the format DD/MM/YYYY | Yes |
time | POST | text | The time at which the transaction was made, should be in the format HH:MM:SS | Yes |
gateway | POST | text | The name of the payment gateway used for the transaction | Yes |
token | POST | text | A reference to the payment transaction | No |
amt | POST | Int | The transaction amount | Yes |
fees | POST | Int | Fees charged by the Gateway | No |
Sample Code
<?php
require_once('/usr/local/virtualizor/sdk/admin.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Admin_API($ip, $key, $pass);
$post = array();
$post['uid'] = 57;
$post['date'] = '18/09/2018';
$post['time'] = '12:33:55';
$post['gateway'] = 'UPI';
$post['amt'] = 1000;
$output = $admin->addtransaction($post);
print_r(json_encode($output));
?>
Output
{
"title": "Add Transaction",
"done": "2",
"timenow": 1537275189,
"time_taken": "0.219"
}