Error with Paypal Auto-Return URL

What you have is just fine, no indenting required.

1 Like

Hi Josh,

Thank you for posting this. I tested it first in Microsoft Edge, and it hung there for a while and finally timed out saying it couldn’t reach the page. Tried the same thing in Chrome, and that timed out saying “too many redirects”, but then it jumped to the success page a few seconds later. This site is not live yet, and I’ve been testing with the Paypal Sandbox. Is it safe to assume there is no difference from the live site (regarding this error)?

Thanks again,

I couldn’t say whether or not this issue exists on the PayPal sandbox. I’m only working in a live environment since that is where my client’s issue has been occurring. I would suggest leaving my code snippet out and generate s2Member debug logs while using the PayPal sandbox and live APIs and see what the auto-return responses look like, then go from there.

If you think the sandbox may need even more time to ready a proper auto-return response you can up the number of sleep seconds – Chrome seems to have a redirect limit of 20; 20 x 3 = 60 seconds + network & script execution time; if those ~60 seconds isn’t enough time then you will get the behavior you experienced.

PayPal sandbox is broken, years ago, never use it. Set amount to $0.01 and test on life environment. Then cancel your tests, if you wish.

1 Like

Josh, I agree with Krum that the PayPal sandbox is not the best for testing, sadly. Do live transactions, even if they’re cents. Here’s an old video I made on that:

I have made several tests these days, and still haven’t managed to reproduce this error, so it’s being quite difficult to troubleshoot. I’m not giving up, though.

In the meantime, there was a tip shared in a separate thread related to this error, that seems to have prevented the error from happening for him, so I’m quoting it here for you guys to try in the meantime. Hopefully it’ll work for you too.

Quick question for my troubleshooting: do you get that error with every purchase, or only some? Is it when paying logged into a PayPal account, or when paying with a card without logging into PayPal, or both? I’m just trying to find more factors that may be playing a part in this… If you have any new details from any new times the error message is shown, please let me know, it may hold a clue. Thank you! :slight_smile:

I cannot find the “Auto-Return Page Template (optional customizations)” under “PayPal Options > PayPal PDT/Auto-Return…”

Its just not there to be customised

You can find it here:

Click on the optional customizations link to expand that block of text.

Christian, it not there… when I go in to paypal pdt/auto return integration all I have is :

More Information (click here)
Quick Tip: In addition to the default Auto-Return/PDT configuration inside your PayPal account, the Auto-Return URL is also set on a per-transaction basis from within the special PayPal Button Code that s2Member provides you with. In other words, if you have multiple sites operating on one PayPal account, that’s OK. s2Member sets the Auto-Return URL (dynamically) for each transaction. The result is that the Auto-Return URL configured from within your PayPal account becomes the default, which is then overwritten on a per-transaction basis by the s2Member software.

my paypal pdt identity token is there along with the auto return url, however the section at the bottom Auto Return page template (optional customisation) is just not there.

its probably an s2member PRO feature… I’m running the free one at the moment

You are absolutely right. I had not looked at the Framework alone for so long, that I missed it. Yes, it’s a Pro feature.

The documentation there even starts by saying “With s2Member Pro installed, you have…” lol. I just opened the box to take the screenshot and didn’t read. Sorry about that.

no worries. What if we were disable the auto return to website feature… Would this be possible?

that error is a real turn off for paying customers… right now I wouldn’t even mind if the auto return directed to somebody else’s website…lol… but that error frightens customers to question their purchase.

So basically… when paypal is done taking payment, it tells s2member its done, but s2member is not ready tell the customer (because it is still processing the info) that they have successfully paid so they can register… this is what I think the issue is in plain English.

It had never occured to me, I haven’t tested it myself. s2Member would still get the IPN from PayPal, which would trigger the signup email, if I’m not mistaken. The user would need to click the link at PayPal to come back, it wouldn’t happen by itself, and then he may not get a cookie set to signup with the paid access right then, but the signup link he gets by email would be fine.

I’ll go do a test with this now, to verify the behavior. Feel free to test it yourself, not just for the behavior, but to see what you get in the logs for the transaction. The user wouldn’t see the error message, that I’m pretty sure of. I’ll be back in a mooment after trying removing the auto-return URL from my setup.

Yeah, that error should not be there at all when the custom value is the correct one…

so where exactly should I disable the auto return feature? in paypal? or is there a particular area in s2member i need to go to to disable it?

Payment data transfer (optional)
Payment data transfer allows you to receive notifications of successful payments when they are made. The use of payment data transfer depends on your system configuration and your Return URL. Please note that in order to use payment data transfer, you must turn on auto return.

It says in paypal “Please note that in order to use payment data transfer, you must turn on auto return.”…

Does this mean that if I turn the auto return feature off in paypal, then paypal will not tell s2member that a successful transaction has taken place and inherently not issue registration emails to customer?

If you remove that PDT token from your set up which i think you mean is turn off auto return in paypal, which will turn off payment data transfer feature along with it, how will paypal notify s2member of successfully paid subscribed customers, and also when customers cancel re-occuring payments how will s2member receive this information?.. doesn’t it need that token to write to s2member, or is that all setup in the paypal button code?

We launch tomorrow evening (sunday 6 jan)… if we can be spared those error messages with a fully functioning system it would be great

I meant to say auto-return URL from my setup, I got confused when typing from looking at them together. Sorry about that.

I can’t remove the URL, though… Even if I don’t set it in PayPal, s2Member sets it on a transaction basis…


So you’re about to launch. If you want me to, I’ll be happy to take a look at your installation. Since I can’t get the error in mine, I’ll be glad to look at one that does.

You can send me privately the WP and FTP credentials.

1 Like