Credit Card fields showing up in mobile when PayPal only is enabled

Hello! It’s been awhile and now I have a new bug. The credit card fields are showing up in mobile only when PayPal only is enabled. I also see it in editing mode on desktop and below using blocks, but it does not show to users on desktop.

So this is an issue because people are filling them in, questioning me about the Credit Card start date field (should that even be there), and then clicking PayPal button, which is, of course, rejecting the credit card. It shows up in PayPal with an ID but says Cancelled by PayPal.

They think they have successfully paid because they get an email as well from the system.

So how do I fix this please? This is in PayPal Pro.

Thanks,
Gillian

1 Like

Interesting! I am getting reports of PayPal sometimes refusing, or Stripe won’t allow the card number to be filled up (I can only replicate it with a VPN).

I do have Stripe’s form together with PayPal Buttons at some pages.

Do we need to separate them?

PayPal is also saying our integration is outdated and that we should upgrade it, I wonder what needs to be changed so we’re not cut off in the near future.

What comes to mind is that either you left the cards in the accept attribute of the shortcode… or that your s2member javascript is not loading properly.

Could you please show me your shortcode, and a link to your page with it?

:slight_smile:

2 Likes

Hi @clavaque! Here’s the link - both payment pages are doing the same thing.

Here is the shortcode:
[s2Member-Pro-PayPal-Form level=“1” ccaps=“test” desc="$59 CAD / Monthly (recurring charge, for ongoing access)" ps=“paypal” lc="" cc=“CAD” dg=“0” ns=“1” custom=“cognitiveresults.com” ta=“0” tp=“0” tt=“D” ra=“59” rp=“1” rt=“M” rr=“1” rrt="" rra=“2” accept=“paypal” accept_via_paypal=“paypal” coupon="" accept_coupons=“0” default_country_code="" captcha=“0” /]

The other one is the exact same except ccaps=“int”, and price is $99.

THANKS! :slight_smile:

So should accept= be blank then? Not sure. It’s accept=“paypal” right now. And if that’s the case, why would it show up in mobile only? :slight_smile:

The other cards show up as greyed out in mobile but still visible. On desktop it’s all as it should be.

I’m also getting the whole PayPal integration is outdated as well - but I’m not interested in adding Apple Pay or Google Pay so is it ok to leave? Thanks!

1 Like

Thanks for the link and shortcode.

That shortcode looks good, that’s not the issue.

I checked your page and see that the pro-form is not behaving normally. I really think it’s a JavaScript issue…

I noticed that your page isn’t loading s2member-o.php for the CSS and JS, instead you seem to have customized the installation, and s2’s CSS is loaded differently, and so is the JS. I believe that this may be playing a part in the behaviour you’re seeing…

You could try removing that customization, at least for the JS, let s2 load it normally, and see what happens.

Let me know how it goes.

:slight_smile:

1 Like

@clavaque Thanks for your help!

I worked hard on this one and had to ask Chat for help. In the end, I had to add this to the functions.php file:

add_action('wp_footer', function() {
    ?>
    <script>
        let script = document.createElement('script');
        script.src = "https://cognitiveresults.com/?ws_plugin__s2member_js_w_globals=1&qcABC=1&ver=241114-241114-3465938733";
        script.onload = () => console.log("✅ S2Member JS Loaded and Running");
        script.onerror = () => console.log("❌ Failed to Load S2Member JS");
        document.body.appendChild(script);
    </script>
    <?php
}, 100);

The chat said:
Issue: S2Member’s JavaScript was loading but not executing in non-Chrome browsers.

Fix: Manually injecting the script via wp_footer ensures it runs properly after the page fully loads .

The form is looking correct now … but is this a proper fix?
Thank you!

1 Like

I’m glad you got it working! Great job :slight_smile:

Well, you can do a test payment to see if it works right, a 1 cent payment should be enough to check PayPal. If the pro-form is showing right, though, it’s most likely okay, the JS seems to be working as it should.

:slight_smile:

2 Likes

Yes I’ve had a couple of people purchase (gratitude because January is slow) and it seemed to work fine. I did also disable each plugin and tested that but there were no conflicts. So it seems for some reason that S2 wasn’t loading it’s JS last? Not sure how that is forced to happen but that was the issue. Thanks for your help!

2 Likes

Thanks for sharing your solution!

I had been trying to figure out why my Stripe Form was randomly failing and AIO WP Security Plugin needs a specific setting turned off.

I know it’s a different scenario, but s2member script wasn’t being executed with error 403, even though it was being called to run and working fine when not using a VPN.