News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Dump PayPal verification?

Started by Sir Osis of Liver, January 17, 2019, 05:39:02 PM

Previous topic - Next topic

Sir Osis of Liver

Chasing what appears to be a server related Paid Subs glitch, would like to view the PayPal verification postback.  Looks like it happens here -



// Get the data back...
while (!feof($fp))
{
$this->return_data = fgets($fp, 1024);
if (strcmp(trim($this->return_data), 'VERIFIED') == 0)
break;
}



Subscription fails here -



/// If this isn't verified then give up...
if (strcmp(trim($this->return_data), 'VERIFIED') != 0) {
log_error('Paid Subscriptions error - IPN verification failed');
exit;
}



If I comment it out, sub activates.  PP support says verification is posted to forum.  Would like to at least confirm receipt, and view post data if possible.


Just checked, curl 7.29.0 is enabled, but verification still fails if I comment out curl code.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

live627

Maybe you could try

log_error(var_export($this->return_data,  true)); ???

I think that logs the data to the error log.

Sir Osis of Liver

I'll give it a try soon as I get a chance.  Thanks.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

Running this code -



/// If this isn't verified then give up...

if (strcmp(trim($this->return_data), 'VERIFIED') == 0)
log_error('Paid Subscription successful');
log_error(var_export($this->return_data, true));

if (strcmp(trim($this->return_data), 'VERIFIED') != 0) {
log_error('Paid Subscriptions error - IPN verification failed');
log_error(var_export($this->return_data, true));
exit;
}




On test forum where sub activates normally, logs two errors -



http://www.thekrashsite.com/smf20/subscriptions.php
'VERIFIED'

http://www.thekrashsite.com/smf20/subscriptions.php
Paid Subscription successful



On client forum where verification fails, logs three errors -



https://www.nukeworker.com/forum/subscriptions.php
false

https://www.nukeworker.com/forum/subscriptions.php
Paid Subscriptions error - IPN verification failed

https://www.nukeworker.com/forum/subscriptions.php
false



Verification postback is sent from same PayPal ip as IPN, and we are receiving IPN, but either not receiving VERIFIED or it is somehow damaged.  Still stumped. >:(
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Find out if the hosting company restricts outward net connections, e.g. what the value of allow_url_fopen is.

Sir Osis of Liver

#5
If that were the case, wouldn't PayPal not be receiving postback from forum?  They've told me postback is received, and they are sending verification.

phpinfo reports allow_url_fopen is 'On' (Local & Master).
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

live627

There are two code paths there: curl and fsock. Did you determine which one it uses?  Have you tried commenting out the curl code block?

Sir Osis of Liver

Yes, commented out curl code to force http, same result.  Other odd thing is, with verification commented out, subs activate ok, but around 10-15% are reported as active and pending.  There are also random currency errors that don't correspond with anything else.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: