Error with Paypal Auto-Return URL

AWESOME!!! Thanks for helping us!

2 Likes

Any joy with the fix Christian?

Yes, I sent it to the user that has been helping me test, but I haven’t had a reply yet. It wasn’t long ago that I sent it.

I can give you the file here for you to test as well, if you feel like it.

I’m not positive that this will fix it yet, that’s what I need to confirm with this test.

What I think may be the problem from what I saw in the log entries, is that PayPal seems to have changed the name of the variable for the custom value. Instead of custom, now it appears to be cm.

The fix to test here just adds this before $paypal['custom'] is checked by s2Member:

											// !!! 'custom' attribute fix. -clavaque
											if (!isset($paypal['custom']) && isset($paypal['cm']))
												$paypal['custom'] = $paypal['cm'];

Here’s the file: paypal-return-in.inc.php.zip (4.2 KB)

Unzip it and upload the PHP file to the dir s2member/src/includes/classes/. Don’t overwrite the existing file, instead rename the original adding .bak at the end, so you can restore it easily if needed.

Then enable logging, do a 1 dollar test, and disable logging again.

Let me know how it goes! :slight_smile:

Cristian, I wish I knew how to follow your fix instructions… it’s technically beyond me :confused:

I’m sorry I made it sound complicated.

You’d extract the paypal-return-in.inc.php file from this zip, and upload it via FTP to the folder /wp-content/plugins/s2member/src/includes/classes/.

Just keep a copy of the original paypal-return-in.inc.php so you can put it back if the above doesn’t work.

If that’s hard for you, don’t worry, someone else will likely try it, too. Once we confirm it works, I can help you further to implement it for you if you need it.

no need to apologise. it doesn’t sound complicated Cristian… I have a history of tinkering with things to the point they need to be scrapped and replaced at considerable expense, there for i don’t tinker with things i really don’t understand anymore lol.

If that fix does end up working, could you not broadly apply it to s2member’s architecture so that ‘it just works’?

1 Like

Absolutely.

But since I don’t know when the next release will happen, although I hope in the next month, it’d be great for users to be able to apply it directly to their installations if it’ll help cope with PayPal’s change in the meantime.

1 Like

Just wondering, does this possible PayPal change apply to S2Member Pro as well? I just tested my site and everything seems to be working fine. I was able to subscribe, pay for the subscription via PayPal, and was then taken to my Thank You page. Didn’t notice any issues.

Thank you Cristian! Much appreciated.

1 Like

s2Member Pro still uses the same code to interact with PayPal, there’s a core integration that’s already in the s2Member Framework, and s2Member Pro adds to it. This processing of the return variables is part of that core.

If by s2Member Pro you mean the pro-forms that integrate with another service of PayPal that isn’t PayPal Standard buttons, then I don’t know.

You’d think that it being the same company, a change would apply to the whole service, but each product really is separate. So it’s still possible that a change was done to PayPal Standard and not PayPal Pro.

You could enable logging, do a test purchase, and see what the log entries say. Look for mentions of the custom attribute and whether it was validated or there’s an error message.

It’d be interesting to see what your tests show.

Let me know if you do them, and your findings, please. :slight_smile:

You would think, though, that if PayPal has made a change, then everyone who uses S2Member for payments would be affected, and that more people would be here reporting it. I’ve had several membership sign-ups today, including payments, and all appear to have gone through without issue.

1 Like

Yes, you would think.

I also know that PayPal, at least in the past, has applied changes to some users first, not everyone. Similar to their user interface.

Other than that, I don’t know what it could be right now.

And that variable name change was the best hint I could find in the logs I had access to from a site with this problem… So I’m tackling it to see the result.

Hopefully it’ll be positive.

Then if someone else still reports it, I’ll dig some more and troubleshoot further. :slight_smile:

1 Like

I know we all appreciate the effort you’re putting in, so thanks. :slight_smile:

2 Likes

Hello Cristian,

I have been following this thread for a while, as I have been receiving the same error as everyone else. When I saw the patch you posted, I was excited to integrate it and gave it a shot.

Unfortunately, I am still getting the same error. I am a PHP programmer, and more than willing to help you do any advanced troubleshooting with my configuration. I am running my own EC2 instance using Amazon Linux2 and PHP7.2. I have noticed a lot of quirks with this latest version of PHP - not sure if there may be a subtle issue there.

Would love to hear your thoughts, and thank you for your efforts!

Ben M.

2 Likes

Thanks, Ben! I really appreciate that. :slight_smile:

I just heard back from another user saying that the patch wasn’t enough for him either.

I will take a new look at it soon.

1 Like

just got this back from PayPal.

Thank you for contacting PayPal Merchant Technical Support.

I understand you get an error after the redirection .

Check that the return URL that you are passing in the subscription button is correct, and is the same domain as your website . Sometimes may be the problem could be http:// https://
The error you sent seems to be from your website, since it comes from php.

I hope this helps. Do not hesitate to contact me for any other questions.

Kind Regards

Pablo
PayPal MTS

Thanks for the update, Sean. :slight_smile:

1 Like

Just wanted to add that after 5 years of working without a hitch (and no ‘tinkering’ with the site mechanics in all that time), I’m suddenly getting the same error as the op.

Checking the logs it appears this has been happening since around November 2018. (Edit - weirdly, 1 subscription worked perfectly in mid December)

Edit - Tried the updated php file, made no difference.

2 Likes

Same issue here on a client site, been causing issues for at least a month. I thought that updating the Auto-return URL to HTTPS had fixed it since I tested successfully twice after that (this was back on Dec 8th) but now the client is again having issues with people that have paid but have no login. And upon my testing the “unable to verify” error is back again.

When I’ve done logging what I saw was an incomplete response (missing custom, subscr_id, and other fields) from PayPal on the initial call of c_ws_plugin__s2member_paypal_utilities::paypal_postvars() and then a later response perhaps 5 min. later would be complete.

@clavaque I tried the PHP file replacement and it made no difference in my case either.

Hope we get a fix soon since this is making everyone look bad.

1 Like