Increase.Simulations (Increase v1.0.0)

Copy Markdown View Source

Sandbox-only endpoints for simulating events that would otherwise take hours or days to occur in production -- settling a card authorization, receiving an inbound wire, having the Federal Reserve acknowledge an ACH transfer, and so on.

These only work against the sandbox environment (the default environment unless you configure :production). If you have a sandbox Event Subscription configured, triggering a simulation will also fire the corresponding webhook to your endpoint, just as the real event would in production.

Each simulate-able resource has its own submodule here, named after the resource it relates to:

Example

client = Increase.Client.new(environment: :sandbox)

{:ok, account} = Increase.Accounts.create(client, %{name: "My First Account"})

{:ok, authorization} =
  Increase.Simulations.CardAuthorizations.create(client, %{
    card_id: card.id,
    amount: 1000
  })