Edit Transaction

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

NameMethodValueDescriptionRequired
actGETedittransactionThe action will return done as transaction after successYes
tridPOSTIntThe transaction IDYes
uidPOSTIntThe user ID of the user making the transactionYes
datePOSTtextThe date on which the transaction was made, should be in the format DD/MM/YYYYYes
timePOSTtextThe time at which the transaction was made, should be in the format HH:MM:SSYes
gatewayPOSTtextThe name of the payment gateway used for the transactionYes
tokenPOSTtextA reference to the payment transactionNo
amtPOSTIntThe transaction amountYes
feesPOSTIntFees charged by the GatewayNo

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"
}
Was this helpful to you?