Policy payment plugin

To customize how PolicyCenter generates a list of available reporting plans for a policy, implement your own version of the policy payment plugin interface, IPolicyPaymentPlugin.

The plugin has only a single method, which is called filterReportingPlans. This method takes a Policy entity and an array of PaymentPlanData objects. Your method must return an array of payment plan data objects (PaymentPlanData), which collectively represents the subset of plans that are available for the policy. You can use properties on both the policy period and the payment plans to filter the payment plans to return. For example, you can use the AllowsPremiumAudit property on the policy period to determine whether to return payment plans that allow premium reporting.

You can return the same array as was passed in. You do not have to generate a new identical array if you do not need to perform any filtering.

In the base configuration, for a policy period that allows premium reporting, this method returns all payment plans. For a policy period that does not allow premium reporting, this method returns only non-premium-reporting payment plans.

The following example implementation filters payment plans. If the policy allows premium reporting, the method returns only premium-reporting payment plans. Otherwise, the method returns only installment plans.

class PolicyPaymentPlugin implements IPolicyPaymentPlugin {

   override function filterReportingPlans( policy : Policy, plans : PaymentPlanData[] )
      : PaymentPlanData[] {
    var plansToReturn : List<PaymentPlanData> = {}
    for ( plan in plans ) {
      if ( period.AllowsPremiumAudit ) {
        if ( plan typeis ReportingPlanData ) {
          plansToReturn.add( plan )
        }
      } else {
        if ( plan typeis InstallmentPlanData ) {
          plansToReturn.add( plan )
        }
      }
    }
    return plansToReturn?.toTypedArray()
  }
}

If you need to examine the payment plan summary, the PaymentPlanSummary object has the following properties.

  • BillingId
  • Name
  • PaymentCode
  • Installment
  • Total
  • Notes
  • PolicyPeriod – Foreign key reference to the policy period where the plan summary resides