Stripe - multiple trial installments

I have, what I’m sure is, a strange requirement.

Basically, my client wants to charge a special fee in 3 installments and then begin a monthly access fee thereafter. Kind of like having special trial period payment for three months and the revert to the normal monthly recurring payment after that third installment.

I had first thought I could leverage the trail period feature, but all you get there is a single special payment and then begin the normal recurring fee. This works fine if this fee is a single first payment, but they also want the option of breaking it up into three installment payments.

No doubt this can be programmed from scratch but before I go down that road, does anyone have some thoughts or directions within the existing Stripe ProForms that I might have missed?

Thanks for any suggestions…

Yeah, it’s kinda of unusual, but interesting…

I’m afraid that the trial can only be one term, and regular term payments can’t change midway in a subscription…

It could be done if one stored the card’s data and managed the recurring payments, charging each installment separately. In the eyes of the payment gateway these would be separate payments, not a subscription.

But s2Member doesn’t store card info, and doesn’t manage the subscription. This is taken care of by the payment gateway, and their subscriptions work this way: trial (optional, one term), regular payments (all the same).

Of course, one way to go about it, would be to have two separate subscriptions: first one for 3 months as a sort of trial at a lower price, and then a second one as the regular, normal payments. Thing is that the user would have to start this second subscription himself, going through checkout again.

Heh, heh… yeah I get the interesting ones… I thought of the two subscriptions idea, but really wanted to avoid the user having to come back and “re-subscribe”, which given human nature will be an uphill battle/admin nightmare.

I wonder if there is a way to start the first subscription and flag the user with a ccap then when maybe when a webhook (?) is triggered to demote them, run a script (php) that triggers a new subscription… (somehow that customer payment method token would have to be saved…)

I know I’m reaching here, I just wanted to keep this from becoming an expensive custom module for the client…

1 Like

Starting a new subscription would need the user’s interaction…

Yeah, I agree that it’s better if the user doesn’t have to re-subscribe. I was just thinking what could be done with the options available.

I wonder if a fancier cart would allow a 3-term trial subscription as the one you described. Then it’d be a matter of integrating with that cart, probably through the Remote Operations API. WP Admin > s2Member Pro > API / Scripting > Remote Operations

Heh, heh… yeah I get the interesting ones…

Keeps it interesting. :smiley:

Thanks, interesting idea… (Remote Operations) I’ll explore that…

1 Like

Say, what if I were to hack a way to create two subscriptions, one for the “trial” (first three months) and one for the membership…(starting on month four) At the same time!

Example:
The first one would be a straight 3 month subscription.
The second one would have a 3 month “free” trial and the membership fee starting on month 4

As I think this through, I fear is that when the first subscription ends the system might demote the user to level 0… So does the system (i.e. s2member pro) check for this (two subscriptions…) Or will these conflict and if so how to work around it?

It sounds interesting, and I love your thinking outside the box. I see a few difficulties with this approach:

One of them is what you mentioned, about the EOT. s2Member currently only knows how to deal with a single subscription.

Another thing is that the user will get two subscriptions in the payment gateway (e.g. PayPal), which some users may have a problem with.

Another is that if the user doesn’t complete the first subscription, your hack would need to end the second one too, or it’ll start charging him after the three months.

Yeah, those are some of the problems I saw as well… But can there be work arounds…?

For example on the EOT… does that come back as a webhook from Stripe (in this case)??

If so can I create a custom webhook that handles:

  1. EOT of first subscription and then maintains membership (using a ccap flags and s2member API, maybe)
  2. Catches a failed payment and then cancels the second subscription (Stripe API), and the demotes member (s2m API)

All of this centers on getting that feedback from Stripe via a webhook… If so, how do I fully know what Stripe will be responding to and s2member is expecting. Is that documented somewhere (besides in the code, which may be the only place…??) Obviously I don’t want to interfere with the s2m webhook, but would my custom webhook be run with, instead or in serial with the s2m webhook…(before or after)

Of course the deeper this gets the more the hack starts costing the same as creating a full on new plugin to handle this… I’m trying to get these folks operating (and cash flow) before having to go back and “do it right”

1 Like

Yeah, I see what you mean.

To study Stripe’s notifications, you can enable logging, do a few test subscriptions, and see what you get in the logs for those.

s2’s Notifications API may be useful too. https://s2member.com/kb-article/building-an-api-notification-handler-webhook/

Does that help?

Thanks, just the article I need to study…

1 Like

Two issues - (sorry to bother you again)

One - I can’t seem to get the “success” attribute to do what I think it should do, and that is redirect to a page on the success of that payment (proform). It just returns to that same page with:

Thank you. Your account has been approved.
— You’ll receive an email momentarily.

Here is my short code:

[s2Member-Pro-Stripe-Form level=“1” ccaps=“paid_training_installmt,paid_no_qualify” desc="$120.00 USD / 3 Installments for Training fee" cc=“USD” custom=“www.peer-pods.com” ta=“0” tp=“0” tt=“D” ra=“120.00” rp=“1” rt=“M” rr=“1” coupon="" accept_coupons=“0” default_country_code=“US” captcha=“0” success="/membership-option-two-2/" /]

Am I missing something here…??

Second issue

This is something I suspect but have not gotten there yet (because of the above) I noticed that when trying to use that same email address it blocks the submission… I’m guessing that this will happen on the second proform (trying to do the training installments then the membership in two steps) Is this going to be a roadblock on this idea…??

Nothing wrong is jumping at me from that shortcode… I’m pretty sure you’re using s2Member Pro, so that shouldn’t be the issue here (“success” attribute is a pro feature).

Enable logging and see if anything wrong is mentioned there when you test it.

To troubleshoot it, I’d remove customizations and other things, to have less variables and narrow down the possible causes. https://s2member.com/kb-article/common-troubleshooting-tips/

Well, the pro-form is also a sign-up form when the user is not logged in. So the second pro-form may be trying to create an account for him also, but the username and email address are already taken by the account created with the first pro-form. This is just my guess, though, but you could explore that.

If that’s the case, then you’d need to auto-login the user after the first pro-form, before loading the second pro-form, so that the latter references his account. This hack may help: https://s2member.com/kb-article/auto-login-on-registration/

:slight_smile:

Thanks…

I’m seeing this in the logs. The log gateway-core-ipn.log shows…

[s2member_paypal_proxy_return_url] => /membership-option-two-2/

which is the correct return url in the same format as shown in the docs… I also tried (for grins)

[s2member_paypal_proxy_return_url] => https://www.peer-pods.com/membership-option-two-2/

(Which is a cut and paste from that pages actual url… so I know there is no typo there.)

So… it is seeing this setting, just not going there… I reviewed all of the other logs and it was clear they weren’t applicable. No errors at all…

I’ll dig around this some more… one problem with disabling other plugins is that it is a live site… I’ll try making a copy of the site at a different URL and then strip it down there. See what happens.

auto login…

Great, I’ll check that out…

1 Like

Cool. Looking forward to your update. :slight_smile:

Ok… twilight zone time

(in case you are NOT familiar with this very old TV show, it was kind of like an X-Files)

Anyway… Created a test site that is the EXACT copy of the production site:

http://test.peer-pods.com

Deactivated all plugins except:

S2member
Classic Editor (required to avoid the new editor)
WP Mail SMTP (my servers don’t have Send Mail active for security reasons)

Also (and this is pertenant to the mystery…)

Removed all non-admin users from the site and removed all test date from Stripe. Also cleared all logs.

BUT… the core problem is still that I don’t get the redirection to the next page…

[s2member_paypal_proxy_return_url] => /membership-option-two-2/

which is reachable at:

http://test.peer-pods.com/membership-option-two-2/

In addition I getting the following error/notice on RETURNING to the original ProForm

“That Email Address is already in use. Please try again.”

??? What!!

But…
It is adding that new user and properly configuring that user with the ccaps
It is adding the new user to the the test data on Stripe and setting up the proper subscription…

So under the hood it is doing what it is expected… just not redirecting and now creating this, what appears to be a bogus error…??

Checked all logs no errors, no hint that I can see why this is happening…

To recap and add the several mysteries here…

  1. When I first tired, I would go to the above page on a separate browser (Chrome, so as to no be logged in) I still see my admin email/login inserted by default… IT CAN NOT BE EDITED… I tried a third browser (Safari) that did not happen. I confirmed that the Chrome session was not logged in so why it insisted on auto fill is still not understood. So the test was run on Safari… I also tried it on another computer (a Windows machine) with Firefox, that has NEVER gone to this site and also got an Admin email address and user that could not be edited. Where might this be coming from?? I then tested on Chrome on that same windows machine and it let me add a new user, but I still got the above “user exits…” type message

2)On Safari(Mac) and Chrome(Win) It claims that the email address was already in use, even if I made up a bogus address (it did add that user though).

  1. It does not redirect… IN ALL CASES…

The logs, that I think apply are below (let me know if something is missing that might be important) Basically I don’t see what to test from here or where to look for a miss configuration.

ANY suggestions would be most EXCELLENT!

===========================

Here is the gateway-core-ipn.log

LOG ENTRY: Sat Feb 16th, 2019 @ precisely 10:39 pm UTC
PHP v7.0.6 :: WordPress v5.0.3 :: s2Member v170722 :: s2Member Pro v170722
Memory 35.34 MB :: Real Memory 14.00 MB :: Peak Memory 35.62 MB :: Real Peak Memory 14.00 MB
test.peer-pods.com/?s2member_paypal_notify=1
User-Agent: s2Member v170722; http://test.peer-pods.com
Array
(
[txn_type] => subscr_signup
[subscr_cid] => cus_EXhC3seRlOJ9ff
[subscr_id] => sub_EXhCjCXWC6ksMG
[custom] => test.peer-pods.com
[txn_cid] => cus_EXhC3seRlOJ9ff
[txn_id] => ch_1E4boTBASZgtHD8zT91ABuNw
[period1] => 0 D
[period3] => 1 M
[mc_amount1] => 0.00
[mc_amount3] => 120.00
[mc_gross] => 120.00
[mc_currency] => USD
[tax] => 0.00
[recurring] => 120.00
[payer_email] => jbm@rightstartwebsites.com
[first_name] => Winnie
[last_name] => Pooh
[option_name1] => Originating Domain
[option_selection1] => test.peer-pods.com
[option_name2] => Customer IP Address
[option_selection2] => 97.73.244.9
[item_name] => $120.00 USD / 3 Installments for Training fee
[item_number] => 1:paid_training_installmt,paid_no_qualify
[period] => 0 D
[mc_amount] => 0.00
[option_name] => Originating Domain
[option_selection] => test.peer-pods.com
[proxy_verified] => stripe
[s2member_log] => Array
(
[0] => IPN received on: Sat Feb 16, 2019 10:39:26 pm UTC
[1] => s2Member POST vars verified with a Proxy Key
[2] => s2Member originating domain ($_SERVER["HTTP_HOST"]) validated.
[3] => s2Member txn_type identified as ( web_accept|subscr_signup ).
[4] => s2Member txn_type identified as ( web_accept|subscr_signup ) w/o update vars.
[5] => Signup Confirmation Email sent to: “Winnie Pooh” jbm@rightstartwebsites.com.
[6] => Subscr. Return ( modification=0 ), a Proxy Return URL is ready.
[7] => User exists. Handling payment for Subscription via ( subscr-signup-as-subscr-payment ).
[8] => Payment Notification URLs have been processed.
[9] => Storing IPN signup vars now. These are associated with a User’s account record; for future reference.
)

[subscr_gateway] => stripe
[subscr_baid] => sub_EXhCjCXWC6ksMG
[level] => 1
[ccaps] => paid_training_installmt,paid_no_qualify
[eotper] => 
[ip] => 97.73.244.9
[initial_term] => 0 D
[initial] => 120.00
[regular] => 120.00
[regular_term] => 1 M
[currency] => USD
[currency_symbol] => $
[s2member_paypal_proxy_return_url] => /membership-option-two-2/
[s2member_paypal_proxy] => stripe
[s2member_paypal_proxy_use] => pro-emails,subscr-signup-as-subscr-payment
[s2member_paypal_proxy_coupon] => Array
    (
        [coupon_code] => 
        [full_coupon_code] => 
        [affiliate_id] => 
    )

[s2member_paypal_proxy_verification] => 6132a4a7a8d9beefb0999f21bd48e54d

)

The Stripe log

200 OK POST /v1/customers/cus_EXhC3seRlOJ9ff/subscriptions
2019/02/16 15:39:14
200 OK POST /v1/charges
2019/02/16 15:39:12
200 OK POST /v1/customers/cus_EXhC3seRlOJ9ff/cards/card_1E4bo0BASZgtHD8zle69VEGA
2019/02/16 15:39:12
200 OK POST /v1/customers/cus_EXhC3seRlOJ9ff
2019/02/16 15:39:11
200 OK POST /v1/customers
2019/02/16 15:39:10
200 OK POST /v1/tokens
2019/02/16 15:38:44

Inspecting the details of each of the above does not reveal any issues on the Stripe end.

reg-handler.log

LOG ENTRY: Sat Feb 16th, 2019 @ precisely 10:39 pm UTC
PHP v7.0.6 :: WordPress v5.0.3 :: s2Member v170722 :: s2Member Pro v170722
Memory 33.80 MB :: Real Memory 2.00 MB :: Peak Memory 33.91 MB :: Real Peak Memory 2.00 MB
test.peer-pods.com/membership-option-two/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15
Array
(
[user_id] => 14
[password] =>
[pagenow] => index.php
[email_config] => 1
[processed] => yes
[user] => WP_User Object
(
[data] => stdClass Object
(
[ID] => 14
[user_login] => pooh
[user_pass] => $P$BongENh73UYAo7.dhWzdIjVkMDdcca/
[user_nicename] => pooh
[user_email] => jbm@rightstartwebsites.com
[user_url] =>
[user_registered] => 2019-02-16 22:39:15
[user_activation_key] =>
[user_status] => 0
[display_name] => pooh
[user_level] => 0
)

        [ID] => 14
        [caps] => Array
            (
                [s2member_level1] => 1
                [access_s2member_ccap_paid_training_installmt] => 1
                [access_s2member_ccap_paid_no_qualify] => 1
            )

        [cap_key] => wp_capabilities
        [roles] => Array
            (
                [0] => s2member_level1
            )

        [allcaps] => Array
            (
                [read] => 1
                [level_0] => 1
                [access_s2member_level0] => 1
                [access_s2member_level1] => 1
                [s2member_level1] => 1
                [access_s2member_ccap_paid_training_installmt] => 1
                [access_s2member_ccap_paid_no_qualify] => 1
            )

        [filter] => 
        [site_id:WP_User:private] => 1
    )

[_pmr] => Array
    (
        [s2member_pro_stripe_checkout] => Array
            (
                [coupon] => 
                [first_name] => Winnie
                [last_name] => Pooh
                [email] => jbm@rightstartwebsites.com
                [username] => pooh
                [state] => 
                [zip] => 
                [country] => US
                [nonce] => 3eda96ea2f
                [attr] => ZGVmNTAyMDBmNzhkZmM4NjI1MWU4OGM4NDcyNjYzY2E2NTRlMmNjMzBjOWJmMmNiZDY0MTc3MTI1ODI5ZTYxM2ZiMjI2N2EwOGRmOTE4MGQ3ZTJmMTU5MGMyZDhmZTUxNzMzOWZkZTkxM2MxODAxM2Y2OWIwNjg1MWI2YzY1OTk0OWM4N2U5NzllNzg5MTUxZDI0ZTEzZTA3NzY0NmQ0ZDE0ZDU3M2UzNWMyNDE4OTljNTBmNzc0M2JiOTU3MWMwZjY1NDNhYzlkNjQxYjlmM2ZlYmU2NGMxYzMyMjNiZjhkZmI2MTlmOTQ0NjNmMjE2NDk3Mjk1ZDBiMzQ0MDc1OGMyZjdhOTRjMmU5MmMzNDUzMzVhNTlmZTQ5NDRkYmY0Y2JlMWI1YWI3NjZiZTRiMzhmMDcwZjJmODAxM2RhNDRkYWYzNGU0M2YxM2E1ZTRkYThmZTk1MTY1Nzk2Yjc0ZmEzZTg2OTVhYWE5NGY5NzQ4NTMyOWNlZjVjNmVlZmQyNzQyZTlkNzIzZjE0YTUyNDg4M2FmMTgzOTkyOWE0ZWVmMzk4NTYwMWI2OTg0MDFlODBhZDkzZjJkZTlmZTIwNGM2MzU4MGIxZmFiZjNjNjc4OGIxZTExZTZhMTIwZWM1MzA1NGYwYzFiYjg0MWY5YzZmMjg0MTI2NzBiZTIyMTRkZDU4NDNhMmI5MjQxY2I3MGU5ZmQ0MjVlY2M3NzA5NjdlNDgzOGEyMzRlN2FiN2YwN2I5MDBiOWM4MGQ1NWVlOGJlOGM1YTA2OGJiZDVlODZlODgzMzk2YjQxM2U1MzY2ZTM5YzEwNmFjZWZhMjNmODk0MjYwODdjMDA1MzJlMDkxYmM0M2QyOTAxNDI1NGU1YzNiY2RjNmQ3OTgyZTIzMzAzOWJkYmM5MmI4YTgyYjEwMjQ1ZjgyOWZjZjAyZmY0MDIxNmQ5ZjUwMmE1YzY3ZGZkZDc1OGVkMGY3ZThjZjhhYmUyNjdjY2Q2ODgzZDZiOTBjNjkyMzE4NjM3Y2U4ZTZmYTk2NDViMWE5MmE1YzRhYTUxYjk3OGM0ZDJkMzZiOTY3YWQ0NDYwNzIzM2Q0MzBjYjAyZjMxMjFkOTRlMzEyNGI2NTBlNGFkYzg2OWVmOGFkOWI0ZmY3ODQxMmQ5NmQzNDdkMjIyOGRkYTAzOTAxNDJiNzI2MzM2YWJjMTE5MjQ0MDA5Y2Q1ZjhhOTkxMjdhMzQ3MDk0MTE4ZWUwZDcyMzI4MzFiOWQ5YzIwNTI0MjA2NGRlNTFjMDkyNmJlYzFhMjZjMDdiOWVhZTRlNWFiZWM1OGRmNDQyN2UwYWI1ZGNlYjEwOTRjMGE4ZThmZTk4ZjY2MDkwNDZiYmY1YWZlYTY5MDkxMjM1Y2JmOWE2NmI3ZWE4YjhlOTY1MjUwODU5NTRmM2JjMWM1MTczY2M3MjlhNzRjNTdlNzU2ZDY1MTdkYTVkYjEyNDFlNDc0MzZjYzAxNTI3YTAwNjQ5NWVlNTc0YzAxZGMxNWQxMzY1YjkyNjZiMTQ3ODI3YTViMWFmM2ZiYjBkYzk5NzA3ZmNiODgyOTVlMzI2MDIwZTA3YWRlMTBlN2ZiZDI1N2NlYWRlOWFkMmU1YWQyM2Q0MjE2NzZhYmZiMzQxZTc4MzJiYWFlNDg1MDRiOGM5ODBiYmU0NmIxYTdhZjM5OWY1NTQ2NzZhZGFhMzNkZjMwODkwNTQyNTIzMTQzYTMzZTQ3MDMzZGIxYjUzOTJmZDMzYTY1ODA5MTNmYTc3ZTcwZDM2YjEwZjJlODE3NjE2NDVkYTNmNzQ2MzBkZTE3ZTQ5NzM3Mzg0ZTEzODJhZjRlZDAyNTNlMzM2MTk1MjBkMGRkZTFjYTQxY2IxODliN2UyODI2ZjNhZWUzNmY0MWFlZDk4OGUxMzRhZWNjNWIzYmUyNjViY2NiZDJiMjZmOGY3Nzc5ZjFhMTA5ZDdlOTE0MWQ5MWM1NWIwMTlhMGU4YmQxY2NlMmZlN2YzMTk5MzU2MDkwMTllNTJmYmU4MTU2NzA2MjViMTc5YmYwMTdiMjdjNWQyYjhiZmM1Yzg2YzA2NTgyNjkxMTIzYmU4N2E1ZWI4ZDQ0OWQ1NmIxMGFmMmE4M2U2NjYwMjYxYmJkYjMzOGY2NWEyNjUwMDcxOGUxYjcwZTBmMDA5YzNjZThjMWIzMzBjZTVlMzkxN2Y0NTQzNTBiNzQ2YzdlMWIwZDYyMDQzNWQ5NTBhNjY5MDk4NzMzOWVjNzJkNjhjYTEyYzUxMzk4NzE2Y2MxNDEwYzJlYTQ5MTRlOGEwY2JkYjkzNmM2YjlkODY4NDNmMDk5NjBhYzU2Mzc0MjhiYWNiNTg1Yjg4MTRhNWJmNDI5ZTE2Yzc3NWI0ZDA1ODkwYzQ4ODE3YmE0NzA2NTk4OTI1Mjc4N2JhZGVmMjI4NDM4ZGNmZDIzMTY3NGFlYjlhYzcxMjI1M2ZkNzliY2UzOWMwMDZmMjQ0OTEwN2Q3NjZhZDM3Yzc3MDdiZTI5M2UzYmMxMTI5NzJmMmNlZjgxM2IxNDk5NzIwMzUxYjQzYTc5NjQyZWVhNWViMDcxYTVlMjgxN2Y2NDViODk3MDAzZDFhOTQzZDJjMGFkNzkwNmEwYWYxNzYyYzQwZjY2ZmNlYjNjMTNmMTE5MGM4MWNmOTg0NTU1NzE3YWM4ZmVjZThhNmY2YjgwM2Y1ZGE4YzcwMjAyNGVkZjJkNDExMGFjMmY1MWNhOTRiOTQ4OWM
            )

        [ws_plugin__s2member_custom_reg_field_user_pass1] => 
        [ws_plugin__s2member_custom_reg_field_first_name] => Winnie
        [ws_plugin__s2member_custom_reg_field_last_name] => Pooh
        [ws_plugin__s2member_custom_reg_field_opt_in] => 
        [ws_plugin__s2member_custom_reg_field_s2member_subscr_gateway] => stripe
        [ws_plugin__s2member_custom_reg_field_s2member_subscr_cid] => cus_EXhC3seRlOJ9ff
        [ws_plugin__s2member_custom_reg_field_s2member_subscr_id] => sub_EXhCjCXWC6ksMG
        [ws_plugin__s2member_custom_reg_field_s2member_level] => 1
        [ws_plugin__s2member_custom_reg_field_s2member_ccaps] => paid_training_installmt,paid_no_qualify
        [ws_plugin__s2member_custom_reg_field_s2member_custom] => test.peer-pods.com
    )

[custom_reg_display_name] => full
[reg_cookies] => 
[current_role] => subscriber
[level] => 1
[ccaps] => paid_training_installmt,paid_no_qualify
[role] => s2member_level1
[email] => jbm@rightstartwebsites.com
[login] => pooh
[ip] => 97.73.244.9
[subscr_baid] => 
[subscr_cid] => cus_EXhC3seRlOJ9ff
[auto_eot_time] => 
[notes] => 
[opt_in] => 
[fname] => Winnie
[lname] => Pooh
[name] => Winnie Pooh
[pass] => %D0AJKVUhyl7
[subscr_gateway] => stripe
[subscr_id] => sub_EXhCjCXWC6ksMG
[custom] => test.peer-pods.com
[ccap] => paid_no_qualify
[fields] => Array
    (
    )

[pr_times] => Array
    (
        [level] => 1550356756
        [level1] => 1550356756
    )

[eot] => 
[_COOKIE] => Array
    (
    )

)

Ok… Still no luck on finding answers… A lot of googling and tested a lot of ideas…

–loopback issue… Added virtual host for local host and this domain,
–check that php setting for allow_url_open is active, it is…
–new wordpress install

Ran health check… it sees no issues

Next I tested it on the default theme. (twenty-sixteen I believe) and ALL PLUGINS deactivated except s2member…

Still getting the same issue

That email Address is already in use… and no success page…
(And yes in every case I used a NEW unique email address that was NEVER used before.)

Please… out of ideas… What else can I check???

That is very odd. I really don’t know what to say there, especially since you’re creating a very custom installation. You don’t get the error if you remove the customization you’re creating, right?

Does it create the user and then give the error, or it doesn’t even get to creating the user?

Hi Cristian,

Thanks for replying… Yes, It is getting very frustrating. And… yes it does create the user, and finishing the processing of the Stripe payment.

As a very old programmer, my gut tells me that some configuration is causing it to loop back and trying to “re-add” that user AFTER finishing and completing the main process. (the should be some code in there to prevent that…hint, hint…)

After stewing on this over night I’m going to try the following…

  1. Go through all of the s2m settings and both document and then reset as many of them as possible to the defaults.

  2. Test again with the most basic ProForm configuration (no success setting…)

  3. if that does not get me back to a basic… “…your membership has been approved…” type message and I still get the “…email already in use…” then…

  4. I’m going to load the s2m code into my php IDE and start searching for that error message in the code. From there I can put some logging to try and detect what is happening and why…

I’m hoping to get everything back to the beginning…

Just to back track on this a bit… When I started down this path, in the beginning, I was getting the “…your membership has been approved…” type message. That is when I got into trying to set the “success” parameter as I was exploring different combinations. Something between then and the latter “test and settings” got me to the “…email already in use…” error which through everything off track.

I hope to do the first two tomorrow and I’ll report back on that…

1 Like

OK…

Did test procedures #1 and #2 as listed above… ( review all settings and set to defaults)

This took quite a bit of time as there are a lot of pages but I carefully reviewed every settings and re-read every section. It is as “default” as I could make it.

Also note in case it was missed… This is a new test site with NO plugins except s2member active and the default Wpress theme active.

Still getting the “…email is already in use…” message. It is adding the new user in Wpress and in Stripe.

I reviewed all logs… nothing… and the php error logs… nothing…

If you have any suggestions at this point, let me know, but next is to dig through the code… (#3 and #4)…

Hi Cristian,

Hopefully you see this fairly soon…

Today I hacked the s2member-pro code to put in logging to test what I suspected, and that is: somehow the proform processing is being called twice. I created a log entry in three spots in the file strip-responses.inc.php

Once at the beginning of the function “stripe_form_submission_validation_errors” (line 526) to detect how many times this function was being called. And two other places where the error: ‘That Email Address is already in use. Please try again.’ was showing up in the code ( approx lines 570 and line 658 - approximate because by adding code I have changed the line numbers a bit)

Here is the code I inserted

c_ws_plugin__s2member_utils_logs::log_entry(‘test_logger’, ‘location description here’);

This resulted in the following output in the “test_logger” file:

LOG ENTRY: Wed Feb 27th, 2019 @ precisely 12:07 am UTC
PHP v7.0.6 :: WordPress v5.0.3 :: s2Member v170722 :: s2Member Pro v170722
Memory 22.81 MB :: Real Memory 2.00 MB :: Peak Memory 22.99 MB :: Real Peak Memory 2.00 MB
test.peer-pods.com/proform-test/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15
Called - stripe_form_submission_validation_errors

LOG ENTRY: Wed Feb 27th, 2019 @ precisely 12:07 am UTC
PHP v7.0.6 :: WordPress v5.0.3 :: s2Member v170722 :: s2Member Pro v170722
Memory 22.81 MB :: Real Memory 2.00 MB :: Peak Memory 22.99 MB :: Real Peak Memory 2.00 MB
test.peer-pods.com/proform-test/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15
Called - stripe_form_submission_validation_errors

LOG ENTRY: Wed Feb 27th, 2019 @ precisely 12:07 am UTC
PHP v7.0.6 :: WordPress v5.0.3 :: s2Member v170722 :: s2Member Pro v170722
Memory 22.86 MB :: Real Memory 2.00 MB :: Peak Memory 22.99 MB :: Real Peak Memory 2.00 MB
test.peer-pods.com/proform-test/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15
Email exists - checkout

As you can see the function “stripe_form_submission_validation_errors” was called twice and the second time it hit the problem that the email for that submission was already posted. This is what I was expecting. Now the issue is: Why is this form trying to process/insert this user twice?

(Note: keep in mind that 1) all non-admin users are deleted before the test in both Wpress and Stripe, and 2) the new user is both inserted in s2m and the payment is posted in Stripe successfully)

So… my questions are to you are:
– Does this give you any hints?
– Should I submit this as a bug? or…
– Do I need to hack deeper to provide more details as to what might be triggering this to “double” submit this user?

Following is the output of the gateway-core-ipn.log in case that helps…

LOG ENTRY: Wed Feb 27th, 2019 @ precisely 12:07 am UTC
PHP v7.0.6 :: WordPress v5.0.3 :: s2Member v170722 :: s2Member Pro v170722
Memory 26.51 MB :: Real Memory 2.00 MB :: Peak Memory 26.67 MB :: Real Peak Memory 2.00 MB
test.peer-pods.com/?s2member_paypal_notify=1
User-Agent: s2Member v170722; http://test.peer-pods.com
Array
(
[txn_type] => subscr_signup
[subscr_cid] => cus_EbSsTTujDFsahD
[subscr_id] => sub_EbStTNFSsadjaw
[custom] => test.peer-pods.com
[txn_cid] => cus_EbSsTTujDFsahD
[txn_id] => ch_1E8FxEBASZgtHD8zWfdpDf1V
[period1] => 0 D
[period3] => 1 M
[mc_amount1] => 0.00
[mc_amount3] => 0.50
[mc_gross] => 0.50
[mc_currency] => USD
[tax] => 0.00
[recurring] => 0.50
[payer_email] => alvin@stupid.com
[first_name] => Alvin
[last_name] => Chipmonk
[option_name1] => Originating Domain
[option_selection1] => test.peer-pods.com
[option_name2] => Customer IP Address
[option_selection2] => 97.73.244.9
[item_name] => Pending Paid Member / description and pricing details here.
[item_number] => 1
[period] => 0 D
[mc_amount] => 0.00
[option_name] => Originating Domain
[option_selection] => test.peer-pods.com
[proxy_verified] => stripe
[s2member_log] => Array
(
[0] => IPN received on: Wed Feb 27, 2019 12:07:33 am UTC
[1] => s2Member POST vars verified with a Proxy Key
[2] => s2Member originating domain ($_SERVER["HTTP_HOST"]) validated.
[3] => s2Member txn_type identified as ( web_accept|subscr_signup ).
[4] => s2Member txn_type identified as ( web_accept|subscr_signup ) w/o update vars.
[5] => Signup Confirmation Email sent to: “Alvin Chipmonk” alvin@stupid.com.
[6] => User exists. Handling payment for Subscription via ( subscr-signup-as-subscr-payment ).
[7] => Storing IPN signup vars now. These are associated with a User’s account record; for future reference.
)

[subscr_gateway] => stripe
[subscr_baid] => sub_EbStTNFSsadjaw
[level] => 1
[ccaps] => 
[eotper] => 
[ip] => 97.73.244.9
[initial_term] => 0 D
[initial] => 0.50
[regular] => 0.50
[regular_term] => 1 M
[currency] => USD
[currency_symbol] => $
[s2member_paypal_proxy] => stripe
[s2member_paypal_proxy_use] => pro-emails,subscr-signup-as-subscr-payment
[s2member_paypal_proxy_coupon] => Array
    (
        [coupon_code] => 
        [full_coupon_code] => 
        [affiliate_id] => 
    )

[s2member_paypal_proxy_verification] => 6132a4a7a8d9beefb0999f21bd48e54d

)