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_nameofNSF Co.orNo Account Co.. The initial funding for payrolls on companies matching that trade name will immediately fail with afailure_codeofINSUFFICIENT_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_CLOSEDfailure in Sandbox, create an employee withfirst_nameset toBarryandlast_nameset toBadAccount, and then create and approve a payroll with a payroll item for this employee with apayment_methodofdirect_deposit. The initial disbursement for payroll items matching that employee name will immediately fail with afailure_codeofACCOUNT_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.
Updated about 18 hours ago
