PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Automatically Create User

s2Member Plugin. A Membership plugin for WordPress®.

Automatically Create User

Postby angelazou » December 21st, 2011, 9:08 am

Hi,

Sorry if this question has been asked before, I haven't done my search yet, but I want to use the S2member plugin to create an automatic billing profile. Here is what I'm thinking:
- If a user buys something using Alipay (one of the payment methods supported)
- Use something (haven't figured out what do with Alipay) to detect the receipt of the payment and the email of the user
- Automatically create a user (using some sort of trigger I guess) and send this information to the user's email obtained through Alipay.

Now the second and third step is what I need to figure out how to do in S2member (and Alipay). I wanna know, is this something S2member can already do, or do I tweak it somehow?

Angela
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: Automatically Create User

Postby Raam Dev » December 21st, 2011, 5:07 pm

Hi Angela,

s2Member Pro supports Buy Now transactions through the Alipay payment gateway (recurring/automatic billing is not supported). If you have the free version of s2Member, you will need to upgrade to activate the Alipay payment gateway.

When you use s2Member Pro to sell items through Alipay (you can activate the Alipay payment gateway under WP Admin -> s2Member -> Other Gateways), s2Member will automatically create the user account and send the welcome email to the customer.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Automatically Create User

Postby angelazou » December 21st, 2011, 9:57 pm

Hi Raamdev,

I'm actually not looking to use the S2member plugin (via Alipay) to have the user paid. I'm going to use Taobao (which integrates with Alipay already). I'm just wondering if it's possible to create some sort of trigger to let S2member plugin to automatically create the user for me.

Angela
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: Automatically Create User

Postby Raam Dev » December 22nd, 2011, 3:32 pm

Hi Angela,

If you have s2Member Pro, you can utilize the s2Member Pro API for Remote Operations to create a user/member account automatically from an external script.

I'm not sure what Alipay offers in terms of payment notifications, but if you can configure Alipay to send payment information to a specific URL, then you can write a script that will receive the information from Alipay and then use s2Member's Pro API to create the user account.

Does that make sense?
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Automatically Create User

Postby angelazou » December 23rd, 2011, 3:38 am

The external script sounds great, just one issue though. I'm actually going to provide 2 places where my customers can use Alipay to purchase: one is on the local site and the other is at Taobao. Now, I'm not so concerned about the plugin's functionality because it will ask the customer to create an account when they purchase, right?
What I'm thinking of doing is that, after the customer purchased at Taobao (using Alipay), I need to have Alipay to send some type of trigger to the S2member plugin to initiate the external script that you suggested (to automatically create a user). Now, I'm quite new to all the programming/scripting languages, and I want to know, is this the way to do something like this? Or, is there a more efficient method to achieve the same affect?

Angela
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: Automatically Create User

Postby Raam Dev » December 23rd, 2011, 1:50 pm

Hi Angela,

Yes, if you want to have an s2Member user created when the customer pays on Taobao using Alipay, then best way to make that happen will be to have Alipay send the notification to a script that creates the s2Member account as described above.

Now if you will also be accepting payments via s2Member using the same Alipay account, the script will need to figure out how to differentiate between payments made via Alipay from s2Member and payments made via Alipay from Taobao, otherwise when customers pay through s2Member->Alipay, the script will create a second user account (as s2Member would've already created the account).

Off the top of my head, that might be a bit tricky. If Alipay passes the customer email address, you might be able to do something like check if there's already an s2Member account matching that email address (which would indicate the payment was made via s2Member->Alipay) and then skip creating an account.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Automatically Create User

Postby angelazou » December 23rd, 2011, 9:27 pm

Hi Raam,

Sounds great, one last question, where should I place that external script?

Angela
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: Automatically Create User

Postby Raam Dev » December 23rd, 2011, 11:46 pm

The external script should be hosted on the server that's running s2Member (that's not a requirement; just a suggestion). The other information you'll need, including a code example for creating a new user, can be found in WP Admin -> s2Member -> API/Scripting -> Pro API for Remote Operations.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron