Preview: payment.php
Size: 3.73 KB
//home/justbyquicklly-old/public_html/js/payment.php
<?php
include("wfcart.php");
include("include/config.php");
include("include/functions.php");
include("include/sessionmsg.php");
//payment mode= $_SESSION['payment_mode']
//Total Amount= $_SESSION['amount_to_pay']
//order id=$_SESSION['value_order_id']
//Cart Total (without tax)=$_SESSION['cart_value']
//Cart Total (with tax)=$_SESSION['netamt']
//total tax=$_SESSION['net_tax']
//store value after deduction of our comission =$_SESSION['store_value']
//braintree Charge = $_SESSION['braintree_charge']=($_SESSION['amount_to_pay']*2.99)/100;
//Our commision=$_SESSION['myvalue365_commission']
//store offer value(10 for above 30)= $_SESSION['store_offer']
//myvalue365 commission(del charge+braintree commission+4%) = $mv365_comm=$_SESSION['myvalue365_commission']+$_SESSION['braintree_charge']+$_SESSION['delivery_charges']
if($_SESSION['delivery_type']=='Pick'){
$_SESSION['delivery_charges']='0.00';
}
$_SESSION['braintree_charge']=($_SESSION['amount_to_pay']*2.99)/100;
if($_SESSION['cart_value']>30){
$_SESSION['store_offer']=10;
} else {
$_SESSION['store_offer']=0;
}
$mv365_comm=$_SESSION['myvalue365_commission']+$_SESSION['braintree_charge']+$_SESSION['delivery_charges']+$_SESSION['store_offer'];
$_SESSION['mv365_com']=$mv365_comm;
$_SESSION['store_value']=$_SESSION['amount_to_pay']-$mv365_comm;
$cart =& $_SESSION['cart'];
if(!is_object($cart)) $cart = new wfCart();
if($_SESSION['value_user_id']==''){
header("location:login.php?redirect=basket.php");
exit();
}
require_once('braintree/final/braintree/lib/Braintree.php');
Braintree_Configuration::environment('production');
Braintree_Configuration::merchantId('85f4dtcxzp6p924q');
Braintree_Configuration::publicKey('3hw5mfz536gzn4jc');
Braintree_Configuration::privateKey('47f67be7bf627608c012b98a0b8b30d1');
/*
// SANDBOX ACCOUNT DETAILS
Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('d68m73wzrttmy8t9');
Braintree_Configuration::publicKey('h7c2bm97b72bm9fd');
Braintree_Configuration::privateKey('67cf79121710d11dfe308c95c8bb3987');
*/
/*
echo "<pre>";
print_r($_SESSION);
die();
*/
$btClientToken = Braintree_ClientToken::generate();
?>
<html>
<head>
<script src="jquery_popup.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src='https://js.braintreegateway.com/v2/braintree.js'></script>
<script>
braintree.setup(
'<?php echo $btClientToken; ?>',
'dropin', {
container: 'braintree'
});
</script>
</head>
<?
if($_GET['error']==TRUE)
{
echo "Error in Payment Processing, please try one more time.";
}
?>
<a href="https://www.braintreegateway.com/merchants/85f4dtcxzp6p924q/verified" target="_blank">
<img src="https://s3.amazonaws.com/braintree-badges/braintree-badge-wide-dark.png" width="280px" height ="44px" border="0"/>
</a>
<div style="border:1px solid #ddd">
<form id="checkout" method="post" action="results.php">
<p>
<img src="images/paycard.png"> <span style="font-family:Arial, Helvetica, sans-serif;">Pay with card</span> <span style="float:right"><img src="images/cards.PNG"></span>
</p>
<p><div id="braintree"></div></p>
<p align="center"><br><input type="submit" value="Pay" name="pay_amount" style="height:40px; width:150px; font-size:20px; color:#fff; background:rgba(0,153,204,1); border:1px solid rgba(0,153,204,1); border-radius:4px"></p>
</form>
</div>
Directory Contents
Dirs: 1 × Files: 76