Custom Success URL being ignored on Stripe Pro-Forms?

Hey all,

I’ve installed S2Member Pro on our website, running Wordpress 6.0.2 and it works flawlessly with one exception - the Custom Success URL is ignored upon successful payment when using our Stripe Pro-Forms and the user is shown a generic message at the top of the form. :sleepy:

This is the Pro-Form code:

[s2Member-Pro-Stripe-Form level="1" ccaps="" cc="GBP" custom="new.ourwebsite.com" ta="0" tp="0" tt="D" ra="30" rp="1" rt="M" rr="0" coupon="" accept_coupons="1" default_country_code="GB" captcha="0" success="/wecome-page/" template="stripe-checkout-form-new.php"]

[s2Member-Pro-Stripe-Form level="1" desc="1 Week - <span>£25.00</span>" ra="25.00" /]
[s2Member-Pro-Stripe-Form level="1" desc="1 Month - £40.00" ra="40.00" /]
[s2Member-Pro-Stripe-Form level="1" desc="3 Months - £60.00" ra="60.00" /]

[/s2Member-Pro-Stripe-Form]

We’ve used S2Member for 8+ years on a previous install and have not experienced any issues, and so I’m hoping this is an easy fix, and we have a theory:

Currently, this website is within a sub-domain which is password-protected on the server - is it possible that this password protection, which throws a 401 error to the user upon providing the wrong password, is causing this issue?

However, we also have standard PayPal buttons on a separate page within this same website and there are no issues with these, and their success “/welcome-page” attributes work flawlessly.

We have no other redirect issues within the website, and logging at s2-http-api-debug.log, we have the following errors:

LOG ENTRY: Fri Mar 17th, 2023 @ precisely 12:43 pm UTC
PHP v7.1.21 :: WordPress v6.0.2 :: s2Member v221103 :: s2Member Pro v221103
Memory 17.92 MB :: Real Memory 6.00 MB :: Peak Memory 18.08 MB :: Real Peak Memory 6.00 MB
new.ourwebsite.com/paymentgatewaystripe/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Array
(
[state] => response
[transport_class] => Requests
[args] => Array
    (
        [method] => POST
        [timeout] => 20
        [redirection] => 5
        [httpversion] => 1.1
        [user-agent] => s2Member v221103; https://new.ourwebsite.com
        [reject_unsafe_urls] => 
        [blocking] => 1
        [headers] => Array
            (
            )

        [cookies] => Array
            (
            )

        [body] => Array
            (
                [txn_type] => web_accept
                [txn_cid] => cus_NVa6DAFwlVCR6o
                [txn_id] => pi_3MmcchB5DI0KRgH211dtjSsU
                [custom] => new.ourwebsite.com
                [mc_gross] => 20.00
                [mc_currency] => GBP
                [tax] => 0.00
                [payer_email] => thecorrectemailaddress@gmail.com
                [first_name] => Joe
                [last_name] => Bloggs
                [option_name1] => Originating Domain
                [option_selection1] => new.ourwebsite.com
                [option_name2] => Customer IP Address
                [option_selection2] => 147.12.228.123
                [item_name] => Discount: 20% off. (Now: £20.00 for 1 month) ~ ORIGINALLY: 1 Week - £25.00
                [item_number] => 1::1 M
                [s2member_paypal_proxy] => stripe
                [s2member_paypal_proxy_use] => pro-emails
                [s2member_paypal_proxy_coupon] => Array
                    (
                        [coupon_code] => demo01
                        [full_coupon_code] => demo01
                        [affiliate_id] => 
                    )

                [s2member_paypal_proxy_verification] => fbfbebc9d298cbeebb193ae03d84b691
                [s2member_paypal_proxy_return_url] => /wecome-page/
            )

        [compress] => 
        [decompress] => 1
        [sslverify] => 
        [sslcertificates] => /var/www/new.ourwebsite/wp-includes/certificates/ca-bundle.crt
        [stream] => 
        [filename] => 
        [limit_response_size] => 
        [s2member] => 221103
        [_redirection] => 5
    )

[url] => https://new.ourwesbite.com/?s2member_paypal_notify=1
[response] => Array
    (
        [headers] => Requests_Utility_CaseInsensitiveDictionary Object
            (
                [data:protected] => Array
                    (
                        [date] => Fri, 17 Mar 2023 12:43:10 GMT
                        [content-type] => text/html; charset=iso-8859-1
                        [www-authenticate] => Basic realm="Restricted"
                        [cf-cache-status] => DYNAMIC
                        [report-to] => {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=2JI4G4AHW3vI0wKV%2FWNULIGvqEWbdmC781a0TJ%2F23txf44kWbz30V8RxsTaMxNNT0G%2FrLNrTJ0YRUfxLFbGC0sk9vZ%2FRIpRk0XYbeCQdBbQFNzAwyJEAjppZiDz5eAPqrpISgg7s0DBnFyCtnFzfN3Q36OvCNBa6"}],"group":"cf-nel","max_age":604800}
                        [nel] => {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
                        [server] => cloudflare
                        [cf-ray] => 7a9551f0bbcb0155-CDG
                        [alt-svc] => h3=":443"; ma=86400, h3-29=":443"; ma=86400
                    )

            )

        [body] => <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<hr>
<address>Apache/2.4.12 (Ubuntu) Server at new.ourwebsite.com Port 443</address>
</body></html>

        [response] => Array
            (
                [code] => 401
                [message] => Unauthorized
            )

        [cookies] => Array
            (
            )

        [filename] => 
        [http_response] => WP_HTTP_Requests_Response Object
            (
                [response:protected] => Requests_Response Object
                    (
                        [body] => <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<hr>
<address>Apache/2.4.12 (Ubuntu) Server at new.ourwebsite.com Port 443</address>
</body></html>

                        [raw] => HTTP/1.1 401 Unauthorized
Date: Fri, 17 Mar 2023 12:43:10 GMT
Content-Type: text/html; charset=iso-8859-1
Transfer-Encoding: chunked
Connection: close
WWW-Authenticate: Basic realm="Restricted"
CF-Cache-Status: DYNAMIC
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=2JI4G4AHW3vI0wKV%2FWNULIGvqEWbdmC781a0TJ%2F23txf44kWbz30V8RxsTaMxNNT0G%2FrLNrTJ0YRUfxLFbGC0sk9vZ%2FRIpRk0XYbeCQdBbQFNzAwyJEAjppZiDz5eAPqrpISgg7s0DBnFyCtnFzfN3Q36OvCNBa6"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
CF-RAY: 7a9551f0bbcb0155-CDG
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<hr>
<address>Apache/2.4.12 (Ubuntu) Server at new.ourwebsite.com Port 443</address>
</body></html>

                        [headers] => Requests_Response_Headers Object
                            (
                                [data:protected] => Array
                                    (
                                        [date] => Array
                                            (
                                                [0] => Fri, 17 Mar 2023 12:43:10 GMT
                                            )

                                        [content-type] => Array
                                            (
                                                [0] => text/html; charset=iso-8859-1
                                            )

                                        [www-authenticate] => Array
                                            (
                                                [0] => Basic realm="Restricted"
                                            )

                                        [cf-cache-status] => Array
                                            (
                                                [0] => DYNAMIC
                                            )

                                        [report-to] => Array
                                            (
                                                [0] => {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=2JI4G4AHW3vI0wKV%2FWNULIGvqEWbdmC781a0TJ%2F23txf44kWbz30V8RxsTaMxNNT0G%2FrLNrTJ0YRUfxLFbGC0sk9vZ%2FRIpRk0XYbeCQdBbQFNzAwyJEAjppZiDz5eAPqrpISgg7s0DBnFyCtnFzfN3Q36OvCNBa6"}],"group":"cf-nel","max_age":604800}
                                            )

                                        [nel] => Array
                                            (
                                                [0] => {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
                                            )

                                        [server] => Array
                                            (
                                                [0] => cloudflare
                                            )

                                        [cf-ray] => Array
                                            (
                                                [0] => 7a9551f0bbcb0155-CDG
                                            )

                                        [alt-svc] => Array
                                            (
                                                [0] => h3=":443"; ma=86400, h3-29=":443"; ma=86400
                                            )

                                    )

                            )

                        [status_code] => 401
                        [protocol_version] => 1.1
                        [success] => 
                        [redirects] => 0
                        [url] => https://new.ourwebsite.com/?s2member_paypal_notify=1
                        [history] => Array
                            (
                            )

                        [cookies] => Requests_Cookie_Jar Object
                            (
                                [cookies:protected] => Array
                                    (
                                    )

                            )

                    )

                [filename:protected] => 
                [data] => 
                [headers] => 
                [status] => 
            )

    )

)

Help would be greatly appreciated! :grinning:

Any support from the plugin author? (It’d be greatly appreciated! :sleepy::sweat_smile: )

Hi Teddy!

I checked your shortcode, and your success attribute’s value seems to have a typo: “wecome” instead of “welcome”. Not sure if that’s causing the issue there. success="/wecome-page/"

What happens after the payment? Does he stay on the page, or is he taken to the wrong page? What does the log entry say for the payment? (e.g. stripe log, core-rtn log)

About the 401’s, maybe it’s a server security setting? See: https://s2member.com/kb-article/mod-security-odd-403-503-500-errors/

:slight_smile:

1 Like

Hey Cristian,

Sorry for leaving this hanging - just thought I’d chime in to say that we fixed the issue and much of it was caused by having the site within a ‘sandbox’ (ergo, a password-protected sub-domain).

1 Like