close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

PayPal Standard IPN Response Record Update and Email Problem

Thread began 12/11/2009 4:46 pm by Kevin373660 | Last modified 12/21/2009 2:29 pm by Eric Mittman | 2946 views | 18 replies |

Kevin373660

PayPal Standard IPN Response Record Update and Email Problem

I ran a live test with PayPal Standard and the results are close. The IPN response updates the correct record in the orders table with the PaymentConfirmation number. However, I need help on the following, please:

1. OrderStatus – What is the type of response that is sent back from PP? The table is set to accept a numeric response. Are they sending back a string value and what can it be? I have been looking for days to find this out in their documentation. If it is a string then at what point in the code can I set it to a numeric value?

2. ShipTrackingID – Did not get a value from my Security Assist Random Password binding. I am not sure if I can add it directly to the record update code block through the update record server behaviour.

3. Email Order Confirmation To Customer – This was not sent. Does it need to go before the record update code? Or is there another problem that I am missing?

Platform: eCart 4.5.2, Universal Email, MySQL, php

Sign in to reply to this post

Kevin373660

I have fixed everything in my original thread except: Email Order Confirmation Recipt To Customer using Universal Email

My IPN page updates to the db correctly but it does not send a confirmation email to customer. I have tried a number of ideas including: changing the page encoding, cc to a fixed/defined email address, and moving the code block above the update code (which stoped the update).

Please take a look and let me know what I am overlooking. Most resent files are attached. The PayPal part has been tested and it works fine. Please & thank you.

Sign in to reply to this post

Eric Mittman

I have checked out the email code on the page and it seems to be ok to me. The code should be running when the other code on the page is. As a test of this you can create a new blank page and just copy the Universal Email code from this page onto the new one. You could alter the trigger to be before page loads on this test page so that you have an easier test scenario. Also, make sure that you have this test page in the same directory so that you do not have to alter any of the include paths. The email should at least be sent to the hard coded value you have there. Please perform this test and let us know what your result is.

Sign in to reply to this post

Kevin373660

Thanks Eric, that was a good email debuging sugestion. There were 3 Parse error: syntax errors in the WAUE_IPN.php email code. Because it was an ipn I would not see the errors and the page would fail.

<a href=\\"https://www.website.com/webpage.php\\">parent account</a>

My links should have been without the extra \, like this:

<a href=\"https://www.website.com/webpage.php\">Click Here</a>


So now the email is comming through to the customer's email (and mine temp. durring testing) as it should.

However, the next problem... the cart values for the item level: product SKU and the two ACTIVATION CODES are NOT BEING SENT IN THE EMAIL. As you will note in the code I generate (DA Random Password behavior) and update the db that Shipping Tracking number on the IPN page. In this case I need the values sepecific to each product item in the cart. The SKU is not important as the product name is sufficient, but the two Access Codes for the pass activation is very important. What is the best way to handle passing these values through PayPal? And where and how would I add this in the code at this point? Or does it need to go through pp?

Sign in to reply to this post

Eric Mittman

Do you have the activation codes in the cart when the user is checking out? If the values are available to you before the user checks out then you can get them in the cart with these input fields on the confirm page:

php:
<input type="hidden" name="on0_<?php echo $eCart1_Index+1?>" id="on0_<?php echo $eCart1_Index+1?>" value="" />
<input type="hidden" name="os0_<?php echo $eCart1_Index+1?>" id="os0_<?php echo $eCart1_Index+1?>" value="" />
<input type="hidden" name="on1_<?php echo $eCart1_Index+1?>" id="on1_<?php echo $eCart1_Index+1?>" value="" />
<input type="hidden" name="os1_<?php echo $eCart1_Index+1?>" id="os1_<?php echo $eCart1_Index+1?>" value="" />



These fields constitute a name value pair, so for the first one you can set it's value to 'access code 1' and for the os0 you would set the value to the access code 1 value. You could do the same thing for the next access code, set the value of on1 to be 'access code 2' and for os1 you would set the value to the second access code. Then on your IPN page you will look for these fields to set the values for your update. You should be able to make a test post with these values to see how your page reacts to them.

Sign in to reply to this post

Kevin373660

Cool! The access codes from the cart are being set through paypal and show up on their recipt. Now I need them to show up in our order acknowledgement email.

I think that would be through the IPN page, and pick up the value(s) from the Checkout Form Responce (paypal) bindings? And bind to the correct cart value for the eCart Get Contents From Form server behavior? I have columns in my cart for both the access codes and the detail options. Later I will need to use these options for other products and will need to set up some code to assisgn depending on if they are required or not.

Will it matter on the IPN page which ( $ATC_ActivationCode1 or $ATC_DetailOPtion1 ) I put the value binding? Is it just beging used to collect the info from the pp responce to display in the email? or will may it affect the pp values for the items in the order? And which pp binding: option_name1/2 or option_selection1/2?? Thank you for your help.

Sign in to reply to this post

Eric Mittman

Like you have noted you will just need to bind these to their corresponding column in the cart on your IPN page. How you make this association should not be critical as it will just be what the user sees in their email and will not have any effect on the values that are stored in the db if you are just doing a regular update.

As far as how to associate these values they should come back the same way you set them up on your confirm page, so you can use that as the key and just bind the values from the PayPal post back to their appropriate cart column.

Sign in to reply to this post

Kevin373660

Thanks Eric. I will give that a go. I am close to putting the shopping live. Your assistance is apprciated. -KW

Sign in to reply to this post

Eric Mittman

Let us know if you have any other issues and we will help you with whatever we can.

Sign in to reply to this post

Kevin373660

I cannot get the value for the Access Code named pair into the customers email. I have worked on this most of the night and have tried everything that I can read about this.

This is the clearest example that I found:

PayPal Button:

<input type="hidden" name="on0" value="CustomID">
<input type="hidden" name="os0" value="<?=$userdata['user_id']?>">

IPN Script:

$customid = $_POST['option_selection1'];

I believe these are the same values that would be used to send size and color options through eCart. An abbreviated section of the specific code is noted below. The confirm.php is sending the correct values and they appear in paypal’s onscreen cart and payment email. eCart is generating a unique value for each of the two random codes and for each product. I believe that I am not grabbing and setting the correct value from the IPN post. I have tried: no0, ns0, no0_, ns0_, option_selection1, option_select1, option_amount1. What is the correct code for the IPN page so that I can retrieve the values from the Post? Please help.


** EDTITED confirm.php EDTITED ****************************

<input type="hidden" name="on0_<?php echo $Cart_Index+1; ?>" id="on0_<?php echo $Cart_Index+1; ?>" value="Code 1" />
<input type="hidden" name="os0_<?php echo $Cart_Index+1; ?>" id="os0_<?php echo $Cart_Index+1; ?>" value="<?php echo $Cart->DisplayInfo("Code1"); ?>" />
<input type="hidden" name="on1_<?php echo $Cart_Index+1; ?>" id="on1_<?php echo $Cart_Index+1; ?>" value="Code 2" />
<input type="hidden" name="os1_<?php echo $Cart_Index+1; ?>" id="os1_<?php echo $Cart_Index+1; ?>" value="<?php echo $Cart->DisplayInfo("Code2"); ?>" />

** EDTITED pp_IPN.php EDTITED ****************************

$ATC_Code1 = "".$_POST["option_selection1".($displayIndex+1)] ."";
$ATC_Code2 = "".$_POST["option_selection2".($displayIndex+1)] ."";
$ATC_DetailOption1 = "";
$ATC_DetailOption2 = "";

** EDTITED WAUE_pp_IPN_1.php EDTITED *********************

$MailBody = $MailBody . " <p style=\"margin:0 0 2px 0;\">Option/Code 1:";
$MailBody = $MailBody . $Cart->DisplayInfo("Code1");
$MailBody = $MailBody . "</p>\r\n";
$MailBody = $MailBody . " <p style=\"margin:0 0 2px 0;\">Option/Code 2:";
$MailBody = $MailBody . $Cart->DisplayInfo("Code2");

******************************************************

Sign in to reply to this post
loading

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