Recurring Billing ending my subscriptions

Discussion in 'Payments processing' started by thefinancialpuzzle, Apr 26, 2010.

  1. thefinancialpuzzle

    thefinancialpuzzle New Member

    Joined:
    Mar 3, 2009
    Messages:
    13
    I have a subscription set for 1 year.
    The product price is paid for over 6 recurring charges set 1 week apart.
    The last payment ends the subscription on week later.

    How can I make the last payment give my customer access for the length of the subscription (10 1/2 months)?
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Will user be able to renew this subscription for another year so this will be another 6 payments?
  3. thefinancialpuzzle

    thefinancialpuzzle New Member

    Joined:
    Mar 3, 2009
    Messages:
    13
    No, the recurring charge is installment billing for a classes with one year access to materials. At the end of the year, the customer will have alternative selections for continued access to materials.
  4. thefinancialpuzzle

    thefinancialpuzzle New Member

    Joined:
    Mar 3, 2009
    Messages:
    13
    No, the recurring charge is installment billing for a classes with one year access to materials. At the end of the year, the customer will have alternative selections for continued access to materials.
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Place this code to site.inc.php and change PRODUCT_ID to actual product number:
    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] != PRODUCT_ID) 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(
    $cnt==6){
        
    // Last payment change it's expiration date;.
        // Last 6 payment will end in 6 weeks  so need to add 323 days;
           
    list($y,$m,$d) = split("-",$p[expire_date]);
           
    $p[expire_date] = date('Y-m-d'mktime(0,0,0,$m,$d+323,$y));
           
    $db->update_payment($pid$p);
        }
    }

    ?>

Share This Page