Here is the last part of process_payment.php :
[php] {
add_new_order(0,‘offline’);
unset($_SESSION[‘cart’]);
$res=$db->getRows(“select * from settings_bank”);
$debug ="";
$debug .="
".$tmpl->get_lstring(‘ORDER COMPLETE’)."!
You can transfer or deposit the amount to any of the accounts mentioned below. After making the payment send transaction details with Order ID to support team.
“;
foreach($res as $row){
$debug .=”
".$tmpl->get_lstring(‘BANK’).": “.$row[‘bank’].”
“;
$debug .=”
".$tmpl->get_lstring(‘ACCOUNT NO’).": “.$row[‘accountnumber’].”
“;
$debug .=”
".$tmpl->get_lstring(‘PAYEE’).": “.$row[‘payee’].”
----------------
";
}
$tmpl->setvar(‘debug’,$debug);
$tmpl->setvar(‘ordercomplete’,1);
}
}
elseif($payment==‘cashsense’)
{
$cashsense_form="";
$payment_type = $_GET[‘type’];
if($payment_type==1)
{
$fee_amt=round(($fee + get_module_config(‘cashsense’,‘cashsense_fee_fixed’))/(100/(100 + get_module_config(‘cashsense’,‘cashsense_fee’) )) , 2);
$cashsense_form .=“Cashsense Payment
<input id=‘fxMerchantID’ type=‘hidden’ name=‘fxMerchantID’ value=’”.get_module_config(‘cashsense’,‘cashsense_id’)."’ />
<input id=‘fcusername’ type=‘hidden’ name=‘fcusername’ value=’".get_module_config(‘cashsense’,‘cashsense_username’)."’/>
<input id=‘fcpassword’ type=‘hidden’ name=‘fcpassword’ value=’".get_module_config(‘cashsense’,‘cashsense_pwd’)."’/>
Username: |
<input id=‘fcCustomerName’ type=‘text’ name=‘fcCustomerName’ value=’".$_SESSION[‘m_user’][‘username’]."’ readonly=‘readonly’/> |
|
Email: |
<input id=‘Text1’ type=‘text’ name=‘fcEmailAddress’ value=’".$_SESSION[‘m_user’][‘email’]."’ readonly=‘readonly’/> |
* Amount: |
|
|
";
$tmpl->setvar(‘debug’,$cashsense_form);
$tmpl->setvar(‘ordercomplete’,1);
}
if($payment_type==2)
{
$fee_amt=round(($fee + get_module_config('cashsense','cashsense_fee_fixed'))/(100/(100 + get_module_config('cashsense','cashsense_fee') )) , 2);
$cashsense_form .="<fieldset><legend>Cashsense Payment</legend><form action='https://merchantapi.cashsense.com/MerchantFormPost.aspx' method='post'>
<input id='fxMerchantID' type='hidden' name='fxMerchantID' value='".get_module_config('cashsense','cashsense_id')."' />
<input id='fcusername' type='hidden' name='fcusername' value='".get_module_config('cashsense','cashsense_username')."'/>
<input id='fcpassword' type='hidden' name='fcpassword' value='".get_module_config('cashsense','cashsense_pwd')."'/>
<table border='0' cellpadding='3' cellspacing='3'>
<tr><td><b><span style='color:red;'>*</span> Username: </b></td><td><input id='fcCustomerName' type='text' name='fcCustomerName' value='".$_SESSION['m_user']['username']."' readonly='readonly'/><td></tr>
<tr><td><b><span style='color:red;'>*</span> Email:</b> </td><td><input id='Text1' type='text' name='fcEmailAddress' value='".$_SESSION['m_user']['email']."' readonly='readonly'/></td></tr>
<tr><td><b><span style='color:red;'>*</span> Amount: </b></td><td><input id='fnAmount' type='text' name='fnAmount' value='".$fee_amt."' readonly='readonly'/></td></tr>
<input id='fcMerchantTxnID' type='hidden' name='fcMerchantTxnID' value='".generate_txnid()."'/>
<input id='fxProdID' type='hidden' name='fxProdID' value='0'/>
<input id='fcProductCode' type='hidden' name='fcProductCode' value='' />
<input id='fnProdQty' type='hidden' name='fnProdQty' value='0' />
<input id='fcDescription' type='hidden' name='fcDescription' value='Membership Renewal Fee'/>
<tr><td colspan='2' align='center'><input type='submit' value='submit' class='subbutton button'/></td></tr></table>
</form></fieldset>";
$tmpl->setvar('debug',$cashsense_form);
$tmpl->setvar('ordercomplete',1);
}
if($payment_type==3)
{
$orderid = add_new_order($username,'cashsense');
unset($_SESSION['cart']);
$cartamt=round(($cart_amount + get_module_config('cashsense','cashsense_fee_fixed'))/(100/(100 + get_module_config('cashsense','cashsense_fee') )) , 2);
$cashsense_form .="<fieldset><legend>Cashsense Payment</legend><form action='https://merchantapi.cashsense.com/MerchantFormPost.aspx' method='post'>
<input id='fxMerchantID' type='hidden' name='fxMerchantID' value='".get_module_config('cashsense','cashsense_id')."' />
<input id='fcusername' type='hidden' name='fcusername' value='".get_module_config('cashsense','cashsense_username')."'/>
<input id='fcpassword' type='hidden' name='fcpassword' value='".get_module_config('cashsense','cashsense_pwd')."'/>
<table border='0' cellpadding='3' cellspacing='3'>
<tr><td><b><span style='color:red;'>*</span> Username: </b></td><td><input id='fcCustomerName' type='text' name='fcCustomerName' value='".$_SESSION['m_user']['username']."' readonly='readonly'/><td></tr>
<tr><td><b><span style='color:red;'>*</span> Email:</b> </td><td><input id='Text1' type='text' name='fcEmailAddress' value='".$_SESSION['m_user']['email']."' readonly='readonly'/></td></tr>
<tr><td><b><span style='color:red;'>*</span> Amount: </b></td><td><input id='fnAmount' type='text' name='fnAmount' value='".$cartamt."' readonly='readonly'/></td></tr>
<input id='fcMerchantTxnID' type='hidden' name='fcMerchantTxnID' value='".generate_txnid()."'/>
<input id='fxProdID' type='hidden' name='fxProdID' value='0'/>
<input id='fcProductCode' type='hidden' name='fcProductCode' value='' />
<input id='fnProdQty' type='hidden' name='fnProdQty' value='0' />
<input id='fcDescription' type='hidden' name='fcDescription' value='Membership Product Purchase'/>
<tr><td colspan='2' align='center'><input type='submit' value='submit' class='subbutton button'/></td></tr></table>
</form></fieldset>";
$tmpl->setvar('debug',$cashsense_form);
$tmpl->setvar('ordercomplete',1);
}
if($payment_type==4)
{
$orderid = add_new_order(0,'cashsense');
unset($_SESSION['cart']);
$cartamt=round(($cart_amount + get_module_config('cashsense','cashsense_fee_fixed'))/(100/(100 + get_module_config('cashsense','cashsense_fee') )) , 2);
$cashsense_form .="<fieldset><legend>Cashsense Payment</legend><form action='https://merchantapi.cashsense.com/MerchantFormPost.aspx' method='post'>
<input id='fxMerchantID' type='hidden' name='fxMerchantID' value='".get_module_config('cashsense','cashsense_id')."' />
<input id='fcusername' type='hidden' name='fcusername' value='".get_module_config('cashsense','cashsense_username')."'/>
<input id='fcpassword' type='hidden' name='fcpassword' value='".get_module_config('cashsense','cashsense_pwd')."'/>
<table border='0' cellpadding='3' cellspacing='3'>
<tr><td><b><span style='color:red;'>*</span> Username: </b></td><td><input id='fcCustomerName' type='text' name='fcCustomerName' value='' /><td></tr>
<tr><td><b><span style='color:red;'>*</span> Email:</b> </td><td><input id='Text1' type='text' name='fcEmailAddress' value='' /></td></tr>
<tr><td><b><span style='color:red;'>*</span> Amount: </b></td><td><input id='fnAmount' type='text' name='fnAmount' value='".$cartamt."' readonly='readonly'/></td></tr>
<input id='fcMerchantTxnID' type='hidden' name='fcMerchantTxnID' value='".generate_txnid()."'/>
<input id='fxProdID' type='hidden' name='fxProdID' value='0'/>
<input id='fcProductCode' type='hidden' name='fcProductCode' value='' />
<input id='fnProdQty' type='hidden' name='fnProdQty' value='0' />
<input id='fcDescription' type='hidden' name='fcDescription' value='Guest Product Purchase'/>
<tr><td colspan='2' align='center'><input type='submit' value='submit' class='subbutton button'/></td></tr></table>
</form></fieldset>";
$tmpl->setvar('debug',$cashsense_form);
$tmpl->setvar('ordercomplete',1);
}
}
else
{
require "includes/payment/".$payment.".php";
require "includes/order.php";
require "includes/user.php";
$classname=$payment;
$obj=new $payment();
$ord=new order();
$usr=new userinfo();
$userid = $_SESSION['m_user']['id'];
$username = $_SESSION['m_user']['username'];
$payment_type = $_GET['type'];
if($payment_type==1)
{
if($payment=='paypal_recurring')
{
$item_name="Membership paypal monthly recurring fee";
$custom="userid-".$_SESSION['m_user']['id']."|type-5|mode-paypal_recurring";
$obj->process($item_name,$fee,$custom,$this_script);
$tmpl->setvar('hide_content',1);
}
elseif($payment=='payza_recurring')
{
$item_name="Membership payza monthly recurring fee";
$custom="userid-".$_SESSION['m_user']['id']."|type-5|mode-payza_recurring";
$obj->process($item_name,$fee,$custom,$payza_recurring_script);
$tmpl->setvar('hide_content',1);
}
else
{
$item_name="Membership Fee";
$custom="userid-".$_SESSION['m_user']['id']."|type-".$payment_type."|mode-".$payment;
$obj->process($item_name,$fee,$custom,$this_script);
$tmpl->setvar('hide_content',1);
}
}
if($payment_type==2)
{
if($payment=='paypal_recurring')
{
$item_name="Membership paypal monthly recurring renewal fee";
$custom="userid-".$_SESSION['m_user']['id']."|type-5|mode-paypal_recurring";
$obj->process($item_name,$fee,$custom,$this_script);
$tmpl->setvar('hide_content',1);
}
elseif($payment=='payza_recurring')
{
$item_name="Membership payza monthly recurring renewal fee";
$custom="userid-".$_SESSION['m_user']['id']."|type-5|mode-payza_recurring";
$obj->process($item_name,$fee,$custom,$payza_recurring_script);
$tmpl->setvar('hide_content',1);
}
else
{
$item_name="Membership Renewal Fee";
$custom="userid-".$_SESSION['m_user']['id']."|type-".$payment_type."|mode-".$payment;
$obj->process($item_name,$fee,$custom,$this_script);
$tmpl->setvar('hide_content',1);
}
}
if($payment_type==3)
{
if($payment=='payza'){ $payment_method='alertpay';}
elseif($payment=='liberty_reserve'){$payment_method='lr'; }
elseif($payment=='money_booker'){$payment_method='skrill'; }
else{$payment_method=$payment;}
$item_name="Product Purchase";
$order_id = $ord->add_new_order($_SESSION['m_user']['username'],$payment_method);
$custom="userid-".$_SESSION['m_user']['id']."|type-".$payment_type."|orderid-".$order_id."|mode-".$payment;
$obj->process($item_name,$amount,$custom,$this_script);
unset($_SESSION['cart']);
unset($_SESSION['carttotal']);
$tmpl->setvar('hide_content',1);
}
if($payment_type==4)
{
if($payment=='payza'){ $payment_method='alertpay';}
elseif($payment=='liberty_reserve'){$payment_method='lr'; }
elseif($payment=='money_booker'){$payment_method='skrill'; }
else{$payment_method=$payment;}
$item_name="Guest Product Purchase";
$order_id = $ord->add_new_order(0,$payment_method);
$custom="userid-0|type-".$payment_type."|orderid-".$order_id."|mode-".$payment;
$obj->process($item_name,$amount,$custom,$this_script);
unset($_SESSION['cart']);
unset($_SESSION['carttotal']);
$tmpl->setvar('hide_content',1);
}
if($payment_type==6)
{
$item_name="Membership Plan upgrade";
$custom="userid-".$_SESSION['m_user']['id']."|type-".$payment_type."||mode-".$payment;
$obj->process($item_name,$fee,$custom,$this_script);
$tmpl->setvar('hide_content',1);
}
}
}
else
{
$err=1;
$msg="<b style='color:#F00'>".$tmpl->get_lstring('SELECT ANY PAYMENT OPTION')."</b>";
$tmpl->setvar('debug',$msg);
}
}
if($_GET[‘type’]==6)
{
//Get all Installed payment gateways
$res=$db->getRows(“select * from module
where
type=‘payment’
and enabled =‘1’
and name!=‘paypal_recurring’
and name!=‘payza_recurring’
and name!=‘bank’
order by order
asc”);
}
else
{
//Get all Installed payment gateways
$res=$db->getRows(“select * from module where enabled
=‘1’ and type
=‘payment’ order by order
asc”);
}
$payment_list ="";
if(count($res) >0)
{
$payment_list .=’
’;
$i=1;
foreach($res as $row)
{
if($row[‘name’]==‘bank’)
{
$hide=‘onclick=“return show_details_bank()”’;
if(file_exists(DOC_ROOT."/images/logo/".$row[‘name’].".jpg"))
{
$payment_logo="<img src=‘images/logo/".$row[‘name’].".jpg’ width=‘140px’ />";
}
else
{
$payment_logo="";
}
}
else
{
$hide=‘onclick=“return hide_details();”’;
$file=get_module_config($row[‘name’],$row[‘name’].‘logo’);
if($file)
{
if(file_exists(DOC_ROOT."/images/logo/".$file))
{
$payment_logo="
";
}
else
{
$payment_logo="";
}
}
else
{
$payment_logo="";
}
}
$payment_list .=’
<input type=“radio” name=“payment” value=’.$row[‘name’].’ ‘.$hide.’>
|
‘.ucwords(str_replace(’’,’ ‘,$row[‘name’])).’
'.$payment_logo;
if($row['name']=='cashsense')
{
$payment_list .='<br />(Charges :P'.sprintf("%1\$.2f",get_module_config($row['name'],$row['name'].'_fee_fixed')).'+'.sprintf("%1\$.2f",get_module_config($row['name'],$row['name'].'_fee')).'%)';
}
elseif($row['name']!=='bank')
{
$payment_list .='<br />(Charges :$'.sprintf("%1\$.2f",get_module_config($row['name'],$row['name'].'_fee_fixed')).'+'.sprintf("%1\$.2f",get_module_config($row['name'],$row['name'].'_fee')).'%)';
}
$payment_list .='</td>';
if (($i % 2) == 0)
{
$payment_list .='</tr><tr>';
}
else
{
$payment_list .='';
}
$i++;
}
$payment_list .='<tr>';
}
$tmpl->setvar(‘payment_list’,$payment_list);
$account_msg="".$tmpl->get_lstring(‘ACCOUNT DETAILS’)."
".$tmpl->get_lstring(‘YOUR ACCOUNT BALANCE’).": |
“.str_replace(‘Â’,’’,$Config->currencysymbol).”".$balance." |
";
$tmpl->setvar(‘account_msg’,$account_msg);
$bank_details=$db->getRow(“select * from settings_bank”);
$page_content.=$tmpl->get_lstring(‘CHECKOUT_A’)."
";
$bankoptions = “”;
$res = $db->getRows(“select * from settings_bank”);
foreach($res as $row)
{
$page_content .="
";
$bankoptions .= “<option value=”".$row[‘bank’]."">". $row[‘bank’]."";
$page_content .= “
”. $row[‘bank’]."
| ";
if($row[‘bankimage’]) $page_content .= “<img src=”".$Config->siteurl."/images/".$row[‘bankimage’]."" style=‘float:left;margin-right:10px;’> | ";
$page_content .= “A/c No: “.$row[‘accountnumber’].” ”. htmlspecialchars_decode(stripslashes($row[‘payee’])) . “
| ”;
$page_content .=" ";
}
$page_content.=" ";
$tmpl->setvar(‘page_content’,$page_content);
$tmpl->pparse();
?>[/php] |