Nombaone. Sandbox
(Nomba One v0.1.0)
View Source
Sandbox only. Simulation instruments that make billing outcomes happen on
demand — no cron waits, no real cards. These endpoints exist only on the
sandbox deployment; calling them with a live key raises ArgumentError
locally, before any network request.
Summary
Functions
Sandbox only. The test clock: run the subscription's next billing cycle right now, through the real engine — invoice, charge, ledger, webhooks and all.
Raising variant of advance_cycle/3.
Sandbox only. Mint a ready, chargeable test payment method whose
:behavior decides every future charge outcome deterministically
(success, decline_insufficient_funds, decline_expired_card,
decline_do_not_honor, requires_otp). :kind is card (default) or
mandate.
Raising variant of create_payment_method/3.
Sandbox only. Emit a real, signed catalog event to your registered
endpoints — the genuine pipeline (real secret, real signature, real retries),
not a mock. :type is any catalog event type; :payload shapes the
delivery's data.
Raising variant of simulate_webhook/3.
Functions
@spec advance_cycle(Nombaone.Client.t(), String.t(), keyword()) :: {:ok, Nombaone.AdvanceCycleResult.t()} | {:error, Nombaone.Error.t()}
Sandbox only. The test clock: run the subscription's next billing cycle right now, through the real engine — invoice, charge, ledger, webhooks and all.
Example
{:ok, result} = Nombaone.Sandbox.advance_cycle(client, subscription.id)
result.outcome # => "paid"
result.invoice.total_in_kobo
@spec advance_cycle!(Nombaone.Client.t(), String.t(), keyword()) :: Nombaone.AdvanceCycleResult.t()
Raising variant of advance_cycle/3.
@spec create_payment_method(Nombaone.Client.t(), map(), keyword()) :: {:ok, Nombaone.PaymentMethod.t()} | {:error, Nombaone.Error.t()}
Sandbox only. Mint a ready, chargeable test payment method whose
:behavior decides every future charge outcome deterministically
(success, decline_insufficient_funds, decline_expired_card,
decline_do_not_honor, requires_otp). :kind is card (default) or
mandate.
Example
{:ok, method} =
Nombaone.Sandbox.create_payment_method(client, %{
customer_id: customer.id,
behavior: "decline_insufficient_funds"
})
@spec create_payment_method!(Nombaone.Client.t(), map(), keyword()) :: Nombaone.PaymentMethod.t()
Raising variant of create_payment_method/3.
@spec simulate_webhook(Nombaone.Client.t(), map(), keyword()) :: {:ok, Nombaone.WebhookSimulation.t()} | {:error, Nombaone.Error.t()}
Sandbox only. Emit a real, signed catalog event to your registered
endpoints — the genuine pipeline (real secret, real signature, real retries),
not a mock. :type is any catalog event type; :payload shapes the
delivery's data.
Example
{:ok, _} =
Nombaone.Sandbox.simulate_webhook(client, %{
type: "invoice.payment_failed",
payload: %{reference: invoice.id, reason: "insufficient_funds"}
})
@spec simulate_webhook!(Nombaone.Client.t(), map(), keyword()) :: Nombaone.WebhookSimulation.t()
Raising variant of simulate_webhook/3.