Atomia Billing Server

Pending charges

0 views 0

Pending charges

Pending charges are small amounts (such as reminder fee, late payment fee, … etc.) for which you don’t want to create a separate invoice. Instead, they should be added to the next renewal invoice.

Pending charges are subscriptions based on the products that belong to PendingCharge category. When created, these subscriptions have their status set to PendingCharge. Due to the status, these subscriptions are not invoiced immediately but later, on renewal, downgrade, termination or collected by PendingChargesScheduledEventHandler.
They are visible only in Admin Panel, on the List of subscriptions page. Once invoiced, these subscriptions’ status is set to Terminated.

Workflow

Pending charges are stored as subscriptions with the status PendingCharge. These subscriptions will not be invoiced immediately, as usual. Instead, the system will:

  • add them to the next renewal invoice if the customer has recurring subscriptions or
  • create a separate invoice periodically for the customers without recurring subscriptions (invoices are created by PendingChargesScheduledEventHandler).

In both cases, the system will create an invoice for all pending charges that are older than the number of hours defined by the parameter PendingChargeDelay in ResellerConfiguration (AdminPanel -> Settings -> Reseller configuration).

This delay allows administrators to check, modify or delete pending charges before they get invoiced.

By default, Pending Charge Delay is 0.

Additionally, the system will invoice remaining pending charges:

  • upon subscription downgrade and
  • before an account is terminated.

Once invoiced, these subscriptions’ status will be set to Terminated.

SubscriptionRenewalScheduledEventHandler will not create invoices for pending charges by default. To activate invoicing, set the parameter CollectPendingCharges in plugin’s configuration:

            {
               "ApprovedItemsCount":0,
               "ScheduleItemsCount":0,
               "ApplyToSubresellers":true,
               "AdditionalOffset":3,
               "AutoApprove":true,
               "IncludeSuspendedSubscriptions":false,
               "Offsets":[
                  {
                     "Key":"Default",
                     "Value":{
                        "DefaultOffsetValue":30,
                        "MonthlyInvoices": false,
                        "MonthlyInvoicesForAll": true,
                        "MontlyInvoicesOffsetValue": 0,
                        "RenewalPeriodsConfiguration":[
                            {
                               "RenewalPeriodUnit": "month",
                               "RenewalPeriodValue": "1", 
                               "OffsetValue": "20"
                            },
                            {
                               "RenewalPeriodUnit": "month",
                               "RenewalPeriodValue": "3", 
                               "OffsetValue": "20"
                            }
                        ]
                     }
                  },
                  {
                     "Key":"Domain",
                     "Value":{
                        "DefaultOffsetValue":38,
                        "MonthlyInvoices": false,
                        "MonthlyInvoicesForAll": true,
                        "MontlyInvoicesOffsetValue": 0,
                        "RenewalPeriodsConfiguration":null
                     }
                  },
                  {
                     "Key":"DomainTransfer",
                     "Value":{
                        "DefaultOffsetValue":38,
                        "MonthlyInvoices": false,
                        "MonthlyInvoicesForAll": true,
                        "MontlyInvoicesOffsetValue": 0,
                        "RenewalPeriodsConfiguration":null
                     }
                  }
               ],
               "SendOnPreviousWorkingDay":true,
               "SendOnWorkingDayOnly":true,
               "CollectPendingCharges":true
            }

Pending charge types

By default, there are 3 types of PendingCharge. For each type, a separate product is defined.

  • FEE-CUSTOM – fee for custom manual jobs
  • FEE-REMINDER – fee for invoice reminders
  • FEE-LATEPAYMENT – fee for late payments

If needed, you can define your own fees. Use FEE-CUSTOM as a template to get proper values for the parameters.

By default, FEE-REMINDER and FEE-LATEPAYMENT are tax-free products, while FEE-CUSTOM has defined VAT rate.

Custom fee

Custom fee is a simple fee for any kind of service you provide to the customer. It is not related to any workflow. Product item for this type of fee is FEE-CUSTOM.

To create a custom fee, simply place an order from the Admin Panel. Select CustomFee as a product and type a short description of provided service in the description field. This description will appear later on the invoice.
For this type of order, order confirmation email will not be sent.
Important: PendingCharge orders may only contain products of the PendingCharge category. If you add any other type of product, the order will be marked as invalid it will not be processed.

Reminder fee

Reminder fee is created whenever a reminder for which the fee is defined, is sent to the customer. Product item for this type of fee is FEE-REMINDER.
This fee is not mandatory and it will be sent only when ReminderFee section is defined in the InvoiceReminder configuration.

Example configuration:

            {
              "ReminderConfigurations": [
                {
                  "Key": "B77B8B91-741B-4CF1-88B4-FEB21550055C",
                  "Value": {
                     "ApprovedItemsCount":1000,
                     "ScheduleItemsCount":1000,
                     "ApplyToSubresellers":true,
                     "InvoiceReminders":[
                       {
                           "AutoApprove":true,
                           "MessageType":0,
                           "Name":"InvoiceReminder1",
                           "SendOnWorkingDayOnly":true,
                           "SendOnPreviousWorkingDay":true,
                           "TemplateNamePrefix":"InvoiceReminder1Email",
                           "AdditionalOffset":3,
                           "AttachInvoice":true,
                           "RelativeToDueDate":false,
                           "CategoriesConfigurations":[
                              {
                                 "Categories":[],
                                 "DaysOffset":22,
                                 "Filter":"all",
                                 "ApplicableTo":"any",
                                 "HandlersConfiguration":null,
                                 "Order":1
                              }
                           ],
                           "RelativeToReminder":null,
                           "ReminderFee": 
                             {
                                 "Name":"Reminder fee 1",
                                 "Item":"FEE-REMINDER",
                                 "CustomerType":0, 
                                 "CountryList":['se','no','dk'], 
                                 "DescriptionTemplate":"ReminderFeeDescription"
                             },
                        }
                        /// ... 
                        /// other reminders...
                        /// ...
                     ],
                 "MessageHandlers":null
                  }
                }
              ]
            }

Parameters of the ReminderFee are:

  • Name – the name of the reminder fee,
  • Item – product number of the reminder fee product
  • CustomerType – the type of the customer. Determines type of the customer for which reminder fee will be created. Possible values are:
    • 0 – All (reminder fee will be created regardless of customer type),
    • 1 – Business (reminder fee will be created only for reminders sent to business customers),
    • 2 – Private (reminder fee will be created only for reminders sent to private customers)
  • CountryList – the list of country codes. If the CountryList is not empty, reminder fee will be created for the customers whose country code is in the list, otherwise not. If the list is empty, reminder fee will be created regardless of the customer’s country.
  • DescriptionTemplate – the name of the template that will be used to create a description that will appear on this invoice. If this value is not defined, or there’s no template with the configured name, a default description will be added (English language is used by default).

Late payment fee

Late payment fee is added whenever a late payment is detected. Payments made after invoice’s due date are considered as late. Product item for this kind of fee is FEE-LATEPAYMENT.
Whenever a payment is made after a due date, the system will trigger Late Payment workflow. The workflow configuration contains following parameters:

  • AllowPaymentDelay – defines a number of days after due date during which payment will not trigger fee calculation. For example, if this parameter is set to 2,  a payment that is made 2 days after the due date will not generate any fee. If payment is made on the third day after due date, late payment fee will be generated. This parameter is mandatory. If it is not defined, Late Payment Fee workflow will not be executed.
  • LatePaymentInterestRate – defines interest rate that will be used to calculate late payment fee. The rate is given in percentage, ie. 20 means 20%.
  • LatePaymentFeeItem – the code of the product item that will appear on the invoice and whose price will be used to calculate the fee. This parameter is mandatory. If it is not defined, Late Payment Fee workflow will not be executed. The default value is FEE-LATEPAYMENT.
  • LatePaymentFeeCalculationStrategyClass – the full name of the class that performs the calculation of the late payment fee. By default, this parameter is empty.
  • DescriptionTemplate – the name of the template that will be used to create a description that will appear on this invoice. If this value is not defined, or there’s no template with the configured name, a default description will be added (English language is used by default).

Late payment fee calculation

The late payment fee is calculated as:

            fee = price * quantity

The price used in this calculation is the price of the product with the code defined by the LatePaymentFeeItem parameter.

The value of the quantity is calculated by LatePaymentFeeCalculationStrategyClass. If this parameter is not defined, quantity is 1.

Late payment fee workflow configuration

This workflow can be configured to work in different scenarios:

  • Fixed late payment fee – if you want to set a fixed fee for late payments, leave parameter LatePaymentFeeCalculationStrategyClass empty and set the price of LatePaymentFeeItem to the desired value.
  • Late payment interest – if you want to calculate a fee as an interest rate for the period between the due date and payment date, set LatePaymentFeeCalculationStrategyClass to “Atomia.Billing.Plugins.GenericWorkflowPlugin.EventHandlers.LatePaymentFeeInterestCalculation, Atomia.Billing.Plugins.GenericWorkflowPlugin”. This is the built-in algorithm that calculates yearly interest rate as:
                quantity = LatePaymentInterestRate / 100 * number_of_days / 365
    

    The price of the LatePaymentFeeItem should be set to 1.

  • Custom calculation – if you want to create a custom algorithm for calculation, create a class that implements interface ILatePaymentFeeCalculationStrategy and set LatePaymentFeeCalculationStrategyClass to the full name of your class. The LatePaymentFeeItem should be set to 1.

Pending Charges Scheduled Event Handler

This event handler is meant to be triggered periodically, at the beginning of the month for example, and to invoice pending charges that were not invoiced during the month (for example, pending charges for customers without recurring subscriptions).

Pending Charges in GUI

Pending Charges are visible only in Admin Panel but hidden by default. To display them, use the checkbox in the Filter section.

Pending charge widget

Pending charge widget displays customer’s pending charge balance. This widget can be found on the Customer Card in the Admin Panel. It is disabled by default. To enable it, set the value of the parameter ShowPendingCharges in Admin Panel’s Web.config file to true.

            <globalSetting name="ShowPendingCharges" value="true" />

 

Was this helpful?