S2member redirect 302 from paypal

After returning from Paypal (using IPN) instead of properly continue the registration I get multiple 302 until the page collapse with “Too many redirections”.

This is the return link (with some editing of course):
https://www.xxx.com/?s2member_paypal_return=1&s2member_paypal_return_tra=xxx&amt=xxx&cc=xxx&cm=xxx&item_name=xxx&item_number=xxx&st=xxx&tx=xxx&do_not_cache=28406

How can I fix it?

I tried to take a look at the debug (log) files I have paypal-api.log, nothing jump to the eye there.

Please help me.

Hi!

Could you verify that your s2-paypal integration is complete and correct? Are you using the s2 shortcode for paypal buttons, or is it some other code? Can I see it?

Also the core-rtn log entries for your test with the issue, please. WP Admin > s2Member > Log Files

Thanks. :slight_smile:

I use s2member shortCode here it is:

[s2Member-PayPal-Button level="1" ccaps="" desc="XXXXXXX" ps="paypal" lc="" cc="ILS" dg="0" ns="1" custom="https://XXXXX" ta="0" tp="0" tt="D" ra="360" rp="1" rt="Y" rr="BN" rrt="" rra="1" image="default" output="button" /]

The log:

LOG ENTRY: Thu Apr 8th, 2021 @ precisely 6:55 am UTC
PHP v7.3.27 :: WordPress v5.7 :: s2Member v200301 :: s2Member Pro v200301
Memory 13.50 MB :: Real Memory 16.00 MB :: Peak Memory 13.76 MB :: Real Peak Memory 16.00 MB
www.XXXXXX.XXXX/XXXXXXX
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
Array
(
    [s2member_log] => Array
        (
            [0] => Unable to verify $_POST vars. This is most likely related to an invalid configuration of s2Member, or a problem with server compatibility.
            [1] => Please make sure that you configure a PayPal PDT Identity Token for your installation of s2Member. See: `s2Member → PayPal Options → PayPal PDT/Auto-Return Integration`.
            [2] => See also, this KB article: `http://www.s2member.com/kb/server-scanner/`. We suggest that you run the s2Member Server Scanner.
            [3] => array (
  's2member_paypal_return' => '1',
  's2member_paypal_return_tra' => 'XXXXX',
  'amt' => '360.00',
  'cc' => 'ILS',
  'item_name' => 'XXXXX',
  'item_number' => '1::1 Y',
  'st' => 'Completed',
  'tx' => 'XXXXXX',
  'do_not_cache' => '67210',
)
            [4] => Redirecting Customer to the Home Page (after displaying an error message).
        )

    [s2member_paypal_return_tra] => XXXXXX
)

Thanks for the new details.

First thing I notice is the https:// in the custom value. It should just be the domain name (with the subdomain if you use one, e.g. “www”). So it’d be “mysite.com”, not “https://mysite.com”. The s2 button shortcode generator should give you the correct value for the custom attribute.

Could you fix that in the shortcode, reload the page with it, and try a new test?

I look forward to your update. :slight_smile: