Freeside:1.7:Documentation:Developer:Price Plans

From Freeside
Revision as of 20:41, 10 June 2007 by EzlAfz (talk | contribs)

Jump to: navigation, search

cheap diazepam cheap xenical nokia ringtones qwest ringtones zanaflex online diazepam online verizon ringtones free motorola ringtones order lortab prozac online ericsson ringtones but ortho cheap cyclobenzaprine cheap celexa free ringtones phentermine free cool ringtones cheap prozac free qwest ringtones cialis online sprint ringtones nexium online real ringtones sagem ringtones tracfone ringtones free nokia ringtones free punk ringtones mp3 ringtones sony ringtones ativan online but hgh free midi ringtones alltel ringtones cheap flexeril sony ericsson ringtones motorola ringtones vicodin online free tracfone ringtones buy soma levitra online free motorola ringtones cheap didrex cheap sildenafil pharmacy online online zoloft online hydrocodone online free sony ringtones cingular ringtones viagra buy paxil ambien online buy lortab order hydrocodone vigrx online cheap ativan hgh online sildenafil online buy viagra ortho online nextel ringtones lisinopril free funny ringtones free sony ericsson ringtones buy vicodin hydrocodone order ativan mono ringtones clonazepam levitra free sprint ringtones cialis online sony ringtones cheap levitra zanaflex online phentermine celexa online ultracet online wwe ringtones free sharp ringtones buy norco soma online cheap ultracet free cingular ringtones cheap adipex cheap xenical cheap albuterol cheap tenuate cheap ortho free music ringtones sagem ringtones cheap lisinopril meridia online cheap propecia cheap vigrx cheap diethylpropion cheap albuterol mp3 ringtones meridia online free ringtones cheap ultram soma online cheap lortab cheap sildenafil free nextel ringtones cheap lorazepam free funny ringtones diethylpropion online free ringtones funny ringtones cingular ringtones cheap soma nokia ringtones clonazepam online zyban online clomid online buy prozac online valium order lisinopril meridia online buy tramadol sharp ringtones free midi ringtones flexeril online real ringtones celexa online zoloft online free nextel ringtones ericsson ringtones free music ringtones mtv ringtones order ultram buy valium viagra online lorazepam online cheap cialis cheap phentermine buy nexium samsung ringtones cheap norco meridia online sprint ringtones buy rivotril order carisoprodol carisoprodol online cyclobenzaprine online free qwest ringtones free qwest ringtones cheap fioricet verizon ringtones punk ringtones cheap hoodia pharmacy online online tracfone ringtones tramadol cheap rivotril tramadol online didrex online cheap fioricet music ringtones cheap albuterol free nokia ringtones buy viagra buy alprazolam buy xenical pharmacy online online free funny ringtones order zanaflex free ericsson ringtones cyclobenzaprine online adipex online cheap xanax free alltel ringtones free qwest ringtones ultram online sonyericsson ringtones free samsung ringtones cheap lortab free mono ringtones free samsung ringtones zyban online cheap celexa free funny ringtones wwe ringtones cheap rivotril but clomid buy fioricet buy hgh cheap lipitor cheap hoodia clonazepam online cool ringtones tenuate online cheap vicodin real ringtones free sonyericsson ringtones buy hoodia buy tramadol nextel ringtones cheap alprazolam ambien online == Pricing Plans == Adding Pricing Plans is pretty easy, but has the potential to cause a lot of pain for other users. PLEASE use your new pricing plan in production on YOUR installation for a period of time before contributing back.

The part_pkg class links the packages to the database. The plan field indicates which pricing plan to use. The pricing plans are are found in FS/FS/part_pkg/. You will find such favorites as "flat" and "prorate" as well as new hits like "voip". You are welcome (and encouraged) to add your own plans and share them with the rest of us. Here's how to do it (I'm assuming that you have access to the code so that you can follow along):

  1. Find a package that is close to what you want to do. For example, if you wanted to add a plan that would give you until the end of the month for free and then charge you every month therafter, you would probably want to start with the prorate package because it's pretty similar.
  2. Make a copy of the old package under a new name. In this example you may want to call it free_rest_of_month.pm
  3. Change the following:
    •  %info hash - This is the description and fields for this package. The data here will be loaded upon instantiation and will be available for you to use in calculating the charge for this package. You should set the fieldorder and any defaults as appropriate.
    • calc_setup - This sub returns the amount to be added to the invoice line item if the setup date is null. you can do some magic here, but be VERY careful. The flat_delayed module does some of this magic. You won't have to add this one for our example.
    • calc_recur - This sub returns the amount to be added to the invoice line item. For examples of interesting recurs check out the voip packages. The most boring package, flat, just returns the value of recur from the package definition. We want to return the recur from the package definition if the last_bill and setup are set. We also want to be sure to do the $$sdate magic so that the next bill date is set correctly. We don't return anything if this is the first bill.
    • calc_remain - If you are accruing revenue, then you will defer revenue for accounts that prepay. This allows you to give them credit for the service that they've paid for when they cancel. This method calculates it for you. Be careful here because this is essentially giving back money.
    • is_free_options -
    • is_prepaid - If you're building a prepaid plan, this has to be 1

Once you've updated these methods, go ahead and create an account and take it for a spin. Remember, if you're changing an existing plan, then PLEASE run it in your production environment before contributing back. Good Luck!

Services

Exports