moneybookers.php

来自「网络硬盘_支持1GB文件上传和续传_无错版」· PHP 代码 · 共 99 行

PHP
99
字号
<?
include "../ipn.class.php";
include "inc/mb.inc.php";
include "../../includes/inc.php";

/**
* iniate the class
*/
$checker = new MB_Validater($db);
$ipn = new ipn_class('MB');

$ipn->TestMode=$checker->TestMode;
$ipn->EmailTo=$user->setting[adminemail];
$ipn->BindDB(&$db);
$ipn->MD5AccountPassword=$checker->MD5AccountPassword;

$Var=$ipn->RecieveData();
$result=$ipn->CheckDataIntegrity();
/**
* Begin to check...
*/
if($result==false) $ipn->SetError('Hack attempted!');

$checker->LoadServer($ipn);
if($ipn->PayeeAccount!=$checker->GetPayeeAcount())
{
    $ipn->SetError('Error PayeeAccount:'.$ipn->PayeeAccount.':'.$checker->GetPayeeAcount());
}

if($ipn->Amount!=$checker->GetAmount())
{
    $ipn->SetError('Error Amount:'.$ipn->Amount.':'.$checker->GetAmount());
}

if($ipn->Currency!=$checker->GetCurrency($ipn))
{
    $ipn->SetError('Error Currency:'.$ipn->Currency.':'.$checker->GetCurrency($ipn));
}
if($ipn->PaymentType=='subscriptions')
{
    if($ipn->TrialAmount!=$checker->GetTrialAmount())
    {
        $ipn->SetError('Error TrialAmount:'.$ipn->TrialAmount.':'.$checker->GetTrialAmount());
    }
    if($ipn->TrialPeriod!=$checker->GetTrialPeriod($ipn))
    {
        $ipn->SetError('Error TrialPeriod:'.$ipn->TrialPeriod.':'.$checker->GetTrialPeriod());
    }
}
/**
* check the TXNID is unique
*/
$TXNID=$ipn->GetTXNID();
if(!$ipn->IsUniqueTXNID())
{
    $ipn->SetError('Repeat Transaction ID:'.$TXNID);
    $ipn->EmailErrors();
    die;//stop to process
}
$ipn->EmailErrors();

if($ipn->Errors)  exit;

$ipn->RecordIPN();

$status=$ipn->GetVar('status');
//============================
// Switch by transaction status
//============================
switch ($status) {
    //-----------------------------------------------------------------------------
    // processed
    //-----------------------------------------------------------------------------
    case '2':
      $checker->ProcessPayment($ipn);
      break;

    //-----------------------------------------------------------------------------
    // pending
    //-----------------------------------------------------------------------------
    case '0':
      if($checker->TestMode==1)
      $checker->ProcessPayment($ipn);
      break;
    //-----------------------------------------------------------------------------
    // canceled
    //-----------------------------------------------------------------------------
    case '-1':
      $checker->ProcessPayment($ipn);
      break;
    //-----------------------------------------------------------------------------
    // schedualed
    //-----------------------------------------------------------------------------
    case '1':
      $checker->ProcessPayment($ipn);
      break;
} // End switch
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?