<?php

session_start();



$amount = $_POST['amount']; // the amount entered in the entry form

$pay_currency = $_POST['currency']; // the currency in which the payment was made

$txn_id = $_POST['mb_transaction_id'];



$scustom = explode('##',$_POST['trans_id']); 


$trn_id=$scustom[0];
$typeofpay=$scustom[1];
$user_id=$scustom[2];
$plan_id=$scustom[3];
$recycle=$scustom[4];
$_SESSION['plan_id']=$plan_id;
$_SESSION['user_id']=$user_id;


$_SESSION['typeofpay'] = $typeofpay;

if ($_POST['status'] == 2) // payment completed

{

$checkpay="yes";

$_SESSION['pay_currency']=$pay_currency;
$_SESSION['amount']=$amount;
$_SESSION['checkpay'] = $checkpay;
$_SESSION['txn_id'] = $txn_id;
$_SESSION['trn_id'] = $trn_id;

echo '<meta http-equiv="refresh" content="0; url=redirections.php?typeofpay='.$typeofpay.'">';

exit();

}

if ($_POST['status'] != 2)

{

$checkpay="no";

$_SESSION['pay_currency']=$pay_currency;
$_SESSION['amount']=$amount;
$_SESSION['checkpay'] = $checkpay;
$_SESSION['txn_id'] = $txn_id;
$_SESSION['trn_id'] = $trn_id;

echo '<meta http-equiv="refresh" content="0; url=redirections.php?typeofpay='.$typeofpay.'">';

exit();

}

?>