Page 1 of 1

s2Member and Infusionsoft

PostPosted: April 27th, 2011, 5:07 pm
by zenji
Hey folks ... first off, BIG thanks for creating such a fantastic plugin, love it!

Second, I was wondering if I can, or if anyone has been able to integrate s2Member and http://www.infusionsoft.com/. I know there is are great functions under API / List Servers ...

Cheers

Re: s2Member and Infusionsoft

PostPosted: April 27th, 2011, 5:38 pm
by Cristián Lávaque
Hi Zenji. :)

I haven't heard about someone doing it yet, but would love to see it. What part of InfusionSoft are you talking about? I.e. cart, mail or both.

You can try working with s2Member's Notification APIs for the mail. If the cart, then future APIs will help, but in the meantime you could search for other WP+Infusion integrations and add the data that s2Member would use for access restrictions.

Re: s2Member and Infusionsoft

PostPosted: May 2nd, 2011, 2:48 pm
by zenji
Hey Cristian ... thanks for the reply. The company that I am with using the CRM function of InfusionSoft. The majority of their application is really badly built, so super buggy. I will see that I can do with some custom form fields ... will keep you posted.

Cheers

Re: s2Member and Infusionsoft

PostPosted: May 3rd, 2011, 1:45 am
by Cristián Lávaque
Great. Looking forward to that. :)

Re: s2Member and Infusionsoft

PostPosted: June 7th, 2011, 3:46 am
by Britney
Heartiest Greetings!!
Infusionsoft is a software that handles all CRM in one application.. With our current knowledge and expertise in InfusionSoft, we would glad to help you or your clients with our experience in catering to your needs in the best possible manner.
Our expertise in InfusionSoft as you can view some of my good work:
http://www.residualrush.com/
-Here we used Infusionsoft, DAP, Optimizepress Themes and EXEC-PHP )
-We also created one custom plug-in "Contact Form" for the same website.
http://www.chronofocus.com/
http://www.commepiedsnus.com
We have developed a dynamic application which fetch the product details from these two websites into Infusionsoft database. This application runs as per the scheduled time, user can change the scheduled time as per his convenience.
Our Capacity:
We have a team of programmers who apart from being talented, are agile problem solvers. Our programmers ensures that the job is done right and deliver it right.

If your firm is looking dependable, results oriented professionals with a solid performance track record; we would be highly interested in discussing how our strengths and experience can benefit you.

Looking forward to hearing from you. Please provide us your best time with contact number or instant messenger to discuss how to proceed over action of plan on your concept.

Best regards,
Britney

Re: s2Member and Infusionsoft

PostPosted: August 22nd, 2011, 4:35 pm
by behladesign
I'm working on a client site with infusionsoftwp , and would really love to use S2 Member. http://www.infusionwp.com/

Right now, there is only one other hosted solution for this, and I think there is room for competition!

Re: s2Member and Infusionsoft

PostPosted: August 23rd, 2011, 1:48 am
by Cristián Lávaque
Thanks!

Re: s2Member and Infusionsoft

PostPosted: August 24th, 2011, 2:24 pm
by skinnytires
Cristián, I'm wondering if you can give a little more, top-level insight on how a s2Member plugin + InfusionSoft API might be put together?

I'm looking at possibly extending s2Member -- which I love -- to work with a client's InfusionSoft's account: to do two main things:

A) send InfusionSoft "tag" user info to InfusionSoft: Tag infusionsoft-member1234 with the tag "active member of program x" or "canceled member of program x" which seems to be the easy thing via your Notification API and their API.

B) The possibly more difficult e-commerce part: the login info syncs with logging in? a InfusionSoft user -- and lets s2member's [s2If current_user_can(access_s2member_level1)] and similar logic be bound to whether user purchased membership on InfusionSoft's shoppingcart (using perhaps Authorize.net) -- NOT via s2member's built-in PayPal, Authorize.net etc...

InfSoft API (http://developers.infusionsoft.com/sdks/)

=====

Hey behladesign - I'm really curious what your experience with the InfusionWP plugin is?

Re: s2Member and Infusionsoft

PostPosted: August 24th, 2011, 3:13 pm
by skinnytires
By the way - here is a staff member from Wishlist Member plugin talking about how it integrates to InfusionSoft: http://member.wishlistproducts.com/45-i ... tegration/

Re: s2Member and Infusionsoft

PostPosted: August 25th, 2011, 2:41 am
by Cristián Lávaque
Thanks for the video.

OK, here's what I suggest you look at. Besides the Notifications API, if you have s2Member Pro you can look at the new Pro API For Remote Operations to create a user. WP Admini -> s2Member -> API / Scripting -> Pro API For Remote Operations

Code: Select all
<?php
$op
["op"] = "create_user"; /* The Remote Operation you're calling upon. */
/**/
$op["api_key"] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; /* Your Remote Ops API Key. */
/* Check your Dashboard for this value, under: `s2Member -> API Scripting -> Remote Operations API`. */
/**/
$op["data"] = array (/**/
"user_login" => "johndoe22", /* Required. A unique Username. Lowercase alphanumerics/underscores. */
"user_email" => "johndoe22@example.com", /* Required. A valid/unique Email Address for the new User. */
"user_pass" => "456DkaIjsd!", /* Optional. Plain text Password. If empty, one will be generated. */
"first_name" => "John", /* Optional. First Name for the new User. */
"last_name" => "Doe", /* Optional. Last Name for the new User. */
"s2member_level" => "2", /* Optional. Defaults to Level #0 ( a Free Subscriber ). */
"s2member_ccaps" => "music,videos", /* Optional. Comma-delimited list of Custom Capabilities. */
"s2member_registration_ip" => "123.456.789.100", /* Optional. User's IP Address. If empty, s2Member will fill this upon first login. */
"s2member_subscr_gateway" => "paypal", /* Optional. User's Paid Subscr. Gateway Code. One of: (paypal|alipay|authnet|ccbill|clickbank|google). */
"s2member_subscr_id" => "I-DJASODJF8933J", /* Optional. User's Paid Subscr. ID. For PayPal®, use their Subscription ID, or Recurring Profile ID. */
"s2member_custom" => "yoursite.com", /* Optional. If provided, should always start with your installation domain name ( i.e. $_SERVER["HTTP_HOST"] ). */
"s2member_auto_eot_time" => "2030-12-25", /* Optional. Can be any value that PHP's ``strtotime()`` function will understand ( i.e. YYYY-MM-DD ). */
"opt_in" => "1", /* Optional. A non-zero value tells s2Member to attempt to process List Servers that you've configured in the Dashboard area. */
"custom_fields" => array ("my_field_id" => "Some value."), /* Optional. An array of Custom Registration Field ID's, with associative values. */
"s2member_notes" => "Administrative notation. Created this User via API call.", /* Optional. Administrative notations. */
"notification" => "1", /* Optional. A non-zero value tells s2Member to email the new User/Member their Username/Password. */
/* The "notification" parameter also tells s2Member to notify the site Administrator about this new account. */
);
/**/
$result = trim (file_get_contents ("http://yoursite.com/?s2member_pro_remote_op=1", false, stream_context_create (array ("http" => array ("method" => "POST", "header" => "Content-type: application/x-www-form-urlencoded", "content" => "s2member_pro_remote_op=" . urlencode (serialize ($op)))))));
/**/
if (!empty ($result) && !preg_match ("/^Error\:/i", $result) && is_array ($user = @unserialize ($result)))
    {
        echo "Success. New User created with ID: " . $user["ID"];
    }
else
    echo "API error reads: " . $result;
?>


It's good that InfusionSoft lets you set a thank-you page URL and pass user info.

You could probably use PayPal's IPN Proxy Key to create an integration. WP Admin -> s2Member -> PayPal Options -> PayPal IPN Integration -> Proxy Key

I hope that helps!

Re: s2Member and Infusionsoft

PostPosted: August 25th, 2011, 1:11 pm
by skinnytires
Great. I'll look into this. Thanks Cristián for the quick and thoughtful reply -- like always! Cheers.

Re: s2Member and Infusionsoft

PostPosted: August 26th, 2011, 2:10 am
by Cristián Lávaque
Glad to help! Let us know when you have the integration running. :)

Re: s2Member and Infusionsoft

PostPosted: October 3rd, 2011, 3:10 pm
by moxall
For those looking, here is code written for an HTTP Post action set in InfusionSoft. Upon testing, you will see a message pop up inside InfusionSoft that says "Success. New User created with ID:".

Copy everything below, save to a new file and upload this file to your server, and then enter the URL in a HTTP Post function to create a new user in Wordpress:

Code: Select all
<?php
$op
["op"] = "create_user"; /* The Remote Operation you're calling upon. */
/**/
$op["api_key"] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; /* Your Remote Ops API Key. */
/* Check your Dashboard for this value, under: `s2Member -> API Scripting -> Remote Operations API`. */
/**/

$op["data"] = array (/**/
"user_login" => $_REQUEST["Email"], /* Required. A unique Username. Lowercase alphanumerics/underscores. */
"user_email" => $_REQUEST["Email"], /* Required. A valid/unique Email Address for the new User. */
"user_pass" => $_REQUEST["LastName"], /* Optional. Plain text Password. If empty, one will be generated. */
"first_name" => $_REQUEST["FirstName"], /* Optional. First Name for the new User. */
"last_name" => $_REQUEST["LastName"], /* Optional. Last Name for the new User. */
"s2member_level" => "2", /* Optional. Defaults to Level #0 ( a Free Subscriber ). */

);
/**/
$result = trim (file_get_contents ("http://yoursite.com/?s2member_pro_remote_op=1", false, stream_context_create (array ("http" => array ("method" => "POST", "header" => "Content-type: application/x-www-form-urlencoded", "content" => "s2member_pro_remote_op=" . urlencode (serialize ($op)))))));
/**/
if (!empty ($result) && !preg_match ("/^Error\:/i", $result) && is_array ($user = @unserialize ($result)))
    {
        echo "Success. New User created with ID: " . $user["ID"];
    }
else
    echo "API error reads: " . $result;
?>

Re: s2Member and Infusionsoft

PostPosted: October 4th, 2011, 3:09 am
by Cristián Lávaque
Thanks Moxall! :)

By the way, I removed your API Key and the domain name from your code.

If anyone tries this, add your own API Key and domain, and please report back what your results were!

Re: s2Member and Infusionsoft

PostPosted: November 10th, 2011, 1:13 pm
by startasocialnetwork
Thanks for this, Guys.

I have tested it out, and it does create a new user, which is awesome.

Two issues:

1) When using a testing gmail address (xxx+YY@gmail.com) either this script or WP strips out the + sign. Not many users use that Gmail feature, but it's worth noting.

2) I'm not getting a password generated when the last name field is empty. Any ideas on how to get InfusionSoft to create a password first, and then pull this info from that field?

Re: s2Member and Infusionsoft

PostPosted: November 12th, 2011, 2:33 am
by Cristián Lávaque
Thanks for the feedback! I emailed it to Jason. :)

Re: s2Member and Infusionsoft

PostPosted: November 16th, 2011, 3:32 pm
by Jason Caldwell
Thanks for reporting these important issues.

startasocialnetwork wrote:1) When using a testing gmail address (xxx+YY@gmail.com) either this script or WP strips out the + sign. Not many users use that Gmail feature, but it's worth noting.
So far I've been unable to reproduce this.
Since the + sign is also a URL encoded space, and spaces WILL be removed by WordPress sanitation routines, I suspect that your email address is not getting URL-encoded before it's posted to the Remote Operations API for s2Member. Or, you can also URL-encode a serialized string of your array, as seen in the example below. Also see: http://php.net/manual/en/function.urlencode.php

For example, this email address <xxx+YY@gmail.com> should be POST'd to the Remote Operations API like this: xxx%2BYY%40gmail.com. If this problem persists, please post your full PHP code and we'll take a look for you. Please be sure NOT to include any sensitive information though. Such as your API Key. Please X that out for us before posting.

startasocialnetwork wrote:2) I'm not getting a password generated when the last name field is empty. Any ideas on how to get InfusionSoft to create a password first, and then pull this info from that field?
Yes, I believe we have this issue corrected in the development copy. I'm attaching a patch file to this post for you. Please unzip the attached file, and upload to your site, allowing it override your existing copy of /s2member-pro/includes/classes/remote-ops-in.inc.php
remote-ops-in.inc.php.zip
(2.31 KiB) Downloaded 107 times

( patches an existing installation of s2Member Pro v111105 )

This patch will be included in the next official release,
but you can use this file to update this aspect ahead of that, if you prefer.



Sample code for clarity:
Code: Select all
<?php
$op
["op"] = "create_user"; /* The Remote Operation you're calling upon. */
/**/
$op["api_key"] = "6f9e092900305e6a5630c3aed5decda6"; /* Your Remote Ops API Key. */
/* Check your Dashboard for this value, under: `s2Member -> API Scripting -> Remote Operations API`. */
/**/
$op["data"] = array (/**/
"user_login" => "johndoe22", /* Required. A unique Username. Lowercase alphanumerics/underscores. */
"user_email" => "johndoe+22@example.com", /* Required. A valid/unique Email Address for the new User. */
"user_pass" => "456DkaIjsd!", /* Optional. Plain text Password. If empty, one will be generated. */
"first_name" => "John", /* Optional. First Name for the new User. */
"last_name" => "Doe", /* Optional. Last Name for the new User. */
"s2member_level" => "2", /* Optional. Defaults to Level #0 ( a Free Subscriber ). */
"s2member_ccaps" => "music,videos", /* Optional. Comma-delimited list of Custom Capabilities. */
"s2member_registration_ip" => "123.456.789.100", /* Optional. User's IP Address. If empty, s2Member will fill this upon first login. */
"s2member_subscr_gateway" => "paypal", /* Optional. User's Paid Subscr. Gateway Code. One of: (paypal|alipay|authnet|ccbill|clickbank|google). */
"s2member_subscr_id" => "I-DJASODJF8933J", /* Optional. User's Paid Subscr. ID. For PayPal®, use their Subscription ID, or Recurring Profile ID. */
"s2member_custom" => "jason.websharks-inc.loc", /* Optional. If provided, should always start with your installation domain name ( i.e. $_SERVER["HTTP_HOST"] ). */
"s2member_auto_eot_time" => "2030-12-25", /* Optional. Can be any value that PHP's ``strtotime()`` function will understand ( i.e. YYYY-MM-DD ). */
"opt_in" => "1", /* Optional. A non-zero value tells s2Member to attempt to process List Servers that you've configured in the Dashboard area. */
"custom_fields" => array ("my_field_id" => "Some value."), /* Optional. An array of Custom Registration Field ID's, with associative values. */
"s2member_notes" => "Administrative notation. Created this User via API call.", /* Optional. Administrative notations. */
"notification" => "1", /* Optional. A non-zero value tells s2Member to email the new User/Member their Username/Password. */
/* The "notification" parameter also tells s2Member to notify the site Administrator about this new account. */
);
/**/
$result = trim (file_get_contents ("http://jason.websharks-inc.loc/?s2member_pro_remote_op=1", false, stream_context_create (array ("http" => array ("method" => "POST", "header" => "Content-type: application/x-www-form-urlencoded", "content" => "s2member_pro_remote_op=" . urlencode (serialize ($op)))))));
/**/
if (!empty ($result) && !preg_match ("/^Error\:/i", $result) && is_array ($user = @unserialize ($result)))
    {
        echo "Success. New User created with ID: " . $user["ID"];
    }
else
    echo "API error reads: " . $result;
?>
In the source code, see this section: urlencode (serialize ($op))