<?
if (isset($_POST['signature']) && isset($_POST['data'])) {
  
  $set_paytype = $payment->getSettings('liqpay');
  
  $sign = $_POST['signature'];
  $data_base = $_POST['data'];
  
  // Подпись платежа
  $hash = base64_encode(sha1($set_paytype['PAYMENT']['PRIVATE_KEY'] . $data_base . $set_paytype['PAYMENT']['PRIVATE_KEY'], 1));
  
  // Массив с данными
  $data = json_decode(base64_decode($data_base), 1);
  
  $order_base = base64_decode($data['order_id']);
  $order = explode(':', $order_base);
  $data['order_id'] = $order[0];

  $checkPOST = array(
                  'id' => $data['order_id'],
                  'wmr' => round($data['amount'], 2), 
                  'paytype' => 'liqpay',
                  'method' => 'LiqPay',
                  'array' => serialize($data),
                  'resp' => 'OK',
                  );
                  
  if ( $sign === $hash && $data['status'] === 'wait_accept') {
    $pay_result = 'result';
  }
}