Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
FAILED: Could not verify that the payment notification coming from Paypal was received correctly.
Posted: 13 May 2011 06:44 PM   [ Ignore ]
Is a Really Great Dancer
RankRank
Total Posts:  80
Joined  2010-06-22

I’m occasionally still getting the error:

FAILEDCould not verify that the payment notification coming from Paypal was received correctly

I saw in another message that this issue was solved. Is it possible to have the code that fixes posted? I’ve had to make some
customization to mod.cartthrob.php so I can’t just upload the latest version.

Thanks,

Rick

[ Edited: 17 June 2011 11:25 AM by Rob Sanchez ]
Profile
 
 
Posted: 13 May 2011 06:56 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

Is it possible to have the code that fixes posted?

All of the changes are in the paypal standard gateway. I’d recommend using a “diff” program to compare the files (like Kaleidoscope or Changes on the Mac http://www.kaleidoscopeapp.com/). The primary change was:

THIS:

// Fix for multi-line data
            
foreach ($post as $key => $value)
            
{
                
// Thanks to Dom.S for finding a cure for this multi-line issue.  
                
$cleaned preg_replace('/(.*[^%^0^D])(
)(.*)/i'
,'${1}
${3}'
,  urldecode($value));
                
                
$post[$key] $cleaned;
            
}
            
            $data 
$this->data_array_to_string($post); 

CHANGED TO:

$data $this->data_array_to_string($post);
            
            
// Fix for multi-line data
            // Thanks to Dom.S for finding a cure for this multi-line issue.  
            // and to me for finally figuring out I needed to move this AFTER I urlencoded the data
            // ***** facepalm ******
            
$data preg_replace('/(.*[^%^0^D])(
)(.*)/i'
,'${1}
${3}'
,  $data); 

 

Rather than changing CartThrob in the future, I’d recommend using the built in Extension hooks to extend and override it. That’s what they’re there for. And if there’s behavior you can’t override, let us know, and we might add a new hook to control it. At the present, I’d strongly recommend undoing any existing hacks and move them out into extensions. Writing an extension is, for the most part pretty easy once you’ve seen it done once…. especially if you’ve already got the code doing what you want.

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 13 May 2011 07:24 PM   [ Ignore ]   [ # 2 ]
Is a Really Great Dancer
RankRank
Total Posts:  80
Joined  2010-06-22

Hi Chris,

I may have been mistaken about modifying mod.cartthrob.php. I see that I wrote a extension for a modification I needed.

All the other mods are in the process folder and paypal gateway.

Will try the above code.

Thanks,

Rick

Profile
 
 
Posted: 13 May 2011 11:21 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

Make sure you reference the actual code in the gateway file over what I have above. It looks a little weird above… like something was lost when it was posted in the preg_replace function. At any rate… that stuff should be easy to find.

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 16 May 2011 08:45 AM   [ Ignore ]   [ # 4 ]
Has a Nice Profile
Avatar
RankRank
Total Posts:  127
Joined  2010-05-24

Im also having this problem, but i can’t find that code in the paypal_standard file to replace?

Profile
 
 
Posted: 16 May 2011 10:16 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

If the file is really, really old… it might not be there. It should be right after


$post[‘cmd’] = ‘_notify-validate’;

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile