omise v0.1.3 Omise.Recipients
Provides Recipients API interfaces.
Summary
Functions
Specs
create(Keyword.t) ::
{:ok, Omise.Recipient.t} |
{:error, Omise.Error.t}
Create a recipient.
Returns {:ok, recipient}
if the request is successful, {:error, error}
otherwise.
Request Parameters:
name
- The recipient’s name.email
- (optional) The recipient’s email.description
- (optional) The recipient’s description.type
- Either individual or corporation.tax_id
- (optional) The recipient’s tax id.bank_account
- A valid bank account.
Examples
params = [
name: "Edward Elric",
email: "edward@omistry.com",
description: "Go away!",
type: "individual",
bank_account: [
brand: "bbl",
number: "1234567890",
name: "Edward Elric"
]
]
{:ok, recipient} = Omise.Recipients.create(params)
Specs
destroy(String.t) ::
{:ok, Omise.Recipient.t} |
{:error, Omise.Error.t}
Destroy a recipient.
Returns {:ok, recipient}
if the request is successful, {:error, error}
otherwise.
Examples
{:ok, recipient} = Omise.Recipients.destroy("recp_test_4z6p7e0m4k40txecj5o")
Specs
list(Keyword.t) ::
{:ok, [Omise.Recipient.t]} |
{:error, Omise.Error.t}
List all recipients.
Returns {:ok, recipients}
if the request is successful, {:error, error}
otherwise.
Query Parameters:
offset
- (optional, default: 0) The offset of the first record returned.limit
- (optional, default: 20, maximum: 100) The maximum amount of records returned.from
- (optional, default: 1970-01-01T00:00:00Z, format: ISO 8601) The UTC date and time limiting the beginning of returned records.to
- (optional, default: current UTC Datetime, format: ISO 8601) The UTC date and time limiting the end of returned records.
Examples
{:ok, recipients} = Omise.Recipients.list
{:ok, recipients} = Omise.Recipients.list(limit: 5)
Specs
retrieve(String.t) ::
{:ok, Omise.Recipient.t} |
{:error, Omise.Error.t}
Retrieve a recipient.
Returns {:ok, recipient}
if the request is successful, {:error, error}
otherwise.
Examples
{:ok, recipient} = Omise.Recipients.retrieve("recp_test_4z6p7e0m4k40txecj5o")