Implementation Guide for Oracle Billing Insight > Payment Processing > About Recurring Payment Processing >

Recurring Payment Job


The pmtRecurringPayment job gets bills and then schedules payments. The first process is called synchronization and the second process is called scheduling.

Recurring Payment Synchronization

During the synchronization process, the job retrieves a list of recurring payments to be synchronized, and then tries to get the bills for the recurring payments from the Command Center. Figure 11 illustrates the recurring payment synchronization process.

Figure 11. The Recurring Payment Synchronization Process
o

Figure 12 shows the synchronization.

Figure 12. Recurring Payment Synchronization

Recurring Payment Scheduling

Recurring payment scheduling processes as follows:

  1. Calls RecurPaymentTask.isValidBillSummar() to validate the latest retrieved bill summary. The latest bill summary could be ignored if it has no bill due date, or if the recurring payment is based on amount due but the bill summary has no amount due.
  2. Now a valid bill summary exists. If the payment to the previous bill summary is still in scheduled status, then the following occurs:
    • Calls RecurPaymentTask.cancelScheduledPayment() to cancel this payment. The reason to cancel it is that the new bill summary just retrieved must include the balance of this scheduled bill, cancel the payment so that it will not pay the same bill twice.
    • Calls RecurPaymentTask.modifyLastPayDate(). If a recurring payment has a fixed pay date, but the amount is based on amount due, then it is necessary to back date the last pay date because the previous bill payment has been cancelled. Failing to do so will cause the current new bill being paid in next pay interval, not the current one. For example, assume that current bill cycle is October, the previous bill was retrieved on October 10 and is scheduled to pay on October 15. As a result, the last_pay_date and next_pay_date of the recurring payment are updated to October 15 and November 15, respectively. On October 11, a new bill is retrieved and the payment is scheduled. If Oracle Billing Insight does not back up the last_pay_date, then the new bill will be scheduled to pay on November 15. But in this case, it is necessary to pay the bill on October 15 because it is still in the October billing cycle. To fulfill this goal, go back date the last_pay_date to Sep 15 so the next_pay_date will be calculated as October 15, which will be used as the pay date for the new bill.
  3. Calls RecurPaymentTask.insertNewBillAndUpdateRecurring(), which inserts the retrieved new bill and updates recurring payment accordingly.
    • Calls IRecurringPaymentPlugIn.preInsertLatestSummary() before inserting the bill summary in the payment_bill_summaries table.
    • If PRE_INSERT_LATEST_SUMMARY_REJECT is returned from the plug-in, then calls RecurPaymenTask.updateRecurringPaymentOnly() and return.
    • Calls IBillSummaryLog.insert() to insert this new bill summary.
    • If IBillSummaryLog.insert() generates the DuplicateKeyException indicating that this bill is already in the Oracle Billing Insight database, then calls RecurPaymenTask.updateRecurringPaymentOnly().
    • Sets the bill_scheduled flag to N if the payment amount is not negative, or Y if it is negative. This means that no credit or reversal will be issued from recurring payment, and the credit appears as part of the next bill.
    • Sets the bill_id of the recurring payment to the one of the new bill summary.
    • Calls IRecurringPaymentPlugIn.preUpdateSynchronizedRecurring().
    • If PRE_UPDATE_SYNCHRONIZED_RECURRING_REJECT is returned from the plug-in, then calls RecurPaymenTask.updateRecurringPaymentOnly() and return.
    • Calls IRecurringPaymentLog.update() to update the recurring payment. The following table lists the information updated.
      Column
      Value

      last_pay_date

      In the case where the pay date is fixed, but amount is based on amount due, last_pay_date could be moved one pay_interval back if a scheduled payment is cancelled because a new bill arrives. Otherwise, last_pay_date will stay the same.

      next_pay_date

      Next_pay_date will be updated in RecurringPaymentUtil.calculateInternal(). In the case of fixed pay date, it will be updated based on last_pay_date. In the case of before due, it will be updated based on the due date of the new bill.

      status

      Because next_pay_date is changed, the status could be changed to inactive if next_pay_date falls after end_date.

      bill_id

      It is set to the bill_id (the primary key of the bill record) of the bill being inserted into the payment_bill_summaries table.

      bill_scheduled

      The bill_scheduled flag is set to N if the payment amount is not negative, Y if it is negative.

      last_process_time

      Set to the current time.

Recurring Payment Scheduling Workflow

Recurring Payment Scheduling Workflow schedules recurring payments for processing with the pmtRecurringPayment job. During scheduling processing, the pmtRecurringPayment job retrieves a list of recurring payments to be scheduled, and then schedules them, as shown in Figure 13.

Figure 13. Recurring Payment Scheduling Workflow

Figure 14 shows the action sequence:

Figure 14. Recurring Payment Scheduling Action Sequence
Implementation Guide for Oracle Billing Insight Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Legal Notices.