Reputation: 1
well iam using payeezy as a payment gateway integration through a single page php script.below is my code
1)index.html
<html>
<body background="skyblue">
<h1 style="text-align:center">User Payment Page</h1>
<br>
<form action="Samplegge4payment.php" method="post">
<table align="center" border='1'>
<!--<th>Enter Product Description</th>--><th>Enter Amount(USD)</th>
<!--<TR><TD><input type="text" name="x_desc"/></TD>-->
<TD><input name="x_amount" value="" type="text"></TD></TR>
<TR>
<TD colspan=3><center><input type="submit" value="Pay Now"></center> </TD>
</TR>
</TABLE>
</form>
</body>
</html>
2)Samplegge4payment.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
Payment Pages: Sample PHP Payment Form
</title>
<style type="text/css">
label {
display: block;
margin: 5px 0px;
color: #AAA;
}
input {
display: block;
}
input[type=submit] {
margin-top: 20px;
}
</style>
</head>
<body>
<h1>Processing Please Wait...</h1>
<form action="https://demo.globalgatewaye4.firstdata.com/payment" method="POST" name="myForm" id="myForm">
<!--<form action="https://checkout.globalgatewaye4.firstdata.com/payment" method="POST" name="myForm" id="myForm">-->
<?php
$x_login = "HCO-DEMO-202"; // Take from Payment Page ID in Payment Pages interface
$transaction_key = "0ZFNA2QayjNbeiiHKulT"; // Take from Payment Pages configuration interface
//$x_relay_response="T5ZvGEJwQwQdtIZmNgCo";
//$x_desc=$_POST['x_desc'];
$x_amount = $_POST["x_amount"];
$x_currency_code = "USD"; // Needs to agree with the currency of the payment page
srand(time()); // initialize random generator for x_fp_sequence
$x_fp_sequence = rand(1000, 100000) + 123456;
$x_fp_timestamp = time(); // needs to be in UTC. Make sure webserver produces UTC
// The values that contribute to x_fp_hash
$hmac_data = $x_login . "^" . $x_fp_sequence . "^" . $x_fp_timestamp . "^" . $x_amount . "^" . $x_currency_code;
$x_fp_hash = hash_hmac('MD5', $hmac_data, $transaction_key);
echo ('<input name="x_login" value="' . $x_login . '" type="hidden">' );
echo ('<input name="x_amount" value="' . $x_amount . '" type="hidden">' );
//echo ('<input name="x_desc" value="' . $x_desc . '" type="hidden">' );
echo ('<input name="x_fp_sequence" value="' . $x_fp_sequence . '" type="hidden">' );
echo ('<input name="x_fp_timestamp" value="' . $x_fp_timestamp . '" type="hidden">' );
echo ('<input name="x_fp_hash" value="' . $x_fp_hash . '" size="50" type="hidden">' );
echo ('<input name="x_currency_code" value="' . $x_currency_code . '" type="hidden">');
//create parameters input in html
foreach ($_POST as $a => $b) {
echo "<input type='hidden' name='".htmlentities($a)."' value='".htmlentities($b)."'>";
}
?>
<input type="hidden" name="x_show_form" value="PAYMENT_FORM"/>
</form>
<script type='text/javascript'>document.myForm.submit();</script>
</body>
</html>
now iam getting below page after presisng submit button
Its fine as its showing only amount and processing succesfully.
but issue is i want a php script having product name,description,quantity,id & price and which hsould reflect same on payment processing page.
I know i have to customize some data in my demo payeeze account but dont kno which one and how to see the changes along with product descriptio,quantity,price,id and amount.
can anyone help me please?
Upvotes: 0
Views: 356