Page 1 of 1

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

PostPosted: January 13th, 2012, 3:44 am
by angelazou
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?

Re: How to verify if transaction No. exists?

PostPosted: January 14th, 2012, 11:47 am
by angelazou
Need a quick reply...

Re: How to verify if transaction No. exists?

PostPosted: January 16th, 2012, 1:30 am
by angelazou
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?

Re: How to verify if transaction No. exists?

PostPosted: January 16th, 2012, 9:27 pm
by angelazou
Hello?

Re: How to verify if transaction No. exists?

PostPosted: January 16th, 2012, 10:59 pm
by Raam Dev
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%'.

Re: How to verify if transaction No. exists?

PostPosted: January 16th, 2012, 11:30 pm
by angelazou
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

Re: How to verify if transaction No. exists?

PostPosted: January 16th, 2012, 11:59 pm
by Raam Dev
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.

Re: How to verify if transaction No. exists?

PostPosted: January 17th, 2012, 12:14 am
by angelazou
By custom field, do you mean the custom field in pro forms?

Re: How to verify if transaction No. exists?

PostPosted: January 17th, 2012, 12:22 am
by Raam Dev
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.

Re: How to verify if transaction No. exists?

PostPosted: January 17th, 2012, 4:13 am
by angelazou
Just to verify, so in my case, the transaction number is 1326465882. Is that correct?

Re: How to verify if transaction No. exists?

PostPosted: January 17th, 2012, 1:40 pm
by Raam Dev
No, that's a Unix timestamp, not a transaction number. You should have a separate meta_key called something like wp_s2member_subscr_id.

Re: How to verify if transaction No. exists?

PostPosted: January 17th, 2012, 9:58 pm
by angelazou
I see, will try to find that.

Re: How to verify if transaction No. exists?

PostPosted: January 21st, 2012, 11:41 pm
by angelazou
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.

Re: How to verify if transaction No. exists?

PostPosted: January 22nd, 2012, 6:11 pm
by Cristián Lávaque
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

Re: How to verify if transaction No. exists?

PostPosted: January 22nd, 2012, 11:46 pm
by angelazou
Since it's a completely different issue, I posted a new thread here viewtopic.php?f=4&t=17049&p=61754#p61754