Jump to content
Mark Evans

Official PayPal IPN Support Thread

Recommended Posts

Hi,

 

I'm looking to move over to this payment module, I'm using the present paypal module and it sends the correct value for the item which includes VAT, but when using this one the item price is -VAT, I assume the module is sending the product value -VAT how do I get around this and make it include the vat when sending the item cost?

 

Darren

Share this post


Link to post
Share on other sites
Hi,

 

I'm looking to move over to this payment module, I'm using the present paypal module and it sends the correct value for the item which includes VAT, but when using this one the item price is -VAT, I assume the module is sending the product value -VAT how do I get around this and make it include the vat when sending the item cost?

 

Darren

 

there is a mod for this ... tax does show right now but only when paying, not when the paypal page opens.

 

I used the mod from this thread here, post 69! Check it out!


:-)

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

Greetings, everyone. I'd like to direct a suggestion to the dev team, and perhaps achieve some enlightenment for myself at the same time.

 

I'm interested in using the PayPal_IPN module... enough to have actually attempted a bit of work on it. Now I'm looking at the design, and it strikes me as incompatible with just about everything else in the system.

 

In particular, the PWA, MVS, and CCGV contributions break rather badly with PayPal_IPN installed. (Gift Certificates can be approved before we ever go to PayPal, for instance.) After looking at the code, and reading the forums, it is reasonable that this is because the PayPal module duplicates portions of checkout_process.php. But why duplicate code? I believe it's because we don't have access to the osCommerce cart or session when PayPal responds to us.

 

This seems reasonable. And when I compared the PayPal_IPN to the Plug-n-Pay SmartScreens module, which performs a verification similar to IPN, I found that Plug-n-Pay echoes the original POST variables, including osCsid. Since PayPal doesn't do this echo, the PayPal_IPN module actually accepts orders into the database *before* they're sent to PayPal. (It only approves them after the IPN returns, though.)

 

So why not pass the session id through PayPal's 'custom' variable? I thought that would allow us get the contents of the cart. (This is the part where I'm looking for enlightenment.) We currently use the custom variable to store the customer id; isn't that in the session, too? Heck, if you can show me how to get the appropriate variables out of the session id, I'll go revise my module and resubmit it.

 

If that won't work, I'd like to suggest encapsulating the code from checkout_process.php into functions. Then the PayPal_IPN module could simply include checkout_process.php and call the appropriate methods; any contribution code would be called as well.


If this were easy, everybody would do it.

Share this post


Link to post
Share on other sites

Hi everyone! I have installed, re-installed, configured and still I cannot get past this:

 

Fatal error: Cannot redeclare class order_total in catalog/includes/classes/order_total.php on line 14

 

The URL shows that it is catalog/checkout_process.php

 

Can anyone please help? Thanks


Tony Mazz

Share this post


Link to post
Share on other sites

Has this contribution ever been fixed to allow addresses to pass to PayPal so that the merchant is protected by the PayPal Seller Protection Program??

Share this post


Link to post
Share on other sites
Has this contribution ever been fixed to allow addresses to pass to PayPal so that the merchant is protected by the PayPal Seller Protection Program??

 

Before the contribution section change there was an addon from Hostmistress which I can't find anymore. There you would find what to add to the catalog/includes/modules/payment/paypal_ipn.php in order to get name, address etc. passed over to Paypal.

   // Add missing variables to prepopulate PayPal form. -- hostmistress 20050210

 $parameters['first_name'] = $order->billing['firstname'];
 $parameters['last_name'] = $order->billing['lastname'];
 $parameters['address1'] = $order->billing['street_address'];
 $parameters['address2'] = $order->billing['suburb'];
 $parameters['city'] = $order->billing['city'];
   if ($order->billing['country']['iso_code_2']=='US') {
	 $order->billing['state'] = tep_get_zone_code($order->billing['country_id'], $order->billing['zone_id'], $order->billing['state']);
   }
 $parameters['state'] = $order->billing['state'];
 $parameters['zip'] = $order->billing['postcode'];
 $parameters['country'] = $order->billing['country']['iso_code_2'];
 $parameters['email'] = $order->customer['email_address'];
 //  End missing variable contribution. -- hostmistress 20050210

If this is what you are looking for then find

      $parameters['bn'] = $this->identifier;

and add the above just before that.

Share this post


Link to post
Share on other sites
Hi everyone! I have installed, re-installed, configured and still I cannot get past this:

 

Fatal error: Cannot redeclare class order_total in catalog/includes/classes/order_total.php on line 14

 

The URL shows that it is catalog/checkout_process.php

 

Can anyone please help? Thanks

 

 

change require of that module to require_once, that should take care of it.


:-)

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
change require of that module to require_once, that should take care of it.

 

 

Thanks for your reply & help on this Monika. I am having trouble understanding or locating the fix. When you refer to "that module", which file would I need to examine. I really appreciate your time & wisdom. Tony...


Tony Mazz

Share this post


Link to post
Share on other sites
Thanks for your reply & help on this Monika. I am having trouble understanding or locating the fix. When you refer to "that module", which file would I need to examine. I really appreciate your time & wisdom. Tony...

 

try the following:

 

paypal_ipn.php, line 412

 

      include(DIR_WS_CLASSES . 'order_total.php');
     $order_total_modules = new order_total;

 

to this

      require_once(DIR_WS_CLASSES . 'order_total.php');
     $order_total_modules = new order_total;


:-)

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
try the following:

 

paypal_ipn.php, line 412

 

      include(DIR_WS_CLASSES . 'order_total.php');
     $order_total_modules = new order_total;

 

to this

      require_once(DIR_WS_CLASSES . 'order_total.php');
     $order_total_modules = new order_total;

 

 

Well that seemed to work on that, but now it I get this:

 

Fatal error: Cannot redeclare class ot_subtotal in catalog/includes/modules/order_total/ot_subtotal.php on line 13

 

Any more help would be greatly appreciated.


Tony Mazz

Share this post


Link to post
Share on other sites
Before the contribution section change there was an addon from Hostmistress which I can't find anymore. There you would find what to add to the catalog/includes/modules/payment/paypal_ipn.php in order to get name, address etc. passed over to Paypal.

 ? // Add missing variables to prepopulate PayPal form. -- hostmistress 20050210

?$parameters['first_name'] = $order->billing['firstname'];
?$parameters['last_name'] = $order->billing['lastname'];
?$parameters['address1'] = $order->billing['street_address'];
?$parameters['address2'] = $order->billing['suburb'];
?$parameters['city'] = $order->billing['city'];
? ?if ($order->billing['country']['iso_code_2']=='US') {
?	$order->billing['state'] = tep_get_zone_code($order->billing['country_id'], $order->billing['zone_id'], $order->billing['state']);
? ?}
?$parameters['state'] = $order->billing['state'];
?$parameters['zip'] = $order->billing['postcode'];
?$parameters['country'] = $order->billing['country']['iso_code_2'];
?$parameters['email'] = $order->customer['email_address'];
?// ?End missing variable contribution. -- hostmistress 20050210

If this is what you are looking for then find

 ? ? ?$parameters['bn'] = $this->identifier;

and add the above just before that.

 

I am looking for this, but I think that it needs to be the shipping address. Can I just change the "billing" to "shipping" and it will work? Or is the billing info what I need to be protected?

Share this post


Link to post
Share on other sites
I am looking for this, but I think that it needs to be the shipping address.  Can I just change the "billing" to "shipping" and it will work?  Or is the billing info what I need to be protected?

 

Change billing to delivery and it should be okay (shipping is a non-existing array for the order).

Share this post


Link to post
Share on other sites

Hello-

I have osCommerce installed here: Couch Fort Store

 

I have added the First Plus Zones contribution and the "PayPal_Shopping_Cart_IPN_v3.1.2" contribution.

 

During the last few steps of the PayPal IPN:

 

26.catalog/admin/includes/languages/english.php

Add:

//begin PayPal_Shopping_Cart_IPN

define('BOX_CUSTOMERS_PAYPAL', 'PayPal IPN');

//end PayPal_Shopping_Cart_IPN

 

27.catalog/admin/includes/languages/english/orders.php

Add:

//begin PayPal_Shopping_Cart_IPN

define('TABLE_HEADING_PAYMENT_STATUS', 'Status');

//end PayPal_Shopping_Cart_IPN

 

I wasn't sure where to drop those in, but I tried my best.

 

I started getting these error messages at the admin portion of my site:

 

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/zsarptne/public_html/osCommerce/admin/includes/filenames.php:56) in /home/zsarptne/public_html/osCommerce/admin/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/zsarptne/public_html/osCommerce/admin/includes/filenames.php:56) in /home/zsarptne/public_html/osCommerce/admin/includes/functions/sessions.php on line 67

 

Every time I need to do something on the back end, I have to refresh & reload the pages, as that error shows up.

 

I'm also having problems with orders. Customer orders item and it shows up on PayPal if they complete payment, and then order shows in osCommerce. But they do not recieve e-mail from osCommerce nor do I. Also, if they do not pay right away in PayPal, osCommerce shows the order as paid. And inventory does not move down with paid sales.

 

Do I need to enable auto-return in PayPal?

 

Obviously there's something wrong.

 

Any ideas?

 

-Tim

Share this post


Link to post
Share on other sites
Help needed,

 

I have purchase without account installed and have tried with it enabled and dissabled.

 

I have installed this IPN module, I am in "test" mode, when I add items to a cart and select the IPN the order shows up in ADMIN ORDERS, then I proceed to check out and complete check out the order disappears from ADMIN.

 

I have switched from test to run mode and tried as well, the order is actually processed by paypal and payment delivered, I recieve the email invoice, but the order still dissapears from ADMIN ORDERS.

 

I never recieve any debug emails and have set my address in the IPN module settings?

 

Any ideas why the orders will not stick in ADMIN?

 

Well with IPN set to On you get a post notification on the IPN url you have specified.

On times there can be data base connectivity problems or some assumed spoofing check not allowing the data base to be populated.

 

So while you are not very sure apart from things populating the Dat base also add those details to a log file.

Analyse the log file and you will have a clear picture of what and where things went wrong.

 

Satish Mantri


Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Share this post


Link to post
Share on other sites

Hello,

I was having a very similar problem to others in this thread: the total amount returned from paypal was different by $.01, which was preventing the order status to be updated.

 

In my case, it was the sales tax that was off by $.01

 

The solution turned out to be switching the transaction type from "per item" to "aggregate" and this is why:

 

Qty = 4

Price = 29.00

tax rate = 8.25%

 

sub total = 116.00

tax = 9.57

total = 125.57

 

But with "per item" paypal was showing

tax = 9.56

total = 125.56

 

and the reason I believe is that osc calculates the tax individually when "per item" is the transaction type. Therefore, 8.25% of 29.00 = 2.3925 which gets rounded down to 2.39 and 4 x 2.39 = 9.56!!!

 

(I also tried changing the tax decimal places from 2 to 4 but that did not fix the problem)

 

I also just did a quick check and tried to change the US number of decimal places from 2 to 4 just to see if the extra tax info would be passed, but I got a malformed url error from paypal.

Share this post


Link to post
Share on other sites

HOLY SCHNIKIES!!! Please don't make me read any more!!!

 

Would someone pretty please tell me what URL PayPal wants in the IPN configuration to send its IPN "message" to?

 

More specifically, here is what PayPal is asking for:

 

"...and enter the URL at which you will receive the payment notifications below."

 

AND, would someone also tell me why this is not in the 'Install Guide' for this contrib?

 

 

Signed,

frustrated (or blind)...help!

Share this post


Link to post
Share on other sites

You don't need to enter anything in the PayPal My Profile section. The IPN module will pass the URL itself, if it's set up correctly.

 

As for the 0.01 rounding with sales tax, it's good to hear that it can be circumvented with per-item. That doesn't work for me, though, because it's a currency issue for me and per-item vs. aggregate changes nothing.

Share this post


Link to post
Share on other sites
You don't need to enter anything in the PayPal My Profile section. The IPN module will pass the URL itself, if it's set up correctly.

 

 

THANKS!!!!!!!!

 

Does IPN still need to be turned ON in the PayPal profile (and make the URL field blank)?

 

 

Also, can anyone confirm or deny if we can test this with my test osc on LOCALHOST?

 

Thanks again!

 

Regards,

T-DOGG

Share this post


Link to post
Share on other sites

Hi,

On the French oscommerce forum, AL1 says he downloaded PayPal_IPN-v1.2 dated Sept. 1, 2005. http://www.oscommerce-fr.info/forum/index....showtopic=24372

 

Where did it go?

Was it broken?

 

Why are there two major contribs for PayPal?

:'(

 

Thanks in advance!

-India

This support thread is for the osCommerce PayPal IPN Module v1.0 For 2.2MS2

 

Which can be downloaded from http://www.oscommerce.com/community/contributions,2679

 

Please post any support questions on this module here.

 

Any questions relating to any other contribution will likely be removed to keep this thread specific to the module above.


*** Je suis plus souvent sur le forum français ***

ms2fr, Header Tags 2.5.5b, Order logging before payment, Better PayPal Description perso, Free shipping per product, Must agree to terms, Country State Selector, World Zones, Visible countries, Store Pick Up, several shipping modules, Personal Invoice Number, 'On the Fly' Auto Thumbnailer using GD Library, More_Pics_6 for 2.2 ms2, Ultimate SEO URLs 2-2.1d/e,Virement Bancaire, Estimated Shipping 1.5, xml_guide, SP+,Step By Step 1.8, Order Editor 2.6.3, Google Analytics, Dynamic Sitemap 2.0, OSC-Expeditor, Recover Cart Sales, Links Manager 1.15

local : linux 2.6 Fedora Core 3, server : APACHE 2.0.54, MySQL 4.1.18, php : 4.4.0 (on strike refuse to update)

remote : IcoOpenBSD 4.x, server : IcodiaSecureHttpd, MySQL 4.1.24, php : 4.4.9

 

You never get a second chance to make a first impression.

Share this post


Link to post
Share on other sites

I don't qualify to but in here, but when I was a wee tot, I was told to always write

 

if abs(a - B) < epsilon

and never write

if a==b

 

Perhaps others who know where the equality check lives can make use if this--seems would help a lot with currency issues.

 

Plus epsilon's value should be tweakable.

best,

India

 

Regarding the Paypal IPN module rounding problems, documented here:

 

http://forums.oscommerce.com/index.php?sho...&hl=ipn&st=500#

 

I would like to fix this myself. I simply don't know where in the code to look, because I assumed the prices were being grabbed from the order total module.

 

All I want to do is a very simple fix, something with the pseudocode like this:

 

if order.total < order.subtotal + order.shipping

then order.total = order.total + 0.01

 

That's all I want to do. Bump the total up by one cent when the rounding issue causes the errors. May not be elegant but it'll work. Can someone tell me which php file to look at to perform this?

 

To recap for those who didn't read my longer bug report, basically if you choose an alternate currency, somewhere in osCommerce there is a rounding error so that the order total is one cent less than the subtotal plus shipping/handling charges. This causes problems because when Paypal sends the IPN, the ipn module gets confused because the amount is for one cent more than the (erroneous) osC total. When this happens, the order status is not automatically updated and the Paypal IPN log info (in the order comments) disappears, causing a duplicate entry and an order that will need a manual status update.

 

Would appreciate someone telling me "look in this file, look for this variable" or something like that.


*** Je suis plus souvent sur le forum français ***

ms2fr, Header Tags 2.5.5b, Order logging before payment, Better PayPal Description perso, Free shipping per product, Must agree to terms, Country State Selector, World Zones, Visible countries, Store Pick Up, several shipping modules, Personal Invoice Number, 'On the Fly' Auto Thumbnailer using GD Library, More_Pics_6 for 2.2 ms2, Ultimate SEO URLs 2-2.1d/e,Virement Bancaire, Estimated Shipping 1.5, xml_guide, SP+,Step By Step 1.8, Order Editor 2.6.3, Google Analytics, Dynamic Sitemap 2.0, OSC-Expeditor, Recover Cart Sales, Links Manager 1.15

local : linux 2.6 Fedora Core 3, server : APACHE 2.0.54, MySQL 4.1.18, php : 4.4.0 (on strike refuse to update)

remote : IcoOpenBSD 4.x, server : IcodiaSecureHttpd, MySQL 4.1.24, php : 4.4.9

 

You never get a second chance to make a first impression.

Share this post


Link to post
Share on other sites

oops-- - b made a smiley. repeat:

 

if abs( a - b ) < epsilon

 

not

 

if a == b

 

If course if the equality check lives in PayPal land, ...

Edited by IndiaStarker

*** Je suis plus souvent sur le forum français ***

ms2fr, Header Tags 2.5.5b, Order logging before payment, Better PayPal Description perso, Free shipping per product, Must agree to terms, Country State Selector, World Zones, Visible countries, Store Pick Up, several shipping modules, Personal Invoice Number, 'On the Fly' Auto Thumbnailer using GD Library, More_Pics_6 for 2.2 ms2, Ultimate SEO URLs 2-2.1d/e,Virement Bancaire, Estimated Shipping 1.5, xml_guide, SP+,Step By Step 1.8, Order Editor 2.6.3, Google Analytics, Dynamic Sitemap 2.0, OSC-Expeditor, Recover Cart Sales, Links Manager 1.15

local : linux 2.6 Fedora Core 3, server : APACHE 2.0.54, MySQL 4.1.18, php : 4.4.0 (on strike refuse to update)

remote : IcoOpenBSD 4.x, server : IcodiaSecureHttpd, MySQL 4.1.24, php : 4.4.9

 

You never get a second chance to make a first impression.

Share this post


Link to post
Share on other sites

Just curious...does anyone know of any other OFFICIAL OSC "patch" contributions, such as this one? trying not to learn about them the hard way, as i did this one. :'(

 

thanks in advance

 

T-DOGG

Share this post


Link to post
Share on other sites

I need to be the devil's advocate:

 

From what I have seen, most people install this contrib b/c OSC is not logging the order unless the buyer clicks on the "continue" or "return to merchant" button (which ever your particular paypal displays)...correct? (I could be wrong right out of the gate)

 

Riddle me this:

I turned ON my "Auto Return for Website Payments" option, found in the Merchant's PayPal configuration: Profile->Website Payment Preferences Then I updated the "Return URL:" to

 

 

This worked like a charm without using this PayPal IPN contrib. The correct variables got passed, or whatever happens, because when it auto-redirected back to the checkout_success page, it still prompted the buyer to tick on the items that they bought if they wanted to receive updates...the purchase email was sent to the buyer...all paypal updates/emails occurred. All seems well in the world.

 

WHAT AM I MISSING HERE? SEEMS TOO EASY! "TALK TO ME GOOSE"

 

 

thanks in advance!

 

Regards,

T-DOGG

Share this post


Link to post
Share on other sites

Hi all! I have been working on this problem and still can't get this to work properly. The transaction goes through, but I get this error (and so does the client)

 

Fatal error: Cannot redeclare class ot_subtotal in /home/testprod/public_html/safecart/includes/modules/order_total/ot_subtotal.php on line 13

 

Subsequently they do not get notified & get that error. Has anyone else run into this? Its driving me nuts!


Tony Mazz

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

×