Stripe.Account (stripity_stripe v2.17.3) View Source

Work with Stripe Connect account objects.

You can:

  • Retrieve your own account
  • Retrieve an account with a specified id

This module does not yet support managed accounts.

Stripe API reference: https://stripe.com/docs/api/accounts

Link to this section Summary

Functions

Create an account.

Delete an account.

List all connected accounts.

Reject an account.

Retrieve your own account without options.

Retrieve your own account with options.

Retrieve an account with a specified id.

Update an account.

Link to this section Types

Specs

alternatives() :: %{
  alternative_fields_due: Stripe.List.t(String.t()) | nil,
  original_fields_due: Stripe.List.t(String.t()) | nil
}

Specs

business_profile() :: %{
  mcc: String.t() | nil,
  name: String.t() | nil,
  product_description: String.t() | nil,
  support_address: %{
    city: String.t() | nil,
    country: String.t() | nil,
    line1: String.t() | nil,
    line2: String.t() | nil,
    postal_code: String.t() | nil,
    state: String.t() | nil
  },
  support_email: String.t() | nil,
  support_phone: String.t() | nil,
  support_url: String.t() | nil,
  url: String.t() | nil
}

Specs

capabilities() :: %{
  card_payments: String.t() | nil,
  legacy_payments: String.t() | nil,
  transfers: String.t() | nil
}

Specs

company() :: %{
  address: Stripe.Types.address(),
  address_kana: Stripe.Types.japan_address() | nil,
  address_kanji: Stripe.Types.japan_address() | nil,
  directors_provided: boolean() | nil,
  name: String.t() | nil,
  name_kana: String.t() | nil,
  name_kanji: String.t() | nil,
  owners_provided: boolean() | nil,
  phone: String.t() | nil,
  tax_id_provided: boolean() | nil,
  tax_id_registar: String.t(),
  vat_id_provided: boolean() | nil
}

Specs

decline_charge_on() :: %{avs_failure: boolean(), cvc_failure: boolean()}

Specs

error() :: %{code: String.t()}

Specs

future_requirements() :: %{
  alternatives: [alternatives()] | nil,
  current_deadline: Stripe.timestamp() | nil,
  currently_due: Stripe.List.t(String.t()) | nil,
  disabled_reason: String.t() | nil,
  errors: Stripe.List.t(error()) | nil,
  eventually_due: Stripe.List.t(String.t()) | nil,
  past_due: Stripe.List.t(String.t()) | nil,
  pending_verification: Stripe.List.t(String.t()) | nil
}

Specs

individual() :: %{
  additional_owners: [individual_additional_owner()] | nil,
  address: Stripe.Types.address(),
  address_kana: Stripe.Types.japan_address() | nil,
  address_kanji: Stripe.Types.japan_address() | nil,
  business_name: String.t() | nil,
  business_name_kana: String.t() | nil,
  business_name_kanji: String.t() | nil,
  business_tax_id_provided: boolean(),
  business_vat_id_provided: boolean(),
  dob: Stripe.Types.dob(),
  first_name: String.t() | nil,
  first_name_kana: String.t() | nil,
  first_name_kanji: String.t() | nil,
  gender: String.t() | nil,
  last_name: String.t() | nil,
  last_name_kana: String.t() | nil,
  last_name_kanji: String.t() | nil,
  maiden_name: String.t() | nil,
  personal_address: Stripe.Types.address(),
  personal_address_kana: Stripe.Types.japan_address() | nil,
  personal_address_kanji: Stripe.Types.japan_address() | nil,
  personal_id_number_provided: boolean(),
  phone_number: String.t() | nil,
  ssn_last_4_provided: String.t(),
  tax_id_registar: String.t(),
  type: String.t() | nil,
  verification: individual_verification()
}
Link to this type

individual_additional_owner()

View Source

Specs

individual_additional_owner() :: %{
  address: Stripe.Types.address(),
  dob: Stripe.Types.dob(),
  first_name: String.t() | nil,
  last_name: String.t() | nil,
  maiden_name: String.t() | nil,
  verification: individual_verification()
}
Link to this type

individual_verification()

View Source

Specs

individual_verification() :: %{
  details: String.t() | nil,
  details_code: String.t() | nil,
  document: Stripe.id() | Stripe.FileUpload.t() | nil,
  status: String.t()
}

Specs

requirements() :: %{
  current_deadline: Stripe.timestamp() | nil,
  currently_due: Stripe.List.t(String.t()) | nil,
  disabled_reason: String.t() | nil,
  eventually_due: Stripe.List.t(String.t()) | nil,
  past_due: Stripe.List.t(String.t()) | nil
}

Specs

settings() :: %{
  branding: map() | nil,
  card_payments: map() | nil,
  dashboard: map() | nil,
  payments: map() | nil,
  payouts: map() | nil
}

Specs

t() :: %Stripe.Account{
  business_profile: business_profile() | nil,
  business_type: String.t() | nil,
  capabilities: capabilities() | nil,
  charges_enabled: boolean(),
  company: company() | nil,
  controller: map(),
  country: String.t(),
  created: Stripe.timestamp() | nil,
  default_currency: String.t(),
  deleted: boolean() | nil,
  details_submitted: boolean(),
  email: String.t() | nil,
  external_accounts: Stripe.List.t(Stripe.BankAccount.t() | Stripe.Card.t()),
  future_requirements: future_requirements() | nil,
  id: Stripe.id(),
  individual: individual() | nil,
  metadata: Stripe.Types.metadata(),
  object: String.t(),
  payouts_enabled: boolean() | nil,
  requirements: requirements() | nil,
  settings: settings() | nil,
  tos_acceptance: tos_acceptance() | nil,
  type: String.t()
}

Specs

tos_acceptance() :: %{
  date: Stripe.timestamp() | nil,
  ip: String.t() | nil,
  user_agent: String.t() | nil
}

Specs

verification() :: %{
  disabled_reason: String.t() | nil,
  due_by: Stripe.timestamp() | nil,
  fields_needed: [String.t()]
}

Link to this section Functions

Link to this function

create(params, opts \\ [])

View Source

Specs

create(params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()}
when params: %{
       :type => String.t(),
       optional(:country) => String.t(),
       optional(:account_token) => String.t(),
       optional(:business_profile) => business_profile(),
       optional(:business_type) => String.t(),
       optional(:company) => company(),
       optional(:email) => String.t(),
       optional(:external_account) => String.t(),
       optional(:individual) => individual(),
       optional(:metadata) => Stripe.Types.metadata(),
       optional(:requested_capabilities) => capabilities(),
       optional(:settings) => settings(),
       optional(:tos_acceptance) => tos_acceptance()
     }

Create an account.

Link to this function

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

View Source

Specs

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

Create a login link.

Specs

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

Delete an account.

Link to this function

list(params \\ %{}, opts \\ [])

View Source

Specs

list(params, Stripe.options()) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.Error.t()}
when params: %{
       optional(:ending_before) => t() | Stripe.id(),
       optional(:limit) => 1..100,
       optional(:starting_after) => t() | Stripe.id()
     }

List all connected accounts.

Link to this function

reject(id, reason, opts \\ [])

View Source

Specs

reject(Stripe.id() | t(), String.t(), Stripe.options()) ::
  {:ok, t()} | {:error, Stripe.Error.t()}

Reject an account.

Takes the id and reason.

Specs

retrieve() :: {:ok, t()} | {:error, Stripe.Error.t()}

Retrieve your own account without options.

Specs

retrieve(list()) :: {:ok, t()} | {:error, Stripe.Error.t()}

Retrieve your own account with options.

Link to this function

retrieve(id, opts \\ [])

View Source

Specs

retrieve(binary(), list()) :: {:ok, t()} | {:error, Stripe.Error.t()}

Retrieve an account with a specified id.

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(:account_token) => String.t(),
       optional(:business_profile) => business_profile(),
       optional(:business_type) => String.t(),
       optional(:company) => company(),
       optional(:default_currency) => String.t(),
       optional(:email) => String.t(),
       optional(:external_accounts) => String.t(),
       optional(:individual) => individual(),
       optional(:metadata) => Stripe.Types.metadata(),
       optional(:requested_capabilities) => capabilities(),
       optional(:settings) => settings(),
       optional(:tos_acceptance) => tos_acceptance()
     }

Update an account.

Takes the id and a map of changes.