Paypal Checkout Beta - Endpoint 404 error

I setup the paypal checkout according to the guide, actually on two websites both running on the same server - however on Test Webhook Endpoint I get a 404.

Is there some procedure for debugging. I assume 404 is not the expected outcome. I think with a 404 it will not show up in nginx logs either (or maybe if I configure debug logging level).

So Test credentials went fine. After doing that I clicked on Create/Update webhook, and then Test. Also clicking save on the s2 page and reloading and trying again didn’t help it.

Oh I got it - I have to enable it to work. Well have to get working on my checkout dropdown to work with the new paypal options - right now I get
“PayPal SDK failed to load.” once activated instead of the paypal button loading.

I would go with standard buttons - but there is no dropdown option in s2 - which is really inconvenient. And no I don’t mean the dropdown that needs reloading your page. That is one heck of inconvenience with the pro-forms and really should be reworked. The proforms that need reloading the page feel like 90s tech and confuse loads of users - especially as everything you entered into the forms before changing another item from the dropdown gets deleted. Proforms dropdown is a horrible user experience.

If you can’t use the new Smart Buttons for PayPal Checkout, instead of output="button" you can try "anchor" or `“url”.

Got it on the pro-form options. I know what you mean, and it’s something I intend to change. Not sure I understood how that relates to the new Checkout button, could you elaborate? Soon I’ll implement PayPal Checkout for the pro-form, too.

:slight_smile:

Oh wait - so we can now use buttons created for example here:
https://www.paypal.com/ncp/links/create?intent=button

This should get documented somewhere. I wasn’t aware of this. I think I can work with them (not really sure how to put a subcription onto an option vs one time payment - but if any kind of paypal generated buttons now integrate with s2mebmer - that will solve my problems.
At worst I will put one button for subscription, and another button for 1,2,3,5,10 years with dropdown.
I haven’t fully understood how those buttons will implement a time per item - but I guess there are ways to do so.

The s2member buttons don’t do it for me because I have too many variants (namely 1,2,3,5,8,15,25 years of access with different prices)

As for the old pro-form with Stripe. It was never a good solution and it would be great if it could be modernized. No reload, possible to be on the same page as the new paypal created buttons, and a more modern layout - that would truly be great. Maybe with Claude Opus 4.6 adapting the plugin to the new things will be easy for you (or chatpgt 5.3). With a premium account you can upload local files and have the AI improve/adapt them.

I have not found out either how I can use the paypal generated button to integrate with s2 at all. But those buttons are slick. It would be enough if s2 recognizes the option name and we can put a table in s2 backend that translates option name to level and time period.

So if we can simply have an way to have s2 react to the “option name” and we can create a table inside s2 what that means in terms of levels and time. (however how will that work with 2 websites but one paypal account and two different webhooks - one for each site)? Could be way simpler that you writing all those button generators - and simply we have a lookup/translate based on option name.

If I understood it right then:


s2member will support paypal checkout,
while s2member will support paypal expanded checkout. With buttons configured at paypal button generator.

I meant in the shortcode use output=“anchor” instead of “button” if you don’t want to use the smart buttons.

I haven’t looked into supporting PayPal-created buttons yet.

I will also modernize the Stripe one later, not right now, but it’s in the plans.

The backend storage of s2 buttons configuration is also I want to implement, but will also be later.

:slight_smile:

Hmm no, that doesn’t help me at all. I have a plugin but I think the jquery outputs the old format instead of the shortcode format for each.

mc_velomap.pdf (22.9 KB)

(need to replace pdf with php as forum doesn’t even allow .txt uploads)
It used to be a much better user interface vs stuffing my page with single buttons for each of those payments.

I’m not really sure how output=anchor helps me to achieve something similar. I guess I must refactor that plugin to produce a shortcode instead.

Okay, so you have a custom way of loading the button based on a few choices. And you skip s2’s button completely, or does the JS load_paybutton() then pass the attributes to generate a button with s2? I’m not sure get that part yet.

I guess I must refactor that plugin to produce a shortcode instead.

Yeah, probably, and then you can do_shortcode it and get the button from s2 with the attribute values you fed it.

It used to be a much better user interface vs stuffing my page with single buttons for each of those payments.

Definitely.

:slight_smile:

Actually I checked and it produces shortcodes - not sure why they don’t work and I get the SDK failed to load notice. It’s shortcodes produced by the jquery.

E.g. one button code:
[s2Member-PayPal-Button level=1 ccaps= desc=First year access for €20, then €15 each year (recurring_charge, for VeloMap access) ps=paypal lc= cc=EUR dg=0 ns=2 custom=www.velomap.org|81.217.157.16|AT|AT|+43- ta=20 tp=1 tt=Y ra=15 rp=1 rt=Y rr=1 rrt= rra=1 image=default output=button rm=2 success=/success/ notify_url=https://www.velomap.org/?s2member_paypal_notify=1 cancel_return=https://www.velomap.org return=https://www.velomap.org/?s2member_paypal_return=1 invoice=value=echo S2MEMBER_VALUE_FOR_PP_INV(); ?> /]

page source code is:

    function load_paybutton() {

    	//jQuery('#paybutton').css('visibility', 'hidden');
    	jQuery('#paybutton').html('loading ...');
    	jQuery('#paybutton').load('/payment-button/?value=' + jQuery('#pay_option').val() + '&country=' + jQuery('#country').val() + '&countryip=AT&telephone=' + jQuery('#tel_country').val() + '-' + jQuery('#tel_num').val(), '', function() { jQuery('#paybutton').css('visibility', 'visible') });
    }
    jQuery(document).ready(function($) {
    	load_paybutton();
    });
		jQuery('#pay_option').change(function() {
			load_paybutton();
		});
		jQuery('#country').change(function() {
			load_paybutton();
			if (jQuery('#country').val() != 'AT') { jQuery('#telephone').show(); } else { jQuery('#telephone').hide(); }
		});
		jQuery('#tel_country').change(function() {
			load_paybutton();
		});
		jQuery('#tel_num').change(function() {
			load_paybutton();
		});
	</script>

Or better - even if I insert this shortcode it does not work:
[s2Member-PayPal-Button level=1 ccaps= desc=50 gives you 3 year VeloMap access ps=paypal lc= cc=EUR dg=0 ns=2 custom=www.velomap.org|81.217.157.16|AT|AT|+43- ta=0 tp=0 tt=Y ra=50 rp=3 rt=Y rr=BN rrt= rra=1 image=default output=button rm=2 success=/success/ notify_url=https://www.velomap.org/?s2member_paypal_notify=1 cancel_return=https://www.velomap.org return=https://www.velomap.org/?s2member_paypal_return=1 invoice=value=20 /]

Edit - if I add “” for all values it works. I wonder why my plugin worked before and what changed that they get missing.

Are they just missing in console, or did this work beforehand on old plugin and now not anymore?
Gonna test out now.

And if you want to use that code ot improve s2member go for it. But I guess it’s quite hard to make those hardcoded sections into something GUI configurable. (and the additional sections about country selection / IP loading of country are for MOSS compliance needed if selling to EU countries and needing 3 independant factors of where someone lives - not needed with stripe as you get credit card issuance country which you do not get for paypal)

yep that’s it - s2member now breaks the shortcode if it misses hypens, old versions was fine without hypens.

That’s what jumped at me when I saw the shortcode.

yep that’s it - s2member now breaks the shortcode if it misses hypens, old versions was fine without hypens.

I’m not sure how that worked before. The quotes requirement is not an s2member thing, it’s a wordpress shortcode thing. The shortcode parsing is done by wordpress’ do_shortcode, not an s2Member function.

In any case, I’m glad you could sort it out!

but if any kind of paypal generated buttons now integrate with s2mebmer - that will solve my problems.

I’ve been studying this and how it could be implemented… But I want to make sure I’m trying to solve the right problem: what do you need/want exactly from those? how do you plan/need to use them?

:slight_smile: