IPN (Instant Payment Notification)
The process of payment and confirmation of payment can take from several minutes to several hours. Our service will notify you when the transaction is credited, by sending a POST request with the information to the address you specified. The notification will be twice: after the transaction appears on the network and after its 12th confirmation.
Data in JSON-format:
type: notification type = (in / track / out)
from: payer address
to: destination address
txid: hash of transaction
confirmations: number of confirmations = (0 / 12)
To verify the signature, you must obtain a hash from the incoming data and compare it with the value in the sign field. The hash is the result of the function sha1 from the string received by connecting through the colon (:) of the values of the fields type, date, from, to, amount, txid, confirmations, tag and token.
Example code for an IPN handler in PHP:
$_POST = @json_decode(file_get_contents('php://input'), true);
$sign = sha1(implode(':', array(
$cfg['token'] // API access token
if ($sign !== $_POST['sign'])
die('Sign wrong'); // this answer will be visible in the office