dongxianshuai8927 2011-09-17 13:30
浏览 99
已采纳

在电子商务确认订单页面上处理后端数据的常见做法是什么?

I'm seeking some guidance from people with experience in building ecommerce sites. This is actually my first time integrating with a payment gateway.

My implementation is actually a very basic booking system, where user places selects a date and number of tickets to book, clicks checkout and comes to a order confirmation screen, and then upon clicking submit again, user is brought to 3rd party payment gateway.

The 3rd party payment gateway url expects a post submission, containing a few mandatory fields for their api, one of which is a orderID to identify the order.

This is what I'm doing:

  1. Unique order is generated when the ticket booking page is loaded.

  2. User chooses what date he want, # of tickets, and clicks submit.

  3. Data is validated, and then saved to a bookings table in db, while the user is brought to the confirmation page, presenting him/her with the details they have chosen and the price.

  4. User clicks checkout, and the form is submitted to the 3rd party payment gateway url, user is brought to their page as well to complete payment.

  5. Payment is completed, user is brought to our success page, payment gateway also posts details of transaction to a url of our choice which captures the transaction details, and saves it into a orders database.

So is that feasible ? My questions are:

  1. Should unique order ID be generated as soon as ticket booking page is loaded ?

  2. Should I have a booking database that saves bookings on the confirmation page ? What is user never clicks submit, then i'd eventually have a long list of records.. of course we could create some functionality to clean up the table, but is this common practice ?

  3. Should I have a temporary booking database as mentioned above, as well as a completed transaction database that only captures transaction details from the payment gateway ? (Regardless of successful/failed)

  • 写回答

1条回答 默认 最新

  • dsgrs26202 2011-09-17 13:46
    关注

    Q1. Should unique order ID be generated as soon as ticket booking page is loaded ?

    Ans: No, you should not do it at the time of load. Rather, should do it when the final submit is made for the 3rd Party payment gateway.

    Q2. Should I have a booking database that saves bookings on the confirmation page ? What is user never clicks submit, then i'd eventually have a long list of records.. of course we could create some functionality to clean up the table, but is this common practice ?

    Ans: Submit the form to your php script and make entry in the database only after submit is clicked. Then you can submit the form to the 3rd party from your php script once the enty has been made into your database.

    Q3. Should I have a temporary booking database as mentioned above, as well as a completed transaction database that only captures transaction details from the payment gateway ? (Regardless of successful/failed)

    Ans: Not required if followed what mentioned in answer for q2 above.

    Hope this helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图