stripity_stripe v2.0.0-alpha.6 Stripe.Card

Work with Stripe card objects.

You can:

  • Create a card
  • Retrieve a card
  • Update a card
  • Delete a card

All requests require owner_type and owner_id parameters to be specified.

owner_type must be one of the following:

  • :customer,
  • :recipient.

owner_id must be the ID of the owning object.

This module does not yet support managed accounts.

Does not yet render lists or take options.

Recipients may be deprecated for your version of the API. They have been replaced by managed accounts (see https://stripe.com/docs/connect/managed-accounts), which you should use if you’re creating a new platform.

Stripe API reference: https://stripe.com/docs/api#cards

Summary

Types

source()
source :: :customer | :recipient
t()
t :: %Stripe.Card{address_city: term, address_country: term, address_line1: term, address_line1_check: term, address_line2: term, address_state: term, address_zip: term, address_zip_check: term, brand: term, country: term, customer: term, cvc_check: term, dynamic_last4: term, exp_month: term, exp_year: term, fingerprint: term, funding: term, id: term, last4: term, metadata: term, name: term, object: term, recipient: term, tokenization_method: term}

Functions

create(owner_type, owner_id, token, opts \\ [])
create(source, String.t, String.t, Keyword.t) ::
  {:ok, t} |
  {:error, Stripe.api_error_struct}

Create a card.

This requires a token created by a library like Stripe.js.

For PCI compliance reasons you should not send a card’s number or CVC to your own server.

If you want to create a card with your server without a token, you can use the low-level API.

delete(owner_type, owner_id, card_id, opts \\ [])
delete(source, String.t, String.t, Keyword.t) ::
  :ok |
  {:error, Stripe.api_error_struct}

Delete a card.

retrieve(owner_type, owner_id, card_id, opts \\ [])
retrieve(source, String.t, String.t, Keyword.t) ::
  {:ok, t} |
  {:error, Stripe.api_error_struct}

Retrieve a card.

update(owner_type, owner_id, card_id, changes, opts \\ [])
update(source, String.t, String.t, map, Keyword.t) ::
  {:ok, t} |
  {:error, Stripe.api_error_struct}

Update a card.

Takes the id and a map of changes