Please help me with my eCommerce Website

Here’s the problem:

PayPal Payout Problem

  1. My problem is on the page where Members Activation is being paid using the website custom currency which is Peso, where 45 Pesos equals to $1.

  2. The membership fee is 50 Pesos or $1.06 USD. The page “fees.php” shows correct Peso amount (50 Pesos) with $1.06 USD as equivalent in dollars.

  3. When clicked the checkout, it proceeds to the page “process_payment.php”, then proceeds to PayPal page

  4. The problem is that it does not convert to the correct $1.06 amount, but shows $50 on the PayPal page which is wrong.

*** The Product page, where customers makes a purchase, there’s no problem because PayPal converts the money correctly to USD amount. I believe there’s something wrong with the “process_payment.php” page but I cannot figure it out.

[php]Website is studio23salons.com[/php]

[php]Download link for the scripts is studio23salons.com/issuewithcurrencyonpaypal.zip[/php]

Well, if you are using PayPal’s own cart system, money conversions are easy to do.
They have a hidden field that you add to your cart system and they handle all of the
conversions for you.

Not sure how it all works. But, here is the link to their site where it explains about
the hidden field. I suspect this is really a Paypal question, not a programming issue.

Check out their page and if you can’t figure it out, let us know. Sorry if this didn’t help enough.

https://www.paypal.com/cgi-bin/webscr?cmd=p/sell/mc/mc_wa-outside

Let me post the Php Codes… I was trying to post all 3 files in one page thats why the system is not accepting it…

Here’s the first one.

fee.php

[php]<?php
require ‘includes/master.inc.php’;
require_once ‘includes/vlib/vlibTemplate.php’;
$Auth->requireUser(‘fee.php’);
$tmpl = new vlibTemplate(‘tmpl/pay_user.htm’);
$db = Database::getDatabase(); // DB conenction
$tmpl->setvar(‘siteurl’, $Config->siteurl);
$tmpl->setvar(‘page_title’, $Config->sitename .’ : ‘.$tmpl->get_lstring(‘PAY FEE’));
$username = $_SESSION[‘m_user’][‘username’];
$frm = $_POST;
$to = adminemailid();
$page_content = “”;
$sitecurrency = $Config->currencysymbol;
$bank_enabled = $db->getValue(“SELECT if(enabled>0,1,0) FROM module where name=‘bank’ and type=‘payment’”);
if(isset($frm) && isset($frm[“send_msg”]) && $frm[“send_msg”] == 1){
$msgtext = “Date: “.$frm[‘paid_date’].”/”.$frm[‘paid_month’]."/".$frm[‘paid_year’]."

“.$tmpl->get_lstring(‘AMOUNT’).”: “.$frm[‘paid_amount’].”

“.$tmpl->get_lstring(‘TRANSFERRED TO’).”: “.$frm[‘paid_bank’].”

“.$tmpl->get_lstring(‘TRANSFERRED FROM BANK’).”: “.$frm[‘branchname’].”

“.$tmpl->get_lstring(‘BRANCH’).”: “.$frm[‘branchdistrict’].”

“.$tmpl->get_lstring(‘STATE’).”: “.$frm[‘branchstate’].”

“.$tmpl->get_lstring(‘NOTES’).”: “.nl2br($frm[“message”]).”
";
$db->query("insert into message(sent_time,text,sender,receiver,subject) values(’".time()."’,’$msgtext’,’".$_SESSION[‘m_user’][‘id’]."’,‘1’,’(Paid Fees)’)");
$page_content.="<span class=“success”>".$tmpl->get_lstring(‘THANK YOU FOR THE PAYMENT DETAILS’)."!


";
}
$mem_fees = get_plan_fee($_SESSION[‘m_user’][‘plan’]);
$page_content.="<span style=“font-size:140%;”>".$tmpl->get_lstring(‘FEE AMOUNT’).": $sitecurrency$mem_fees

".$tmpl->get_lstring('PAYMENT OPTIONS').""; $amount = round($mem_fees / $Config->currencyrate , 2); $amount_orig = $amount; $_SESSION['fee_amt']=$mem_fees; //$page_content.="".$tmpl->get_lstring('PAY BY CREDIT OR DEBIT CARD').""; /*$page_content .= "siteurl."/images/account_balance.jpg\" alt=\"eWallet\" style=\"width:130px; padding:10px;\" />";*/ $res=$db->getRows("select * from module where type='payment' and enabled ='1' order by `order` asc"); foreach($res as $row) { if($row['name']=='bank') { if(file_exists(DOC_ROOT."/images/logo/".$row['name'].".jpg")) { $page_content.="&nbsp"; } else { $page_content=""; } } else { $file=get_module_config($row['name'],$row['name'].'_logo'); if($file) { if(file_exists(DOC_ROOT."/images/logo/".$file)) { $page_content.="".$row[&nbsp"; } else { $page_content.="   ".$row['name']."   "; } } else { $page_content.=""; } } } $page_content.="
get_lstring('CONTINUE')." >>\" onclick=\"document.location.href='process_payment.php?type=".$g_payment_member_join."'\">

"; if($bank_enabled == 1) { /*$page_content.=$tmpl->get_lstring('BANK TRANS OR DEPOSIT')."imageurl."/bank_transf.jpg\">
".$tmpl->get_lstring('TRANS OR DEPOSIT FEES AMT TO BANK ACNT').".


";*/ $bankoptions = ""; $res = $db->getRows("select * from settings_bank"); //while($row = db_fetch_array($res)){ foreach($res as $row){ $bankoptions .= "". $row['bank'].""; /*$page_content .= "
". $row['bank']."
"; if($row['bankimage']) $page_content .= "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->get_lstring('ALREADY MADE PAYMENT SEND DETAILS').":
* ".$tmpl->get_lstring('PAYMENT DATE').": ".get_day_options(date('d')) ."" . get_month_options(date('m')) . "" . get_year_options3() . "
* ".$tmpl->get_lstring('AMOUNT').":
* ".$tmpl->get_lstring('TRANSFERRED TO').": $bankoptions Other
".$tmpl->get_lstring('TRANSFERRED FROM BANK').":
".$tmpl->get_lstring('BANK NAME').":
".$tmpl->get_lstring('CITY').":
".$tmpl->get_lstring('STATE REGION').":
".$tmpl->get_lstring('MESSAGE').":
                                                   "; } $tmpl->setvar('pagecontent',$page_content); $tmpl->pparse(); ?>[/php]

Im going to split the payment_process.php because it is more than 20,000 characters.

Here’s the first part of payment_process.php:

[php]<?php
$PAGE = ‘store’;
require ‘includes/master.inc.php’;
require_once ‘includes/vlib/vlibTemplate.php’;
require_once ‘includes/vlib/vlibDate.php’;
if($_GET[‘type’]==4)
{}
else{
$Auth->requireUser(‘process_payment.php’);}
$tmpl = new vlibTemplate(‘tmpl/process_payment.htm’);
$tmpl->setvar(‘siteurl’, $Config->siteurl);
$tmpl->setvar(‘page_title’, $Config->title . " :".$tmpl->get_lstring(‘CHECKOUT’));
$db = Database::getDatabase();
$tmpl->setvar(‘debug’,’’);
$tmpl->setvar(‘disable’,’’);
$err=0;
$tmpl->setvar(‘hide_account’,0);
if(!isset($_GET[‘type’]))
{
redirect(‘home.php’);
}
else
{
if(($_GET[‘type’]==1) || ($_GET[‘type’]==4) || ($_GET[‘type’]==6))
{
$tmpl->setvar(‘hide_account’,1);
}
}
$this_script = $Config->siteurl."/call_back.php";
$payza_recurring_script = $Config->siteurl."/payzacall_back.php";
if(($_GET[‘type’]==1) || ($_GET[‘type’]==2) || ($_GET[‘type’]==3) || ($_GET[‘type’]==6))
{
$username= $_SESSION[‘un’];
}
else
{
$username= “”;
}
$timestamp = date(‘Y-m-d H:i:s’);
$balance=get_member_balance($username);
$amount = get_usd_amount($_SESSION[‘carttotal’]+get_config(‘shipping_charge’));
$frm = $_POST;
$to = adminemailid();
$page_content = “”;
if(isset($_SESSION[‘carttotal’]))
{
$amount = get_usd_amount($_SESSION[‘carttotal’]+get_config(‘shipping_charge’));
$cart_amount=$_SESSION[‘carttotal’]+get_config(‘shipping_charge’);
$tmpl->setvar(‘total_in_local’,$_SESSION[‘carttotal’]+get_config(‘shipping_charge’));
$tmpl->setvar(‘usd_total’,$amount);
}
elseif(isset($_SESSION[‘fee_amt’]))
{
$amount = get_usd_amount($_SESSION[‘fee_amt’]);
$fee=$_SESSION[‘fee_amt’];
$tmpl->setvar(‘total_in_local’,$_SESSION[‘fee_amt’]);
$tmpl->setvar(‘usd_total’,$amount);
}
$tmpl->setvar(‘hide_content’,0);
if($frm[‘submit’] )
{
$payment=$frm[‘payment’];
if(isset($payment))
{
//Throught E-wallent Balance
if($payment==‘account’)
{
if($balance < $cart_amount)
{
$err=1;
$msg=$tmpl->get_lstring(‘YOU HAVE INSUFFICIENT ACCOUNT BALANCE’);
$tmpl->setvar(‘msg_err’,$msg);
}
else
{
$comment=‘Debited for product purchase’;
$orderid = add_new_order($username,‘account’);
debit_member($username, $cart_amount, $comment, $timestamp);
change_order_status($orderid, ‘paid’, “auto-debited from eWallet balance”, 1);
unset($_SESSION[‘cart’]);
unset($_SESSION[‘carttotal’]);
$tmpl->setvar(‘debug’,"

".$tmpl->get_lstring(‘ORDER COMPLETE’)."!


".$tmpl->get_lstring(‘YOU ACCOUNT IS DEBITED’)." “.$Config->currencysymbol.$cart_amount.”
“.$tmpl->get_lstring(‘VIEW ORDER DETAILS’).”");
$tmpl->setvar(‘ordercomplete’,1);
}
}
else if($payment==‘bank’)
{
$payment_type = $_GET[‘type’];
if($payment_type==1 || $payment_type==2)
{
$res=$db->getRows(“select * from settings_bank”);
$debug ="";
$debug .=“

Thank You!

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);
}
if($payment_type==3)
{
add_new_order($username,‘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);
}
if($payment_type==4)
{
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)[/php]

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 .= “";
if($row[‘bankimage’]) $page_content .= “";
$page_content .= “”;
$page_content .="";
}
$page_content.="

”. $row[‘bank’]."
<img src=”".$Config->siteurl."/images/".$row[‘bankimage’]."" style=‘float:left;margin-right:10px;’>A/c No: “.$row[‘accountnumber’].”
”. htmlspecialchars_decode(stripslashes($row[‘payee’])) . “


";
$tmpl->setvar(‘page_content’,$page_content);
$tmpl->pparse();
?>[/php]

thanks for your reply ErnieAlex… let me check it out…

Well, I read thru all that code and it is just the front-end processing.
It does not show any of the Paypal code. There was no conversion code in it from what I saw.

The code you posted appears to be creating template data to be displayed.
After all of this code, it is passed to another page somewhere that hold the Paypal code.
(Unless I missed it somewhere.)

I went to your site. I created an order with fake information. (It let me, validation is only fair!)
I entered a country which it did not seem to pass on to Paypal. I did not see any Paypal payment
entries on your site until it switched me to the Paypal site. Then, it identified your company as
icgreen something… So, it appears that you are not sending the correct info to the Paypal site.

This is totally a Paypal issue. They have a good support system and lots of info on their forum.
I would suggest looking thru their blog-forum or contacting them directly. It would save time as
we would have to learn your large code to be able to help.

Sorry if this is not helpful. Maybe someone else reading this thread has Paypal experience?

Sponsor our Newsletter | Privacy Policy | Terms of Service