Stripe.PaymentMethod (stripity_stripe v2.17.2) View Source
Work with Stripe payment method objects.
Stripe API reference: https://stripe.com/docs/api/payment_methods
Link to this section Summary
Functions
Attach payment_method to customer
Create a payment method.
Detach payment_method from customer
List all payment methods.
Retrieve a payment method.
Update a card.
Link to this section Types
Specs
Specs
Specs
Specs
billing_details() :: %{ optional(:address) => Stripe.Types.address(), optional(:email) => String.t(), optional(:name) => String.t(), optional(:phone) => String.t() }
Specs
Specs
Specs
t() :: %Stripe.PaymentMethod{ acss_debit: acss_debit() | nil, au_becs_debit: au_becs_debit() | nil, bacs_debit: bacs_debit() | nil, billing_details: %{ address: Stripe.Types.address(), email: String.t() | nil, name: String.t() | nil, phone: String.t() | nil }, card: Stripe.Card.t() | nil, created: Stripe.timestamp(), customer: Stripe.id() | Stripe.Customer.t() | nil, id: Stripe.id(), link: %{persistent_token: String.t() | nil} | nil, livemode: boolean(), metadata: Stripe.Types.metadata(), object: String.t(), sepa_debit: sepa_debit() | nil, type: String.t(), us_bank_account: us_bank_account() | nil }
Specs
us_bank_account() :: %{ account_holder_type: String.t() | nil, account_type: String.t() | nil, bank_name: String.t() | nil, financial_connections_account: String.t() | nil, fingerprint: String.t() | nil, last4: String.t() | nil, networks: %{preferred: String.t() | nil, supported: list() | nil} | nil, routing_number: String.t() | nil }
Link to this section Functions
Specs
attach(params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ customer: Stripe.id() | Stripe.Customer.t(), payment_method: Stripe.id() | t() }
Attach payment_method to customer
Specs
create(params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ :type => String.t(), optional(:billing_details) => billing_details(), optional(:card) => card(), optional(:metadata) => Stripe.Types.metadata() }
Create a payment method.
Specs
detach(params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{payment_method: Stripe.id() | t()}
Detach payment_method from customer
Specs
list(params, Stripe.options()) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.Error.t()} when params: %{ :customer => Stripe.id() | Stripe.Customer.t(), :type => String.t(), optional(:ending_before) => t() | Stripe.id(), optional(:limit) => 1..100, optional(:starting_after) => t() | Stripe.id() }
List all payment methods.
Specs
retrieve(Stripe.id() | t(), Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()}
Retrieve a payment method.
Specs
update(Stripe.id() | t(), params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ optional(:billing_details) => billing_details(), optional(:card) => card(), optional(:metadata) => Stripe.Types.metadata() }
Update a card.
Takes the id
and a map of changes