Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal_Shopping_Cart_IPN


devosc

Recommended Posts

Posted this in the Installation Forum and no response.? :(

 

Help? Anyone?

 

Post a url

My Webpage

 

Here's my site address, thank you for responding. :)

If you look at your url for linking to checkout and my account it is a https:// link. The problem is not with your paypal setup but with your ssl setup. If you do not have a ssl certificate you need to go into your configure.php files and set ssl to false. If you do have one then you need to check and make sure you have everything setup correctly.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Thank you! Now I can get to payment page but when I try to set up a buyer acct to finish the test purchase I get the following:

 

Warning: mail(): SMTP server response: 501 5.5.4 Invalid Address in U:\www\sunsetwebdesign\html\catalog\includes\classes\email.php on line 502

 

Warning: Cannot modify header information - headers already sent by (output started at U:\www\sunsetwebdesign\html\catalog\includes\classes\email.php:502) in U:\www\sunsetwebdesign\html\catalog\includes\functions\general.php on line 29

 

I've looked over general.php and email.php and can't find anything odd. Am I looking in the right place?

Link to comment
Share on other sites

Thank you! Now I can get to payment page but when I try to set up a buyer acct to finish the test purchase I get the following:

 

Warning: mail(): SMTP server response: 501 5.5.4 Invalid Address in U:\www\sunsetwebdesign\html\catalog\includes\classes\email.php on line 502

 

Warning: Cannot modify header information - headers already sent by (output started at U:\www\sunsetwebdesign\html\catalog\includes\classes\email.php:502) in U:\www\sunsetwebdesign\html\catalog\includes\functions\general.php on line 29

 

I've looked over general.php and email.php and can't find anything odd. Am I looking in the right place?

Link to comment
Share on other sites

Thank you! Now I can get to payment page but when I try to set up a buyer acct to finish the test purchase I get the following:

 

Warning: mail(): SMTP server response: 501 5.5.4 Invalid Address in U:\www\sunsetwebdesign\html\catalog\includes\classes\email.php on line 502

 

Warning: Cannot modify header information - headers already sent by (output started at U:\www\sunsetwebdesign\html\catalog\includes\classes\email.php:502) in U:\www\sunsetwebdesign\html\catalog\includes\functions\general.php on line 29

 

I've looked over general.php and email.php and can't find anything odd. Am I looking in the right place?

The headers already sent error message usually means you have some blank space either at the beginning or end of your file. I would check that first.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Thank you, Richard. I checked and there was a space at the bottom of the email.php. I deleted the space, saved it and still not having any luck.

 

Searched the forum and can't seem to find anyone else with this error, unless I'm using the search wrong.

 

I'm usually not this slow at learning something but this is my first time with php. I love this software, can't wait to use it. It was so easy to install, I guess I should've known there would be some hitches later on. Nothing good comes without lots of work. :)

Link to comment
Share on other sites

Noel, thank you for those kind words and looking into the compatibilty issue with the GV contrib.

 

sunset, I just looked at your site and didn't see any issues, maybe they're now resolved, bit busy at present.

 

Those having problems with the sendto and billto addresses not appearing in the order confirmation emails, I'm not sure why there should be any problem at all, when I get the chance I'll try and look into it (this would more easily be done if I had access to the site having the problem, but right now I can't afford the time), I would prefer to resolve this issue rather than going with the suggested fix below, since it would be preferable to maintain the code in the same format as the original checkout_process.php script so that when others want to change the email formats they can more easily relate back to the original script, anyhow below is another method for extracting the sendto and billto information, I haven't had time to test to see whether it can just be inserted into paypal/checkout_update.php but the following will give an idea of what could also be done:

        if ($order->content_type != 'virtual') {

          $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .

                          EMAIL_SEPARATOR . "\n";

          if ($order->delivery['company']) { $email_order .= $order->delivery['company'] . "\n"; };

          $email_order .= $order->delivery['name'] . "\n" .

                          $order->delivery['street_address'] . "\n";

          if ($order->delivery['suburb']) { $email_order .= $order->delivery['suburb'] . "\n"; };

          $email_order .= $order->delivery['city'] . ', ' . $order->delivery['postcode'] . "\n";

          if ($order->delivery['state']) { $email_order .= $order->delivery['state'] . ', '; };

          $email_order .= $order->delivery['country'] . "\n";

        }

 

        $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .

                        EMAIL_SEPARATOR . "\n";

          if ($order->billing['company']) { $email_order .= $order->billing['company'] . "\n"; };

          $email_order .= $order->billing['name'] . "\n" .

                          $order->billing['street_address'] . "\n";

          if ($order->billing['suburb']) { $email_order .= $order->billing['suburb'] . "\n"; };

          $email_order .= $order->billing['city'] . ', ' . $order->billing['postcode'] . "\n";

          if ($order->billing['state']) { $email_order .= $order->billing['state'] . ', '; };

          $email_order .= $order->billing['country'] . "\n\n";

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Thanks, Greg.

 

Still having issues trying to check-out and adding a new user. I'm plugging away trying to figure this out but not having much luck. Any suggestions you can offer when you have time would be greatly appreciated.

 

Thanks,

Dawn

Link to comment
Share on other sites

Ok I think I have found the problem with the emails

 

In the database setup sendto & billto fields are set as TinyInt

 

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

DROP TABLE IF EXISTS orders_session_info;

CREATE TABLE orders_session_info (

orders_id int(11) NOT NULL default '0',

sendto tinyint(1) NOT NULL default '1',

billto tinyint(1) NOT NULL default '1',

language varchar(32) NOT NULL default '',

currency char(3) NOT NULL default '',

content_type varchar(32) NOT NULL default ''

);

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

 

You can store only a number between -127 and 127 in a tinyint so if your address book gets bigger than 127 you get a problem

I changed the sendto and billto to a int(11)

I did a test order and now the Delivery Address and Billing Address is there again for a customer with a high id number

I have to waited a couple of days to see if I get the addresses on all the emails but it looks good so far :unsure:

 

Rob

Link to comment
Share on other sites

I'm also curious if anybody has this working with CCGV...

 

 

 

I was unable to ever figure out how to get it to work with CCGV, so I had to switch to the other paypal contribution (PayPal IPN v0.98). I have both contributions running fine now.

 

Which CCGV are you using? I have Strider's CCGV 510b on my system with Greg's IPN 2.2 and they both integrate fine and work great.

 

 

Not everything went smoothly for me, I got alot of "cannot redefine" in there. checkout_process's CCGV parts were calling the same functions as the paypal 2.2 checkout_process were. If you rem out one, the other mod doesn't work. For me that is.

 

First off though, Thank you very much Greg and Strider for making these mods and then taking the time to help others with them. That is the true spirit and heart of OSC. It is because of people like you that make OSC cart loyalty the best. Don't even mention another cart on this forum or you'll get your head bitten off.

 

Tip of the hat, a hearty handshake and a heartfelt thank you goes out to you guys for this.

 

AnyHoo...

Here's what I had to do (<disclaimer>I'm also heavily modded with 55 contribs installed, I have no idea what the stock version of this looks like, so this may or may not work for some... </disclaimer>):

 

If you do this, backup, haven't you learned that by now?!?

 

catalog/checkout_process.php

 

look for:

require(DIR_WS_CLASSES . 'order.php');
$order = new order;

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

$order_totals = $order_total_modules->process();

 

Change to:

	require(DIR_WS_CLASSES . 'order.php');
$order = new order;
// Noels mod to get this workin (CCGV and IPN)
if ($payment != 'paypal') 
{
require(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;
$order_totals = $order_total_modules->process();
} 
// End Noels mod to get this workin (CCGV and IPN)

 

That did it for me...

 

Hope this helps someone, I'm happy at least....

 

Noel

Noel, Thanks for the fix. This was the same problem I was having with the Paypal IPN and the Authorize.net Consolidated 1.7 modules. Your suggested changes did the trick. :P

 

Kilaz

Link to comment
Share on other sites

error message when installing PayPal_Shopping_Cart

 

hmm nearly made through theinstallingprocedure following the manual in the HTMLfile PayPal_Shopping_Cart_IPN .html

 

errormessage i gets when saving the general.php file

----------

Parse error: parse error in /home/rmblfish/public_html/ebooks/admin/includes/functions/general.php on line 401

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/rmblfish/public_html/ebooks/admin/includes/functions/general.php:401) in /home/rmblfish/public_html/ebooks/admin/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/rmblfish/public_html/ebooks/admin/includes/functions/general.php:401) in /home/rmblfish/public_html/ebooks/admin/includes/functions/sessions.php on line 67

 

 

Fatal error: Call to undefined function: tep_get_file_permissions() in /home/rmblfish/public_html/ebooks/admin/file_manager.php on line 183

 

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

 

 

whats wrong?

 

please help...

 

 

forgot to tell ya that i was here in the installationinfo when editing general.php in admin filemanager..

----------

admin/includes/functions/general.php

 

 

Find (line 919 in function tep_remove_order($order_id, $restock = false) ):

 

 

tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

 

 

 

ABOVE this line add:

 

 

//begin PayPal_Shopping_Cart_IPN

$ipn_query = tep_db_query("select paypal_ipn_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

if (tep_db_num_rows($ipn_query)) { // this is a paypal ipn order

$ipn_order = tep_db_fetch_array($ipn_query);

$paypal_ipn_id = $ipn_order['paypal_ipn_id'];

tep_db_query("delete from " . TABLE_PAYPAL . " where paypal_ipn_id = '" . (int)$paypal_ipn_id . "'");

tep_db_query("delete from " . TABLE_PAYPAL_PAYMENT_STATUS_HISTORY . " where paypal_ipn_id = '" . (int)$paypal_ipn_id . "'");

}

//end PayPal_Shopping_Cart_IPN

:huh:

Link to comment
Share on other sites

you would need to post the lines around line number 401 of general.php (5 up and below).

 

Sometimes hidden characters get inserted when copying and psting from the html code so if there are any spaces before '//begin PayPal_Shopping_Cart_IPN' and '//end PayPal_Shopping_Cart_IPN' on those respective lines, remove them.

 

Also see the post above regarding changing 'tinyint(1)' to 'int(11)' this is important

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

hello greg

 

shit have been trying all day now and now is night and im tired ;(

 

my english isnt that good anymor..rusty..

what do you meen by (5 up and below) ?

i tried pasting the htmlcode that should be above line :

tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

so you mean it should looklike this:

 

//begin PayPal_Shopping_Cart_IPN

$ipn_query = tep_db_query("select paypal_ipn_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

if (tep_db_num_rows($ipn_query)) { // this is a paypal ipn order

$ipn_order = tep_db_fetch_array($ipn_query);

$paypal_ipn_id = $ipn_order['paypal_ipn_id'];

tep_db_query("delete from " . TABLE_PAYPAL . " where paypal_ipn_id = '" . (int)$paypal_ipn_id . "'");

tep_db_query("delete from " . TABLE_PAYPAL_PAYMENT_STATUS_HISTORY . " where paypal_ipn_id = '" . (int)$paypal_ipn_id . "'");

}

//end PayPal_Shopping_Cart_IPN

tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

 

after pasting is done?

 

 

 

And were do i change the tinyint to int? is it in phpmysdmin you mean?

 

 

regards

 

 

a tired kenneth

 

ps! have my site at http://ebooks.top-10-list.com

Edited by rmblfish
Link to comment
Share on other sites

Don't use the file manager to edit your php script files (or any) I think the problem is that on line 401 (which is nothing to do with this contrib) is that there are some escaped quotes in the script but if you edit this script via the admin these escaped quotes will be lossed since the functions stripslashes is probably used which will remove the escaping '\' slash, (I've been tired all week).

 

Try repeating the edit on a fresh general.php and 'upload' to your site.

 

Yeah that int(11) thing needs to be done via phpMyAdmin etc...

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

ahh thanX will try to edit the files outside admin and doing it local instead...thanx i will tell ya how it went.

thanx you seem to be here fo everybody, keep up the good work!

have 2 Zzzzzzzzleep ;)

Link to comment
Share on other sites

I've installed all the files, made the edits, run the SQL, and am getting the following errors:

 

From the Catalog:

Parse error: parse error in /var/www/html/source/CATALOG/includes/application_top.php on line 261
? 
Warning: main(DIR_WS_INCLUDESfooter.php): failed to open stream: No such file or directory in /var/www/html/source/CATALOG/index.php on line 27

Fatal error: main(): Failed opening required 'DIR_WS_INCLUDESfooter.php' (include_path='.:/php/includes:/usr/share/php') in /var/www/html/source/CATALOG/index.php on line 27

includes/application_top.php, line 261 is:

???require_once DIR_WS_MODULES . 'payment/paypal/functions.php';

 

index.php, line 27 is:

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

 

From the Admin:

Fatal error: Call to undefined function: define() in /var/www/html/source/CATALOG/admin/includes/filenames.php on line 52

admin/includes/filenames.php, line 52 is:

??define('FILENAME_PAYPAL', 'paypal.php');

 

I'm working through them now, but if anyone can offer pointers or quick direction that would be really great!

 

(I've previously installed the STS Templates, UltraPics, Authorize.net Consolidated, and Print Order with Store Logo.)

 

Thanks

Edited by JABevan
Link to comment
Share on other sites

PHP Question:

 

includes/application_top.php, line 261:

 

???require_once DIR_WS_MODULES . 'payment/paypal/functions.php';

 

Shouldn't this have parenthesis:

 

???require_once (DIR_WS_MODULES . 'payment/paypal/functions.php');

 

 

If I do include the parenthesis I get this error:

Fatal error: Call to undefined function: require_once() in /var/www/html/source/CATALOG/includes/application_top.php on line 261

 

Also, isn't the relative path wrong? Shouldn't it be:

 

'modules/payment/paypal/functions.php'

 

???

Edited by JABevan
Link to comment
Share on other sites

Fixed the first problem. There was an extra space (or tab?) before line 261.

 

For educations sake, I'm still interested in the above question and why you wouldn't use parenthesis in this case. Thanks.

 

On to the admin error....

 

NIX that, the error on line 52 had an extra space before the line too... Shaking down the next error now that showed up after fixing the filenames.php error.

Edited by JABevan
Link to comment
Share on other sites

In the instructions it does say that copying and pasting from HTML can cause problems with extra characters and spaces being inserted. I thought I would mention that so if people in the future have similar problems they know to check that first before posting on here.

 

DIR_WS_MODULES points to your 'modules' folder, so that DIR_WS_MODULES . 'payment/paypal/functions.php' does point to modules/payment/paypal/functions.php.

Link to comment
Share on other sites

safoo -

 

Thanks for your reply. I feel stupid... :P

 

I was cruising along through all the errors I was running into, started testing the IPN and ran into this:

Fatal error: Cannot redeclare class order_total in /var/www/html/source/CATALOG/includes/classes/order_total.php on line 13

I don't think this is one I can overcome by myself. Any ideas???

Link to comment
Share on other sites

JaBevan, the fix Noel posted took care of this error for me. This seems to be a problem with using the Paypal IPN with other mods like authorize.net and CCGV.

 

catalog/checkout_process.php

 

look for:

 

 ?
require(DIR_WS_CLASSES . 'order.php');
$order = new order;

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

$order_totals = $order_total_modules->process();

 

 

Change to:

 

 ?
require(DIR_WS_CLASSES . 'order.php');
$order = new order;
// Noels mod to get this workin (CCGV and IPN)
if ($payment != 'paypal') 
{
require(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;
$order_totals = $order_total_modules->process();
} 
// End Noels mod to get this workin (CCGV and IPN)

Edited by Kilaz
Link to comment
Share on other sites

I did retest selecting a different payment method and it worked without a problem (no code changes) so the error above is somehow related to the module.

 

I'm still running this error down, and will report what I find, but if anyone has suggestions or experience with this I would appreciate the help.

 

Thanks!!! :)

 

~~~~~~~~~~~~~EDIT~~~~~~~~~~~~~~~~~

Kilaz - Trying it out now, thanks for the reply!!!

Edited by JABevan
Link to comment
Share on other sites

Hi Guys,

 

In regard to the fix Noel has identified and suggested, it would be preferable to not have to change anything in the original osC catalog/checkout_process.php script, so in paypal/checkout_process.php where it says,

 

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

Could someone try changing it to:

if(!class_exists('order_total')) {

  include(DIR_WS_CLASSES . 'order_total.php');

  $order_total_modules = new order_total;

}

This will first check to see whether the 'order_total' class exists already and if not then will create it as usual, you would then need to add $order_total_modules to the list of globals at the top of the file so that it can access the original one.

Haven't had time to test yet....

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

You would also need to move $order_totals = $order_total_modules->process(); into the above suggested if statement, I did a quick test and it should work but I don't have the CCGV installed.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...