To make use of this api, just add this function in coinpayments.inc.php
}
public function GetTransactionInformation($txId) {
$req = array(
'txid' => $txId,
);
return $this->api_call('get_tx_info', $req);
}
Add this in you's script before printing tx id $txid = strip_tags($_POST['txn_id']) And for results
$cps = new CoinPaymentsAPI();
$cps->Setup('Your_Private_Key', 'Your_Public_Key');
$result = $cps->GetTransactionInformation('$txid');
//get the array info of transaction
if ($result['error'] == 'ok') {
print_r ($result);
} else {
print 'Error: '.$result['error']."\n";
}
You should get result in Array. For getting in Json output just replace.
print_r ($result);
With
print $result['result']['status']