S2 Button code suddenly not working with PayPal

fixed it - had some php inside which hid the text.
basically I would like to fiddle with
name=“cmd” value="_xclick"
instead of
name=“cmd” value="_xclick-subscriptions"
or _sxclick

for subsciptions. The documentation doesn’t specify that you cannot use xclick for subsciptions - so its worth trying. I’m not sure where in s2member the button is expanded…

actually it’s here:
[src/includes/templates/buttons/paypal-checkout-button.php)

But I’m not getting anywhere editing anything in that file…

Maybe I would need to work in another file?

Its quite annoying I don’t know which one actually is responsible for the button, and which one is maybe only the text that expands on the top. Search there for xclick then all files that are possible show up.

Looks like besides adding the BN value, simple membership used the same button notation:

Memberpress seems identical too - but :unlike s2member and like simple press they also set BN

So maybe what we are missing is the BN=Name_SP

The MemberPress code is from 5 years ago. They have not updated since then?

Does this PayPal page help?

https://www.paypal.com/bd/cshelp/article/how-do-i-add-paypal-checkout-to-my-custom-shopping-cart-ts1200

Actually s2member must botch it up when creating the shortcode!
I just installed PHP code snippets plugin, created a code snippet with the subscription php code inside - and BAM - it works.

s2member has some fundamental problem when converting the php full code to shortcode - because the full button code does work!

But why all of a sudden?

dont know - maybe downgrading some versions would actually help - even though it’s somehow related to a paypal update.

But try it out yourself - all subscriptions work without problems if you use the full code instead of the s2member created shortcode. Now using the full code isn’t advisable in real production - because users can simply edit the code if they want (set price to 1 cent or maybe even 0). But the full code works for subscriptions too.

Well problem is mine already works. I use PayPal Pro forms and they still work. I’m just here for future reference in case they suddenly stop working.

There’s no way to see what code is being generated by s2, to compare it to the full code?

no because it’s encrypted. CTRL-U and you could read the page source yourself!

Now do simple membership and memberpress maybe not encrypt the old paypal standard payment buttons? Then we would have the solution why they still work.

And btw - some features of paypal pro forms are broken since over 2 years with s2member - because they cannot be used with 3D-secure. You will be losing loads of payments with paypal pro forms. That’s outright stupid right now to use! Sorry to tell you.

I don’t suppose you can share the code that worked so we can try it? :grinning:

and we avoided paypal proforms - had issues and didn’t feel like clients they had to shell out $20a month to paypal to make our sites worl LOL

Sid

Yes but 3D secure is only an issue in the EU. It doesn’t apply in the US. They still work great for me.

I was about to go to bed when I checked the forums, and saw this. I just finished reading the whole thread. I was away the past days, and came back to find this. Sorry for not seeing it earlier. :expressionless:

Sid, I’ll try to reproduce this on my tests site. Can I take a look at one of your sites with the issue? You can message me the login.

Do you have logging enabled? I don’t think that some change in the latest release may be related, since nothing related to PayPal was changed. Did you try going back to the previous version you had?

Are you using button encryption or not? Did you try it the other way? just to check if the encryption may be behind the problem (this is something done by Paypal, and maybe they stopped it). s2Member > PayPal Options > Account Details > Enable Button Encryption

About the pro-forms, they don’t require PayPal Pro to work, with a regular PayPal Business account, the pro-form will use the PayPal Express Checkout integration.

I will get back to this tomorrow, and figure it out. I will integrate s2 with the new PayPal Checkout. It’s 5:30am where I am right now, and I’m not in shape to work on this right now, I need to sleep, but will get back to it later today.

2 Likes

Thank you Cristian :slight_smile:

1 Like

Read my reply again. Amy full not condensed button code works. But as it is PHP you need to insert it via shortcode of a php code insertion plugin.
Plus it will end up fully in page source so anyone can change it and pay amount he likes by editing page source.

Oh and yeah of course inside PayPal I have button encryption enabled. That only applies to the S2 created shortcodes. Not PHP insertion plugin shortcodes.

It will happen on your site too. Very sure it will. Just try the short S2 button generated code Vs the full one inserted with a php code insertion plugin.
All subscription type button are affected.

I guess buttons generated on PayPal website will work without problems but s2 isn’t compatible with them and you cannot create them in legacy format anymore.

yes disabling button encryption works as well (needs to be set to off in paypal too). Only encrypted s2member subscription buttons cause this problem.

But of course without encyption - you can just right click on the paypal button - click on inspect - edit the amount to your liking - then click on the button and paypal will let you checkout with the new amount.

Actually a similar problem existed 10 years ago once:
https://www.s2member.com/forums/topic/encrypted-paypal-subscription-button-error/page/2/index.html

Paypal hosted buttons actually still can be created and avoid this problem. However they cannot be used on exisiting members (I guess because the button is not able to get the wordpress username of the person checking out - actually as I said sometimes - I would like to have s2member in that case just add the time to existing user, if demoted re enable - and only in case say the membership level is different create an email to inform of conflict. 99% of times this would solve any interaction for me - as often people forget to login before paying then complain that their account is not active).
Now it’s very unlikely any customer would do that - but that is possible without encryption and very easy to do.

And I still don’t know if back then paypal informing me about failed payments happened due to unencrypted buttons or was just random chance. With PCI on paypal for button payments it’s very uncommon for people to test credit cards against your button/paypal website. That problem usually only comes up on checkouts directly on your own website. Theoretically an unencrypted button makes this easier in some ways for automation - but paypal credit card testing prevention is uber strict so not a good target.

Oh and Memberpress uses unencrypted classic SOAP API buttons… But yeah that’s why they have no problem (how do I know they are unencrypted - I looked at their tutorial video and they mentioned to make sure that on paypal side encryption is set to off).
For Simple Membership I am not sure.

BTW - maybe switching to API certificates would be a solution - if s2member keeps on using SOAP? At least that is the recommended way - I think the cert is then used for encrypting the button.
https://developer.paypal.com/api/nvp-soap/apiCredentials/

Another problem could be the way s2member encrypts the button. Paypal recently announced they only accept SHA256 going forward. Now PKCS7 is a container for X509 - is it using SHA1 or SHA256 for it? If SHA1 then that is the problem. SHA1 is deprecated by paypal for encryption and it could be that they just started enacting this.

But the ‘full’ code s2 generate failed with access denied.
The code is mostly HTML form code, not php - though there is embedded php calls, so not sure how you got it to work??

Till now, we have been running with ‘encode’ ON

Sid

read again, think again or ask your developer. You cannot paste php code in wordpress pages but need a plugin for it! I wrote exactly how I got it to work and the button generator already tells you that you need to make sure php can be executed.

Any help would be appreciated Christian. :grinning:

When the problem happened - for us 7 days ago - we blamed PayPal and their deprecation’s (it is a FACT they have deprecated a LOT)

But we installed simple member on a site and NO issues with PayPal (using the NEW checkout API). Made NO changes to a PayPal account that HAS issues when using s2 but didn’t with simple.

Our tracking shows that on 85 (8 sites are brand new no traffic yet) sites a total 613 people tried to buy - went to PayPal. 11 wrote their own payment amount. The other never completed. If we tell our clients this, there will be, I’m sure (most are marketers, not techies but they know how to ■■■■■!), an explosion on social media about s2 AND us. Would like to avoid that.

Cristian, We will provide access to a site for you to test as you like - how do we get you the information?

Yes my CTO did logging which is how he determined it was probably not PayPal per se
All our stuff is encrypted - we did not test unencrypted

Yes PayPal definitely deprecated SHA1 - and EU is really coming down on issues related to encryption, protection of CC data etc. (our partner is located in Spain) so they may well be enforcing it now.

Felix, CTO says php executions was/is on, (we have a few pages that need it for some task in the software platform) but they will try it with the plugin as you did just in case.

Sid

2 Likes