Payment Plan Ruling

Add custom ruling for payment plans

This document explains how to override default payment plans ruling in the operating configuration of schemes. This setup is designed for use with the Rating portal.

Table of Contents

Introduction

The Payment Plans Ruling script contains a list of payment plans that will be displayed to users when they intend to make a payment in ICE Policy. To override the default settings, you need to define some variables and dictionaries as shown in the code below.

# Initialise plan list
paymentPlans = []

paymentPlanSTRIPE_WITH_REN = {}
paymentPlanCLOSE_BROTHERS_FINANCE_1295_WITH_REN_INIT4 = {}
paymentPlanCLOSE_BROTHERS_FINANCE_1295_WITH_REN_INIT5 = {}

Setting up Payment Plans

Each payment plan has a unique name and properties. To set up a payment plan, define a dictionary for each plan and assign values to its properties.

Customising Payment Plan Properties

Each payment plan dictionary can store various properties such as ["name"], ["default"], ["apr"], and ["interestRate"]. Assign values to these properties to customise the payment plan.

For example, to set up a plan for new businesses with instalments:

Selecting a Default Payment Plan

Set the ["default"] property of a payment plan to true to make it the default plan that will be selected in ICE Policy. You can only set one default plan at a time, while others should be false.

Plan Renewals

Different renewal plans can be set for different policy transaction types. For example, if a policy was set up on INIT2 or INIT3, it renews on INIT4.

Additional Info

The paymentPlans list holds the string values of the names of the intended plans, and the server's CalcResponse will only return the plans added to this list. If an empty array is returned, the setup will revert back to the default settings, showing all the plans previously defined in the operating configuration by default.

It is important to note that all policies created on CLOSE_BROTHERS_FINANCE_995_WITH_REN_INIT2 or CLOSE_BROTHERS_FINANCE_WITH_REN_INIT3 prior to the recent updates are renewed on CLOSE_BROTHERS_FINANCE_1295_WITH_REN_INIT4, while new business policies are offered CLOSE_BROTHERS_FINANCE_1295_WITH_REN_INIT5.

Error Handling

Error handling is an essential aspect of writing robust code, particularly when dealing with user input or external data sources. Proper error handling can help prevent unexpected crashes, provide informative error messages, and improve the overall user experience.

Handling Missing or Incorrect Plan Names

It is possible that an incorrect or missing plan name could be added to the paymentPlans list. To handle this scenario, you can implement a check to ensure that the plan names in the list match the defined dictionaries:

Handling Multiple Default Payment Plans

It is crucial to ensure that only one payment plan is set as the default. To handle cases where multiple plans are mistakenly marked as default, you can implement a check:

Last updated