Paypal Button Error | How to integrate S2member to new Button code

Hi there,

I am using S2member for a very long time. Have a little wordpress blog, where clients have to pay for articles and publications and then they get access for a period of time. Set it up for simple Paypal payments (not Paypal Pro / Payflow). And as additional info, my Paypal button is transmitted in encrypted form (encrypted by S2member).

May be I have also to say that I am from Germany.

All worked fine for years until this monday.

My Paypal button didn’t worked anymore - error page from Paypal. Contacted the support, they said may be it is the authentification and that my button is outdated. They recommend to build a new button with the tools on their webpage (Jesus, that’s a mess).

Anyway, I managed to create a new button and add it to my site again. And indeed, the payment process is initiated and money even ends up in my merchant account.

The problem is the correct feedback to S2member. In the current process, I have not yet managed to integrate the S2member member variables of my customers into the new button code. So in the end S2member doesn’t know who actually bought what.

That here was my old short code:

[s2Member-PayPal-Button level=“1” ccaps="" desc=“my article-description” ps=“paypal” lc="" cc=“EUR” dg=“0” ns=“1” custom=“mywebsite” ta=“0” tp=“0” tt=“D” ra=“15.00” rp=“1” rt=“M” rr=“BN” rrt="" rra=“1” image=“default” output=“button” /]

The old shortcode produced this form element: (line breaks for better reading)

Now I did following, I went to my merchant account and set up a simple Checkout Button. Paypal generates this code:

In Paypal’s code generator I can enter my article description, the price, the kind of shippment and so on. I have also an extra field, where I can put some variables into the code.

Eligible variables are listed here:
developer.paypal.com/api/nvp-soap/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/

In the end, Paypal render all together under this hosted Button ID, and give you that form element for your website.

I tried different ways to get in these S2member PHP variables, but without success.

Is that even possible? For example I tried to enter this in the extra field for variables:

invoice=<?php echo S2MEMBER_VALUE_FOR_PP_INV(); ?>
os1=<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; ?>
os0=<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; ?>
on0=<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; ?>

and so on, but it didn’t worked. At this point my knowledge and my skills as developer are not good enough (I’ am a publisher not a coder). So, may be anybody is out where, who can give me a tip, how I can fix that problem.

Thank you very much.
Robert

Swith off encryption.

1 Like

Is it working well without encryption?

I am using PayPal’s native code right now, instead, and updating users manually (I get a couple of new users per month right now, anyways :man_shrugging:t2:).

I remember a long topic about it but I ended up not looking into it after I placed the manual code generated by PayPal.

Yes without encryption it works as before. So only the problems with complaints handled wrongly, or cancellations of subscriptions directly after subscribing and similar problems

1 Like

Awesome! Thanks. I will “hack the code” to neuter cancellations manually by editing the files directly as I don’t know how to do it more elegantly, I will mention what I’ll do in the appropriate topic once I get my hands on it.

:slightly_smiling_face:

Hello thanks for the “disable encryption” tip. That worked for me.

And after several hours of test runs and configurations, it was exactly what I thought of right at the beginning - just switch off the encryption.

It worked in my case. Now I am using my old button code but not encrypted.

But this can only be a kind of a workaround and not a solution. And not just in terms of safety. I mean what will happend next? It is quite conceivable that Paypal will therefore go ahead and simply prohibit transfers using an unencrypted button. And then we really have a problem.

I have seen that Paypal now also offers certificates for encryption, which have to be installed on your own server. At the same time, Paypal requires a public key to be deposited on the site.

But that’s a bit beyond my modest abilities at this point - at least off the top of my head.

Perhaps it would be advisable to create an interface for this in an S2member update.

Case closed for now.

1 Like

Yes. Hopefully we’ll figure out a way to help @clavaque updating things gradually or he’ll figure something out as usual, timely, when it’s not possible to use a workaround, anymore, and it’s something critical.

I still have a case open with paypal support. If they report back anything useful, I’ll let you know.

1 Like