Configuring Scripts That Update Accounts

You can set up scripts to update balances in the accounts from which the usage of a service is charged and update accounts by assigning values to variables for the account balances.

You can create or delete account update scripts:

  • To add a script, click Add Account Update Script, enter a name for the script in the Add Account Update Script field that appears, and click Create.
  • To delete a script, click Delete next to the script that you want to delete.Image g015853.gif

Account Update Script Name

  • Name of the script.
  • Value—Name of a script
  • Default—No value

Account Update Script Content

  • JavaScript program that updates a subscriber’s account. The script can refer to the attribute name of any attributes in the event being processed.
  • Value—Fields of an account can be updated by assigning values to the following parameters:
    • balance_<accountName>—Values written to this parameter are put in the balance field of the account.
    • status_<accountName>—Values written to this parameter are put in the status field of the account.
    • lastUpdateTime_<accountName>—Values written to this parameter are put in the last_update_time field of the account.
  • Example—<balance_PeriodicQuota>=<balance_PeriodicQuota>-\ <currentUsage>;<lastUpdateTime_PeriodicQuota>=<currentTime>;