Gravity Forms and Pro Sites integration

Alright, let's do this thing.

I've seen a lot of comments on Gravity Forms and Pro Sites integration on these forums; alas, no solution has been provided.

I feel this is an important feature to have since this integration can be bound to many other products for future integration. Just like Zapier has done with many products, this also can be recreated for different subjects.

Unfortunately, no documentation is to be found regarding this subject. So let's make our own here.

All related topics are over a year old so they can be rendered irrelevant.

Any comments regarding this integration will be highly appreciated, especially from the WPMU staff to confirm my way of thinking to help with this integration. I do not expect the WPMU staff to give values and code because they're as they call it: support - and not 24/7 code dummies.

So, before I digress any further, here are the problems, the order is not important:
1. Pro Sites has bound to its own payment systems, like Credit Card, Stripe and PayPal (pro/express). In many countries outside of the USA the Credit Card isn't well accepted and we have other means of payment. I myself use the Pronamic iDeal plugin for payments which works great for my target customers: Dutch people.
2. The Pro Sites gateway is too complex to alter, therefor we must find other means for integration, see 3. for elaboration.
3. WHMCS Provisioning is a great tool, unfortunately, you'll be bound to the restricted WHMCS API which requires a WHMCS license and installation, which both will be far too complex to work with. Also, you'll be working with 2 different account systems which both have their own way of password handling, therefor this will be too complex for our users and we do not want to work with WHMCS.
4. Pro Sites has undocumented values for the WPMUdev developers to work with, and we have to figure out what they do and when to call them. Luckily the Database entries are easy to understand.
5. Gravity Forms is a great tool, unfortunately, their documentation is also limited and complex.
6. Customization is awesome: Having your own workflow and user interaction/engagement is extremely important. Therefor, having your own forms are needed. Gravity Forms provide a lot of customization and integration and this is exactly what we need.

Many more points can be written down here as a problem but I think you'll get the picture.

To tackle this problem, let us "steal" the code from integration services provided by the WPMUdev team, yes, I'm looking at you WHMCS Provisioning.

From whmcs-mrp.php:

$ch_blog = $wpdb->get_row("SELECT blog_ID FROM " . $wpdb->base_prefix . "pro_sites WHERE blog_ID=$id LIMIT 1");

			if(!empty($ch_blog->blog_ID)){

				$wpdb->query($wpdb->prepare("UPDATE " . $wpdb->base_prefix . "pro_sites SET level=%d WHERE blog_ID=%s", $level_id, $id));

				$psts->record_stat($id, 'upgrade');

			} else {

				$wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->base_prefix . "pro_sites (blog_ID, expire, level, gateway, term) VALUES (%d, '9999999999', %s, 'WHMCS', 'Permanent')", $id, $level_id));

				$psts->record_stat($id, 'signup');

			}

What we can read from this code is that wp_pro_sites gets new values, those values are:
1. blog_ID (Binds to signup blog ID)
2. level (Binds to predefined level)
3. expire (UNIX timestamp)
4. gateway (How did the user get its term? We could define these in terms like GFregister and GFextend for support reference, these terms aren't "important" to function)
5. term (I think this has to do with extending, but we're focusing on registration now)
6. amount (let's just leave this blank for now)

The problem is, that when a user registers (and pays) the blog_ID isn't defined yet. This is still under testing for confirmation and I will tackle this further.

HOWEVER, we can take the blog_ID from the Gravity Forms registration code and let Gravity Forms handle the process of putting everything in the database. In other words: We put everything in one nice packet so when the registration is complete, the values will be the same.

When the code is completed, we'll tackle this when bugs occur.

Another problem might be updates, shall we put this in a new .php file or integrate this into the Gravity Forms code? I'll leave this question unanswered for now, however it might be best to save the integration code elsewhere if an update might occur.

OK, now let's look at userregistration.php from Gravity Forms.
We have this little code right here (line 4067):

$blog_id = wpmu_create_blog($site_data['domain'], $site_data['path'], $site_data['title'], $user_id, $meta, $current_site->id);

Somehow, we need to implement the Pro Sites code into this.

We could solve this in a few different ways, but what is most important is that Gravity Forms can act upon the Pro Sites code.
What we need is the following in Gravity Forms:

1. Subscription choice: Be it Free (0), Basic (1), Pro (2), Business (3), etc. (4+)
That will be like this, (it's Dutch, where Waarde = Value): https://hostmijnpagina.nl/images/gravityforms1.jpg
1.a) A function to call those values (I'm still fuzzy on this one).

2. The period (experation date), and alter it to UNIX timestamp format: https://hostmijnpagina.nl/images/gravityforms2.jpg

We need to get those values, and bind it to a query that fires together with the blog creation. Where the blog_ID and everything thereafter will be put into the wp_pro_sites database.

Note that for correct pricing per Pro Sites level, you'll need conditional forms with those options and price per period (month/3months/year/etc).
Luckily, we do not need to duplicate the "time values" so you'll probably just put in 'month', '3months' and 'year' for each time period with their own pricing per Pro Site level.

And then we're done. It's not that hard. We just need to find the right way to implement this.

I will continue on this project for the upcoming days, for now, I have an appointment. Any input will be extremely appreciated.

  • Michelle Shull

    Hi Sybre!

    Wow! This is BRILLIANT so far! Look at you go!

    1. I agree about the needless friction between WHMCS and ProSites - I think WHMCS and our integration plugin are great, don't get me wrong, but I agree that there are a lot of steps, and it can be wholly confusing to set up properly.

    2. I also agree that the default payment methods we have available are super convenient, as long as your customers live in a place where these gateways actually work.

    I'm going to flag the dev with a feature request, it's the easiest way to let him know this convo is happening without adding a bug to his todo list. : )

  • Sybre Waaijer

    Reporting back with the full code:

    <? php
    /**
    PUT THIS IN YOUR MAIN BLOG'S THEME FUNCTIONS.PHP FILE
    FOR SECURITY AND PERFORMANCE REASONS, DO NOT ALLOW USERS TO USE THE THEME FOR THEIR OWN SITE
    
    DO NOT CREATE MORE THAN ONE BLOG REGISTRATION FORM ON YOUR  MAIN BLOG', AS THESE VALUES ARE NOT BIASED TO WHICH FORM ITS USING
    
    NOTE: NO EXTENSIVE ERROR HANDLING SO I CANNOT HELP YOU (but hey, just make sure Pro Sites is active)
    **/
    
    add_action("gform_site_created", "enter_pro_site_level", 10, 5);
    function enter_pro_site_level($site_id, $entry, $config) {
    
    	// GETTING THE VALUES -- Make these according to the Form ID's
    
    	function getpsttime() { // These are the periods (time) you give to your customers. Make these Conditional Drop Down or Radio buttons. Multi Select will break the code. Add the following values in Gravity Forms (see line 32, 35 and 38):
    		if (!empty($entry['9'])) { // bound to 1st pro site level selection in GForms
    			return $entry['9'];
    		}
    		else if (!empty($entry['10'])) {  // ID bound to 2nd  pro site level selection in GForms
    			return $entry['10'];
    		}
    		else if (!empty($entry['11'])) {  // ID bound to 3rd pro site level selection in GForms
    			return $entry['11'];
    		}
    		else {
    			// do nothing, see line 42
    		}
    	}
    
    	function time_to_unix() {
    		if getpststime() == 'termmonth' {	//1 month of subscription time, fill this in as a Value (termmonth) in Gravity Forms -- Note: Give this a Price in GForms
    			return strtotime("+1 month");
    		}
    		else if getpststime() == 'term3months'  {	//3 months of subscription time, fill this in as a Value (term3months) in Gravity Forms -- Note: Give this a Price in GForms
    			return strtotime("+3 month");
    		}
    		else if getpststime() == 'termyear' {	//1 year of subscription time, fill this in as a Value (termyear) in Gravity Forms -- Note: Give this a Price in GForms
    			return strtotime("+1 year");
    		}
    		else {
    			return time(); //Current UNIX (system)time
    		}
    	}
    
    	$pstslevel = $entry['8'];	// Your "Product" in Gravity Forms. select Show Values and add these accordingly, 0 = free, 1 = first pro site level, 2 = 2nd pro site level, etc. -- Note: The product must be free for this to be logical
    	$pststime = return time_to_unix();	// See line 16 to 44 (pro site remaining time)
    
    	// New values for reference
    	$pstsgateway = 'GFormRegister'; //To see how the user got his Pro Site, nothing too important
    	$pststerm = ''; // This must be either permanent or something else?
    	$pstsamount = ''; //Why would I use this?
    
    	function changepackage(){
    		global $wpdb,$base,$psts;
    
    		$id = $site_id;
    		$domain = $entry['4']; //Blog Address
    		$level = $pstslevel;
    
    		if( !empty( getpststime() ) ) {
    			if( empty($psts) ) {
    				$this->response['error'] = __( 'Requesting Pro-sites which is not active on this site.');
    				return;
    			}
    
    			$levels = get_site_option('psts_levels', array() ); // get levels in your given name
    			if(empty($levels) ) {
    				//No levels to search
    				$this->response['error'] = __( 'No Levels defined in Pro-Sites.');
    				return;
    			}
    
    			$this->response['level'] = $level_id;
    
    			if(!empty($id)){
    				$update_level = $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->base_prefix . "pro_sites SET level=$level, expire=$pststime, gateway=$pstsgateway WHERE blog_ID=$id", $level, $id)); // If the site_ID is available
    			} else {
    				$update_level = $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->base_prefix . "pro_sites (blog_ID, expire, level, gateway, term) VALUES ($id, $pststime, $level, $pstsgateway, $pststerm)", $id, $level)); // Something went wrong because no site was created before.
    			}
    
    			if( $update_level === false ){
    				$this->response['error'] = "$domain: $update_level" . __( "Error SQL Update Level Status $wpdb->last_error $wpdb->last_query");
    				return;
    			}
    
    			$this->response['message'] = "success";
    			$psts->record_stat($id, 'upgrade');
    			$psts->log_action($id, __("GFormsRegister changed Pro-Sites level to {$levels[$level]['name']} (Level ID {$level}).") );
    		}
    	}
    
        switch_to_blog($site_id);
        restore_current_blog();
    
    }

    I have not yet tested this code yet but I think it will do something :') Could anyone report back on this and see if I made any syntax errors or drastic security mistakes? Thanks and good night!
    Will test this code tomorrow myself.

  • Sybre Waaijer

    Updated the code to better handle the Gravity forms input (read from SQL inputs) and of course filtered out all bugs. Unfortunately, the query never gets fired...

    /**
    PUT THIS IN YOUR MAIN BLOG'S THEME FUNCTIONS.PHP FILE
    FOR SECURITY AND PERFORMANCE REASONS, DO NOT ALLOW USERS TO USE THE THEME FOR THEIR OWN SITE
    
    DO NOT CREATE MORE THAN ONE BLOG REGISTRATION FORM ON YOUR  MAIN BLOG', AS THESE VALUES ARE NOT BIASED TO WHICH FORM ITS USING
    
    NOTE: NO EXTENSIVE ERROR HANDLING SO I CANNOT HELP YOU (but hey, just make sure Pro Sites is active)
    **/
    
    function enter_pro_site_level($site_id, $entry, $config, $password) {
    
    	// GETTING THE VALUES -- Make these according to the Form ID's
    
    	function getpststime() { // These are the periods (time) you give to your customers. Make these Conditional Drop Down or Radio buttons. Multi Select will break the code. Add the following values in Gravity Forms (see line 32, 35 and 38):
    		global $entry;
    		if (!empty($entry['9'])) { // bound to 1st pro site level selection in GForms
    			return strstr($entry['9'], '|', true);
    		}
    		else if (!empty($entry['10'])) {  // ID bound to 2nd  pro site level selection in GForms
    			return strstr($entry['10'], '|', true);
    		}
    		else if (!empty($entry['11'])) {  // ID bound to 3rd pro site level selection in GForms
    			return strstr($entry['11'], '|', true);
    		}
    		else {
    			// do nothing, see line 42
    		}
    	}
    
    	add_action("init","getpststime",10,1);
    
    	function time_to_unix() {
    		global $entry;
    		if (getpststime() == 'termmonth') {	//1 month of subscription time, fill this in as a Value (termmonth) in Gravity Forms -- Note: Give this a Price in GForms
    			return strtotime("+1 month");
    		}
    		else if (getpststime() == 'term3months') {	//3 months of subscription time, fill this in as a Value (term3months) in Gravity Forms -- Note: Give this a Price in GForms
    			return strtotime("+3 month");
    		}
    		else if (getpststime() == 'termyear') {	//1 year of subscription time, fill this in as a Value (termyear) in Gravity Forms -- Note: Give this a Price in GForms
    			return strtotime("+1 year");
    		}
    		else {
    			return time(); //Current UNIX (system)time
    		}
    	}
    
    	add_action("init","time_to_unix",10,1);
    
    	$pstslevel =  strstr($entry['8'], '|', true);	// Your "Product" in Gravity Forms. select Show Values and add these accordingly, 0 = free, 1 = first pro site level, 2 = 2nd pro site level, etc. -- Note: The product must be free for this to be logical
    	$pststime = time_to_unix();	// See line 16 to 44 (pro site remaining time)
    
    	// New values for reference
    	$pstsgateway = 'GFormRegister'; //To see how the user got his Pro Site, nothing too important
    	$pststerm = ''; // This must be either permanent or something else?
    	$pstsamount = ''; //Why would I use this?
    
    	function changepackage(){
    		global $wpdb,$base,$psts,$site_id,$entry;
    
    		$id = $site_id;
    		$domain = $entry['4']; //Blog Address
    		$level = $pstslevel;
    
    		if( !empty( getpststime() ) ) {
    			if( empty($psts) ) {
    				$this->response['error'] = __( 'Requesting Pro-sites which is not active on this site.');
    				return;
    			}
    
    			$levels = get_site_option('psts_levels', array() ); // get levels in your given name
    			if(empty($levels) ) {
    				//No levels to search
    				$this->response['error'] = __( 'No Levels defined in Pro-Sites.');
    				return;
    			}
    
    			$this->response['level'] = $level_id;
    
    			if(!empty($id)){
    				$update_level = $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->base_prefix . "pro_sites SET level=$level, expire=$pststime, gateway=$pstsgateway WHERE blog_ID=$id", $level, $id)); // If the site_ID is available
    			} else {
    				$update_level = $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->base_prefix . "pro_sites (blog_ID, expire, level, gateway, term) VALUES ($id, $pststime, $level, $pstsgateway, $pststerm)", $id, $level)); // Something went wrong because no site was created before.
    			}
    
    			if( $update_level === false ){
    				$this->response['error'] = "$domain: $update_level" . __( "Error SQL Update Level Status $wpdb->last_error $wpdb->last_query");
    				return;
    			}
    
    			$this->response['message'] = "success";
    			$psts->record_stat($id, 'upgrade');
    			$psts->log_action($id, __("GFormsRegister changed Pro-Sites level to {$levels[$level]['name']} (Level ID {$level}).") );
    		}
    	}
    
    	add_action("init","changepackage",10,5);
    
        switch_to_blog($site_id);
        restore_current_blog();
    
    }
    add_action("gform_site_created", "enter_pro_site_level", 10, 5);

    Any idea's why?

  • Sybre Waaijer

    Alright, the code works! The database gets written correctly without any errors. Although there's still an error regarding the use of $this, but that's negligible at the moment.

    Unfortunately, the UNIX timestamp converts itself back to time() (e.g. the current time). So there will be no upgrade.

    All that needs fixing now is the Timestamp converter.. Does anyone have any tips? (line 14 to 48)

    /**
    PUT THIS IN YOUR MAIN BLOG'S THEME FUNCTIONS.PHP FILE
    FOR SECURITY AND PERFORMANCE REASONS, DO NOT ALLOW USERS TO USE THE THEME FOR THEIR OWN SITE
    
    DO NOT CREATE MORE THAN ONE BLOG REGISTRATION FORM ON YOUR  MAIN BLOG', AS THESE VALUES ARE NOT BIASED TO WHICH FORM ITS USING
    
    NOTE: NO EXTENSIVE ERROR HANDLING SO I CANNOT HELP YOU (but hey, just make sure Pro Sites is active)
    **/
    
    function enter_pro_site_level($site_id, $user_id, $entry, $config, $password) {
    	global $wpdb,$psts;
    	// GETTING THE VALUES -- Make these according to the Form ID's
    
    	function getpststime($entry) { // These are the periods (time) you give to your customers. Make these Conditional Drop Down or Radio buttons. Multi Select will break the code. Add the following values in Gravity Forms (see line 32, 35 and 38):
    		if (!empty($entry['9'])) { // bound to 1st pro site level selection in GForms
    			return strstr($entry['9'], '|', true);
    		}
    		else if (!empty($entry['10'])) {  // ID bound to 2nd  pro site level selection in GForms
    			return strstr($entry['10'], '|', true);
    		}
    		else if (!empty($entry['11'])) {  // ID bound to 3rd pro site level selection in GForms
    			return strstr($entry['11'], '|', true);
    		}
    		else {
    			// do nothing, see line 42
    		}
    	}
    
    	add_action("init","getpststime",10,1);
    
    	function time_to_unix() {
    		if (getpststime() == 'termmonth') {	//1 month of subscription time, fill this in as a Value (termmonth) in Gravity Forms -- Note: Give this a Price in GForms
    			return strtotime("+1 month");
    		}
    		else if (getpststime() == 'term3months') {	//3 months of subscription time, fill this in as a Value (term3months) in Gravity Forms -- Note: Give this a Price in GForms
    			return strtotime("+3 month");
    		}
    		else if (getpststime() == 'termyear') {	//1 year of subscription time, fill this in as a Value (termyear) in Gravity Forms -- Note: Give this a Price in GForms
    			return strtotime("+1 year");
    		}
    		else {
    			return time(); //Current UNIX (system)time
    		}
    	}
    
    	add_action("init","time_to_unix",9,1);
    
    	$pstslevel =  strstr($entry['8'], '|', true);	// Your "Product" in Gravity Forms. select Show Values and add these accordingly, 0 = free, 1 = first pro site level, 2 = 2nd pro site level, etc. -- Note: The product must be free for this to be logical
    	$pststime = time_to_unix();	// See line 16 to 44 (pro site remaining time)
    
    	// New values for reference
    	$pstsgateway = 'GFormRegister'; //To see how the user got his Pro Site, nothing too important
    	$pststerm = ''; // This must be either permanent or something else?
    	$pstsamount = ''; //Why would I use this?
    
    	$domain = $entry['4']; //Blog Address for log
    
    	if(!empty($site_id)){
    		$update_level = $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->base_prefix . "pro_sites (blog_ID, level, expire, gateway, term) VALUES ('$site_id', '$pstslevel', '$pststime', '$pstsgateway', '$pststerm')", $site_id, $pstslevel)); // Write to (wp)_pro_sites
    	} else {
    		// Do nothing
    	}
    	if( $update_level === false ){
    		$this->response['error'] = "$domain: $update_level" . __( "Error SQL INSERT INTO Level Status $wpdb->last_error $wpdb->last_query");
    		return;
    	}
    
    	$this->response['message'] = "success";
    	$psts->record_stat($id, 'upgrade');
    	$psts->log_action($id, __("GFormsRegister changed Pro-Sites level to Level ID {$level}.") );
    
    	switch_to_blog($site_id);
        restore_current_blog();
    
    }
    add_action("gform_site_created", "enter_pro_site_level", 10, 5);
  • Sybre Waaijer

    SOLVED. WordPress doesn't like functions within functions. Oh well. The following code is working as intended. Will update with "pro sites extensions/upgrade" soon. For now, this was the most important part, the registration, enjoy!

    Some explanation, alter the entry number where needed:
    entry['8'] = product, be it free, basic, pro, elite. Give these options values from 0 (free) to 3 (elite) in gravity forms.

    entry 9/10/11 are conditional values based upon the "paid" options from entry['8'], give these options values accordingly (termmonth, term3months, termyear).

    function enter_pro_site_level($site_id, $user_id, $entry, $config, $password) {
    	global $wpdb,$psts;
    	// GETTING THE VALUES -- Make these according to the Form ID's
    
    	$pstslevel =  strstr($entry['8'], '|', true);	// Your "Product" in Gravity Forms. select Show Values and add these accordingly, 0 = free, 1 = first pro site level, 2 = 2nd pro site level, etc. -- Note: The product must be free for this to be logical
    
    	$getperiod =  strstr($entry['9'], '|', true); // Specifies the months in a dropdown list. See the following lines (termmonth, term3months, termyear) for more info.
    	$getperiod .=  strstr($entry['10'], '|', true); // Values must be identical to the above one
    	$getperiod .=  strstr($entry['11'], '|', true); // ditto
    
    	if ($getperiod == "termmonth") {	//1 month of subscription time, fill this in as a Value (termmonth) in Gravity Forms -- Note: Give this a Price in GForms
    		$pststime = strtotime("+1 month");
    	}
    	else if ($getperiod == "term3months") {	//3 months of subscription time, fill this in as a Value (term3months) in Gravity Forms -- Note: Give this a Price in GForms
    		$pststime = strtotime("+3 month");
    	}
    	else if ($getperiod == "termyear") {	//1 year of subscription time, fill this in as a Value (termyear) in Gravity Forms -- Note: Give this a Price in GForms
    		$pststime = strtotime("+1 year");
    	}
    	else {
    		$pststime = time(); //Current UNIX (system)time yet entry will still be created for free site
    	}
    
    	// Other values for reference
    	$pstsgateway = 'GFormRegister'; //To see how the user got his Pro Site, nothing too important
    	$pststerm = ''; // This must be either permanent, trial or empty
    	$pstsamount = ''; //Why would I use this?
    
    	$domain = $entry['4']; //Blog Address for log
    
    	if(!empty($site_id)){
    		$update_level = $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->base_prefix . "pro_sites (blog_ID, level, expire, gateway, term) VALUES ('$site_id', '$pstslevel', '$pststime', '$pstsgateway', '$pststerm')", $site_id, $pstslevel)); // Write to (wp)_pro_sites
    	} else {
    		// Do nothing
    	}
    
    	$psts->record_stat($site_id, 'upgrade');
    	$psts->log_action($site_id, __("GFormsRegister changed Pro-Sites level to Level ID {$level}.") );	
    
    	switch_to_blog($site_id);
        restore_current_blog();
    
    }
    add_action("gform_site_created", "enter_pro_site_level", 10, 5);

    Good night for now (lol 7:40 am)!

    p.s. I don't know when I'll update this further for pro site upgrade/extend etc. but it will be entirely possible, expect most likely within a month.

  • Todd Heitner

    Hi, great work on this! I have a question and I'm not sure if you can answer it, so if not, no worries. I know part of why you created this was to use other payment gateways. In my case, I actually want to use Stripe, one of the few Pro Sites actually supports. I'm considering using Gravity Forms because I don't like the default registration form. It has options I don't want to include and there are others I'd like to add. I also don't like the flow. I'd prefer to have everything on one page.

    What I'm wondering is, if I use this registration add-on, I assume I'd have to use the Stripe add-on from GF. But then I'm wondering if a user could still modify his account via the default Pro Sites menu (Account) or if I'd have to use the other plugin you created for modifying an account. I'm guessing the latter but I'm not sure.

    Thanks!

  • Todd Heitner

    Thanks for the quick reply. I did test it this morning and here's what happened:

    Everything goes well with the registration and payment. The site is set up, the card is charged (and recurring billing subscription set up). If I go to Network Admin -> Sites and see the site, it shows it as being a Pro Site (paid). It shows the correct level in the "Pro Site" column.

    However, the only problem seems to be that it isn't connected to the built-in account management. If I go into the newly created site's dashboard and click on the Pro-Sites "Account" menu item, it doesn't show any account details. Normally, when I use the built-in registration process and the Pro Sites Stripe module, when I go to this page it shows the level purchased, payment method, last payment, next payment, and there's a button to cancel the subscription. Then below it is an option to modify the subscription.

    On the site created with this registration process, none of that is there. It looks exactly the same as on a free site. It shows no payment history and gives me the option of signing up for the paid site. There is no cancellation button.

    So it seems the newly-created Stripe subscription via Gravity Forms isn't connected with the Pro Sites Stripe module.

    I noticed that in Stripe it creates "Plans" based on the levels in Pro Sites. It looks like "Level Name: Monthly", "Level Name: Quarterly", etc., where "Level Name" is whatever you called the level in Pro Sites. I tried setting the Stripe feed/subscription name in the Stripe GF add-on to the same name to see if maybe it would put it under the same plan, but it didn't. It just created a second one with exactly the same name.

    It seems like the registration needs to somehow connect to the Stripe module. Any ideas?

    • Sybre Waaijer

      Hi @Todd Heitner

      I'm not really sure at what page you are looking when trying to troubleshoot this problem but I guess it's on yourmaindomain.com/pro-site/

      If so, that's correct. I haven't build in any modules that tell Pro Sites what payment system it has used.
      I never imagined anyone using this module to eventually connect back with Pro Sites. Especially with the same payment module.

      I also haven't built in any "subscription" based support within the plugin. It's all based on Pre-Paid plans.
      I did make a custom version of my plugin for @WP Tech that supports these subscription based feeds (based upon PayPal), I'm not sure if you can use this (because it's really custom).
      It does feature coupon support ^^ and the basis for what eventually is needed to connect to the Official Pro Sites module.

      My suggestion would be to at least try the advanced "Upgrade/Downgrade/Extend" module of the plugin, I notice you know your way around PHP so it won't be too much work ^^.
      The Upgrade/Downgrade/Extend plugin does talk to the registration-plugin based upon a few values set in there. It also sets new values so it knows what the user can and can not do.

      I have yet to support a complete fall-back solution. I hope I will find the time for this in the near future. For now, I need to finish a theme.

      Hope this helps and let me know if you have any other questions. Have a great day!

  • Todd Heitner

    Thanks again for your quick reply. I have a few questions.

    You say you haven't built in any subscription-based support. In the test I did, the subscription was created successfully via the Stripe add-on for GF. What I don't know is what will happen in a month. I know Stripe will bill them, but I don't know if Pro Sites will get the memo and keep the account active. I know it will try to notify the site via the webhooks, but I have a feeling it won't get properly credited. Any guess as to whether that might work?

    Another question - has this been tested with the Affiliate plugin? Affiliate works with Pro Sites but I'm wondering how well it would work in this scenario. Do you know?

    Just wondering, how long do you think it will be before you finish your current project (the theme)? I'd be willing to pay you something to help with getting this connected. It would definitely help me and may help others in the community.

    Thanks,
    Todd

    • Sybre Waaijer

      Hi @Todd Heitner

      My plugin doesn't communicate with external subscription methods by default. What this means is that when you set a subscription for one month ("term1month"), the user's Pro Site subscription will end after one month, exactly. Regardless of the terms set in Scribe. Scribe will continue to ask for payments without telling Pro Sites anything.
      For all I know, the PayPal Add-On on Gravity Forms does have a method determining if the User has paid or not, if not, it will disable the website of the user. For instance, you ask a monthly payment for 1 year from the user, then you set the price for 1 month (recurring) and the pro site to "term1year". This will ensure the user gets a full year of Pro Site, but the website will be deactivated when the user does not pay

      I'm not sure which Affiliate plugin you mean. Therefor I can not respond to this. The plugin I wrote only takes the values set in Gravity Forms and outputs them in the Pro Sites database. Pro Sites then handles everything based upon the level it read from the Gravity Forms input.
      This basically means that it will not interfere with other plugins, so it should work.

      The theme I'm currently working on has about 50 days of work in it (400 hours). I'm guessing another 20 will end my pursuit of a better theme for my website
      Unfortunately, I do have a lot of other projects that will be coming to me after I finish the theme, like, filling in the contents But feel free to drop by a request through the pro section of this website found at https://premium.wpmudev.org/pros/
      You can find me there, but I'm sure others are willing to help you out as well

      Hope you have a great day!