Hi All
I have a bit of problem with a project I am working on.
Basically I have built a simple shopping cart and now I need to integrate the payment proccessor (HSBC)
The cart content are stored in a temp table until the user goes to pay, that way we don't get loads of orders in the system where people have just been browsing and didn't pay.
The problem with this is... I need a form on the 'cart confirmation' page that posts the order value, currency and loads of other stuff to HSBC and bounces the customer to the HSBC payment gateway. But at the same time I want to be able to write the order to the database and make a note that the user has clicked on the HSBC button.
Initally I considered posting the form to a processing page, which stores the data and then creates the HSBC form, and posts it automatically via javascript, not ideal.
I also looked at fsocketopen, the problem with this is that it does'nt seem (well not from my inital research) to actually send the browser to the page it is posting to, which is crucial.
I had considered saving the order to the DB when the confirmation page loads, and then perhaps running a cron job to remove unpaid orders after a certain time, to stop the DB getting clogged. But then this would mean I would need to allow for users changing the cart contents, or delivery options, and then have to update the records etc.
Anyone got any ideas of how to achieve what I am after?
Thanks in advance
Aaron
I have a bit of problem with a project I am working on.
Basically I have built a simple shopping cart and now I need to integrate the payment proccessor (HSBC)
The cart content are stored in a temp table until the user goes to pay, that way we don't get loads of orders in the system where people have just been browsing and didn't pay.
The problem with this is... I need a form on the 'cart confirmation' page that posts the order value, currency and loads of other stuff to HSBC and bounces the customer to the HSBC payment gateway. But at the same time I want to be able to write the order to the database and make a note that the user has clicked on the HSBC button.
Initally I considered posting the form to a processing page, which stores the data and then creates the HSBC form, and posts it automatically via javascript, not ideal.
I also looked at fsocketopen, the problem with this is that it does'nt seem (well not from my inital research) to actually send the browser to the page it is posting to, which is crucial.
I had considered saving the order to the DB when the confirmation page loads, and then perhaps running a cron job to remove unpaid orders after a certain time, to stop the DB getting clogged. But then this would mean I would need to allow for users changing the cart contents, or delivery options, and then have to update the records etc.
Anyone got any ideas of how to achieve what I am after?
Thanks in advance
Aaron