Stripe.Source (stripity_stripe v2.17.3) View Source

Work with Stripe source objects.

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

Link to this section Summary

Functions

Attach a source to a customer.

Create a source.

Detach a source from a customer.

Link to this section Types

Specs

ach_credit_transfer() :: %{
  account_number: String.t() | nil,
  bank_name: String.t() | nil,
  fingerprint: String.t() | nil,
  routing_number: String.t() | nil,
  swift_code: String.t() | nil
}

Specs

ach_debit() :: %{
  bank_name: String.t() | nil,
  country: String.t() | nil,
  fingerprint: String.t() | nil,
  last_4: String.t() | nil,
  routing_number: String.t() | nil,
  type: String.t() | nil
}

Specs

alipay() :: %{
  data_string: String.t() | nil,
  native_url: String.t() | nil,
  statement_descriptor: String.t() | nil
}

Specs

bancontact() :: %{
  bank_code: String.t() | nil,
  bank_name: String.t() | nil,
  bic: String.t() | nil,
  preferred_language: String.t() | nil,
  statement_descriptor: String.t() | nil
}

Specs

bitcoin() :: %{
  address: String.t() | nil,
  amount: String.t() | nil,
  amount_charged: String.t() | nil,
  amount_received: String.t() | nil,
  amount_returned: String.t() | nil,
  refund_address: String.t() | nil,
  uri: String.t() | nil
}

Specs

card() :: %{
  address_line1_check: String.t() | nil,
  address_zip_check: String.t() | nil,
  brand: String.t() | nil,
  country: String.t() | nil,
  cvc_check: String.t() | nil,
  dynamic_last4: String.t() | nil,
  exp_month: integer() | nil,
  exp_year: integer() | nil,
  fingerprint: String.t(),
  funding: String.t() | nil,
  last4: String.t() | nil,
  skip_validation: boolean(),
  three_d_secure: String.t(),
  tokenization_method: String.t() | nil
}
Link to this type

code_verification_flow()

View Source

Specs

code_verification_flow() :: %{attempts_remaining: integer(), status: String.t()}

Specs

customer() :: Stripe.id()

Specs

eps() :: %{reference: String.t() | nil, string_descriptor: String.t() | nil}

Specs

giropay() :: %{
  bank_code: String.t() | nil,
  bank_name: String.t() | nil,
  bic: String.t() | nil,
  statement_descriptor: String.t() | nil
}

Specs

ideal() :: %{
  bank: String.t() | nil,
  bic: String.t() | nil,
  iban_last4: String.t() | nil,
  statement_descriptor: String.t() | nil
}

Specs

multibanco() :: %{
  entity: String.t() | nil,
  reference: String.t() | nil,
  refund_account_holder_address_city: String.t() | nil,
  refund_account_holder_address_country: String.t() | nil,
  refund_account_holder_address_line1: String.t() | nil,
  refund_account_holder_address_line2: String.t() | nil,
  refund_account_holder_address_postal_code: String.t() | nil,
  refund_account_holder_address_state: String.t() | nil,
  refund_account_holder_name: String.t() | nil,
  refund_iban: String.t() | nil
}

Specs

owner() :: %{
  address: Stripe.Types.address() | nil,
  email: String.t() | nil,
  name: String.t() | nil,
  phone: String.t() | nil,
  verifired_address: Stripe.Types.address() | nil,
  verified_email: String.t() | nil,
  verified_name: String.t() | nil,
  verified_phone: String.t() | nil
}

Specs

p24() :: %{reference: String.t() | nil}

Specs

receiver_flow() :: %{
  address: String.t() | nil,
  amount_charged: integer(),
  amount_received: integer(),
  amount_returned: integer()
}

Specs

redirect_flow() :: %{
  failure_reason: String.t() | nil,
  return_url: String.t(),
  status: String.t(),
  url: String.t()
}

Specs

sepa_debit() :: %{
  bank_code: String.t() | nil,
  branch_code: String.t() | nil,
  country: String.t() | nil,
  fingerprint: String.t() | nil,
  last4: String.t() | nil,
  mandate_reference: String.t() | nil,
  mandate_url: String.t() | nil,
  skip_validations: boolean()
}

Specs

sofort() :: %{
  bank_code: String.t() | nil,
  bank_name: String.t() | nil,
  bic: String.t() | nil,
  country: String.t() | nil,
  iban_last4: String.t() | nil,
  preferred_language: String.t() | nil,
  statement_descriptor: String.t() | nil
}

Specs

source_type() :: String.t()

Specs

t() :: %Stripe.Source{
  ach_credit_transfer: ach_credit_transfer() | nil,
  ach_debit: ach_debit() | nil,
  alipay: alipay() | nil,
  amount: non_neg_integer() | nil,
  bancontact: bancontact() | nil,
  bitcoin: bitcoin() | nil,
  card: card() | nil,
  client_secret: String.t(),
  code_verification: code_verification_flow() | nil,
  created: Stripe.timestamp(),
  currency: String.t() | nil,
  customer: term(),
  eps: eps() | nil,
  flow: String.t(),
  giropay: giropay() | nil,
  id: Stripe.id(),
  ideal: ideal() | nil,
  klarna: term(),
  livemode: boolean(),
  metadata: Stripe.Types.metadata(),
  multibanco: multibanco() | nil,
  object: String.t(),
  owner: owner() | nil,
  p24: p24() | nil,
  receiver: receiver_flow() | nil,
  redirect: redirect_flow() | nil,
  sepa_debit: sepa_debit() | nil,
  sofort: sofort() | nil,
  statement_descriptor: String.t() | nil,
  status: String.t(),
  three_d_secure: three_d_secure() | nil,
  type: source_type(),
  usage: String.t() | nil
}

Specs

three_d_secure() :: %{
  result: String.t() | nil,
  card: String.t() | nil,
  customer: String.t() | nil
}

Link to this section Functions

Link to this function

attach(params, opts \\ [])

View Source

Specs

attach(map(), Keyword.t()) :: {:ok, t()} | {:error, Stripe.Error.t()}

Attach a source to a customer.

Link to this function

create(params, opts \\ [])

View Source

Specs

create(params, Keyword.t()) :: {:ok, t()} | {:error, Stripe.Error.t()}
when params: %{
       :type => String.t(),
       optional(:amount) => non_neg_integer(),
       optional(:currency) => String.t(),
       optional(:flow) => String.t(),
       optional(:mandate) => map(),
       optional(:metadata) => Stripe.Types.metadata(),
       optional(:owner) => owner(),
       optional(:receiver) => receiver_flow(),
       optional(:redirect) => redirect_flow(),
       optional(:statement_descriptor) => String.t(),
       optional(:token) => String.t(),
       optional(:usage) => String.t()
     }

Create a source.

Link to this function

detach(id, params, opts \\ [])

View Source

Specs

detach(Stripe.id() | t(), map(), Stripe.options()) ::
  {:ok, t()} | {:error, Stripe.Error.t()}

Detach a source from a customer.

Link to this function

retrieve(id, params, opts \\ [])

View Source

Specs

retrieve(Stripe.id() | t(), params, Stripe.options()) ::
  {:ok, t()} | {:error, Stripe.Error.t()}
when params: %{optional(:client_secret) => String.t()}

Retrieve a source.

Link to this function

update(id, params, opts \\ [])

View Source

Specs

update(Stripe.id() | t(), params, Stripe.options()) ::
  {:ok, t()} | {:error, Stripe.Error.t()}
when params: %{
       optional(:mandate) => map(),
       optional(:metadata) => Stripe.Types.metadata(),
       optional(:owner) => owner()
     }

Update a source.

Takes the id and a map of changes