Jump to content

CubeCart Recommends

Photo

Paypal IPN/Auto return payment failed solution


This topic has been archived. This means that you cannot reply to this topic.
69 replies to this topic

#31 feenster

feenster
  • Members
  • 29 posts

Posted 25 May 2006 - 09:30 PM

I had to apply it manually in 3.0.10.

Matt

#32 pds

pds
  • Members
  • 5 posts

Posted 29 May 2006 - 09:41 PM

If you add the above two methods to your file, make sure to replace the auth_token with the ones provided by paypal.


I tried to implement this fix, but have no PayPal token. We're using the API Certificate method, and PayPal says, "A given PayPal account can only be configured to use one of the two authentication methods, API Certificate or API Signature, at one time." The "token" is the "API Signature."

Any solution for this problem for API Certificates?

#33 feenster

feenster
  • Members
  • 29 posts

Posted 30 May 2006 - 01:52 PM

Just discovered an important point, which I think was touched on further back in the thread. With this mod, the email address that you use for Paypal and the email address you have entered in the store settings (to receive order notifications to), *must* be the same.

If they are not, you will receive money fine, but your customers will get "Your order failed" messages and the order will not be updated to "Processing".

Thanks to the OP for this great fix :-)

Matt

#34 nthrusse

nthrusse
  • Members
  • 19 posts

Posted 08 June 2006 - 04:55 PM

Issues with IPN, I get this error and I THINK I've done all the steps correctly...

This is the error message I get!

Warning: fopen(/2006-Jun-08.log): failed to open stream: Permission denied in /homepages/5/d159930759/htdocs/includes/content/confirmed.inc.php on line 273
can't open file


This is the code pasted in my confirmed.inc.php

$today = date("Y-M-d");
$myFile = "/homepages/5/d159930759/htdocs/".date("Y-M-d").".log";
$fh = fopen($myFile, 'abcloggerhead') or die("can't open file"); Line 273
$stringData = date("[Y/M/d, G:i:s] ").$msg."\n";
fwrite($fh, $stringData);
fclose($fh);

#35 peanutp

peanutp
  • Members
  • 90 posts

Posted 09 June 2006 - 02:43 PM

Thank you so so much for this fix. I have been pulling my hair out over the past few weeks trying to make sense of why the orders come back failed when they actually credit the account and change the status to processing in admin.

I must ask support why this fix has not been put forward for inclusion in the source files?? It was post a few months ago and im sure many other people have had similar issues??? Could you at least make this post a sticky?

Anyway, you have stopped my frustration and I can now progress with my cart development :lol:

Have a good weekend. Im off down the pub....

Peter :D :cat: :cry: :^^: :D :D :D :D :D :D :D

#36 Godsjewel

Godsjewel
  • Members
  • 8 posts

Posted 22 June 2006 - 09:35 PM



If you add the above two methods to your file, make sure to replace the auth_token with the ones provided by paypal.


I tried to implement this fix, but have no PayPal token. We're using the API Certificate method, and PayPal says, "A given PayPal account can only be configured to use one of the two authentication methods, API Certificate or API Signature, at one time." The "token" is the "API Signature."

Any solution for this problem for API Certificates?



When I set up IPN I received a identity token which is a long list of letters and numbers. It THAT the auth_token if so where do I replace that code?? Clarity would be appreciated. :lol:

#37 peanutp

peanutp
  • Members
  • 90 posts

Posted 23 June 2006 - 07:48 AM




If you add the above two methods to your file, make sure to replace the auth_token with the ones provided by paypal.


I tried to implement this fix, but have no PayPal token. We're using the API Certificate method, and PayPal says, "A given PayPal account can only be configured to use one of the two authentication methods, API Certificate or API Signature, at one time." The "token" is the "API Signature."

Any solution for this problem for API Certificates?



When I set up IPN I received a identity token which is a long list of letters and numbers. It THAT the auth_token if so where do I replace that code?? Clarity would be appreciated. :lol:



Log onto your Paypal account, goto your profile, click on website payment preferences, goto Payment Data Transfer, and you will see a long token number there. That is the one you to make a note of and paste between the quotes in the $auto_token field below.


////////////////////////////////
// Added by paypal auto return fix
////////////////////////////////
function pdtcheck()
{
global $db, $glob, $module, $basket;
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-synch';

$tx_token = $_GET['tx'];
logMsg( "" );
logMsg( "Using PDT to check order status for tx:".$tx_token );
$auth_token = "PASTE PAYPAL TOKEN INTO HERE";
$req .= "&tx=$tx_token&at=$auth_token";


Hope this helps.

Peter

#38 Godsjewel

Godsjewel
  • Members
  • 8 posts

Posted 23 June 2006 - 04:38 PM

When I set up IPN I received a identity token which is a long list of letters and numbers. It THAT the auth_token if so where do I replace that code?? Clarity would be appreciated. ;)


Log onto your Paypal account, goto your profile, click on website payment preferences, goto Payment Data Transfer, and you will see a long token number there. That is the one you to make a note of and paste between the quotes in the $auto_token field below.


////////////////////////////////
// Added by paypal auto return fix
////////////////////////////////
function pdtcheck()
{
global $db, $glob, $module, $basket;
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-synch';

$tx_token = $_GET['tx'];
logMsg( "" );
logMsg( "Using PDT to check order status for tx:".$tx_token );
$auth_token = "PASTE PAYPAL TOKEN INTO HERE";
$req .= "&tx=$tx_token&at=$auth_token";


Hope this helps.

Peter


Well I don't get the order failed anymore but get this instead

Warning: fopen(/home/public_html//2006-Jun-23.log): failed to open stream: No such file or directory in /home/lifesong/public_html/includes/content/confirmed.inc.php on line 270
can't open file

I am assuming I put the wrong path to the log directory that I created in the public_html folder. Not sure what I need to put there if its not /home/public_html/my log directory filename/ what do I need to put or is something else wrong? I did change the permission for the directory to 777. I at least feel like I am getting closer any help is appreciated. ;)

#39 peanutp

peanutp
  • Members
  • 90 posts

Posted 24 June 2006 - 05:10 PM

When I set up IPN I received a identity token which is a long list of letters and numbers. It THAT the auth_token if so where do I replace that code?? Clarity would be appreciated. :(


Log onto your Paypal account, goto your profile, click on website payment preferences, goto Payment Data Transfer, and you will see a long token number there. That is the one you to make a note of and paste between the quotes in the $auto_token field below.


////////////////////////////////
// Added by paypal auto return fix
////////////////////////////////
function pdtcheck()
{
global $db, $glob, $module, $basket;
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-synch';

$tx_token = $_GET['tx'];
logMsg( "" );
logMsg( "Using PDT to check order status for tx:".$tx_token );
$auth_token = "PASTE PAYPAL TOKEN INTO HERE";
$req .= "&tx=$tx_token&at=$auth_token";


Hope this helps.

Peter


Well I don't get the order failed anymore but get this instead

Warning: fopen(/home/public_html//2006-Jun-23.log): failed to open stream: No such file or directory in /home/lifesong/public_html/includes/content/confirmed.inc.php on line 270
can't open file

I am assuming I put the wrong path to the log directory that I created in the public_html folder. Not sure what I need to put there if its not /home/public_html/my log directory filename/ what do I need to put or is something else wrong? I did change the permission for the directory to 777. I at least feel like I am getting closer any help is appreciated. :D


hi,

Like you say, looks like you got the log path incorrect. To find out the correct path, either ask your hosting company, or open up /includes/global.inc and look at the $glob['rootDir'] entry. That is the full path to your store. Create the log file directory in root of your cubecart directory and pop the full path (remembering to include your logfile directory name at the end) into the appropiate line in the code.

Hope this helps.

Peter

#40 rukiman

rukiman
  • Members
  • 218 posts

Posted 28 July 2006 - 05:59 AM

I am trying to setup another cubecart 3.0.11 this time, and I have tried everything possible to get paypal IPN to work...all the orders keep coming up as orders failed, however payments are going through to paypal ok.

I have setup paypal sides of things, and pretty certain I have done everything correct, I have crosschecked multiple times.

I can't seem to apply this mod to fix this either as my server says that there is no SSL support in fsocketopen, I suspect it is the way my server is configured.

Any ideas on how to fix this or workarounds to fsocketopen??

#41 Sailor

Sailor
  • Members
  • 1 posts

Posted 29 July 2006 - 12:48 AM

I've been also working with the IPN stuff, and am not able to get the IPN to correctly reduce the stock when a purchase is processed. I've tried it both in the Sandbox, and via a live paypal account.

What DOES work is changing the setting from "IPN" to "Standard", but it seems like that has some bad security implications. I can't seem to find out why IPN is better than "standard" - and I don't currently have SSL/HTTPS set up for this client, so I gather IPN is better...

Can anyone confirm the difference between IPN and Standard?

I was suprised that 3.0.11 did not include the fix discussed here, it looks pretty robust to me. I guess the reason it was not just "dropped in" is becuase you do have to modify the code put in your identity token.

Thoughs on just going from IPN(does not reduce stock) to Standard (correctly adjust stock)?

Thanks!

#42 Chargin

Chargin
  • Members
  • 174 posts

Posted 30 July 2006 - 01:03 PM

I went through this mod and got the following error on a test purchase.
What does this mean?

Warning: fopen(): open_basedir restriction in effect. File(/logfoldername/2006-Jul-30.log) is not within the allowed path(s): (/home/cookie:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/cookie/public_html/includes/content/confirmed.inc.php on line 275

Warning: fopen(/logfoldername/2006-Jul-30.log): failed to open stream: Operation not permitted in /home/cookie/public_html/includes/content/confirmed.inc.php on line 275
can't open file

#43 Chargin

Chargin
  • Members
  • 174 posts

Posted 31 July 2006 - 01:22 AM

I went through this mod and got the following error on a test purchase.
What does this mean?

Warning: fopen(): open_basedir restriction in effect. File(/logfoldername/2006-Jul-30.log) is not within the allowed path(s): (/home/cookie:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/cookie/public_html/includes/content/confirmed.inc.php on line 275

Warning: fopen(/logfoldername/2006-Jul-30.log): failed to open stream: Operation not permitted in /home/cookie/public_html/includes/content/confirmed.inc.php on line 275
can't open file


I figured out where I went wrong, I didnt have home/public_html/ in the log folders location...
BUT this still doesnt work for me, Im still getting the sorry error...
I have-
-got same email in Paypal and cart
-included the mod listed on page 1 pf this thread with Paypal token string pasted, and my log file location included.
-IPN is on at Paypal
-Auto return is on at Paypal
-Payment Data Transfer is On at Paypal
-return address is http://www.mystore.com/confirmed.php
-IPN URL is http://mystore.com/m.../PayPal/ipn.php

What have I missed????? I might have to bother support for some help on this perhaps....

#44 Chargin

Chargin
  • Members
  • 174 posts

Posted 31 July 2006 - 02:03 AM

I just checked the Log folder and found this

[2006/Jul/31, 10:59:45]
[2006/Jul/31, 10:59:45] Using PDT to check order status for tx:3626661308517554L
[2006/Jul/31, 10:59:46] Payment Failed, Paypal response follows:
[2006/Jul/31, 10:59:46] FAIL
Error: 4003

4003, maybe I can search paypals site for that?

Hmm doesnt seem to help much..

What is Error 3105-4003?

Error 3105-4003 may appear if you click on a link for a secret question or an instant password. This error is most probably caused by invalid data.

If a link presented in an email received from PayPal does not work, the link may have been split into multiple lines by your email programme. To correct the problem, please copy and paste the link line by line until the entire link appears in the address bar of your web browser.

#45 spooksie

spooksie
  • Members
  • 18 posts

Posted 24 August 2006 - 11:09 AM

Im still having problems with this, could you at my code to tell me if I have missed anything out.

http://www.cubecart....showtopic=21436