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 Edit transaction API allows the admin to edit the transaction details.
The API response will contain "done" as the transaction ID of updated transaction entry.
HTTP Request
https://hostname:4085/index.php?act=edittransaction
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | edittransaction | The action will return done as transaction after success | Yes |
trid | POST | Int | The transaction ID | 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['trid'] = 10;
$post['uid'] = 57;
$post['date'] = '18/09/2018';
$post['time'] = '15:33:55';
$post['gateway'] = 'New API two';
$post['amt'] = 1000;
$output = $admin->edittransaction($post);
print_r(json_encode($output));
?>
Output
{
"title": "Edit Transaction",
"done": 10,
"tranx": {
"trid": "10",
"uid": "57",
"date": "20180918",
"unixtime": "1537230835",
"invoid": "0",
"gateway": "New API two",
"token": "",
"amt": "1000.00",
"fees": "0.00",
"net": "1000.00",
"bal": "10000.00",
"used": "0"
},
"timenow": 1537282349,
"time_taken": "0.374"
}