Solved

How to transfer order info to payment gateway interface in php?

Posted on 2012-04-10
7
287 Views
Last Modified: 2012-05-15
Now, I have following e-commece application scenario:
1. I have one web site designed for selling one specific software product;
2. There is a form in the page which is used for input contact email, mobile,addr,quantities information;
3.If people are intersted in the product, he will input above information and click submit;
4.The order will be printed on the screen with another button named:pay for this order;
5.After that, the order information including money number, order id will be transfered to the payment gateway(Third party, alipay in china, similar to paypal)in a formatted manner;
6. The alipay handle the payment and will notify my site.
I have couples of questions on above steps:
In the step 5. how can I "store" step 3 inputed information?
How can I transfer that to alipay(paypal)?Can you give more alternative solutions to address this requirement?
Can you give a detail technical description on those steps what happened during those steps?
Thanks!
0
Comment
Question by:matiascx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 

Author Comment

by:matiascx
ID: 37828476
To address above order-checkout process, maybe two alternatives, with mysql and without mysql, can anyone kindly give explaination how to implement if with mysql or without mysql?

Thanks!
0
 

Author Comment

by:matiascx
ID: 37828530
Please be aware that the customer will not be asked to login in to the website which is selling software product.
0
 

Author Comment

by:matiascx
ID: 37828574
I have found one page: http://www.php-shopping-cart-tutorial.com/paypal-integration.htm describing about integrating shopping cart with paypal. In the code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="POST">

To pay with PayPal now please click on the PayPal icon below:

<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="your@paypal.email">
<input type="hidden" name="item_name" value="Order #{$order_id}">
<input type="hidden" name="amount" value="{$order_amount}">
<input type="hidden" name="currency_code" value="{$currency_iso_3}">
<input type="image" name="submit" src="http://images.paypal.com/images/x-click-but01.gif" alt="Pay with PayPal">

</form>

My concern is How shopping cart store and retrieve and transfer the information of $order_id,$order_ammount information?

Any comments are welcome!
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 13

Expert Comment

by:joomla_php
ID: 37831059
Generally your form will submit the order amount by post; the currency is hard coded; the order id is retrieved from the database (next highest one from current highest order id). This is received in a $_POST. An easier way to is to create PayPal or authorize.net pre-configured buttons. Then you don't need to write code.
0
 

Author Comment

by:matiascx
ID: 37831708
Hi,joomla_php,
"
the order id is retrieved from the database
"
As I say, the user will not login into the e-commerce system, how the code knows which order id should be retrieved from database??

Assuming many concurrent users are checking out, how to assure the orderid was right?

If there was no database allowed(To simplify program), is it possible to implement the above scenario?

Thanks!
0
 
LVL 13

Accepted Solution

by:
joomla_php earned 500 total points
ID: 37833321
The order id has to be unique. Usually it's the last order number plus 1. Ideally you lock the order number table while retrieving the highest number, create your order number based on the result, and then unlock the table. Another process requesting the same info (highest order number) has to wait until your transaction is complete. Their result will then be your order number that you inserted into the table. The scenario is something like:

lock order table
get maximum order id from order table
new order id = add one to maximum order id
insert empty order with new order id
unlock order table

As long as you can generate a unique value you can do it without a database. You could do it with a simple order number file that contains a number. A random unique value would not be very human-friendly.
0
 

Author Comment

by:matiascx
ID: 37877944
I found the easy solution with session technology.
Will the solution impact the server performance?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime is disastrous for companies and can lead to major hits on a brand, reputation, an…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question