Photoshop plugin, IPN, PayPal issue Photoshop plugin, IPN, PayPal issue
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Photoshop plugin, IPN, PayPal issue

Started by webhostingelite, December 09, 2009, 06:33:56 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

webhostingelite

Running CPG 1.4.25, ModPack (works), Photoshop Plugin, PayPal and PayPal Sandbox, Godaddy Linux, PHP 5x, MySql 5.0, SSL is installed. OK, I am a nooby so I need some help!

I have purchases set for downloads. I have not changed any "custom fields" and she had them set to 1.Location, 2.Interests, website , Occupation, 5 is blank and 6 is biography...I did not change any confirmation email fields yet. Does paypal require them to be set to street address, city, state, country etc...?

I CHMOD to 755 on albums folder and the modpack works. IPN Log file is also 755 and works. Do any other folders require CHMOD to 755 or 777 for the shop and IPN?

I can purchase a pic thru PayPal and the IPN log is logging fine but I get a 7 Invalid 0 at the end of the transaction. IF I issue a refund in PayPal the IPN log file shows an 8 Verified for that transaction. I am using the https:// url in paypal IPN. https://www.cristinavelinaphotography.net/photogallery/index.php?file=photo_shop/photo_shop_paypal_ipn&action=ipn

When returning from PayPal back to my clients website (it uses the action=return at the end of that same link above), I get an internal server error 500. I looked thru the SERVER error log and here is what I get.

[Mon Dec  7 17:36:58 2009] [error] [client 24.xxx.xxx.30] FastCGI: comm with server "/home/content/x/y/z/justapath/html-x-httpd-php5" aborted: error parsing headers: malformed header 'index.php'

That is all I can think of at the moment and I have read thru as many posts on here for 3 days and I am getting frustrated so decided to ask for some advice and help! Thanks all in advance!


webhostingelite

OK folks, here is my issue simplified.

When Returning from PayPal to my clients CPG website, I get the Internal Server 500 error.

Could it be something with the action=return code?

I had the same problem on my other server with PHP4, now using PHP5

*could it be something with .htaccess and fastcgi?
*could it be anything with the php.ini? I looked at it and allow_url_fopen is = off, does that need to be turned on?

I could deal with shutting the PayPal return URL off and not getting the error at which time my client would have to manualy mark the order paid and HIT D to create the download directory, but it would be great to have it automated.

Stramm

Quote from: webhostingelite on December 09, 2009, 06:33:56 AM
I can purchase a pic thru PayPal and the IPN log is logging fine but I get a 7 Invalid 0 at the end of the transaction. IF I issue a refund in PayPal the IPN log file shows an 8 Verified for that transaction. I am using the https:// url in paypal IPN. https://www.cristinavelinaphotography.net/photogallery/index.php?file=photo_shop/photo_shop_paypal_ipn&action=ipn

Make sure you've set within both, PayPal settings and the shop plugin the same currency...

Check the merchant email for unwanted chars at the beginning and the end (space)

webhostingelite

I have the currency for both set to EUR and double checked the email address for spaces. My clients email address has a . (period) in the name like firstname.lastname@gmail.com but no space before or after the name etc.

My client is in Romania, so the PayPal merchant email address in CPG photoshop is set to https://www.paypal.com/ro/cgi-bin/webscr etc.

I have the pic set at 1EUR if you want to try it I will give you a FULL REFUND OR I can send you a couple bucks for the PayPal first if needed!  I am doing this particular job for next to nothing ...I have multi-user "admin access" and "refund" access to her PayPal so the refund can be immediate refund.

Stramm, for you I would give FTP, hit me up via email if you have time for it! We do reseller hosting and this very well might lead to some extra work for both you and I ....and could be great for all of us :).

Thanks again for your help and interest in getting this going, Jeff




webhostingelite

Quote from: webhostingelite on December 10, 2009, 02:13:38 AM
I have the currency for both set to EUR and double checked the email address for spaces. My clients email address has a . (period) in the name like firstname.lastname@gmail.com but no space before or after the name etc.

My client is in Romania, so the PayPal merchant email address in CPG photoshop is set to https://www.paypal.com/ro/cgi-bin/webscr etc.

I have the pic set at 1EUR if you want to try it I will give you a FULL REFUND OR I can send you a couple bucks for the PayPal first if needed!  I am doing this particular job for next to nothing ...I have multi-user "admin access" and "refund" access to her PayPal so the refund can be immediate refund.

Stramm, for you I would give FTP, hit me up via email if you have time for it! We do reseller hosting and this very well might lead to some extra work for both you and I ....and could be great for all of us :).

Thanks again for your help and interest in getting this going, Jeff




sorry, I clicked on the check to see what it was, ..I am very new here lolz

webhostingelite

Interesting, if I make a CD and purchase it, the paypal IPN returns valid and it is automatically mark paid, but I am still getting internal server 500 error upon returning from Paypal.

Maybe I did not install the modpack and photoshop correctly, do you happen to have a zip of CPG, modpack, and photoshop I could download from you?

If not, maybe it is time to reinstall everything an have another crack at it.


Stramm

Check the server error log for more info.
Maybe reupload
photo_shop_paypal_ipn.php
and
photo_shop_paypal_ipn_cls.php
again.

The return part just displays a message (Thanks for the purchease) and redirects to the index. So you could set another return URL (photo shop config) if it won't work for you at all. But with having a look at the error log you should be able to find out the reason.

webhostingelite

OK, maybe I missed the boat on installing the photoshop. I am thinking, it is a plugin, so I uploaded all files in that whole photoshop folder to the plugin folder and then I ran install plugin in the cpg admin.

Just to make sure, is that what I was suppose to do???? or "should I have taken all the files that were in the photoshop include folder and overwrite the main CPG include folder" like what you told me to do on the modpack...

If so, Should I do the sql and and lang folders like that too?

I will wait to hear back from you on this one before I proceed. Thanks again Stramm.

Stramm

it's a plugin... the unpacked photo_shop folder needs to be uploaded into the plugins dir.

webhostingelite

OK, that is what I originally did. I will try uploaded the IPN files again...

webhostingelite

I uploaded them again and did another transaction. The money makes it to her paypal but when returning to her website from PayPal I still get the internal server 500 error. Also, the order does not get marked to Paid. Here is the error from my error log.

[Thu Dec 10 01:40:36 2009] [error] [client 24.xxx.xxx.30] FastCGI: comm with server "/home/content/c/r/s/cristina/html-x-httpd-php5" aborted: error parsing headers: malformed header 'index.php'

webhostingelite

I made a thank you .php page for the return url in the admin shop config. It makes it to paypal and then from PayPal back to her server to the new thank you page without any errors, but it is not showing up paid until the admin manually marks it as paid.

*Is there a place to download an alternative like that for the shop?

If selling a "photo" for download, is it OK to leave the CD on 0 (zero) or does that need to be set on at least 1?

Thanks again, Jeff

webhostingelite

Hosting configuration 2.0 with godaddy (now is called 2.1 and they say scripts can be run from anywhere)

By default, files with a .php extension run under PHP 4 and files with the .php5 extension run under PHP 5. The .htaccess file, located at the root of your site, can be used to change these default settings. The following entries in a directory's .htaccess file designate .php files to run under PHP 5 and .php4 files to run under PHP 4.

AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4

So, if we check the error I am getting it is:
[Mon Dec  7 17:36:58 2009] [error] [client 24.xxx.xx.30] FastCGI: comm with server "/home/content/x/y/z/justapath/html-x-httpd-php5" aborted: error parsing headers: malformed header 'index.php'

you can see the error is from "FastCGI". So, now I am thinking, do I add the .htaccess AddHandler for PHP 4 and php 5 in or do I try to write code to deny "fastcgi" all together... OR can I try to rename the main page in CPG to index.php5 and try to take advantage of the fastcgi and see if we can get it working for the future.

this code could be used to block it in htaccess?
<Files fastphp.ini>
order allow,deny
deny from all
</Files>

Seems very strange because they are not running from CGI, but the server config is setup to take advantage of fastcgi from anywhere on the server now and associates the .extension .php or .php5 with the associated version respectively.

It will be great the "photoshop" setup with the new SERVER configuration and I spent so much time in google it seems like there are a ton of PHP applications that are giving the same errors with SERVER config 2.0. Joomla has quite a few and wordpress also, and we all know these are world class apps...

Anyway, this gives us food for thought and things to try. I posted info and ideas I could find so maybe others that come along with Server configuration 2.0 can help and contribute too! If I get things working on this configuration I will post my findings for all...


webhostingelite

sorry, the bold index.php5 above should have been index.php4

webhostingelite

OK, I am making progress. Adding AddHandler x-httpd-php5 .php to the .htaccess is allowing the order to come back from PayPal with IPN approved!

NOTE: I also changed my php5.ini file allo_url_open = on.

webhostingelite

If I make my own thankyou.php page for the return URL with no variables in it, the order goes thru paypal fine and returns the customer back to the site fine.

For my thankyou.php page "I get the P Shop PayPal IPN log" but if I try to use the default index.php?file=photo_shop/photo_shop_paypal_ipn&action=return "why do I get the Internal Server 500 error and I don't get the P. Any ideas?


webhostingelite

In CPG admin with logging and statistics, then view log, I can read the security log, but the path to view the text file log is bad. there is my error below. Any Ideas how to fix that? It reads it fine from the shop admin but was wondering about this area also...



/include/logger.inc.php

    * Warning line 66: include(logs/paypal_ipnlog.log.php) [function.include]: failed to open stream: No such file or directory
    * Warning line 66: include() [function.include]: Failed opening 'logs/paypal_ipnlog.log.php' for inclusion (include_path='.:/usr/local/php5/lib/php')

webhostingelite

Database Config: I would like to double check this configuration with you.

My tables in the mysql are prefixed cpg_ so I have "cpg_shop_" tables pertaining to the shop.

when I look through the photo_shop_paypal_ipn.php and look at the queries, it has
INSERT INTO `{$CONFIG['TABLE_SHOP_PAYPAL_LOG' and the other ones as well.

Should there have been a line updated in my config.inc.php when I installed and ran update?
The only one I have in the config.inc.php is the $CONFIG['TABLE_PREFIX'] =  'cpg_'; for the original CPG install.





webhostingelite

Hey Stramm, my environmental variable for _server is _SERVER["HTTP_HOST"] and _env host is _ENV["HTTP_HOST"] . Could that be why I am having problems with my parsed header error and receiving internal server 500 error?

Would the fputs and fsockopen be affected by this? I don't know what $url_parsed[host] section does cuz I am not a PHP programmer. Please respond this one :)

I have the CPG in a folder called photogallery located here: https://www.cristinavelinaphotography.net/photogallery

Is it possible we could hardcode the URL parsed host and path sections for testing?

Thanks for hanging in there with me!

*here is the error in my error log again:
[Tue Dec  8 20:20:59 2009] [error] [client 24.xxx.84.30] FastCGI: comm with server "/home/content/c/r/i/criseller2/html-x-httpd-php5" aborted: error parsing headers: malformed header

Gene-2008

If you are still having this issue with a IPN reply    action=return      this is what I found I had to do to fix it.

In the file: photo_shop_paypal_ipn.php

Add the $header_location equation and pay note to the addition of the Unix in the match pattern.
Also note I set Refresh to 8 for some delay to allow user to see the message.


require('photo_shop_paypal_ipn_cls.php');
$p = new photo_shop_paypal_class;

$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami|Unix/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 8; URL=' : 'Location: ';

switch ($_GET['action'])



I don't know why this is not set here as a matter of course....?

Hope this helps,
Gene