•Creating and Executing the Data Management Job
•Data Management Configuration
Script Name |
Add Scheduled Payments |
|
Minimum Supported Version |
7.27.0 |
|
Source Type |
Business Intelligence (BI) |
Single Source |
Script Definitions |
Add Scheduled Payments |
Warning Never use 'Dry Run' when payments are involved. It will send the payments to the gateway but not commit anything to the database, causing double-charges when you do run it. |
The Add Scheduled Payments script adds scheduled payments to a set of orders, using the customers' saved payment methods with the furthest expiration dates. The schedule for the payments is defined using execution fields, and the order list is generated using a BI query
This Add Scheduled Payments script is run using a single BI (saved as a text/csv 'Extract Tempate') source file.
Information Any Orders BI with the 'Order Number' as the result member can be used as the source file with the appropriate filter criteria to identify the orders that need the scheduled payments added. Use the Business Intelligence CSV Report Extract (text/csv) 'Extract Template' for the BI otherwise the script will not be able to parse the headers. |
The following table outlines the field mapping:
Column |
Required? |
Source Column Header |
Field Name |
UI Field Location |
1 |
Yes |
Order Number |
Order Number |
Customer Services - Order|Summary page |
The following table outlines the actions and expected results of the script:
Condition |
Action |
Expected Results |
The orders are identified by the source input. |
The order is loaded and the customer's saved payment method with the furthest expiry date is used to add scheduled payments to the order, based on the scheduling criteria supplied by the execution fields at run time. |
The order is updated with a the number of scheduled payments added to the order, based on the execution fields supplied at run time. |
The following tables outline the script definition configuration:
•Script Definition Name: Add Scheduled Payments
•Application Script: Add Scheduled Payments
Job Criteria Section |
|
Source Name |
Source Type |
firstPaymentDate |
The date of the first scheduled payment. |
frequency |
The frequency of the scheduled payments (monthly, weekly or quarterly). |
scheduleEndType |
When the scheduled payments will end (a specified date or number of payments). |
lastPaymentDate |
The date of the last scheduled payment if the 'End Date' end type is used. |
numberOfPayments |
The total number of recurring payments if the 'Number of Payments' end type is used. |
The following outlines the data management job configuration:
•Data Management Job Name: Add Scheduled Payments
•Script Definition: Add Scheduled Payments
The following image is an example of the Data Management|Schedule page when creating a job using all of the available source files: