close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Ingredients for Sending Email/Updating Database "before page load"

Thread began 2/01/2010 10:23 am by john42771 | Last modified 2/04/2010 2:02 pm by Jason Byrnes | 1797 views | 5 replies |

john42771

Ingredients for Sending Email/Updating Database "before page load"

I want to wait to post the data into the tables and send email confirmation until the payment has been successful -- the "before page load" trigger of the checkout_success page.
I have left the page redirect BLANK for both of the server behaviors.

What are the active components of this checkout_success page?
What are the rules that need to be followed so this page works correctly?
What bindings, in general, need to be on this page.

This process has been "hit and miss" with me and I end up wasting so much time;
-redoing and redoing -trying things slightly different,
-searching these forums time after time, but never finding a comprehensive solution outlined.

I don't necessarily just want to get my current project working correctly, I want a sort of checklist that I can use each time to make certain that my shopping process is working the way it is supposed to.

Thank you for your help.

Sign in to reply to this post

Jason ByrnesWebAssist

There is no one answer to the question you are asking, it is dependent on the type of checkout process you are creating (Local or Remote) and the gateway you are using.


lets take PayPal as an example.

If you are using Local Chekout:
The PayPal local checkout behavior on the confirm page will automatically transfer the user to the failure page if the transaction fails. If it is successful, the order will be stored and the email sent then the page is directed to the success page.

It is really not necessary to wait till the success page to send the email or store the order in the database since the confirm page will not get to the code to perform those action unless the order is successful.

If you use Remote checkout however, the checkout success page really only means that paypal has agreed to process the transaction.

The transaction is placed in a queue and will be processed on a first come first served basis with the bank. It may be processed in 5 minutes, or as long as 5 day's.

With paypal standard checkout, you need to configure your account to use an IPN page. Once the transaction is processed through the gateway, paypal will post the results through the IPN page. on the IPN -page, you can add the behaviors for sending the email and storing the order in the database.

Sign in to reply to this post

john42771

Type of Checkout Answers

I am using Authorize.net for my gateway with local checkout.
My desired result is the same as you mentioned for PayPal Remote:
"If you use Remote checkout however, the checkout success page really only means that paypal has agreed to process the transaction."

When Authorize.net verifies that the transaction was successful, it sends me to my success page. That is the only time I want an email notification to go out and that's when I want the database to be populated --- NOT before and NOT without verification from Authorize.net.

If there is another way to accomplish this timing of events by only code on the confirm page, please explain.
If not, then please help me understand what the ingredients are for sending email/updating database "before page load".

I want a sort of checklist that I can use each time to make certain that my shopping process is working the way it is supposed to:
-What are the active components of this checkout_success page?
-What are the rules that need to be followed so this page works correctly?
-What bindings, in general, need to be on this page?

Sign in to reply to this post

Jason ByrnesWebAssist

Using a local checkout method, the code for storing the order information and sending the email will only be executed if the transaction is successfull. With a local checkout method the code on the confirm page is processed in this order:


Process transaction through gateway

If Transaction Fail:
redirect to checkout failure page.

The redirect to the failure page causes the confirm page to stop processing.

If it does not redirect, it continues through the confirm page to store the order info in the database and send the email, then redirect to the success page.


There is no need for you to move the code to the success page as it will only occur if the transaction was successful.

Sign in to reply to this post

john42771

My Experience has experienced the opposite

Jason,

Thank you so much for your help so far and for trying to point me in the right direction.

The reason I am even seeking a solution through the checkout_success page, is because I could not get the "store in database" and " send email confirmation" to be triggered correctly to cause that to happen.

Even though we had record of failed attempts from Authorize.net, the same info that was rejected by A.net, was entered in the database, recorded as a sale, and the results were emailed to the customer.

So, although I set the trigger for "any form post" or "current page submit", somewhere it is coded so that it is REALLY triggered when Authorize.net sends the authorization, right?
Where could I see that in the code?
Does this require special custom coding?
What are the correct settings to get this functionality operational?

I really want to understand how to get this right - thanks again,

John

Sign in to reply to this post

Jason ByrnesWebAssist

On rare occasions, the PHP server may continu processing the page after the header function is called to redirect to the failure page

this can be fixed by finding the following code on the confirm page:
else if ("checkout_failure.php" != "") {
header("Location: ". "checkout_failure.php");
}



and adding an exit function:
else if ("checkout_failure.php" != "") {
header("Location: ". "checkout_failure.php");
}

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...