Jump to content
Mark Evans

Official PayPal IPN Support Thread

Recommended Posts

OK, I have solved the problem by myself. Just put these codes

$ip = $_SERVER['REMOTE_ADDR'];
 $client = gethostbyaddr($ip);
 $str = preg_split("/\./", $client);
 $i = count($str);
 $x = $i - 1;
 $n = $i - 2;
 $isp = $str[$n] . "." . $str[$x];

to the file catalog/includes/modules/payment/paypal_ipn.php, in fron of this block

 $sql_data_array = array('customers_id' => $customer_id,
							  'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
							  'customers_company' => $order->customer['company'],
							  'customers_street_address' => $order->customer['street_address'],
							  'customers_suburb' => $order->customer['suburb'],
							  'customers_city' => $order->customer['city'],
							  'customers_postcode' => $order->customer['postcode'],
							  'customers_state' => $order->customer['state'],
							  'customers_country' => $order->customer['country']['title'],
							  'customers_telephone' => $order->customer['telephone'],
							  'customers_email_address' => $order->customer['email_address'],
							  'customers_address_format_id' => $order->customer['format_id'],
							  'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
							  'delivery_company' => $order->delivery['company'],
							  'delivery_street_address' => $order->delivery['street_address'],
							  'delivery_suburb' => $order->delivery['suburb'],
							  'delivery_city' => $order->delivery['city'],
							  'delivery_postcode' => $order->delivery['postcode'],
							  'delivery_state' => $order->delivery['state'],
							  'delivery_country' => $order->delivery['country']['title'],
							  'delivery_address_format_id' => $order->delivery['format_id'],
							  'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],
							  'billing_company' => $order->billing['company'],
							  'billing_street_address' => $order->billing['street_address'],
							  'billing_suburb' => $order->billing['suburb'],
							  'billing_city' => $order->billing['city'],
							  'billing_postcode' => $order->billing['postcode'],
							  'billing_state' => $order->billing['state'],
							  'billing_country' => $order->billing['country']['title'],
							  'billing_address_format_id' => $order->billing['format_id'],
							  'payment_method' => $order->info['payment_method'],
							  'cc_type' => $order->info['cc_type'],
							  'cc_owner' => $order->info['cc_owner'],
							  'cc_number' => $order->info['cc_number'],
							  'cc_expires' => $order->info['cc_expires'],
							  'date_purchased' => 'now()',
							  'orders_status' => $order->info['order_status'],
							  'currency' => $order->info['currency'],
							  'currency_value' => $order->info['currency_value'],
							  'ipaddy' => $ip,
							  'ipisp' => $isp);

NOTICE The last 2 lines are added follow by the IP Order Recorder contrib mentioned in my last post.

 

Now IP Order Recording is working with osC PayPal IPN in my store. You might need PHP4.10 in your host to use the codes I modified.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites

need help. i was testing out my site this morning and all was working fine.... then all of the sudden i started i started getting this error message on my "checkout_success.php" page:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/mysite.com/dev/includes/functions/database.php:13) in /home/mysite.com/dev/includes/functions/database.php on line 13

 

paypal is processing the order but when it auto returns to my site i get that error message. it was working perfectly fine and then the error.

 

i searched in this forum and found someone else with this same problem but nobody responded to him. anyone know what's going on and how to fix it?

 

thanks

Share this post


Link to post
Share on other sites
need help. i was testing out my site this morning and all was working fine.... then all of the sudden i started i started getting this error message on my "checkout_success.php" page:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/mysite.com/dev/includes/functions/database.php:13) in /home/mysite.com/dev/includes/functions/database.php on line 13

 

paypal is processing the order but when it auto returns to my site i get that error message. it was working perfectly fine and then the error.

 

i searched in this forum and found someone else with this same problem but nobody responded to him. anyone know what's going on and how to fix it?

 

thanks

 

there's got to be some kind soul out there that can help me with this. i finally got the Encrypted Web Payments working but this error message is driving me NUTS!

 

john

Share this post


Link to post
Share on other sites

fribhey,

 

did you mod the osC PayPal IPN module? This error won't happen on fresh osC with un-mod Osc PayPal IPN module.

 

This error is saying you have redeclared the tep_db_xxxxx PREVIOUSLY, means you have included some files that shouldn't be, or not in properly places. For all the message you showed here is not enough to find out what caused that error.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites
fribhey,

 

did you mod the osC PayPal IPN module? This error won't happen on fresh osC with un-mod Osc PayPal IPN module.

 

This error is saying you have redeclared the tep_db_xxxxx PREVIOUSLY, means you have included some files that shouldn't be, or not in properly places. For all the message you showed here is not enough to find out what caused that error.

 

it's a fresh install of the module. i even uninstalled it, removed the files from the server, downloaded the module and installed it again.... still no luck.

 

i even dropped in a fresh un-modded checkout_success.php file.

 

i was testing it out yesterday morning with sandbox and it was working fine, then all of the sudden that error on the checkout_success.php page. nothing else, just that error.

 

i have no idea what's going on.

Share this post


Link to post
Share on other sites

i have IPN turned off in the sandbox seller account and in the website payment prefs i have auto return on with a return url. i also have PayPal Account Optional is turned on but i never get the option to pay without an account.

 

should i try replacing the checkout_confirmation.php file?

 

i've tried setting up new accounts in sandbox, new buyer accounts in the store, etc. i can't think of anything else.

Share this post


Link to post
Share on other sites
fribhey,

 

did you mod the osC PayPal IPN module? This error won't happen on fresh osC with un-mod Osc PayPal IPN module.

 

This error is saying you have redeclared the tep_db_xxxxx PREVIOUSLY, means you have included some files that shouldn't be, or not in properly places. For all the message you showed here is not enough to find out what caused that error.

 

 

Alex,

 

thanks for helping. after many many hours of banging my head against the wall i figured out what i did. i was thinking about what exactly i was doing right before it stopped working and the only thing i was doing was editing the text on the checkout_success.php page by editing the includes>languages>english>checkout_success.php file. that file on my computer is fine so i just logged into my ftp to download that file to see if there was something wrong with it.... and .... (i feel like an idiot for doing this and not realizing it) instead of uploading the includes>languages>english>checkout_success.php file that i had edited, i had uploaded the checkout_success.php that's in the root directory into the languages folder. so that explains why everything was all wacky. i replaced that file with the correct file that's supposed to be in the languages folder and all is now good.

 

i've been staring at code for the past 6+ hours straight and am working on less then 4 hours of sleep. i need a nap.

 

:D

Share this post


Link to post
Share on other sites

Hi -

 

I've installed PayPal IPN. Product price and shipping charges are passed to PayPal, but sales tax is NOT passed. What do I configure to pass the sales tax along also? I have everything passed as an aggregate amount to PayPal.

 

Thanks for the help.

Share this post


Link to post
Share on other sites
fribhey,

 

did you mod the osC PayPal IPN module? This error won't happen on fresh osC with un-mod Osc PayPal IPN module.

 

This error is saying you have redeclared the tep_db_xxxxx PREVIOUSLY, means you have included some files that shouldn't be, or not in properly places. For all the message you showed here is not enough to find out what caused that error.

 

 

Any idea why I may be getting this error? The transaction goes through, but this is the error the client gets. They then do not know that the transaction went through and eMails are not sent. I have been struggling with this for weeks.

 

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


Tony Mazz

Share this post


Link to post
Share on other sites

I found the answer in this thread. Post #69 has the answer - http://forums.oscommerce.com/index.php?sho...ic=124298&st=68

 

Hope this helps someone else.

 

Hi -

 

I've installed PayPal IPN. Product price and shipping charges are passed to PayPal, but sales tax is NOT passed. What do I configure to pass the sales tax along also? I have everything passed as an aggregate amount to PayPal.

 

Thanks for the help.

Share this post


Link to post
Share on other sites

why does this module write items to the database when the customer reaches checkout_confirmation.php all other payment modules only do this when you reach checkout success. Should it not be written to the database on clicking confirm order?

Maybe this is while so many "ghost" orders are being recived, as customers go back and change options.

OK I know this is probably the only way to set the status etc, but it is a bad flaw of this contribution, as if I choose to go back and edit something (as a customer) and can send duplicate orders.

 

I too am also having trouble with updating the IPN after the customer goes off to paypal and pays. If I type in the folder where the temporary files are supposed to be stored, I get a 403 (forbidden) I take it the permissions just need setting for this to work?

Share this post


Link to post
Share on other sites

I've been a chicken about installing contributions but I decided this one was very much worth the risk (and this time I backed everything up - twice).

 

Everything went smoothly on the install. I went to the IPN Test Panel and poked several tests through. I received emails but my ipn.php page was blank. I changed Lines 24-25 as per the instructions but there was no change.

 

All of my emails came with a 'Are you running tests?' comment and I figured that was ok but then I saw a sample and my reply didn't have any order information in it from the test file.

 

So I decided to play in the sandbox instead. I had my fake person order a bunch of stuff (I wish!!!) and pay for it via PayPal. The transaction went through, everything looked swell. But when I returned to the store, the cart was still full of everything. But the order history showed all the stuff in the cart. Weird.

 

I shopped a bit more without clearing out the cart and it just added even more stuff (woo hoo! big sale!), then I paid for it through PayPal again. All that part looked like it went through - got the PayPal confirmation screen, etc.

 

Back to the store and the cart is still filled with all the stuff. So I emptied it manually and decided to shop more. This time I paid with a credit card and everything worked well according to PayPal. But again, the shopping cart did not empty.

 

So I checked my admin window and the first two orders (PayPal bank payments) did not show up at all. The credit card payment showed in the orders window. There was absolutely nothing in the PayPal IPN Payments window.

 

I checked my email account and there were emails that said IPN Notification and included the same information as my IPN Test Mode:

 

Unknown Post

------------------------------------------------------

An unknown POST from xxx.xxx.xxx.xxx was received.

Are you running any tests?

 

I have bafflement and any assistance would be hugely appreciated! Thank you!!!

Share this post


Link to post
Share on other sites

Hi -

 

I've installed PayPal IPN (the August 05 version). I've noticed that when a person reaches PayPal with their purchase that the "Purchase without PayPal Account" may or may not be available. At first I thought I missed something. All of my clients have business PayPal accounts. I have turned on the "Allow purchase without PayPal account" setting under the profile. What I have noticed though is that in IE the "Purchase without PayPal account" is more likely to appear (does for 2 out of 3 clients). In Mozilla, the "Purchase without PayPal account" option appears 0 out of 3 times. Why would the browser you are using affect which payment options show? I've search the forums and found other quirky PayPal behavior, but nothing like what I'm describing.

 

Any pointers are greatly appreciated.

 

Thank you,

Barb

Share this post


Link to post
Share on other sites

An update to my prevous post -

 

I've done a little more digging. Whether or not you get the option to "Purchase without PayPal Account" seems to be tied to whether or not a cookie has been set on the pc you are using. Once I've accessed PayPal on my computer, I no longer receive the option to "pay without account". If I clear the cache, cookies, history, etc. - then I will get the "pay without account" option. My question is - is it possible to ignore this cookie, so that a person will always receive the option to pay without a PayPal account?

 

Thanks,

Barb

 

Hi -

 

I've installed PayPal IPN (the August 05 version). I've noticed that when a person reaches PayPal with their purchase that the "Purchase without PayPal Account" may or may not be available. At first I thought I missed something. All of my clients have business PayPal accounts. I have turned on the "Allow purchase without PayPal account" setting under the profile. What I have noticed though is that in IE the "Purchase without PayPal account" is more likely to appear (does for 2 out of 3 clients). In Mozilla, the "Purchase without PayPal account" option appears 0 out of 3 times. Why would the browser you are using affect which payment options show? I've search the forums and found other quirky PayPal behavior, but nothing like what I'm describing.

 

Any pointers are greatly appreciated.

 

Thank you,

Barb

Share this post


Link to post
Share on other sites

Just a quicky!

 

I've been using this PP-IPN module for quite sometime. 90% of the time it works perfect. However I've got the same problem everyone gets in that if the client doesn't return to my site none of the order emails get sent to the customer (or me).

 

This is something I can live with as it's a low volume site and I still get the payment notification from paypal. However I'd like to add a note to my checkout process to remind customers to click the 'reurn to merchant' button at paypal. I would be really greatful if someone could have a look at my below modification and confirm if there other files I need to change other than the catalog\includes\languages\english\modules\payment\paypal_ipn.php

Here's what I've added:

define('MODULE_PAYMENT_PAYPAL_IPN_TEXT_TITLE', 'PayPal (Credit Card / Debit) <br></b>After payment at paypal, please click <b>Return to Mechant</b> to complete your order.');

 

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

 

Also, I'd be greatful if someone could let me know how to get the paypal logo to appear before my text (but after 'credit card / debit). It looks a bit odd showing after my text. I can't seem to find where in the paypal_IPN files that anything refers to the paypal.gif, let along change the postion of where it appears.

 

Many thanks in advance, Andy

Share this post


Link to post
Share on other sites

Hi all. I have a problem with taxes.

 

At store level the pricebreak down is:

 

Amount: $70.15

Shipping $4.95

Tax included in price: $6.83

Total: 75.10

 

(This is correct)

 

When passed to paypal first screen i get:

 

Amount: $63.77

Shipping: $4.95

Total Amount $68.72

 

(It shows the Amount without tax but the shipping with the tax? But Amount should appear as $70.15)

 

Then when passed to paypal payment confirmation screen i get:

 

Amount: $63.77

Shipping: $4.95

Vat: $6.38

Total: $75.10

 

(The total is actually correct but really the amount should be inclusive of tax and Vat should appear as GST included)

 

Please help,

Will.

Share this post


Link to post
Share on other sites
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.

I am having a problem with Paypal sending the cart details. The order detail in in admin under orders and in the order processing email. However the detail do not show up in Paypal. All that shows up is the amount and the name of the person that ordered. Can you tell me why and how to fix it?

Share this post


Link to post
Share on other sites

Hi all, I have a quick question that I'm sure someone can answer easily.

 

I have been using Paypal-IPN for months now, and everything is cool. However, recently, I've had a couple of orders go awry.

 

Now I had set up a button in my Paypal checkout process to say "CLICK TO COMPLETE ORDER" and 99% of customers clicked it and everything was fine.

 

But on two recent orders, it appears they did not click it. The order was logged fine, I received payment notification in osC (and the order status was updated to Paid), but the items were not deducted from my osC inventory, nor was an order notification email copy sent to me. I had to manually mess with the DB to fix inventory levels.

 

I have heard that AUTORETURN is not necessary for Paypal-IPN users, but can I still use it, in case the customer doesn't click the button? I want the order to be finalized and GO THROUGH.

 

I wish there was a way to get osC to automatically let the order be processed once it receives the IPN from Paypal, but maybe that's too complicated.

 

If I set autoreturn to on, what URL do I use?

 

checkout_success.php or checkout_process.php?

 

That's the main question I guess.

Share this post


Link to post
Share on other sites
Hi all, I have a quick question that I'm sure someone can answer easily.

 

checkout_success.php or checkout_process.php?

 

That's the main question I guess.

 

I have mine set to checkout_success.php and so far so good. Of course still running tests to see everything is working ok....


Read, read, read, test, read, read, test, read, implement.

Always back up your site and database before changes.

Always back up on a regular basis.

Share this post


Link to post
Share on other sites

on the other hand...

 

at the contribution page found this...

 

I realised in my prior fix, named updated, i had set the can return to /checkout_success, this is a no no, because if a customer cancelled from paying via paypl, they were taken to the checkout_success page and given a link. the correct link is ?shopping_cart. if they cancel from paypal, they are atken back to their shopping cart.

 

So will be testing this also...

 

Would be great if the answer to this issue was in the documentation.


Read, read, read, test, read, read, test, read, implement.

Always back up your site and database before changes.

Always back up on a regular basis.

Share this post


Link to post
Share on other sites
An update to my prevous post -

 

I've done a little more digging. Whether or not you get the option to "Purchase without PayPal Account" seems to be tied to whether or not a cookie has been set on the pc you are using. Once I've accessed PayPal on my computer, I no longer receive the option to "pay without account". If I clear the cache, cookies, history, etc. - then I will get the "pay without account" option. My question is - is it possible to ignore this cookie, so that a person will always receive the option to pay without a PayPal account?

 

Thanks,

Barb

 

At the paypal developers forum: http://paypal.forums.liveworld.com/thread....adID=1000001844 its short but should give you a better idea of the problem with the cookies.


Read, read, read, test, read, read, test, read, implement.

Always back up your site and database before changes.

Always back up on a regular basis.

Share this post


Link to post
Share on other sites
In regards to the encryption is a .crt file different from a .pem file?

 

Thanks, Will.

 

I used my .crt file and it worked where paypal was requesting a .pem file, so i would say no...

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

×