Файл: billing/online_egold.php
Строк: 49
<?
$full_home_path = dirname(__FILE__);
require_once($full_home_path."/_rootload.php");
$PAYEE_ACCOUNT = $HTTP_POST_VARS['PAYEE_ACCOUNT']; #
$PAYMENT_ID = $HTTP_POST_VARS['PAYMENT_ID']; #
$PAYMENT_AMOUNT = $HTTP_POST_VARS['PAYMENT_AMOUNT']; #
$PAYMENT_UNITS = $HTTP_POST_VARS['PAYMENT_UNITS']; #
$PAYMENT_METAL_ID = $HTTP_POST_VARS['PAYMENT_METAL_ID']; #
$PAYMENT_BATCH_NUM = $HTTP_POST_VARS['PAYMENT_BATCH_NUM']; #
$PAYER_ACCOUNT = $HTTP_POST_VARS['PAYER_ACCOUNT']; #
$handshake_hash = $HTTP_POST_VARS['HANDSHAKE_HASH']; #
$ACTUAL_PAYMENT_OUNCES = $HTTP_POST_VARS['ACTUAL_PAYMENT_OUNCES']; #
$USD_PER_OUNCE = $HTTP_POST_VARS['USD_PER_OUNCE']; #
$FEEWEIGHT = $HTTP_POST_VARS['FEEWEIGHT']; #
$TIMESTAMPGMT = $HTTP_POST_VARS['TIMESTAMPGMT']; #
$V2_HASH = $HTTP_POST_VARS['V2_HASH']; #
if ($PAYEE_ACCOUNT) {
mconnect();
EnableLanguages();
$bill = GetBillById(intval($PAYMENT_ID));
$AlternateMerchantPassphraseHash = strtoupper(md5(GetSetting("egold_pass")));
$string = $PAYMENT_ID.":".$PAYEE_ACCOUNT.":".$PAYMENT_AMOUNT.":".$PAYMENT_UNITS.":".$PAYMENT_METAL_ID.":".$PAYMENT_BATCH_NUM.":".$PAYER_ACCOUNT.":".$AlternateMerchantPassphraseHash.":".$ACTUAL_PAYMENT_OUNCES.":".$USD_PER_OUNCE.":".$FEEWEIGHT.":".$TIMESTAMPGMT;
if (!$PAYMENT_ID) { $error_msg = "Отсутствует номер счета биллинг-системы."; }
else if (!$bill->id) { $error_msg = "Счет # $orderId не найден."; }
else if ($V2_HASH != strtoupper(md5($string))) { $error_msg = "Неправильная контрольная подпись."; }
else if ($PAYMENT_AMOUNT != $bill->merchantmoney) { $error_msg = "Неправильная сумма оплаты."; }
else if ($PAYEE_ACCOUNT != GetSetting("egold")) { $error_msg = "Неправильный кошелек продавца."; }
else {
MakeBillPayed($bill->id,1,"E-Gold Merchant ($PAYER_ACCOUNT)");
mclose();
exit;
}
$manager_email=GetSetting('manager_email');
$msg = "Автоматическая оплата через E-Gold Merchant отклонена биллинг-системой по причине:nn$error_msgnnPAYMENT_ID $PAYMENT_IDnPAYEE_ACCOUNT $PAYEE_ACCOUNTnPAYMENT_AMOUNT $PAYMENT_AMOUNTnPAYMENT_UNITS $PAYMENT_UNITSnPAYMENT_METAL_ID $PAYMENT_METAL_IDnPAYMENT_BATCH_NUM $PAYMENT_BATCH_NUMnPAYER_ACCOUNT $PAYER_ACCOUNTnAlternateMerchantPassphraseHash $AlternateMerchantPassphraseHashnACTUAL_PAYMENT_OUNCES $ACTUAL_PAYMENT_OUNCESnUSD_PER_OUNCE $USD_PER_OUNCEnFEEWEIGHT $FEEWEIGHTnTIMESTAMPGMT $TIMESTAMPGMTnV2_HASH $V2_HASH";
$subject = "Ошибка автоматической оплаты [E-Gold]";
$admEmails=GetAdminEmailsWhereTrueParam("senderror");
if (count($admEmails) > 0) {
WriteMailLog($subject,$msg);
}
while (list($i,$em) = @each($admEmails)) {
sendmail($em,'',$manager_email,$subject,$msg);
}
mclose();
}
?>