When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered product items details before you do the payment gateway process.
It can be done in the below manner.
On your web site process page, you need to connect with the database and retrieve the products and user details. And then you need to place the payment gateway implementation code in the page with auto post form script written.
So here, we just combine our custom database values with payment gateway implementation script and redirecting to it
It will look like the sample code,
<?
your database process... connecting to the db
and get the details for the payment gateway page
?>
<html>
<head><title>Web Site Title</title></head>
<body>
<form name="frm1" method="post" action="payment_gateway_url.jsp">
<input type=hidden name="Amount" value="">
<input type=hidden name="Order_Id" value="">
<input type=hidden name="Merchant_Id" value="">
<input type=hidden name="WorkingKey" value="">
<input type="hidden" name="billing_cust_name" value="echo value">
<input type="hidden" name="billing_cust_address" value="echo value">
<input type="hidden" name="billing_cust_country" value="echo value">
<input type="hidden" name="billing_cust_tel" value="echo value">
<input type="hidden" name="billing_cust_email" value="echo value">
<input type="hidden" name="billing_cust_notes" value="">
<input type="hidden" name="delivery_cust_name" value="echo value">
<input type="hidden" name="delivery_cust_address" value="echo value">
<input type="hidden" name="delivery_cust_tel" value="echo value">
</form>
<script language="javascript" type="text/javascript">
document.frm1.submit();
</script>
</body>
</html>
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
Select allOpen in new window
Once you auto posted the values with the required fields to the payment gateway page, you will get response from the gateway page.
That's all, now you can verify into your merchant account whether the payment is done or not.
This process helps much to auto post the form field values along with required values to the payment gateway and to keep track the ordered product items details into the database.
Enjoy this tip.
by: samirbhogayta on 2012-03-12 at 20:11:05ID: 45435
You can use the session variables to store the values which you want to pass to another page. like this
session.Contents("Name") = txtName.Text
session.Contents("Address"
and then after you can access this session varibles from another page.
like this
hdName.Text = session.Contents("Name")
hdAddress.Text = session.Contents("Address"