Jump to content
Mark Evans

Official PayPal IPN Support Thread

Recommended Posts

if I do not hit continue after paying, no order email will be sent ...why???

 

Is this normal or just me?


:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Share this post


Link to post
Share on other sites
This is a known problem with the standard paypal module which is why the following was developed by the team

 

http://www.oscommerce.com/community/contributions,2679

 

 

I have this happen with the team IPN mod. Database is fine, just no emails sent when users do not return to the site.


:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Share this post


Link to post
Share on other sites
I have this happen with the team IPN mod. Database is fine, just no emails sent when users do not return to the site.

 

You wont get emails unless the customer actually clicks the final PayPal continue button and returns back to the store as the emails are sent out from the paypal_ipn.php module in the after process not the ipn callback module - ipn.php.

 

There is no easy solution to this. You could move the email generation to the process_button section of paypal_ipn.php or alternatively to ipn.php. But both solutions create other problems.

 

In the first case, the emails would be sent out even if the payment has not actually been made and in both cases it would be a little complicated to get the full order detail into the email. Or you could generate a temporary email from the process_button section with some bland all purpose words about the order but again it has problems if the customer doesnt complete the purchase.

 

In addition, you cannot actually tell which module - ipn.php or paypal_ipn.php will actually be run first as it depends on the speed of the cusomer returning versus the speed of the ipn callback.

 

So the simpler option is just to add this to the parameter list in paypal_ipn.php!

 

 $parameters['cbt'] = 'Click to Complete Order!';

 

This will rename the final PayPal button and make it clearer that the customer must return to the store.

Edited by Ian-San

Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites
You wont get emails unless the customer actually clicks the final PayPal continue button and returns back to the store as the emails are sent out from the paypal_ipn.php module in the after process not the ipn callback module - ipn.php.

 

There is no easy solution to this. You could move the email generation to the process_button section of paypal_ipn.php or alternatively to ipn.php. But both solutions create other problems.

 

In the first case, the emails would be sent out even if the payment has not actually been made and in both cases it would be a little complicated to get the full order detail into the email. Or you could generate a temporary email from the process_button section with some bland all purpose words about the order but again it has problems if the customer doesnt complete the purchase.

 

In addition, you cannot actually tell which module - ipn.php or paypal_ipn.php will actually be run first as it depends on the speed of the cusomer returning versus the speed of the ipn callback.

 

So the simpler option is just to add this to the parameter list in paypal_ipn.php!

 

 $parameters['cbt'] = 'Click to Complete Order!';

 

This will rename the final PayPal button and make it clearer that the customer must return to the store.

 

 

thanks Ian. That's what I was thinking too. So I moved the email and completion of the order to the confirmation function in paypal_ipn.php, and the wording in the emails says to regard this as void if they didn't complete the order.


:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Share this post


Link to post
Share on other sites

I would like to know what code I need to look for in order to add the code for this mod?

I am unable to go by line# due to a mod in the checkout_payment.php file already.

 

PayPal is adding $.01 to the total of all my orders, Any body else have this problem and a fix?

 

Thanks

 

Todd

 

 

 

Yes, I modified the look tyo be comparable to v2.9 adding the following code to checkout_payment.php at line 252

<td class="main" colspan="3" nowrap><?php
? ? ? ? ? ? ? ? ? ? if ($selection[$i]['module'] == 'PayPal IPN') {
? ? ? ? ? ? ? ? ? ? ? ?>
? ? ? ? ? ? ? ? ? ? ? ? <big><b>
? ? ? ? ? ? ? ? ? ? ? ? ? Credit Card
? ? ? ? ? ? ? ? ? ? ? ? ? ? <img src="images/logo_ccVisa.gif" ? ? ? ? ? ? alt="Visa" width="37" height="21" ? ? border="0" ? ? ? ? ? ?align="bottom" title=" Visa ">
? ? ? ? ? ? ? ? ? ? ? ? ? ? <img src="/images/logo_ccMC.gif" ? ? ? alt="MasterCard" width="37" height="21" ? ? ? border="0" ? ? ?align="bottom" title=" MasterCard ">
? ? ? ? ? ? ? ? ? ? ? ? ? ? <img src="/images/logo_ccDiscover.gif" ? ? ? ? alt="Discover" width="37" height="21" border="0" ? ? ? ?align="bottom" title=" Discover ">
? ? ? ? ? ? ? ? ? ? ? ? ? ? <img src="/images/logo_ccAmex.gif" alt="American Express" width="37" height="21" ? ? border="0"align="bottom" title=" American Express ">
? ? ? ? ? ? ? ? ? ? ? ? ? or
? ? ? ? ? ? ? ? ? ? ? ? ? ? <img src="/images/banner_intl.gif" ? ? ? ? ? alt="PayPal" width="88" height="33" ? ? ?border="0" ? ? ? ? ?align="bottom" title=" PayPal ">
? ? ? ? ? ? ? ? ? ? ? ? </b></big>
? ? ? ? ? ? ? ? ? ? ? ? ? <br>
? ? ? ? ? ? ? ? ? ? ? ? ? You do not need to be a PayPal member to pay by credit card.
? ? ? ? ? ? ? ? ? ? ? ? ? <script>
? ? ? ? ? ? ? ? ? ? ? ? ? ? document.writeln('<a style="cursor:hand" onclick="javascript:popup=window.open('
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+ '\'http://www.mydomain.com/catalog/CreditCardExplain.htm\',\'popup\','
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+ '\'scrollbars,resizable,width=625,height=800,left=50,top=50\'); popup.focus(); return false;">'
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+ '<font color="blue"><u>[info]</u></font></a>');
? ? ? ? ? ? ? ? ? ? ? ? ? </script><noscript>
? ? ? ? ? ? ? ? ? ? ? ? ? ? <a href="CreditCardExplain.html" target="_blank"><font color="blue"><u>[info]</u></font></a>
? ? ? ? ? ? ? ? ? ? ? ? ? </noscript>
? ? ? ? ? ? ? ? ? ? ? <?php
? ? ? ? ? ? ? ? ? ? } else if ($selection[$i]['module'] == 'Check/Money Order') {
? ? ? ? ? ? ? ? ? ? ? ?><big><b>Check or Money Order </b></big>
? ? ? ? ? ? ? ? ? ? ? ? <img src="/check.gif" border=0 alt=" Send Us a Check " align="absmiddle">
? ? ? ? ? ? ? ? ? ? ? <?php
? ? ? ? ? ? ? ? ? ? } else {
? ? ? ? ? ? ? ? ? ? ? echo '<big><b>' . $selection[$i]['module'] . '</b></big>';
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ?></td>

and using CreditCardExplain.html from the contributions for a start I also changed the email notification in paypal_ipn.php

 

hth James

Share this post


Link to post
Share on other sites

[The code I am interested in adding will add the credit card icons for PayPal IPN. I would like to know what code I need to look for in order to add the code for this mod?

I am unable to go by line# due to a mod in the checkout_payment.php file already.

 

Also, PayPal is adding $.01 to the total of all my orders, Any body else have this problem and a fix?

 

Thanks

 

Todd

 

 

 

Yes, I modified the look tyo be comparable to v2.9 adding the following code to checkout_payment.php at line 252

<td class="main" colspan="3" nowrap><?php
                    if ($selection[$i]['module'] == 'PayPal IPN') {
                      ?>
                        <big><b>
                          Credit Card
                            <img src="images/logo_ccVisa.gif"             alt="Visa" width="37" height="21"     border="0"            align="bottom" title=" Visa ">
                            <img src="/images/logo_ccMC.gif"       alt="MasterCard" width="37" height="21"       border="0"      align="bottom" title=" MasterCard ">
                            <img src="/images/logo_ccDiscover.gif"         alt="Discover" width="37" height="21" border="0"        align="bottom" title=" Discover ">
                            <img src="/images/logo_ccAmex.gif" alt="American Express" width="37" height="21"     border="0"align="bottom" title=" American Express ">
                          or
                            <img src="/images/banner_intl.gif"           alt="PayPal" width="88" height="33"      border="0"          align="bottom" title=" PayPal ">
                        </b></big>
                          <br>
                          You do not need to be a PayPal member to pay by credit card.
                          <script>
                            document.writeln('<a style="cursor:hand" onclick="javascript:popup=window.open('
                                           + '\'http://www.mydomain.com/catalog/CreditCardExplain.htm\',\'popup\','
                                           + '\'scrollbars,resizable,width=625,height=800,left=50,top=50\'); popup.focus(); return false;">'
                                           + '<font color="blue"><u>[info]</u></font></a>');
                          </script><noscript>
                            <a href="CreditCardExplain.html" target="_blank"><font color="blue"><u>[info]</u></font></a>
                          </noscript>
                      <?php
                    } else if ($selection[$i]['module'] == 'Check/Money Order') {
                      ?><big><b>Check or Money Order </b></big>
                        <img src="/check.gif" border=0 alt=" Send Us a Check " align="absmiddle">
                      <?php
                    } else {
                      echo '<big><b>' . $selection[$i]['module'] . '</b></big>';
                    }
                  ?></td>

and using CreditCardExplain.html from the contributions for a start I also changed the email notification in paypal_ipn.php

 

hth James

Share this post


Link to post
Share on other sites
Wow. Looks like a few potential frustrations out there with this one.

 

This is mine:

 

Order Total data never gets entered into the osCommerce database from the paypal_ipn.php page, and so otherwise successful PayPal orders aren't showing up in the Administrator interface. (Customers are being redirected back to the site, etc.)

 

I've done some tests, so I have some clues.

 

I believe that when it gets to this line (near line 116):

 

    for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++)

 

the '$GLOBALS[$class]->output' array is empty, and so it never gets to the curly brackets that create the $order_totals[] array.

 

Hm. Can anybody hand me down their higher wisdom on this one?

 

Why might that '$GLOBALS[$class]->output' array be empty?

 

 

Did you ever fix this? I just installed the Mod, when I found which one to install the download page is a mess of tips, tricks and hacks!

 

Anyway, when it goes to the paypal site, nothing is entered into the database, not even with the preparing status.

When the user is returned from paypal, no order shows up in Admin, there are no products to select to receive updates from the confirmation page, no orders show up in accounts and the customer does get an email, however that email has no order_id on the end of the URL.

 

Anyone know what the problem might be?


Feel free to ask me for help

beep... beep....My Pager

Share this post


Link to post
Share on other sites
A lot of people in this post have reported problems with the order status "Preparing [PayPal IPN]" not changing on PayPal notify and so far there has not been a real solution posted.

 

I also have that problem.

 

However, it is obvious that this contribution does work for many people and so the problem is clearly not with the module itself.

 

In addition, I have verified that the module does in fact work perfectly up to the point of notify, everything that should be sent is sent to PayPal, all the emails are received, the basket is cleared, the order history updated and PayPal does indeed send back a notify which is logged by my server.

 

I get this code 200 in my server logs which clearly indicates that the notify was uccessfully attempted and Paypal does not attempt to send any repeat notifies:

 

216.113.188.202 - - [09/Jul/2005:19:33:26 +0100] "POST /ext/modules/payment/paypal_ipn/ipn.php HTTP/1.0" 200 189 "-" "-"

 

However, the fact remains that the notify still doesnt work!

 

Initially, I thought the problem was something to do with session creation, permissions or spider blocking but after changing the ipn.php file to one that would simply add an entry to the page_parse_time.log it still doesnt work.

 

Yet, if I manually post the variables to the ipn.php file it works perfectly.

 

So, it appears to me that something in the server settings is preventing the posts from what looks to the server as being a spider or robot.

 

It is not the htaccess file as far as I can see and I can successfully post forms to my site from other external sites.

 

So does anyone have any idea what this might be?

 

I am running in safe mode - has anyone successfully used this contribution on shared server running safe mode?

 

Has anyone who reported the notify not working actually got it to work?

 

Ian - - did you ever get this sorted out? I'm also seeing this problem on one of my customers' sites.

 

Thanks!

 

-jared

Share this post


Link to post
Share on other sites
Ian - - did you ever get this sorted out? I'm also seeing this problem on one of my customers' sites.

 

Thanks!

 

-jared

 

yes I got it to work and no, I don't know why it doesnt work with the standard set-up. My solution was:

 

1) Replace the top two lines of ipn.php with:

 

require('ipn_application_top.php');

 

and the bottom with:

 

tep_db_close();

 

2) Create the following file called ipn_application_top.php in the same place as ipn.php:

 

<?php // ipn_application_top.php, v 1.0

 chdir('../../../../');

// include server parameters
 require('includes/configure.php');

// include the list of project database tables
 require(DIR_WS_INCLUDES . 'database_tables.php');

// include the database functions
 require(DIR_WS_FUNCTIONS . 'database.php');

// make a connection to the database... now
 tep_db_connect() or die('Unable to connect to database server!');

// set the application parameters
 $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
 while ($configuration = tep_db_fetch_array($configuration_query)) {
   define($configuration['cfgKey'], $configuration['cfgValue']);
 }

// Add in specific other functions
 function tep_not_null($value) {
   if (is_array($value)) {
     if (sizeof($value) > 0) {
       return true;
     } else {
       return false;
     }
   } else {
     if (($value != '') && ($value != 'NULL') && (strlen(trim($value)) > 0)) {
       return true;
     } else {
       return false;
     }
   }
 }

// Return a random value
   function tep_rand($min = null, $max = null) {
     static $seeded;

     if (!isset($seeded)) {
       mt_srand((double)microtime()*1000000);
       $seeded = true;
     }

     if (isset($min) && isset($max)) {
       if ($min >= $max) {
         return $min;
       } else {
         return mt_rand($min, $max);
       }
     } else {
       return mt_rand();
     }
   }

// Wrapper function for round()
 function tep_round($number, $precision) {
   if (strpos($number, '.') && (strlen(substr($number, strpos($number, '.')+1)) > $precision)) {
     $number = substr($number, 0, strpos($number, '.') + 1 + $precision + 1);

     if (substr($number, -1) >= 5) {
       if ($precision > 1) {
         $number = substr($number, 0, -1) + ('0.' . str_repeat(0, $precision-1) . '1');
       } elseif ($precision == 1) {
         $number = substr($number, 0, -1) + 0.1;
       } else {
         $number = substr($number, 0, -1) + 1;
       }
     } else {
       $number = substr($number, 0, -1);
     }
   }
   return $number;
 }

// include currencies class and create an instance
 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

// charset for emails
define('CHARSET', 'iso-8859-1');

// include the mail classes
 require(DIR_WS_CLASSES . 'mime.php');
 require(DIR_WS_CLASSES . 'email.php');
 
// Send an Email
 function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) {
   if (SEND_EMAILS != 'true') return false;

   // Instantiate a new mail object
   $message = new email(array('X-Mailer: osCommerce Mailer'));

   // Build the text version
   $text = strip_tags($email_text);
   if (EMAIL_USE_HTML == 'true') {
     $message->add_html($email_text, $text);
   } else {
     $message->add_text($text);
   }

   // Send message
   $message->build_message();
   $message->send('', $to_email_address, $from_email_name, $from_email_address, $email_subject);
 }  

?>

 

 

Note, I use HTML emails and not sure how standard the above Send Email part is. Also, you may want to check on the need for CHARSET - it might be something I added!


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites
You wont get emails unless the customer actually clicks the final PayPal continue button and returns back to the store as the emails are sent out from the paypal_ipn.php module in the after process not the ipn callback module - ipn.php.

 

There is no easy solution to this. You could move the email generation to the process_button section of paypal_ipn.php or alternatively to ipn.php. But both solutions create other problems.

 

In the first case, the emails would be sent out even if the payment has not actually been made and in both cases it would be a little complicated to get the full order detail into the email. Or you could generate a temporary email from the process_button section with some bland all purpose words about the order but again it has problems if the customer doesnt complete the purchase.

 

In addition, you cannot actually tell which module - ipn.php or paypal_ipn.php will actually be run first as it depends on the speed of the cusomer returning versus the speed of the ipn callback.

 

So the simpler option is just to add this to the parameter list in paypal_ipn.php!

 

 $parameters['cbt'] = 'Click to Complete Order!';

 

This will rename the final PayPal button and make it clearer that the customer must return to the store.

 

I thought the IPN took care of this and recorded orders even if the customer didn't return to the site. What is the point in using IPN module?

Share this post


Link to post
Share on other sites
I thought the IPN took care of this and recorded orders even if the customer didn't return to the site. What is the point in using IPN module?

 

There are two parts to this mod:

- The first part pre-stores the order, manages the transfer of the customer and order details to PayPal and on customer payment and return will generate your customer emails (and any copies to yourself).

- The second part will receive the IPN from PayPal in the background, change the order status to completed and update the order history.

 

Depending on your store, IPN is not really required anyway in so much as you can just check the emails you get direct from PayPal, go to PayPal and check you actually have the cash and then manually update the order status before sending out the product. The IPN just automates this bit for you and gives you another opportunity to spot fraud.

 

In my case, I do not sell physical products anyway so am not so concerned about spotting fraud in real time. However, I use the successful IPN to automatically update the customers account and alert me to specific order status details which allows me to manage my store in a completely hands-off way and deal with fraud in my own time.


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites

I have posted this question elsewhere a few days ago with poor information coming back so I included this topic as well searching for the questions to be answered better. I am not trying to cross post however getting replies to some questions has been difficult, it may be my wording in the questions not being answered correctly, The answer may already be out there and I cannot find it?s location, Thanks to anyone trying to assist me in my quest for answers.

 

I am having the same issue as another user here that has posted here.. No shipping information being sent to PayPal, I was looking for an answer to the last persons post and did not find the answer yet anyhow.

 

I have a question about shipping, I want to still be able to ship using PayPal, currently our store does this now ship everything through PayPal using our PayPal account to handle shipping costs, as we include shipping in our prices?

 

I think I must get the shipping information passing to through the PayPal IPN module first in order to continue moving forward with using PayPal IPN. I realize that the shipping information shows up in osCommerce. However I do not want to open another shipping account with USPS or UPS when PayPal handles that for us.


Thank You In Advance, For Your Assistance

From A Newbie Point Of View...

 

Happiness is Getting OSC Operating to it's fullest potential and

with the help of Contributors and Forum Moderators, we can all do it. Support the cause. Donate to osCommerce.

 

baesic2

Share this post


Link to post
Share on other sites

Hello Gurus,

 

I have searched and searched and read and read but to no avial.

 

Everytime I send a transaction through either using sandbox or live with a .01 product I get

 

PayPal IPN Invalid [Completed] on my orders and I get a debug email with the same message.

 

I get the funds in my account and the customer gets a receipt

 

I did find a some posts that said that this was just because I am Using the sandbox or I am using an unverifed paypal account to buy.

 

Can someone verfiy this the case or tell me how to fix the problem.

 

I am about ready to go live and I want to make sure this works properly for both my protection and my customers

Please save my sanity!!

 

Thank you

Share this post


Link to post
Share on other sites

Hi,

 

I just have installed PayPal IPN v 2.9 and it runs good. Even a costumer ordered using PayPal the order was completed correctly.

Sometimes a costumer do not complete payment process. Then the costumer can go to the order history and confirm the order a second time. But when thay do so I've got an error message from PayPal thats tells:

 

...incorrectly formatted item amount..

 

Whats going on? I use only aggregate amounts!

Share this post


Link to post
Share on other sites
Hi,

 

I just have installed PayPal IPN v 2.9 and it runs good. Even a costumer ordered using PayPal the order was completed correctly.

Sometimes a costumer do not complete payment process. Then the costumer can go to the order history and confirm the order a second time. But when thay do so I've got an error message from PayPal thats tells:

 

...incorrectly formatted item amount..

 

Whats going on? I use only aggregate amounts!

 

 

... so I have made some tests and the problem could be, that the amount format is xx.xxxx (four places!! - but Paypal expects only two).

 

How can I resolve this conflict?

Share this post


Link to post
Share on other sites

I'm having trouble with my IPN passing the buyers address into Paypal. Everything with the IPN works like a charm, status is correct, emails get sent, inventory is updated, etc.

 

My problem is on all of the payments I have received in Paypal none of them include the buyers address. I have to go back into my Admin Console and use the address provided there.

 

Is there something obvious I missed as to why it won't pass it on?

Share this post


Link to post
Share on other sites

I've got a strange problem. Been racking my brains trying to figure out why IPN is apparently not working with the sandbox (Testing server). So I dug around in this thread and on the second page I saw a post regarding the order confirmation page -- and that I should do a View Source on it.

 

The bit with "notify-url" has a very strange URL in it, which must be why my stuff isn't working:

 

http://www.mydomain.com/catalog/ipn.php

 

But that should be:

 

http://www.mydomain.com/ext/modules/paymen...pal_ipn/ipn.php

 

Should it not? Any idea why this is screwed up? I may have installed things incorrectly, but I'm not sure what I need to do to fix it. I tried installing the official 1.1 release, then I put someone else's 1.2 on top of that. Not sure what got messed up, but things were not working from the get go, so I think this may be an osC installation issue for me?

 

Would greatly appreciate any tips.

Share this post


Link to post
Share on other sites
i have read through this but cant actually find a solution to this

 

orders go through fine and everything works great - ie moneyt received, customer is happy etc etc

 

but it wont change from

"Preparing [PayPal IPN]"

 

any ideas on a fix.  I have it all turned on in my paypal account as i was using a different version previously, so i know it can work

 

Mike

I've been having exactly the same problem after I updated IPN to v1.1_1 and I din't really like the idea of creating new file ipn_application_top.php (also some of my test orders dissapeared from admin instead of changing status) so I decided to edit ipn.php instead. It may need more testing but at the moment it looks like it works just fine. Others having the same problem can try it and let everybody know the outcome.

 

ipn.php line 98

	//Set status for default (Pending)
 $order_status_id = MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_ID;

change to:

  //Set status for default (Pending)
 $order_status_id = DEFAULT_ORDERS_STATUS_ID;

I have tested various currencies and languages and it all seems to work fine. I also use Email Subject with Order Number and Status contribution (thanks Jared, great contrib BTW!) and all emails are being received.


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

I realize this has been covered before, but I would like someone to spell it out for me if possible. What are the technical or security limitations that require the Paypal IPN module *NOT* to pass the buyer's address info to Paypal?

 

When I get the orders, there is no buyer address whatsoever. I know I can check to see that the payer is a verified account, simply by looking at the IPN codes in the orders list through the Admin CPL (in the comments box when the status is changed after a successful IPN).

 

However, for Paypal purposes this still doesn't help the seller because the order becomes INELIGIBLE for the Paypal Seller Protection Policy.

 

This has been brought up before. I'm not here to point fingers or criticize, I'm just trying to understand why it has to be this way and if there's a way around it.

 

I think sparky posted really early in this thread that "this was taken out at the last minute due to the Encrypted Website Payments." I really don't understand the causal relation between those two statements.

 

It would be great to pass the address. I think (from the documentation available on Paypal.com itself) that if a customer tries to buy without a paypal account, they are asked for shipping information etc. and there is a checkbox if this is the same as their credit card billing address. I think this is to make sure the payment is eligible for seller protection.

 

Anyway, it would be great to hear from you IPN gurus why this is the way it is, even now (August 2005).

Share this post


Link to post
Share on other sites

Um, just ran into a weird bug today.

 

Have IPN pretty much working, but if the customer enters a comment for the order that contains an apostrophe, when they finish payment and click the button to return to the store, I get the following error:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 't be eligible for seller protection unless paypal forces the sh

 

update orders_status_history set customer_notified = '1', comments = 'Test to see if a buyer with a different address can pay paypal if the paypal account address conflicts with the buyer address. Well, they can buy, but they shouldn't be eligible for seller protection unless paypal forces the shipping address to be the one on file with them, which I think they do.' where orders_id = '28' AND orders_status_id = '4'

 

 

Obviously, it's the apostrophe causing that error. I've tried it with other comments.

 

 

This seems absurd, that a customer won't be able to type contractions like "won't" or "don't" or "can't" in their comments section. Is there an easy workaround to this, like some sort of wrapper that would strip out apostrophes from the comments?

Edited by raddygast

Share this post


Link to post
Share on other sites
I realize this has been covered before, but I would like someone to spell it out for me if possible. What are the technical or security limitations that require the Paypal IPN module *NOT* to pass the buyer's address info to Paypal?

 

When I get the orders, there is no buyer address whatsoever. I know I can check to see that the payer is a verified account, simply by looking at the IPN codes in the orders list through the Admin CPL (in the comments box when the status is changed after a successful IPN).

 

However, for Paypal purposes this still doesn't help the seller because the order becomes INELIGIBLE for the Paypal Seller Protection Policy.

 

This has been brought up before. I'm not here to point fingers or criticize, I'm just trying to understand why it has to be this way and if there's a way around it.

 

I think sparky posted really early in this thread that "this was taken out at the last minute due to the Encrypted Website Payments."  I really don't understand the causal relation between those two statements.

 

It would be great to pass the address. I think (from the documentation available on Paypal.com itself) that if a customer tries to buy without a paypal account, they are asked for shipping information etc. and there is a checkbox if this is the same as their credit card billing address. I think this is to make sure the payment is eligible for seller protection.

 

Anyway, it would be great to hear from you IPN gurus why this is the way it is, even now (August 2005).

 

 

There is contribution included with this mod that intends to add back in the missing customer details. But my belief is that it is flawed as it using the "billing" address which is not defined function order in class order in the standard build so actually no details are actually passed. Apologies to hostmistress if I am wrong.

 

I havent had time to test it yet, but I think it would work, without changing the order class, if "billing" was changed to "customer".

 

In short, just paste this in to paypal_ipn.php at the end of the current parameter list:

 

   $parameters['first_name'] = $order->customer['name'];
  $parameters['address1'] = $order->customer['street_address'];
  $parameters['address2'] = $order->customer['suburb'];
  $parameters['city'] = $order->customer['city'];
  if ($order->customer['country']['iso_code_2']=='US') {
    $order->customer['state'] = tep_get_zone_code($order->customer['country_id'], $order->customer['zone_id'], $order->customer['state']);
  }
  $parameters['state'] = $order->customer['state'];
  $parameters['zip'] = $order->customer['postcode'];
  $parameters['country'] = $order->customer['country']['iso_code_2'];
  $parameters['email'] = $order->customer['email_address'];


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites
Um, just ran into a weird bug today.

 

Have IPN pretty much working, but if the customer enters a comment for the order that contains an apostrophe, when they finish payment and click the button to return to the store, I get the following error:

Obviously, it's the apostrophe causing that error. I've tried it with other comments.

This seems absurd, that a customer won't be able to type contractions like "won't" or "don't" or "can't" in their comments section. Is there an easy workaround to this, like some sort of wrapper that would strip out apostrophes from the comments?

 

The solution should be easy but I havent tested it. Just change:

 

'comments' => $order->info['comments']);

 

in paypal_ipn.php to:

 

'comments' => $order->tep_db_input(info['comments']));


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites
I havent had time to test it yet, but I think it would work, without changing the order class, if "billing" was changed to "customer".

 

In short, just paste this in to paypal_ipn.php at the end of the current parameter list:

 

   $parameters['first_name'] = $order->customer['name'];
  $parameters['address1'] = $order->customer['street_address'];
  $parameters['address2'] = $order->customer['suburb'];
  $parameters['city'] = $order->customer['city'];
  if ($order->customer['country']['iso_code_2']=='US') {
    $order->customer['state'] = tep_get_zone_code($order->customer['country_id'], $order->customer['zone_id'], $order->customer['state']);
  }
  $parameters['state'] = $order->customer['state'];
  $parameters['zip'] = $order->customer['postcode'];
  $parameters['country'] = $order->customer['country']['iso_code_2'];
  $parameters['email'] = $order->customer['email_address'];

 

Thanks for that. So what did you do there, just made it manually include customer address info? Will it skip the suburb if I've defined it so that customers don't sign up with a suburb? Also, for Canadian customers, will it skip the "state" (i.e. province)?

 

 

Here's what I did do already (found in another post) and it seems to help. It sets it up so that when the buyer goes to paypal, it has a "shipping address" selected in paypal, which is basically the address associated with their paypal account. Paying in this way makes the payment eligible for seller protection, but the drawback is that it completely ignores the "shipping" or "billing" address set up in osCommerce, and takes it exclusively from whatever is set up with the paypal account used to make the payment.

 

I guess that's bad behaviour though, but I'm not sure what is the best way to go about doing things. There may be a time when a customer wants his order shipped to a different address (due to being on vacation or something), and then this method will screw that up. Plus the store owner (me) will have to constantly check to make sure the address on the paypal payment matches the one in the osC order. Yikes, this is complicated.

 

But anyway, this was the line of code that I changed:

 

$parameters['no_shipping'] = '0';

 

It defaults to 1, so changing it to 0 seems to force specifying a shipping address. Leaving it at 1 specifies no address.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×