Packages

Elixir client for the Zepto Payments API

Current section

Files

Jump to
zepto lib zepto client sandbox.ex
Raw

lib/zepto/client/sandbox.ex

defmodule Zepto.Client.Sandbox do
@moduledoc """
Sandbox-only simulation operations for the Zepto Payments API.
These endpoints only exist in the sandbox environment and are used
for testing payment flows.
"""
alias Zepto.Client
alias Zepto.Client.Request
@doc """
Simulates receiving a real-time PayID payment from a Receivable Contact.
## Examples
{:ok, _} = Zepto.Client.Sandbox.simulate_payid_payment(client, %{
payid_email: "customer@yourdomain.com",
amount: 10000, # Amount in cents
payer_name: "John Smith"
})
"""
@spec simulate_payid_payment(Client.t(), map()) :: Request.response()
def simulate_payid_payment(client, params) do
Request.post(client, "/simulate/incoming_npp_payid_payment", json: params)
end
@doc """
Simulates receiving a real-time NPP payment using BSB and account number.
Can target either a Receivable Contact or one of your float accounts.
## Examples
{:ok, _} = Zepto.Client.Sandbox.simulate_npp_payment(client, %{
to_bsb: "802919",
to_account_number: "12345678",
amount: 10000,
payer_name: "John Smith"
})
"""
@spec simulate_npp_payment(Client.t(), map()) :: Request.response()
def simulate_npp_payment(client, params) do
Request.post(client, "/simulate/incoming_npp_bban_payment", json: params)
end
@doc """
Simulates receiving a Direct Entry payment (non-real-time).
Can target either a Receivable Contact or one of your float accounts.
## Examples
{:ok, _} = Zepto.Client.Sandbox.simulate_de_payment(client, %{
to_bsb: "802919",
to_account_number: "12345678",
amount: 10000,
payer_name: "John Smith"
})
"""
@spec simulate_de_payment(Client.t(), map()) :: Request.response()
def simulate_de_payment(client, params) do
Request.post(client, "/simulate/incoming_de_payment", json: params)
end
end