View Source ExOAPI.Stripe.SDK.PaymentMethods (exoapi_stripe v0.1.4)

Link to this section Summary

Functions

description: <p>Returns a list of PaymentMethods. For listing a customer’s payment methods, you should use <a href="/docs/api/payment_methods/customer_list">List a Customer’s PaymentMethods</a></p>

description: <p>Retrieves a PaymentMethod object.</p>

description: <p>Creates a PaymentMethod object. Read the <a href="/docs/stripe-js/reference#stripe-create-payment-method">Stripe.js reference</a> to learn how to create PaymentMethods via Stripe.js.</p>

description: <p>Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.</p>

description: <p>Attaches a PaymentMethod object to a Customer.</p>

description: <p>Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.</p>

Link to this section Types

Link to this type

get_payment_methods_opts()

View Source
@type get_payment_methods_opts() ::
  {:starting_after, String.t()}
  | {:limit, String.t()}
  | {:expand, String.t()}
  | {:ending_before, String.t()}
  | {:customer, String.t()}
Link to this type

get_payment_methods_payment_method_opts()

View Source
@type get_payment_methods_payment_method_opts() :: {:expand, String.t()}

Link to this section Functions

Link to this function

get_payment_methods(client, type, opts \\ [])

View Source
@spec get_payment_methods(
  client :: ExOAPI.Client.t(),
  type :: String.t(),
  [get_payment_methods_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | %{
       url: String.t(),
       object: String.t() | :list,
       has_more: boolean(),
       data: [ExOAPI.Stripe.Schemas.PaymentMethod.t()]
     }
   | map()}
  | {:error, any()}

description: <p>Returns a list of PaymentMethods. For listing a customer’s payment methods, you should use <a href="/docs/api/payment_methods/customer_list">List a Customer’s PaymentMethods</a></p>

Link to this function

get_payment_methods_payment_method(client, payment_method, opts \\ [])

View Source
@spec get_payment_methods_payment_method(
  client :: ExOAPI.Client.t(),
  payment_method :: String.t(),
  [get_payment_methods_payment_method_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.PaymentMethod.t()
   | map()}
  | {:error, any()}

description: <p>Retrieves a PaymentMethod object.</p>

Link to this function

post_payment_methods(client, body)

View Source
@spec post_payment_methods(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      wechat_pay: %{},
      us_bank_account: %{
        routing_number: String.t(),
        account_type: String.t() | :checking | :savings,
        account_number: String.t(),
        account_holder_type: String.t() | :company | :individual
      },
      type:
        String.t()
        | :acss_debit
        | :afterpay_clearpay
        | :alipay
        | :au_becs_debit
        | :bacs_debit
        | :bancontact
        | :boleto
        | :card
        | :customer_balance
        | :eps
        | :fpx
        | :giropay
        | :grabpay
        | :ideal
        | :klarna
        | :konbini
        | :oxxo
        | :p24
        | :paynow
        | :sepa_debit
        | :sofort
        | :us_bank_account
        | :wechat_pay,
      sofort: %{country: String.t() | :AT | :BE | :DE | :ES | :IT | :NL},
      sepa_debit: %{iban: String.t()},
      paynow: %{},
      payment_method: String.t(),
      p24: %{
        bank:
          String.t()
          | :alior_bank
          | :bank_millennium
          | :bank_nowy_bfg_sa
          | :bank_pekao_sa
          | :banki_spbdzielcze
          | :blik
          | :bnp_paribas
          | :boz
          | :citi_handlowy
          | :credit_agricole
          | :envelobank
          | :etransfer_pocztowy24
          | :getin_bank
          | :ideabank
          | :ing
          | :inteligo
          | :mbank_mtransfer
          | :nest_przelew
          | :noble_pay
          | :pbac_z_ipko
          | :plus_bank
          | :santander_przelew24
          | :tmobile_usbugi_bankowe
          | :toyota_bank
          | :volkswagen_bank
      },
      oxxo: %{},
      metadata: map(),
      konbini: %{},
      klarna: %{dob: %{year: integer(), month: integer(), day: integer()}},
      interac_present: %{},
      ideal: %{
        bank:
          String.t()
          | :abn_amro
          | :asn_bank
          | :bunq
          | :handelsbanken
          | :ing
          | :knab
          | :moneyou
          | :rabobank
          | :regiobank
          | :revolut
          | :sns_bank
          | :triodos_bank
          | :van_lanschot
      },
      grabpay: %{},
      giropay: %{},
      fpx: %{
        bank:
          String.t()
          | :affin_bank
          | :agrobank
          | :alliance_bank
          | :ambank
          | :bank_islam
          | :bank_muamalat
          | :bank_rakyat
          | :bsn
          | :cimb
          | :deutsche_bank
          | :hong_leong_bank
          | :hsbc
          | :kfh
          | :maybank2e
          | :maybank2u
          | :ocbc
          | :pb_enterprise
          | :public_bank
          | :rhb
          | :standard_chartered
          | :uob
      },
      expand: [String.t()],
      eps: %{
        bank:
          String.t()
          | :arzte_und_apotheker_bank
          | :austrian_anadi_bank_ag
          | :bank_austria
          | :bankhaus_carl_spangler
          | :bankhaus_schelhammer_und_schattera_ag
          | :bawag_psk_ag
          | :bks_bank_ag
          | :brull_kallmus_bank_ag
          | :btv_vier_lander_bank
          | :capital_bank_grawe_gruppe_ag
          | :dolomitenbank
          | :easybank_ag
          | :erste_bank_und_sparkassen
          | :hypo_alpeadriabank_international_ag
          | :hypo_bank_burgenland_aktiengesellschaft
          | :hypo_noe_lb_fur_niederosterreich_u_wien
          | :hypo_oberosterreich_salzburg_steiermark
          | :hypo_tirol_bank_ag
          | :hypo_vorarlberg_bank_ag
          | :marchfelder_bank
          | :oberbank_ag
          | :raiffeisen_bankengruppe_osterreich
          | :schoellerbank_ag
          | :sparda_bank_wien
          | :volksbank_gruppe
          | :volkskreditbank_ag
          | :vr_bank_braunau
      },
      customer_balance: %{},
      customer: String.t(),
      card:
        %{token: String.t()}
        | %{
            number: String.t(),
            exp_year: integer(),
            exp_month: integer(),
            cvc: String.t()
          },
      boleto: %{tax_id: String.t()},
      billing_details: %{
        phone: String.t(),
        name: String.t(),
        email: String.t(),
        address:
          String.t()
          | %{
              state: String.t(),
              postal_code: String.t(),
              line2: String.t(),
              line1: String.t(),
              country: String.t(),
              city: String.t()
            }
      },
      bancontact: %{},
      bacs_debit: %{sort_code: String.t(), account_number: String.t()},
      au_becs_debit: %{bsb_number: String.t(), account_number: String.t()},
      alipay: %{},
      afterpay_clearpay: %{},
      acss_debit: %{
        transit_number: String.t(),
        institution_number: String.t(),
        account_number: String.t()
      }
    }
    | map()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.PaymentMethod.t()
   | map()}
  | {:error, any()}

description: <p>Creates a PaymentMethod object. Read the <a href="/docs/stripe-js/reference#stripe-create-payment-method">Stripe.js reference</a> to learn how to create PaymentMethods via Stripe.js.</p>

Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.

Link to this function

post_payment_methods_payment_method(client, body, payment_method)

View Source
@spec post_payment_methods_payment_method(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      us_bank_account: %{
        account_holder_type: String.t() | :company | :individual
      },
      metadata: String.t() | map(),
      expand: [String.t()],
      card: %{exp_year: integer(), exp_month: integer()},
      billing_details: %{
        phone: String.t(),
        name: String.t(),
        email: String.t(),
        address:
          String.t()
          | %{
              state: String.t(),
              postal_code: String.t(),
              line2: String.t(),
              line1: String.t(),
              country: String.t(),
              city: String.t()
            }
      }
    }
    | map(),
  payment_method :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.PaymentMethod.t()
   | map()}
  | {:error, any()}

description: <p>Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.</p>

Link to this function

post_payment_methods_payment_method_attach(client, body, payment_method)

View Source
@spec post_payment_methods_payment_method_attach(
  client :: ExOAPI.Client.t(),
  body :: %{expand: [String.t()], customer: String.t()} | map(),
  payment_method :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.PaymentMethod.t()
   | map()}
  | {:error, any()}

description: <p>Attaches a PaymentMethod object to a Customer.</p>

To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntentor a PaymentIntent with setup_future_usage. These approaches will perform any necessary steps to ensure that the PaymentMethod can be used in a future payment. Using the /v1/payment_methods/:id/attach endpoint does not ensure that future payments can be made with the attached PaymentMethod. See Optimizing cards for future payments for more information about setting up future payments.

To use this PaymentMethod as the default for invoice or subscription payments,set invoice_settings.default_payment_method, on the Customer to the PaymentMethod’s ID.

Link to this function

post_payment_methods_payment_method_detach(client, body, payment_method)

View Source
@spec post_payment_methods_payment_method_detach(
  client :: ExOAPI.Client.t(),
  body :: %{expand: [String.t()]} | map(),
  payment_method :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.PaymentMethod.t()
   | map()}
  | {:error, any()}

description: <p>Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.</p>