Edit: If you receive the error "No HMAC signature sent" generate a IPN secret here:
https://www.coinpayments.net/index.php?cmd=acct_settings and add it to your callback code.
Edit 2: If you don't want to use IPN, you can use this API code:
https://www.coinpayments.net/downloads/api-example.phps$req = array(
'txid' => 'transaction_id', // e.g. 25fc307cc7a28d0cc18369f1775ea8e5be8495b33a74ae18a1a9c430b9d8a49c
'full' => '1'
);
print_r(coinpayments_api_call('get_tx_info',$req));
More info here:
https://www.coinpayments.net/apidoc-get-tx-info
To check payment status you can use IPN (instant payment notification)
To track payments you can set the button "custom" field to the order ID.
Create a callback PHP page on your server with this code:
https://www.coinpayments.net/downloads/cpipn.phpsChange "ipn_url" field to the url of your callback script:
https://www.coinpayments.net/merchant-tools-buttonsThis code deals with payment status:
if ($status >= 100 || $status == 2) {
// payment is complete or queued for nightly payout, success
// e.g. now update orders database with "payment complete"
} else if ($status < 0) {
//payment error, this is usually final but payments will sometimes be reopened if there was no exchange rate conversion or with seller consent
} else {
//payment is pending, you can optionally add a note to the order page
// e.g. now update orders database with "payment pending"
}
Relevant variables:
$_POST['status'] $_POST['received_amount'] $_POST['received_confirms']
See possible payment status here:
https://www.coinpayments.net/merchant-tools-ipn