Testing with Controlled Processing

This is the recommended approach for testing behavior in Canopy over extended timeframes

๐Ÿ“˜

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 Auto-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 Auto-Processing off. This gives you control to walk through each step in the loan lifecycle.

When youโ€™ve turned Auto-Processing back on in your UAT environment, it will again replicate production environments. When Auto-Processing is turned on, we recommend testing with migration mode.

This guide gives you the instructions on running controlled tests when Auto-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 an account 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 Auto-Processing is turned off in your environment.


The pattern to follow is to roll time after each API request to manually process it.

  1. Onboard a new borrower with the Create Account API
  2. Make any API Request passing the effective_at parameter
  3. Call PATCH admin/roll/account?account_id=\<account_id>&exclusive_end=\<end_time>
  4. end_time may be any time after the effective_at of the previous API request
  5. end_time is in the format: 2022-06-23T09%3A12%3A28%2B00%3A00 (URL-encoded string representing a date and time in ISO 8601)
  6. If Auto-Processing is turned off for webhooks, include the roll_webhooks=true query parameter to process webhooks

โ—๏ธ

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.


Whatโ€™s Next