Securion v0.4.0 Securion.Card View Source

CRUD operations for payment cards.

Card represents a credit or a debit card.

Cards are used to save a credit or a debit card data for later use. Cards can also be used to represent card data in other operations (for example to specify card data when creating a new change).

Corresponding docs for the original REST APIs.

Example

iex> {:ok, card} = Card.create_by_token("cust_ ...", "tok_ ...")

Link to this section Summary

Functions

Creates a new card by providing a token id.

Deletes an existing card.

Lists cards for given customer.

Updates an existing card.

Link to this section Functions

Link to this function

create_by_token(customer_id, token_id)

View Source

Creates a new card by providing a token id.

Examples

Deletes an existing card.

If you delete card that is current default card then most recently added card will be used as new default card. If you delete last card then default card will be set to null.

https://securionpay.com/docs/api#card-retrieve Retrieves an existing card object.

Examples

iex> Securion.Card.create(customer_id, token_id)
Link to this function

list(customer_id, params)

View Source

Lists cards for given customer.

Link to this function

update(customer_id, id, params)

View Source

Updates an existing card.

Any not provided parameter will be left unchanged.