Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution]Paypal IPN - Devosc


devosc

Recommended Posts

just as a footnote, the osCommerce PayPal IPN Module v1.0 contribution allows the customer to cancel the order and when they return to the checkout, they have their gift voucher balance intakt, and the order has not been set a visible status. However, this contribution so more flexible and preferable, but Im worried im going to have to resort to it should I not find a fix for this current problem.

Link to comment
Share on other sites

  • Replies 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

I must admit that this is an imperfect solution. For example, I am also running the CCGV(trad) contribution. In the scenario that the customer cancels and the order is set as 'paypal pending', upon returning to the checkout their gift voucher balance would now be zero, despite them cancelling the order and hence not in effect using their gift voucher balance.

 

I cant understand why, in the module configuration, it has as an option 'Set Canceled Order Status', but this is not utilised when the customer does in fact cancel the order. Is this a bug? It certainly seems like it is :'(

 

Does anyone know the solution? I can't be the only one with this problem...

 

Canceled Order Status does not mean that the customer has cancelled the order. It means that the customer started the order using Paypal payment and pressed the cancel button while at the paypal website. Your admin section has the store this somehow because the customer can still log into their account and continue the same checkout from the order history page and complete the payment. The Set Canceled Order Status setting is so you can separate the that were cancelled by the customer at the paypal site. So it is not a bug. The setting is correctly used.

 

Did you try with the gift voucher balance? From what I understand they should be able to complete the same order at a later time using paypal through their order history so the same totals would apply. Also, from what I understand, the CCGV data is updated when the IPN is received but I may be wrong on that.

Link to comment
Share on other sites

Hi people,

 

I have installed this and followed the configuration perfectly. I have tried setup a fake account to test the process of paying through paypal but it does not give me the option to pay without signing in to paypal. Does anyone know what I'm doing wrong here?

 

Many thanks,

 

Richy

Link to comment
Share on other sites

Hi people,

 

I have installed this and followed the configuration perfectly. I have tried setup a fake account to test the process of paying through paypal but it does not give me the option to pay without signing in to paypal. Does anyone know what I'm doing wrong here?

 

Many thanks,

 

Richy

 

This is not a setting for the contribution but rather a setting in your paypal account settings. Go to paypal.com and change the settings there. This may only be allowed for business or premier accounts.

Link to comment
Share on other sites

This is not a setting for the contribution but rather a setting in your paypal account settings. Go to paypal.com and change the settings there. This may only be allowed for business or premier accounts.

 

Ahh thank you. This would have fixed my problem but it was not the solution to what I was experiencing.

 

I was so stupid that I thought the "click here if you don't have a paypal account link" would actually take you to sign up for paypal. I'm now worried that my customers will be as stupid as me and not realise to use this link to pay by credit card without having to have an account.

 

I clicked on the "info" link provided in the contrib but that shows different information than was relevant to me and any further users. Has paypal changed their payment screen recently making this popup help screen info invalid?

 

Cheers mates for the answers,

 

Richy

Link to comment
Share on other sites

  • 3 weeks later...

My problem with this started as soon as my server box was flagged with running recursive

DNS.

 

The email I got from godaddy stated that my server

"was identified as running an improper configuration of recursive DNS"

 

This is when my paypal problem started! (same time within say 30 mins)

 

It must be related somehow?!? ANY one have any ideas/knows?

 

Thank you, Wes

Link to comment
Share on other sites

Hi,

 

Good contribution, thanks, I have just installed it over an older version which I've started to have a few problems with.

 

How do I remove the "You do not need to be a PayPal member to pay by credit card [info]" and the credit card images? as I already have my own version of this in the checkout_payment.php file, and my current one fits better (not indented, spans less lines and is part of the selectable payment). At the moment I either have two version of it, or one that doesn't look very good (probably because my template is fixed width unlike the default template).

 

I have tried just blanking out the lines in the language file, and also had a look in the paypal.php module file itself, but I couldn't get it to work with it removed, so any tips would be appreciated.

 

 

 

Jason Fenlon

Link to comment
Share on other sites

Hi,

 

I have a problem with the ipn.php file - orders are not being updated from "Pending" after payment is completed, and if I test IPN through the test panel, or try and call ipn.php through my browser I just get this:

 

Firefox:

 

ipnxf4.jpg

 

Internet Explorer:

 

ipn2yc8.jpg

 

My primary and business emails are correct, the ipn.php file is defenitly on the server, and there are no references to ipn in the .htaccess file, so I am not sure what it could be.

 

Thanks in adavance for any help.

 

 

Jason Fenlon

Link to comment
Share on other sites

Hi,

 

I'm putting payment options into a site and this Contribution looks like the one to go for. Just one question before I start, I've gone to the Contribution download page but I'm not sure what to download - I thought all updates would contain all files but they don't so I'm a little lost - I've not installed a Contribution before. Any guidance appreciated.

 

Cheers,

Roman

Link to comment
Share on other sites

Hi,

 

Installed this contribution but in admin panel it is not rememebering the email address, ie when i hit update it is reverting back to root@localhost

 

anyone have any idea??? help its doing my nut in!!!!!!1

 

 

Well guess no one is around to help.

 

Just tried to re-insall, as usual i have to alter the sql file to make it acceptable to PHP admin, i go through it all again and now i get yet anothe problem.

 

I load up admin panel and all the links dont work.

 

Least its something different.

 

Please someone offer their help or ill burn my pc ( itll make me feel better for a breif moment)

Link to comment
Share on other sites

It doesn't look like this contribution is supported any more, which is a shame. Devosc hasn't been online since mid-July.

 

I managed to sort out my first problem, but still the ipn.php (which I guess is one of the most important files for this particular contribution) does not work.

Link to comment
Share on other sites

Hi,

 

I have a problem with the ipn.php file - orders are not being updated from "Pending" after payment is completed, and if I test IPN through the test panel, or try and call ipn.php through my browser I just get this:

 

Firefox:

 

ipnxf4.jpg

 

Internet Explorer:

 

ipn2yc8.jpg

 

My primary and business emails are correct, the ipn.php file is defenitly on the server, and there are no references to ipn in the .htaccess file, so I am not sure what it could be.

 

Thanks in adavance for any help.

Jason Fenlon

 

I think I have tracked this problem down to the includes/modules/payment/paypal/application_top.inc.php file.

 

Perhaps there is some sort of incompatibility with the code and my servers version of PHP (4.4.4).

 

If I delete application_top.inc.php from the server, I get an error message when calling ipn.php, which is more than I get with application_top.inc.php still on the server.

 

I've looked at the code, and nothing really stands out as something that may be causing the problem. The code I have is:

 

<?php
/*
 $Id: application_top.inc.php,v 1.1.1.1 2004/09/22 13:45:13 devosc Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 DevosC, Developing open source Code
 http://www.devosc.com

 Copyright (c) 2003 osCommerce
 Copyright (c) 2004 DevosC.com

 Released under the GNU General Public License
*/
 if ( strcmp(phpversion(),'4.0.6') <= 0 ) {
$_GET = $HTTP_GET_VARS;
$_POST = $HTTP_POST_VARS;
$_SERVER = $HTTP_SERVER_VARS;
 }
 unset($_GET,$HTTP_GET_VARS,$HTTP_POST_VARS);

// set the level of error reporting
//error_reporting(E_ALL & ~E_NOTICE);
error_reporting(1);

// check if register_globals is enabled.
// since this is a temporary measure this message is hardcoded. The requirement will be removed 

before 2.2 is finalized.
 if (function_exists('ini_get')) {
ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, 

please enable it!');
 }

// Set the local configuration parameters - mainly for developers
 if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

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

// define the project version
 define('PROJECT_VERSION', 'osCommerce 2.2-MS2');
 define('IPN_PAYMENT_MODULE_NAME', 'PayPal_Shopping_Cart_IPN');

// set php_self in the local scope
 if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];

// include the list of project filenames
 require(DIR_WS_INCLUDES . 'filenames.php');

// include the list of project database tables
 require(DIR_WS_INCLUDES . 'database_tables.php');
 require(DIR_WS_INCLUDES . 'modules/payment/paypal/database_tables.inc.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']);
 }

// define general functions used application-wide
 require(DIR_WS_FUNCTIONS . 'general.php');
 require(DIR_WS_FUNCTIONS . 'html_output.php');

// some code to solve compatibility issues
 require(DIR_WS_FUNCTIONS . 'compatibility.php');

// define how the session functions will be used
 require(DIR_WS_FUNCTIONS . 'sessions.php');

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

// include the mail classes
 require(DIR_WS_CLASSES . 'mime.php');
 require(DIR_WS_CLASSES . 'email.php');

 include(DIR_WS_MODULES . 'payment/paypal/classes/osC/Order.class.php');
 $PayPal_osC_Order = new PayPal_osC_Order();
 $PayPal_osC_Order->loadTransactionSessionInfo($_POST['custom']);

 if(isset($PayPal_osC_Order->language)) {
// include the language translations
$language = $PayPal_osC_Order->language;
include(DIR_WS_LANGUAGES . $PayPal_osC_Order->language . '.php');
 } else {
//later on change to Store Default
include(DIR_WS_INCLUDES . 'modules/payment/paypal/languages/english.php');
 }
?>

Link to comment
Share on other sites

I think the part that is causing the problem is this bit:

 

  include(DIR_WS_MODULES . 'payment/paypal/classes/osC/Order.class.php');
 $PayPal_osC_Order = new PayPal_osC_Order();
 $PayPal_osC_Order->loadTransactionSessionInfo($_POST['custom']);

 

Around line 83 in the file includes/modules/payment/paypal/application_top.inc.php

 

If you remove either of the first two of those lines, the file ipn.php loads (blank page) but is not functional as far as I can tell.

 

As far as I can tell, the error is either within these lines of code, or somewhere in the Order.class.php file.

Link to comment
Share on other sites

Hello again 2 days later after almost giving up today I made some headway!

 

It seems that someware along the line the download is calling the file from

 

/myhostwenthere/catalogdownload/

 

Rather then

/myhostwenthere/catalog/download/

 

when i made the dir /myhostwenhere/catalogdownload/

and /myhostwenthere/catalogpub/

 

and put the test file inside; the link was there however, when you click the link

and download the file it does not open! I opened it with notepad and low and behold this is what it said

 

 

Warning: opendir(/myhostwenthere/catalogpub/): failed to open dir: No such file or directory in /myhostwenhere/download.php on line 59

 

Warning: readdir(): supplied argument is not a valid Directory resource in /myhostwenthere/catalog/download.php on line 60

 

Warning: closedir(): supplied argument is not a valid Directory resource in /myhostwenhere/catalog/download.php on line 74

 

Warning: mkdir(myhostwenthere/catalogpub/.rryqoyehkhdhyqrprr): No such file or directory in /myhostwenhere/catalog/download.php on line 91

 

Warning: symlink(): No such file or directory in /myhostwenhere/catalog/download.php on line 92

 

Warning: Cannot modify header information - headers already sent by (output started at /myhostwenhere/catalog/download.php:59) in /myhostwenhere/catalog/includes/functions/general.php on line 29

 

 

 

I think there is a / missing between catalogdownload & catalogpub but what file or files woud I need to change?

 

How did I find out? I noticed a directory called /catalogdownload/ in my web directory

 

You can check to see if you have /catalogdownload/ in your main directory above /catalog/ where your main index.html is located.

 

If you do have that folder in your website then 100% chance you have the same problem I do! When I

 

solve this pest I will post it here.

 

Hope this helps.

 

 

Tony

Link to comment
Share on other sites

Hello again 2 days later after almost giving up today I made some headway!

 

It seems that someware along the line the download is calling the file from

 

/myhostwenthere/catalogdownload/

 

Rather then

/myhostwenthere/catalog/download/

 

Have you tried changing:

 

  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

 

to:

 

  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . '/download/');

 

and:

 

  define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

 

to:

 

  define('DIR_WS_DOWNLOAD_PUBLIC', '/pub/');

 

in catalog/includes/configure.php ?

 

That might help

Edited by JFenlon
Link to comment
Share on other sites

I just installed this on 2 sites yesterday and both installed with out any problems...I just printed all the directions out found a quiet room and cut and pasted away...I suggest for those that are having problems and are fairly new to OS/PHP to start over..

 

I did an entire intall for the 1st time in about 45mins and the sites were modified with various contributions...So many I have lost track.

 

 

I was using the Official Paypal IPN and it worked well, but since my site was not broke I thought I would try to break it

 

 

 

Good luck..

 

Back up and back up and just to be safe, back it up again!

Link to comment
Share on other sites

  • 2 weeks later...

All orders from the 12th of this month onwards are no longer receiving information from Pay Pal so they're sticking to PENDING - Which means the customer and myself receive notification of the payment but not the order process email.

 

I have 5 different sites running, this is currently seeming to affect all of the websites and NOTHING has been changed on the websites, NOTHING. No additions, nothing.

 

No changes to Pay Pal account either.

 

Is anyone else having this problem or know how to fix?

Link to comment
Share on other sites

I think many people (includung myself) are having the same problem.

 

The likely explanation seems to be either a change by PayPal, or perhaps your web host have done a server upgrade, (I know mine a pretty regular with the updates) and there are incompatiblities between the script and the new version of PHP/MySQL or perhaps something else on the server.

 

In my case, the ipn.php script isn't working, and using the test panel, or trying to bring the page directly via http://url.com/ipn.php results in "Cannot Find Server" (Internet Explorer) or an attempt to download the ipn.php file (Firefox). My problem seems similar to the one you (SamyT) had many pages ago in this thread.

 

I hope someone can discover a fix for this problem, because it isn't good for the seller or the customers when they aren't receiving order confirmation, and were having to update them manually.

Link to comment
Share on other sites

I've spoken with the host and they say nothing has been changed on or around the 12th of october and I certainly didn't change anything, it just suddenly stopped.

 

When I say I havent changed anything, I've had guests staying with me so I literally have done NOTHING to the site other than deal with orders - I'm just not getting this at all.

Link to comment
Share on other sites

I've spoken with the host and they say nothing has been changed on or around the 12th of october and I certainly didn't change anything, it just suddenly stopped.

 

When I say I havent changed anything, I've had guests staying with me so I literally have done NOTHING to the site other than deal with orders - I'm just not getting this at all.

 

 

Not my Findings, but I have a fix for it..

 

Make sure your Email Address and Businss ID Address are the same in the Payment Module under the Admin area.

 

Im sure Paypal's fix will correct this, but Im up and running with no problems now..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...