How to make membership not to expire after stopping recurring billing (PayPal)

Discussion in 'Payments processing' started by mystery, May 4, 2010.

  1. mystery

    mystery New Member

    Joined:
    Jun 27, 2008
    Messages:
    7
    I need to give my customers 30 day trial to my site for $1, then charge then one-time payment of $97. There are 2 possible scenarios to that:

    Scenario 1:
    30 days trial for $1, then one-time payment if $97. If they cancel the trial (i.e. don't pay the $97), they will keep the membership access forever.

    Scenario 2:
    30 days trial for $1, then one-time payment of $97. If they don't cancel the trial, then after a successful $97 payment they will get an additional access to a different members' area (folder). They will keep the membership access to both areas forever.

    In other words - I have a product for $1. If you don't cancel and pay another $97 after 30 days, you will get extra access.

    I've created a PayPal recurring payment - 30 days trial for $1, then $97 one recurring payment. However, I assume that after that month their membership will expire and they will lose access, which I don't want. Even if it didn't expire it still doesn't solve the problem of separating those who canceled and those who paid.

    Any idea how to do that?
  2. grantswaim

    grantswaim New Member

    Joined:
    Mar 16, 2008
    Messages:
    109
  3. mystery

    mystery New Member

    Joined:
    Jun 27, 2008
    Messages:
    7
    I have partially solved my problem by purchasing the "Complimentary" plugin - http://jlogica.com/jess/?act=product&id=2
    I bundle a 'copy' of my $1 product (the same product with Scope set to disabled) as a "free" never expiring product with my main product. This way they will have access to the site no matter what.

    Now I have to figure out how to set 'no expiration' on the main product for those who don't cancel and actually pay $97.

    I wonder if this would work:

    PHP:
    <?php
    setup_plugin_hook
    ("finish_waiting_payment""fwp");
    function 
    fwp($pid){
        global 
    $db;
        
    $p $db->get_payment($pid);
         
    /// Do not execute anything for other products..
        
    if($p[product_id] != 2) return;
        
    $cnt $db->query_one("select count(*) from amember_payments
                                          where product_id='
    $p[product_id]' and member_id='$p[member_id]' and completed=1");
        
    // If 2 payments are made ($1 trial + $97 one-time payment)
        
    if($cnt==2){
        
    // Last payment change it's expiration date to 12-31-2037;.
           
    $p[expire_date] = date('Y-m-d'mktime(0,0,0,12,31,2037));
           
    $db->update_payment($pid$p);
        }
    }

    ?>
    I'm not a programmer, just trying some reverse engineering with the code from here: http://www.amember.com/forum/showthread.php?t=12109
    Any help is welcome.
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    mystery,
    Yes that code will work in your situation. It will make second payment to be lifetime.
    However as was mentioned by David, paypal does not support such setup. There is no way to set Trial with one recurring payment.
  6. mystery

    mystery New Member

    Joined:
    Jun 27, 2008
    Messages:
    7
    Thanks for the replies.

    What you are saying is that it's not possible to set "Recurring Times" to 1?
    So I can't have a product "$1 trial for 30 days, then 1 payment of $97" ?

    But on PayPal checkout page under terms it says: $1.00 USD for the first 30 days
    Then $97.00 USD for one month. So why that wouldn't work?


    What are my options here? Which of these would work?:
    -30 days trial for $47, then 1 payment of $47 (it's the same thing as above, so I guess this one is a no-go)
    -2 payments of $47

    -any other idea?
  7. mystery

    mystery New Member

    Joined:
    Jun 27, 2008
    Messages:
    7
  8. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Well actually I was wrong. Such modification already implemented in latest paypal plugin so recurring_times =1 will work.
  9. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    OK, it used to not work- and the paypal button creation still has a 2 as the minimum period- but clearly its working!

    Good to know!

    David
  10. mystery

    mystery New Member

    Joined:
    Jun 27, 2008
    Messages:
    7
    Thanks for your replies. The trial/1 payment seems to be working as well as the code.
  11. boylovell

    boylovell aMember Pro Customer

    Joined:
    Mar 4, 2009
    Messages:
    10
    my site

    Hi,

    I am going to be using the + 1 feature on my site so can i find out if the version I have features it, mine was bought on 12/ Mar /2010.

    Or is this the 'Paypal Recurring' feature added to the latest version of amember released recently?

    Thanks

    Simon
  12. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    For a trial + single payment, yeah, you need 3.1.9.

    David

Share This Page