omise v0.1.4 Omise.Cards
Provides Cards API interfaces.
Summary
Functions
Specs
destroy(String.t, String.t) ::
{:ok, Omise.Card.t} |
{:error, Omise.Error.t}
Destroy a card.
Returns {:ok, card}
if the request is successful, {:error, error}
otherwise.
Examples
{:ok, card} = Omise.Cards.destroy(
"cust_test_520j6g67py52xa7qbu2",
"card_test_520j6g4rxrmurw16b2d"
)
Specs
list(String.t, Keyword.t) ::
{:ok, [Omise.Card.t]} |
{:error, Omise.Error.t}
List all cards that belongs to the customer.
Returns {:ok, cards}
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.order
- (optional, default: chronological) The order of the list returned.
Examples
{:ok, cards} = Omise.Cards.list("cust_test_520j6g67py52xa7qbu2")
Specs
retrieve(String.t, String.t) ::
{:ok, Omise.Card.t} |
{:error, Omise.Error.t}
Retrieve a card.
Returns {:ok, card}
if the request is successful, {:error, error}
otherwise.
Examples
{:ok, card} = Omise.Cards.retrieve("cust_test_520j6g67py52xa7qbu2", "card_test_520j6g4rxrmurw16b2d")
Specs
update(String.t, String.t, Keyword.t) ::
{:ok, Omise.Card.t} |
{:error, Omise.Error.t}
Update a card.
Returns {:ok, card}
if the request is successful, {:error, error}
otherwise.
Request Parameters:
name
- (optional) The cardholder name as printed on the card.expiration_month
- (optional) The expiration month printed on the card.expiration_year
- (optional) The expiration year printed on the card in the format YYYY.postal_code
- (optional) The postal code from the city where the card was issued.city
- (optional) The city where the card was issued.
Examples
{:ok, updated_card} = Omise.Cards.update(
"cust_test_520j6g67py52xa7qbu2",
"card_test_520j6g4rxrmurw16b2d",
name: "George Ezra", city: "London"
)