latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Hourly access!

Home Forums Community Forum Hourly access!

This topic contains 6 replies, has 2 voices. Last updated by  Ronnie 3 years, 11 months ago.

Topic Author Topic
Posted: Tuesday Jan 15th, 2013 at 3:17 pm #37629
Ronnie
Username: Zeeflo

Hi there.

Is it possible to use Pro Forms to get payment for hourly access (12 hours without subscription)?

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Tuesday Jan 15th, 2013 at 4:09 pm #37647
Staff Member

Thanks for your inquiry. ~ We appreciate your patience :-)

Yes, that is possible with s2Member’s “Specific Post/Page Access” functionality.
Please see these sections of your Dashboard for further details.

Dashboard -› s2Member® -› Restriction Options -› Specific Post/Page Access Restrictions
Dashboard -› s2Member® -› PayPal® Pro Forms -› Specific Post/Page (Buy Now) Forms

There is also a video tutorial that goes into some detail on this feature here.
Video » s2Member (Specific Posts/Pages)

Posted: Tuesday Jan 15th, 2013 at 4:18 pm #37649
Ronnie
Username: Zeeflo

@Jason.

Thats not really the option I am looking for. We already have restrictions set to ALL posts, and this would create a conflict, also, its not just a page or a single post we restrict. We restrict all posts like before mentioned.

Can I use the pro-forms Level 1-4 somehow, like making the RT=”D” and 0.5 for ½ a day?

  • This reply was modified 3 years, 11 months ago by  Ronnie.
  • This reply was modified 3 years, 11 months ago by  Ronnie.
Posted: Tuesday Jan 15th, 2013 at 4:56 pm #37662
Staff Member

Thanks for the follow-up :-)

No, I’m sorry but a value of 0.5 is not supported in that attribute.

I suggest that you sell Membership Level Access with a One Day Fixed-Term, when you configure your Pro Form. Then, create a script and connect it to s2Member’s API Notification for Payments. In that script, you would set a customer’s Auto-EOT Time to 12 hours later, instead of 24 hours later.


This code sample assumes that you’re selling Membership Level Access with a One Day Fixed-Term. This Payment Notification Handler will convert the ONE day, into a 12 hour term for you.

Step #1.

Please create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
(NOTE: these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins)
(See also: http://www.s2member.com/kb/hacking-s2member/)

<?php
add_action('init', 's2_payment_notification_handler');
function s2_payment_notification_handler()
	{
		if(!empty($_GET&#91;'s2_payment_notification'&#93;) & !empty($_GET&#91;'user_id'&#93;) && !empty($_GET&#91;'item_number'&#93;))
			{
				if(preg_match('/\:1 D$/', $_GET&#91;'item_number'&#93;))
					update_user_option((integer)$_GET&#91;'user_id'&#93;, 's2member_auto_eot_time', strtotime('+12 hours'));
				exit;
			}
	}
&#91;/hilite&#93;

&#91;warning_box&#93;
This code is untested and may contain bugs. Please let us know if you have trouble.
&#91;/warning_box&#93;

<h4>Step #2</h4>
See: Dashboard -› s2Member® -› API / Notifications -› Payment Notifications

Enter the following URL in the text box provided by s2Member®

http://www.example.com/?s2_payment_notification=1&user_id=%%user_id%%&item_number=%%item_number%%

Of course, replace http://www.example.com with your WordPress installation domain.


You will know this code is working, when a customer pays for a ONE Day membership, and upon inspection of their account in your WordPress Dashboard, you will see that your customer’s Auto-EOT Time, has been set to 12 hours after the payment was received, instead of the ONE day that would have normally occurred.

Also, please be sure that you have s2Member’s Auto EOT System turned on.
See: Dashboard -› s2Member® -› PayPal® Options -› Automatic EOT Behavior

Posted: Tuesday Jan 15th, 2013 at 5:00 pm #37663
Ronnie
Username: Zeeflo

Since we already have 1 day access as another option, I could – with the s2 hacks plugin create, lets say a WEEK pass instead, and give it the +12 hours definition in the hack.

I would then create a button for 1 week access, but the client would in fact only get 12 hours!

Like this:

<?php
add_action('init', 's2_payment_notification_handler');
function s2_payment_notification_handler()
	{
		if(!empty($_GET['s2_payment_notification']) & !empty($_GET['user_id']) && !empty($_GET['item_number']))
			{
				if(preg_match('/\:1 W$/', $_GET['item_number']))
					update_user_option((integer)$_GET['user_id'], 's2member_auto_eot_time', strtotime('+12 hours'));
			}
	}
	
	

(:1 W$ instead of :1D$)

Correct?

  • This reply was modified 3 years, 11 months ago by  Ronnie.
Posted: Tuesday Jan 15th, 2013 at 5:28 pm #37673
Staff Member

Yes, that is correct! Nice work :-)

Posted: Tuesday Jan 15th, 2013 at 5:33 pm #37675
Ronnie
Username: Zeeflo

Thank you for your quick replies. Its much appriciated! Thumbs up from here!

Hack file is created and edited as per your guideline. I have created the button and hack for “3: D” and will keep you posted about what happens when we get our first 12 hour sale! :)

Viewing 6 replies - 1 through 6 (of 6 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.