Testing with Controlled Processing
Enterprise Customers Only
To turn on Controlled Processing for your test environment, please contact our team. Each time you generate a new set of API keys, please contact our team to add Controlled Processing permissions to those keys.
Overview
All production environments in Canopy have Event-Processing turned on, which means that all events are processed until the current moment in time. In UAT environments, you may contact Canopyโs team to turn Event-Processing off. This gives you control to walk through each step in the loan lifecycle.
This guide gives you the instructions on running controlled tests when Event-Processing is turned off.
Usage Guide
In order to understand how to set up test cases in the system and enforce their behavior, you will need to think about a borrower's lifecycle as a series of events that occur; starting with the moment theyโre onboarded. Events can range from human activity โ such as making a payment, to automatic activity โ such as a due date passing by.
This guide assumes that Event-Processing is turned off in your environment.
The pattern to follow is to roll time after each API request to manually process it.
- Onboard a new borrower to an account and create an associated financial product
- Make any API Request passing the
effective_at
parameter - Call
PATCH admin/roll/account?account_id=\<account_id>&exclusive_end=\<end_time>
- end_time may be any time after the
effective_at
of the previous API request - end_time is in the format:
2022-06-23T09:12:28Z
(URL-encoded string representing a date and time in ISO 8601) - If Event-Processing is turned off for notifications, like webhooks, include the
roll_webhooks=true
query parameter to process webhook notificaitons
In-order Sequencing
Make sure to sequence events for an account in order. You should never insert an event with an
effective_at
earlier than the latest point to which you have rolled time
Enterprise Customer?
Our team is very specialized in getting you started with test cases that ensure your loan behaves as expected and cover edge cases you may not have thought of. Reach our to our team about getting set up with test cases and Postman collections that implement your use-case and borrower agreement.
Updated about 23 hours ago