1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to use aMember Pro for software licining

Discussion in 'Visual Basic .NET' started by SEOboss, Feb 28, 2013.

  1. SEOboss

    SEOboss Junior Member

    Joined:
    Nov 23, 2009
    Messages:
    166
    Likes Received:
    38
    Occupation:
    IM
    Location:
    India
    Hi

    I need help I am willing to use aMember Pro script to sell multiple products so far every thing is ok because its default feature of amember

    To validate users credentials I created a form in my software which will validate username and password if username password is ok my application will get shown if its wrong application will not get open - This is also OK

    Main problem is as I am selling multiple products and if a user purchase any one software from me he will get access to all software because aMember successfully validate user name and password is its is ok and due to that user can use same username password for all software

    so I need help how to prevent this
     
  2. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,879
    Likes Received:
    1,932
    Works with aMember V4 Bootstrap:
    PHP:
    $active_subs $user->getActiveProductIds();
    if(
    in_array("PRODUCT_ID_NUMBER",$active_subs)==false){ // Not Purchase Product
     
  3. SEOboss

    SEOboss Junior Member

    Joined:
    Nov 23, 2009
    Messages:
    166
    Likes Received:
    38
    Occupation:
    IM
    Location:
    India
    Hi

    Thank post cods for code , I will be very thankful to u if u explain or post code in c#/vb.net
     
  4. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,879
    Likes Received:
    1,932
    You must use PHP to contact the aMember API then you can return answers to your program, E.g.
    On your web server get the users details etc then check for product existence:
    if(in_array("PRODUCT_ID_NUMBER",$active_subs)==false){echo "NOT PURCHASED"; exit;}

    And in VB:
    If Response = "NOT PURCHASED" Then
    MessageBox.Show("You do not have access to this product");
    Me.Close()
    End If
     
    • Thanks Thanks x 1
  5. hatemachine

    hatemachine Regular Member

    Joined:
    Jan 14, 2011
    Messages:
    271
    Likes Received:
    1,138
    Not sure if aMember has this. But s2member has an "notifications api" where you can basically call an url after the user has successfully purchased your product. So what I do is when someone orders a product I just call my php script which then adds the user details to the "customer db" and this db I use for verifying the license.
     
  6. terebi

    terebi Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 11, 2011
    Messages:
    337
    Likes Received:
    62
    Amember has a rest API. You have to "purchase" it for $0 (free). Next time you download amembers it comes with REST plugin and some documentation.

    Otherwise, you need to hack into the amembers installation by writing a PHP based API.

    Basically you import the boot strapper

    require_once "../members/bootstrap.php";

    Then after that you can make calls such as...

    $user = Am_Di::getInstance()->userTable->getAuthenticatedRow($login, $pass, $code);

    I think REST is probably easier. However when I needed integration I actually had to do it via the bootstrapper since the REST API wasn't released yet.
     
  7. SEOboss

    SEOboss Junior Member

    Joined:
    Nov 23, 2009
    Messages:
    166
    Likes Received:
    38
    Occupation:
    IM
    Location:
    India
    hi

    its worked very well thanks for valuable help