Payment Schedules
Unaric Payment Schedule contains the information needed to drive the creation of payments where they need to recur automatically. Every payment schedule is linked to an authorisation, which stores the customer's payment details. Their only function is to create Payment records, linked to Authorisations (Saved Payment methods) on a fixed schedule so that these payments can be collected automatically.

Key fields
Field | Description |
|---|---|
Authorisation | Set to the authorisation record that should be used to collect the schedule payment. |
Frequency | The frequency at which the payment should be collected. |
Regular amount | The amount that should be taken from each payment. |
Next payment date | The date that you want the payment schedule to start collecting. This will be updated (according to the frequency) each time the schedule collects. |
Status | Active, Inactive, or Expired. |
Statuses
Status | Description |
|---|---|
Active (previously In Force) | The default status. The schedule is active and will collect. |
Inactive | The schedule is not collecting. |
Expired | In cases a final payment date has been set and is due, the record will be set to expired after the final payment. |
Create Payment Schedules from existing authorisation
- On the Unaric Payments Authorisations tab, navigate to the Authorisation record you want to use for the payment schedule.
- Select the dropdown arrow by the payment schedules related list and click New.

- The correct authorisation will already be pre-populated. Fill in the rest of the required fields.
- Click Save to finish. The payment schedule is now active, and will collect overnight each time the following conditions are met:
- The Next Payment Date is set to either today, or is in the past.
- The status of the payment schedule is set to Active.
- The status of the authorisation attached to the payment schedule is In force.
Deactivate payment schedule
If you wish to temporarily stop the payment schedule from collecting, then edit the record, and change its status from In force to Inactive.
Direct Debits take time to process. As such, ensure the payment is taken from the customer's bank account on the correct date the whole cycle starts a number of days before the actual due date ("Next Payment Date"). The number of days is a configuration parameter that is set to 4 by default. If you make a Payment Schedule Inactive during that window then there might already be a payment being processed that you will need to deal with separately.
Processing payment schedules
In order to process payment schedules the Unaric Repeat Payment Scheduled job needs setting up.
- In Salesforce, navigate to Setup > Environments > Jobs > Scheduled Jobs.
- Navigate to Setup > Custom Code > Apex Classes.
- Click the Schedule Apex button.
- Configure the new job as follows:
- Job Name: Asperato Repeat Payment (recommended)
- Apex Class: Click the magnifying glass and select BatchProcessPaymentSchedules.
- Schedule Apex Execution:
- Frequency: As per requirements
- Recurs every week on: Select all checkboxes.
- Start Date: Choose a date (defaults to today).
- End Date: Set a date far in the future (e.g., 12/31/2050).
- Preferred Start Time: Set a time (e.g., 04:00 or 05:00).
- Click Save to finish.
Ensure that the user account you use to recreate the scheduled job has the System Administrator profile. This is necessary to grant the job the required permissions to access the AggregateResult entity.