Understanding the process for dual checkout options

I have been trying to think how to implement PayPal and stripe.

My process is the following:

  1. Membership levels page
  2. Free level - stripe pro form - register - return to members dashboard
  3. Level 1 - click on either credit card or PayPal icon, redirect user to one of the two pro forms - register - success return to members dashboard
  4. I wanted a separate dashboard based on how they paid, so level one stripe and level two PayPal. On each dashboard I would then have the cancel membership form etc relevant to the payment gateway. This works avoid confusing in the future, however now I have read that you can’t redirect users based on level.

So the question is. What is the best way in a practical and process sense to manage two payment gateways on a site if they need separate pro forms for upgrading and cancelling membership.

Taking payments seems easy enough but then later there could be problems, especially if the customer forgets how they originally paíd.

Hi Andrew,

I wouldn’t give them different levels to tell one gateway from the other. The level should be for the access they have. There are better ways of showing them content based on the payment gateway they used.

You could have a PHP condiitonal that checks the user’s payment gateway with the constant S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY and displays the corresponding options (i.e. PayPal or Stripe). See: WP Admin > s2Member > API / Scripting > s2Member PHP/API Constants

Or you could give users a ccap that matches the payment gateway on checkout, e.g. in the PayPal pro-form you add the ccap “paypal”. https://s2member.com/kb-article/video-custom-capabilities-for-wordpress/

Then the conditional could check for the ccap, and this can be done with the s2If shortcode, which may be simpler for you than the PHP approach. https://s2member.com/kb-article/s2if-simple-shortcode-conditionals/#toc-cc6d1c60

I hope that helps. :slight_smile:

Thanks Cristián for this reply.

Unfortunately, this is a bit above my technical ability. I will read the material and see if I can work it out.

Does anyone have a step by step guide or YouTube video for this?

I understand it can be intimidating. Here:

[s2If current_user_can(access_s2member_ccap_stripe)]
   Your Stripe content.
[/s2If]
[s2If current_user_can(access_s2member_ccap_paypal)]
   Your PayPal content.
[/s2If]

In your pro-form shortcode there’s an attribute called ccaps, there you’d give the “stripe” one in the Stripe pro-form, and “paypal” in the PayPal pro-form.

Does that make it sound simpler? :slight_smile:

OK, I think that seems easier, shortcodes are super simple.

Do I have to create the custom capabilities beforehand? Or is it just these two steps:

  1. Wrap content in shortcodes
  2. Generate new pro form with ccap

Regards

Yes, it’s that simple.

You can add it to the pro-form for new sales to have them, but for existing users you can add the ccap yourself from the user editor.

The s2Member Pro importer will let you update users in bulk even. https://s2member.com/kb-article/basic-usermember-importexport-guide/

:slight_smile:

I watched the Video, this seems awesome! I think I understand it now.

I’ll give it a test run, thanks!

1 Like

One question. If u wanted to wrap content for both PayPal and stripe would the short code look like this:

[s2If current_user_can(access_s2member_ccap_stripe_paypal]

No, that would not work, because that’s a ccap called “stripe_paypal” and they would not have that.

If you want to show something regardless of their payment gateway, then just use the level access (e.g. s2Member Level 1), which is common to both. Either the page is all protected at their level, or in the content you use a conditional that checks for their level.

Does that make sense? :slight_smile:

Any content out of the both [s2If ] shortcodes will be seen from both user’s groups.