close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

when to save order details to database

Thread begun 11/03/2010 2:27 am by esmond192961 | Last modified 12/03/2010 12:36 pm by Jason Byrnes | 2749 views | 5 replies |

esmond192961

when to save order details to database

I have ecart working OK, but would like to add the information to the database after the payment has been processed. As standard, the data is added to the database when you hit the chechout button on the checkout page, which is before the payment has been processed.
This can result with orders in the database which have not been paid for if the user does not complete the process.
Is there a way of changing the timing of the data going into the databse so that this happens after the payment process has been sucessfully completed

Sign in to reply to this post

Jason ByrnesWebAssist

This is the problem with using a remote checkout method like paypal payments standard.

Since the payments are not processed real time, there are some extra steps that need to be made.

the order should be stored to the database on going from checkout to confirm, but you should have a column in the order table for orderStatus and this should get set to pending.

You then need to configure your paypal account to make an IPN post on transaction completion. and configure the IPN page to update the order status in the database based on the IPN information.

see this page for details on IPN.



another alternative is to use PayPal Express Checkout, this is also a Free Service from PayPal, but has the advantage of processing transactions in real time.

Sign in to reply to this post

kingston.andrew401728

No orderStatus in Database

I'm having a similar problem but I don't have an orderStatus column in my database at all which was created using the the checkout wizard.

Even if it was there anyway Paypal doesn't currently redirect back to my site so I can't see how it would be updated. I have seen that I can put in a return address on the confirm.php page but I don't know what url to use. Also I have seen the auto return option in my paypal profile but again don't know what url to insert. Even if I knew the url though - which one of these options should I use?

Also you mention Paypal Express Checkout here but how do you actually set that up. I don't see it mentioned anywhere in the checkout wizard..

Thanks,
Andrew.

Sign in to reply to this post

Jason ByrnesWebAssist

If you do not have an order status column in the orders table, you will need to add one.

the return address to add in the confirm page is the full URL to the checkout success page:
checkout_success.php


The order status wont be updated by the checkout success page though.


the page that will be used to update the order status is a page you will create but the customer will never see, it will be created to accept the paypal IPN post and update the order details.

The wizard does not give the option to configure express checkout by itself, but express checkout is configured if you select to use paypal payments pro.


You can set the checkout wizard to create payoa payments pro pages, then delete the checkout form added to the checkout page and only use the express checkout portion.

Sign in to reply to this post

kingston.andrew401728

Thank you for your quick reply Jason.

That's fine about the checkout_success.php. Can you give me some more info about what I need to put in the additional page though and at what point it loads. Also will that same page clear the cart and the session as at the moment the cart still contains the products that were just purchased and if I process another transaction the original order gets overwritten in the Orders table.

I thought setting up paypal with ecart was going to be easy but it seems to be far from it. I'm sorry to be bothering you with so many questions but if there are any other posts or documentation you can point me to it would be much appreciated.

By the way I don't think I will use express checkout because I want people to be able to avail of the option to checkout without having a paypal account.

Sign in to reply to this post

Jason ByrnesWebAssist

you should view the paypal documentation for ipn.
ipn

There are also many other threads on IPN in this forum if you use the search.


There is no telling when the ipn post will take place. when the customer is transferred to the checkout success page, the transaction is placed in a queue to be processed with the creadit card company. It can take 2 seconds, or 2 days for the transaction to be processed.

When it id finally processed, the results are posted to the IPN page.

Express checkout can still take the account optional setting.

However, settings for paypal standard like return URL make the account optional setting not function correctly in express checkout.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...