Return page no correct

I’m using the free version of S2 member, my problem:
I have a PayPal button for one time paiement 1 day access, in this page (test) I need a id_article for display my article:

[s2Member-PayPal-Button level=“1” ccaps="" ids=“398” desc=« One time / description and pricing details here." ps=“paypal” lc="" cc=“EUR” dg=“0” ns=“1” custom=“127.0.0.1|398” ta=“0” tp=“0” tt=“D” ra=“3.99” rp=“1” rt=“D” rr=“BN” rrt="" rra=“1” image=“default” output=“button” success="/test/" /]

I add success="/test2/" but I think is not correct, what is the correct code for buy an article and return on my article page.

Sorry I do not understand everything.
Thanks for the help.

This is a Pro feature. it won’t work if you have the free version.

ids=“398”

That attribute is only valid for Specific Post/Page access, and that shortcode is for a Level. WP Admin > s2Member > PayPal Buttons > Shortcode Attributes > ids

desc=« One time / description and pricing details here."

Your opening quote mark is wrong.

in this page (test) I need a id_article for display my article:

I’m not sure I understand that. Could you describe it a bit more? :slight_smile:

Thanks for the help,
we finally bought the pro version, I partly solved my problem with the option “pay now”. last question can I pass a dynamic parameter during the purchase, because my page is unique but uses a content dynamique (article id in a personal table)? and how do I get this variable ?

1 Like

I’m not sure what you need there, but maybe the custom value is something you could use… or a custom profile field, if you’re using pro-forms…

WP Admin > s2Member > PayPal Pro-Forms / Buttons > Shortcode Attributes > custom

WP Admin > s2Member > General Options > Registration / Profile Fields & Options

Does that help? :slight_smile:

I think that custom is my solution (user not register account, I use “buy now for 1 day”). the custom value is secure ?(the buyer can not change id) :joy:

Yes, it’s secure. :slight_smile:

If you use the PayPal Buttons, make sure you use encryption. WP Admin > s2Member > PayPal Options > Account Details > Button Encryption

Last question, In the documentation I can not find how to retrieve this variable, could you tell me the page or how to process. Thanks in advance (again) for help.

I don’t understand. What variable? :slight_smile:

Enabling button encryption? PayPal > My Profile > Website Payment Preferences

when I have for example in button custom=“127.0.0.1|398” how I can get “398” because user is not register (user not register account, I use “buy now for 1 day”).

Oh, so you’re using the Specific Post/Page restriction?

I know that the custom value is there as well, so it should be available when the person uses the special URL to view the page he paid access for. I’m not exactly sure where you’d find it, it’d take a little bit of testing to find out.

For logged in users, there’s a constant s2Member makes available, but I’m not sure that the same applies to a not logged-in user while using the special access URL… WP Admin > s2Member > API / Scripting > s2Member > PHP/API Constants > S2MEMBER_CURRENT_USER_CUSTOM

You could start your tests using this on the page and viewing it with the access your user would have:

<?php print_r(get_defined_vars()); ?>

I hope that helps. :slight_smile: