Testing Payments in Sandbox

In Sandbox, you have two options for testing payments flows:

  • Automatic Simulation
  • Manual Simulation

To switch between these two modes, set the simulation_mode property on the Payroll object (only available in Sandbox) to automatic or manual.

Automatic Simulation (default)

By default, payrolls in Sandbox will automatically transition to the next phase of payroll processing (i.e., from pending to processing, and from processing to paid) every 5 minutes. To start the process, you just need to create and approve a payroll.

If you wish to simulate failed payments in Sandbox (either failed debits or failed credits), you can use a special designated name for Companies or Employees:

  • Non-sufficient funds (NSFs): To simulate a payroll that fails to due an NSF in Sandbox, create a company with a trade_name of NSF Co. or No Account Co.. The initial funding for payrolls on companies matching that trade name will immediately fail with a failure_code of INSUFFICIENT_FUNDS. Any retry attempts will immediately succeed. Employee disbursement payments will be scheduled if the funding succeeds and canceled if funding fails.
  • Employee closed account: To simulate a failed disbursement due to an ACCOUNT_CLOSED failure in Sandbox, create an employee with first_name set to Barry and last_name set to BadAccount, and then create and approve a payroll with a payroll item for this employee with a payment_method of direct_deposit. The initial disbursement for payroll items matching that employee name will immediately fail with a failure_code of ACCOUNT_CLOSED. Any retry or refund attempts will succeed.

Manual Simulation

Check additionally offers the ability to manually simulate payments processing with a set of endpoints on the Payroll API. These endpoints allow you to manually trigger the completion or failure of the payroll debit, and the completion of employee direct deposit disbursements.

To use these endpoints, first update the simulation_mode property on the Payroll to manual, and then use the Start processing endpoint to transition the payroll to a processing status.