S2Member - Error 'Unable to verify $_SERVER["HTTP_HOST"]

Hi all,

I’ve been having the same issue as many others have reported, since the middle of last week; when a new registrant signs up via PayPal, the payment process is complete on the PayPal side, and the user is redirected back to:

http://visionmixers.tv/?s2member_paypal_return=1&s2member_paypal_return_tra=TRACK_ID&s2member_paypal_return_success=http%3A%2F%2Fvisionmixers.tv%2Fsuccess%2F&amt=TXN_AMOUNT&cc=GBP&cm=visionmixers.tv&item_number=1&sig=TXN_SIG&st=Completed&tx=TXN_ID

At this point, the error

“ERROR: Unable to verify $_SERVER["HTTP_HOST"].
Please contact Support for assistance.”

If you are the site owner, please check the custom value in your Button Code. It MUST start with your domain name. "

is displayed. The PayPal transaction still goes through, and usually, the email confirmation of payment is still sent.

I’m guessing that since the cm=visionmixers.tv query variable appears in the return ID, that the custom variable in the shortcode for the PayPal button is set correctly. I’ve also verified that the Auto-Return URL is correct in our PayPal settings, as is the IPN URL (and using https).

An odd thing is: if I leave the error page open for a while and then reload it, the error page goes away and the user is redirected back to the success page.

I’ve tried this both using the S2Member shortcode directly in the page, and also by inserting the shortcode via PHP with a do_shortcode(); snippet. The error remains.

gateway-core-rtn.log - On the initial error:


LOG ENTRY: Wed Dec 5th, 2018 @ precisely 10:50 am UTC
PHP v5.3.3 :: WordPress v4.7.3 :: s2Member v170722 :: s2Member Pro v170722
Memory 97.07 MB :: Real Memory 97.75 MB :: Peak Memory 97.26 MB :: Real Peak Memory 97.75 MB
visionmixers.tv/?s2member_paypal_return=1&s2member_paypal_return_tra=fnhlOjkzNjkwYWE3NWE4ZjBhZGE4NzNiZjI2OGI2OTZjNDZifLzZn9SfW5GhiMLttoqLXp7deLPqWo6XiJd8heZxfYdppOBjrfGdp6NcoqCBn4FznY-dyXZvrZh6gYmroHDTg6Fui6nVVFyZZIB9dmWHd7nCs66joO-sQ6a0Z1m1Zatve9aAqpyQ5OB2r5-knn55e46WqZhplW-o4FOk5lqahoJfYJytknFbguLAu5y3y4tsZJ54s-pakJeI2cyrlXK-h3hqknKUudawoHSU57SitqrG0kuQx25slINpnMqubMGs1JegmKSVg6RigHGJYIiKr32rrp2guK9bo3tPi-Oo3biz2LOaneGsn4auTs6keYpk0Ixql5mLfZqfk86mgs58wl9xlXOOoFKQ0X6tnLfV&s2member_paypal_return_success=http%3A%2F%2Fvisionmixers.tv%2Fsuccess%2F&amt=30.00&cc=GBP&cm=visionmixers.tv&item_number=1&sig=JHcs1G%2F9HzxrtqTpmAloQUEeBLs%2BPTvirqpniS4PG97TPzeVXWnlKKLYh2EaSVj2Yptpmlv9IDv9nHkQj2qkd96zbuEuiVmics8avxXqVZys79pODoP7wkKnUv0uHXXDy%2F9PJSMLLpty0Mxttc62xAmuDbE4haJHrrR%2BsxOMo3c%3D&st=Completed&tx=8NK30664D2997260W
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
Array
(
    [transaction_subject] => Guild Freelance Members
    [payment_date] => 02:49:55 Dec 05, 2018 PST
    [txn_type] => subscr_payment
    [last_name] => McLean
    [receipt_id] => *RECEIPT ID REDACTED*
    [residence_country] => GB
    [mc_currency] => GBP
    [business] => *OUR-EMAIL-REDACTED*@visionmixers.tv
    [payment_type] => instant
    [protection_eligibility] => Ineligible
    [payer_status] => unverified
    [payer_email] => *MY-EMAIL-REDACTED*
    [txn_id] => *TXN ID REDACTED*
    [receiver_email] => *OUR-EMAIL-REDACTED*@visionmixers.tv
    [first_name] => William
    [payer_id] => 8GDF4BY9MGLJN
    [receiver_id] => 5L25JBVBJKETS
    [contact_phone] => *MY PHONE NO. REDACTED*
    [payment_status] => Completed
    [mc_fee] => 1.22
    [mc_gross] => 30.00
    [charset] => windows-1252
    [s2member_log] => Array
        (
            [0] => Return-Data received on: Wed Dec 5, 2018 10:50:09 am UTC
            [1] => s2Member POST vars verified through a POST back to PayPal.
            [2] => Unable to verify `$_SERVER["HTTP_HOST"]`. Please check the `custom` value in your Button Code. It MUST start with your domain name.
            [3] => Redirecting Customer to the Home Page (after displaying an error message).
        )

    [subscr_gateway] => paypal
    [s2member_paypal_return_success] => http://visionmixers.tv/success/
    [s2member_paypal_return_tra] => fnhlOjkzNjkwYWE3NWE4ZjBhZGE4NzNiZjI2OGI2OTZjNDZifLzZn9SfW5GhiMLttoqLXp7deLPqWo6XiJd8heZxfYdppOBjrfGdp6NcoqCBn4FznY-dyXZvrZh6gYmroHDTg6Fui6nVVFyZZIB9dmWHd7nCs66joO-sQ6a0Z1m1Zatve9aAqpyQ5OB2r5-knn55e46WqZhplW-o4FOk5lqahoJfYJytknFbguLAu5y3y4tsZJ54s-pakJeI2cyrlXK-h3hqknKUudawoHSU57SitqrG0kuQx25slINpnMqubMGs1JegmKSVg6RigHGJYIiKr32rrp2guK9bo3tPi-Oo3biz2LOaneGsn4auTs6keYpk0Ixql5mLfZqfk86mgs58wl9xlXOOoFKQ0X6tnLfV
)

Note: the custom value does not appear in the variable dump

gateway-core-rtn.log - After page reload and redirection to success page:

LOG ENTRY: Wed Dec 5th, 2018 @ precisely 10:56 am UTC
PHP v5.3.3 :: WordPress v4.7.3 :: s2Member v170722 :: s2Member Pro v170722
Memory 97.48 MB :: Real Memory 98.25 MB :: Peak Memory 97.80 MB :: Real Peak Memory 98.25 MB
visionmixers.tv/?s2member_paypal_return=1&s2member_paypal_return_tra=fnhlOjkzNjkwYWE3NWE4ZjBhZGE4NzNiZjI2OGI2OTZjNDZifLzZn9SfW5GhiMLttoqLXp7deLPqWo6XiJd8heZxfYdppOBjrfGdp6NcoqCBn4FznY-dyXZvrZh6gYmroHDTg6Fui6nVVFyZZIB9dmWHd7nCs66joO-sQ6a0Z1m1Zatve9aAqpyQ5OB2r5-knn55e46WqZhplW-o4FOk5lqahoJfYJytknFbguLAu5y3y4tsZJ54s-pakJeI2cyrlXK-h3hqknKUudawoHSU57SitqrG0kuQx25slINpnMqubMGs1JegmKSVg6RigHGJYIiKr32rrp2guK9bo3tPi-Oo3biz2LOaneGsn4auTs6keYpk0Ixql5mLfZqfk86mgs58wl9xlXOOoFKQ0X6tnLfV&s2member_paypal_return_success=http%3A%2F%2Fvisionmixers.tv%2Fsuccess%2F&amt=30.00&cc=GBP&cm=visionmixers.tv&item_number=1&sig=JHcs1G%2F9HzxrtqTpmAloQUEeBLs%2BPTvirqpniS4PG97TPzeVXWnlKKLYh2EaSVj2Yptpmlv9IDv9nHkQj2qkd96zbuEuiVmics8avxXqVZys79pODoP7wkKnUv0uHXXDy%2F9PJSMLLpty0Mxttc62xAmuDbE4haJHrrR%2BsxOMo3c%3D&st=Completed&tx=8NK30664D2997260W
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
Array
(
    [mc_gross] => 30.00
    [invoice] => 5c07acec7a0cb~82.5.151.224
    [protection_eligibility] => Ineligible
    [payer_id] => 8GDF4BY9MGLJN
    [payment_date] => 02:49:55 Dec 05, 2018 PST
    [payment_status] => Completed
    [charset] => windows-1252
    [first_name] => William
    [option_selection1] => visionmixers.tv
    [option_selection2] => 82.5.151.224
    [mc_fee] => 1.22
    [subscr_id] =>*PAYPAL SUBSCR. ID REDACTED*
    [custom] => visionmixers.tv
    [payer_status] => unverified
    [business] => *OUR-EMAIL-REDACTED*@visionmixers.tv
    [payer_email] => *MY-EMAIL-REDACTED*
    [option_name1] => Originating Domain
    [option_name2] => Customer IP Address
    [contact_phone] => *MY PHONE NO. REDACTED*
    [txn_id] => 8NK30664D2997260W
    [payment_type] => instant
    [last_name] => McLean
    [receiver_email] => *OUR-EMAIL-REDACTED*@visionmixers.tv
    [receiver_id] => 5L25JBVBJKETS
    [txn_type] => subscr_payment
    [item_name] => Guild Freelance Members
    [mc_currency] => GBP
    [item_number] => 1
    [residence_country] => GB
    [receipt_id] => 9648-4147-8056-2049
    [transaction_subject] => Guild Freelance Members
    [option_selection] => visionmixers.tv
    [option_name] => Originating Domain
    [s2member_log] => Array
        (
            [0] => Return-Data received on: Wed Dec 5, 2018 10:56:52 am UTC
            [1] => s2Member POST vars verified through a POST back to PayPal.
            [2] => s2Member originating domain ( `$_SERVER["HTTP_HOST"]` ) validated.
            [3] => s2Member `txn_type` identified as ( `web_accept|subscr_signup|subscr_payment` ).
            [4] => s2Member `txn_type` identified as ( `web_accept|subscr_signup|subscr_payment` ) w/o update vars.
            [5] => Registration Cookies set on ( `web_accept|subscr_signup|subscr_payment` ) w/o update vars.
            [6] => Transient Tracking Cookie set on ( `web_accept|subscr_signup|subscr_payment` ) w/o update vars.
            [7] => Redirecting Customer to a custom URL on success: http://visionmixers.tv/success/
        )

    [subscr_gateway] => paypal
    [subscr_baid] => *PAYPAL SUBSCR. ID REDACTED*
    [subscr_cid] => *PAYPAL SUBSCR. ID REDACTED*
    [eotper] => 
    [ccaps] => 
    [level] => 1
    [ip] => 82.5.151.224
    [period1] => 0 D
    [mc_amount1] => 0.00
    [period3] => 1 M
    [mc_amount3] => 30
    [recurring] => 30
    [initial_term] => 0 D
    [initial] => 30
    [regular] => 30
    [regular_term] => 1 M
    [currency] => GBP
    [currency_symbol] => £
    [s2member_paypal_return_success] => http://visionmixers.tv/success/
    [s2member_paypal_return_tra] => fnhlOjkzNjkwYWE3NWE4ZjBhZGE4NzNiZjI2OGI2OTZjNDZifLzZn9SfW5GhiMLttoqLXp7deLPqWo6XiJd8heZxfYdppOBjrfGdp6NcoqCBn4FznY-dyXZvrZh6gYmroHDTg6Fui6nVVFyZZIB9dmWHd7nCs66joO-sQ6a0Z1m1Zatve9aAqpyQ5OB2r5-knn55e46WqZhplW-o4FOk5lqahoJfYJytknFbguLAu5y3y4tsZJ54s-pakJeI2cyrlXK-h3hqknKUudawoHSU57SitqrG0kuQx25slINpnMqubMGs1JegmKSVg6RigHGJYIiKr32rrp2guK9bo3tPi-Oo3biz2LOaneGsn4auTs6keYpk0Ixql5mLfZqfk86mgs58wl9xlXOOoFKQ0X6tnLfV
)

I’m slightly baffled at this point. I’ve tried all of the suggestions here - and the S2Member Server Scanner passes almost perfectly (the only issue is a lack of mcrypt module).

Anyone have any ideas?

Thanks,

Cal McLean

It seems that many of us are experiencing this issue. And for all of those experiencing this, it seems to be a recent issue. I suspect it is a problem with PayPal. You may check out this thread in which one of us has been in contact with PayPal…https://forums.wpsharks.com/t/error-with-paypal-auto-return-url/5250/17

@mfussell - indeed, I’ve seen that post a few times. Unfortunately, it doesn’t look like PayPal are too keen to respond…

For those maybe having this problem going forward, and I was one try this if you haven’t already:

PayPal Options > PayPal PDT/Auto-Return…

At very bottom of section, click Auto-Return Page Template (optional customizations)
Read the next to last paragraph that explains Auto-Return Page Template, follow those directions about creating a php page and creating/naming per instructions and put in directory per instructions. I made a basic html page and just added the php code that begins the default return page and no other php code (not that it mattered, I just better with html). So this puts your return page more in your control. s2member happy, Paypal happy, customer happy, you happy.

I don’t think this requires much else, you are just replacing a default s2M php page with your own. Now you can link up or redirect as you wish. I hope this is a helpful post. If not, ignore me. But it’s working for me. Maybe some more php variables need to be in there, I haven’t played it all the way through yet, but the “Unable to verify” error message is gone.

1 Like