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™

[Solved] How to verify if transaction No. exists?

s2Member Plugin. A Membership plugin for WordPress®.

[Solved] How to verify if transaction No. exists?

Postby angelazou » January 13th, 2012, 3:44 am

Hi,

I'm selling a page that contains a form to generate content. I'm making the link available for 1 year, but I only want my customer to be able to use it once. Can I do that with S2member?

Angela

PS: How can I verify if a particular S2member transaction number exists (and has a certain description)? I'm thinking, if there is no way I can do the above, I can configure the form to have a transaction number field where the user must enter his/her transaction number in order to submit the form, but I will also need to check if this number exists and belongs to a payment to this product only. How can I do that?
Last edited by angelazou on January 27th, 2012, 7:29 am, edited 1 time in total.
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: How to verify if transaction No. exists?

Postby angelazou » January 14th, 2012, 11:47 am

Need a quick reply...
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: How to verify if transaction No. exists?

Postby angelazou » January 16th, 2012, 1:30 am

I tried looking into the databases and tables, especially the wp_users table, but I wasn't able to find anything about transaction number/user status/purchased membership anywhere in there. Where are they stored?
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: How to verify if transaction No. exists?

Postby angelazou » January 16th, 2012, 9:27 pm

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

Re: How to verify if transaction No. exists?

Postby Raam Dev » January 16th, 2012, 10:59 pm

angelazou wrote:I'm selling a page that contains a form to generate content. I'm making the link available for 1 year, but I only want my customer to be able to use it once. Can I do that with S2member?


The s2Member Specific Post/Page access links are based on a time range, not number of access times. Even if you configured something to only allow access once, that could cause a lot of potential problems (what happens if the user clicks the link but doesn't use the form to generate content and decides to come back later to use the link?).

An alternative solution would be to check if the user has ever successfully generated to the content with the page.

If the user isn't logging in with an account, then the easiest way to do that would be to set a cookie with PHP after the user has generated the content. Then, if he comes back to the page a second time, you can check if the cookie exists and show a message saying access is denied.

Of course that's not a foolproof solution, as the user only needs to clear his cookies to gain access again.

But back to the original problem: this isn't the best way to do it. If you really want to limit access, the user should be logging in with an account that you can control.

angelazou wrote:How can I verify if a particular S2member transaction number exists (and has a certain description)? I'm thinking, if there is no way I can do the above, I can configure the form to have a transaction number field where the user must enter his/her transaction number in order to submit the form, but I will also need to check if this number exists and belongs to a payment to this product only. How can I do that?


You'll need to search the database and interface with the data that way. You can find the s2Member Transaction IDs in the wp_usermeta table. Use phpMyAdmin and do a search WHERE `meta_key` LIKE '%s2member%'.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: How to verify if transaction No. exists?

Postby angelazou » January 16th, 2012, 11:30 pm

But what about the product description in the 'desc=' attribute? I wasn't able to find anything but this string "a:2:{s:5:"level";s:10:"1326465882";s:6:"level4";s:10:"1326465882";}". This is for my admin account, all I can tell is that I'm a level 4, what does the s:10, s:5, and s:6 mean?

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

Re: How to verify if transaction No. exists?

Postby Raam Dev » January 16th, 2012, 11:59 pm

I do not believe the description is stored anywhere. If you want to store that, you'll need to create a custom field and populate it manually.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: How to verify if transaction No. exists?

Postby angelazou » January 17th, 2012, 12:14 am

By custom field, do you mean the custom field in pro forms?
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: How to verify if transaction No. exists?

Postby Raam Dev » January 17th, 2012, 12:22 am

Yes, you could use an s2Member Custom Registration Field (WP Admin -> s2Member -> General Options -> Registration / Profile Fields & Options.

You could also manually populate that field if necessary using a script attached to an API Notification (WP Admin -> s2Member -> API / Notifications.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: How to verify if transaction No. exists?

Postby angelazou » January 17th, 2012, 4:13 am

Just to verify, so in my case, the transaction number is 1326465882. Is that correct?
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: How to verify if transaction No. exists?

Postby Raam Dev » January 17th, 2012, 1:40 pm

No, that's a Unix timestamp, not a transaction number. You should have a separate meta_key called something like wp_s2member_subscr_id.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: How to verify if transaction No. exists?

Postby angelazou » January 17th, 2012, 9:58 pm

I see, will try to find that.
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: How to verify if transaction No. exists?

Postby angelazou » January 21st, 2012, 11:41 pm

Hi,

I've finally reached the testing phase for s2member, and I'm testing the Alipay gateway with the following code:
Code: Select all
[s2Member-Pro-AliPay-Button level="1" ccaps="" desc="房屋信息" custom="wanda.example.com|rent" ra="0.01" rp="1" rt="Y" image="default" output="anchor" /]


It went very successful, I was able to make the purchase, return to the site (btw, I would like to translate that page specifically for my Chinese users, how can I do it without translating the entire S2member plugin?). The user signs up, and I got the purchase confirmation email.
However, I didn't find anything else. I didn't get the username/password email. Nor did I find any trace of that transaction + user anywhere in the wordpress database, specifically, the user and user_meta table.

I'm running a multisite installation of wordpress, and I have set up the multisite patch. If you need any other information, please let me know.
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011

Re: How to verify if transaction No. exists?

Postby Cristián Lávaque » January 22nd, 2012, 6:11 pm

Angela, are you giving child blogs in the network to your users? What s2Member Pro license do you have?

Are you selling the membership from your main blog?

Could you please enable logging and, after a test purchase with this problem, post here the related log entries, x'ing out any private information? WP Admin -> s2Member -> AliPay Options -> Account Details -> Enable Logging

Did you double check your AliPay integration? WP Admin -> s2Member -> AliPay Options
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: How to verify if transaction No. exists?

Postby angelazou » January 22nd, 2012, 11:46 pm

Since it's a completely different issue, I posted a new thread here viewtopic.php?f=4&t=17049&p=61754#p61754
Last edited by angelazou on January 25th, 2012, 4:43 am, edited 2 times in total.
User avatar
angelazou
Registered User
Registered User
 
Posts: 72
Joined: July 14, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron