View Source Stripe.Source (stripity_stripe v3.2.0)
Source objects allow you to accept a variety of payment methods. They
represent a customer's payment instrument, and can be used with the Stripe API
just like a Card object: once chargeable, they can be charged, or can be
attached to customers.
Stripe doesn't recommend using the deprecated Sources API. We recommend that you adopt the PaymentMethods API. This newer API provides access to our latest features and payment method types.
Related guides: Sources API and Sources & Customers.
Summary
Types
The parameters required to notify Stripe of a mandate acceptance or refusal by the customer.
Owner's address.
Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status.
The parameters required to store a mandate accepted offline. Should only be set if mandate[type] is offline
The parameters required to store a mandate accepted online. Should only be set if mandate[type] is online
Information about the owner of the payment instrument that may be used or required by particular source types.
Optional parameters for the receiver flow. Can be set only if the source is a receiver (flow is receiver).
Parameters required for the redirect flow. Required if the source is authenticated by a redirect (flow is redirect).
Shipping address for the order. Required if any of the SKUs are for products that have shippable set to true.
Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it.
The source type.
Functions
Creates a new source object.
Delete a specified source for a given customer.
Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.
List source transactions for a given source.
Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Verify a given source.
Types
@type acceptance() :: %{ optional(:date) => integer(), optional(:ip) => binary(), optional(:offline) => offline(), optional(:online) => online(), optional(:status) => :accepted | :pending | :refused | :revoked, optional(:type) => :offline | :online, optional(:user_agent) => binary() }
The parameters required to notify Stripe of a mandate acceptance or refusal by the customer.
@type address() :: %{ optional(:city) => binary(), optional(:country) => binary(), optional(:line1) => binary(), optional(:line2) => binary(), optional(:postal_code) => binary(), optional(:state) => binary() }
Owner's address.
@type mandate() :: %{ optional(:acceptance) => acceptance(), optional(:amount) => integer() | binary(), optional(:currency) => binary(), optional(:interval) => :one_time | :scheduled | :variable, optional(:notification_method) => :deprecated_none | :email | :manual | :none | :stripe_email }
Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status.
@type offline() :: %{optional(:contact_email) => binary()}
The parameters required to store a mandate accepted offline. Should only be set if mandate[type] is offline
@type online() :: %{ optional(:date) => integer(), optional(:ip) => binary(), optional(:user_agent) => binary() }
The parameters required to store a mandate accepted online. Should only be set if mandate[type] is online
@type owner() :: %{ optional(:address) => address(), optional(:email) => binary(), optional(:name) => binary(), optional(:phone) => binary() }
Information about the owner of the payment instrument that may be used or required by particular source types.
@type receiver() :: %{optional(:refund_attributes_method) => :email | :manual | :none}
      Optional parameters for the receiver flow. Can be set only if the source is a receiver (flow is receiver).
@type redirect() :: %{optional(:return_url) => binary()}
Parameters required for the redirect flow. Required if the source is authenticated by a redirect (flow is redirect).
@type shipping() :: %{ optional(:address) => address(), optional(:carrier) => binary(), optional(:name) => binary(), optional(:phone) => binary(), optional(:tracking_number) => binary() }
Shipping address for the order. Required if any of the SKUs are for products that have shippable set to true.
Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it.
@type t() :: %Stripe.Source{ ach_credit_transfer: term(), ach_debit: term(), acss_debit: term(), alipay: term(), amount: integer() | nil, au_becs_debit: term(), bancontact: term(), card: term(), card_present: term(), client_secret: binary(), code_verification: term(), created: integer(), currency: binary() | nil, customer: binary(), eps: term(), flow: binary(), giropay: term(), id: binary(), ideal: term(), klarna: term(), livemode: boolean(), metadata: term() | nil, multibanco: term(), object: binary(), owner: term() | nil, p24: term(), receiver: term(), redirect: term(), sepa_credit_transfer: term(), sepa_debit: term(), sofort: term(), source_order: term(), statement_descriptor: binary() | nil, status: binary(), three_d_secure: term(), type: binary(), usage: binary() | nil, wechat: term() }
The source type.
ach_credit_transferach_debitacss_debitalipayamountA positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required forsingle_usesources.au_becs_debitbancontactcardcard_presentclient_secretThe client secret of the source. Used for client-side retrieval using a publishable key.code_verificationcreatedTime at which the object was created. Measured in seconds since the Unix epoch.currencyThree-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required forsingle_usesources.customerThe ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer.epsflowThe authenticationflowof the source.flowis one ofredirect,receiver,code_verification,none.giropayidUnique identifier for the object.idealklarnalivemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.metadataSet of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.multibancoobjectString representing the object's type. Objects of the same type share the same value.ownerInformation about the owner of the payment instrument that may be used or required by particular source types.p24receiverredirectsepa_credit_transfersepa_debitsofortsource_orderstatement_descriptorExtra information about a source. This will appear on your customer's statement every time you charge the source.statusThe status of the source, one ofcanceled,chargeable,consumed,failed, orpending. Onlychargeablesources can be used to create a charge.three_d_securetypeThetypeof the source. Thetypeis a payment method, one ofach_credit_transfer,ach_debit,alipay,bancontact,card,card_present,eps,giropay,ideal,multibanco,klarna,p24,sepa_debit,sofort,three_d_secure, orwechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used.usageEitherreusableorsingle_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned.wechat
Functions
@spec create( params :: %{ optional(:amount) => integer(), optional(:currency) => binary(), optional(:customer) => binary(), optional(:expand) => [binary()], optional(:flow) => :code_verification | :none | :receiver | :redirect, optional(:mandate) => mandate(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:original_source) => binary(), optional(:owner) => owner(), optional(:receiver) => receiver(), optional(:redirect) => redirect(), optional(:source_order) => source_order(), optional(:statement_descriptor) => binary(), optional(:token) => binary(), optional(:type) => binary(), optional(:usage) => :reusable | :single_use }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Creates a new source object.
Details
- Method: 
post - Path: 
/v1/sources 
@spec detach( customer :: binary(), id :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, Stripe.PaymentSource.t() | Stripe.DeletedPaymentSource.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Delete a specified source for a given customer.
Details
- Method: 
delete - Path: 
/v1/customers/{customer}/sources/{id} 
@spec retrieve( source :: binary(), params :: %{ optional(:client_secret) => binary(), optional(:expand) => [binary()] }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.
Details
- Method: 
get - Path: 
/v1/sources/{source} 
@spec source_transactions( source :: binary(), params :: %{ optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:limit) => integer(), optional(:starting_after) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(Stripe.SourceTransaction.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
List source transactions for a given source.
Details
- Method: 
get - Path: 
/v1/sources/{source}/source_transactions 
@spec update( source :: binary(), params :: %{ optional(:amount) => integer(), optional(:expand) => [binary()], optional(:mandate) => mandate(), optional(:metadata) => %{optional(binary()) => binary()} | binary(), optional(:owner) => owner(), optional(:source_order) => source_order() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our payment method guides for more detail.
Details
- Method: 
post - Path: 
/v1/sources/{source} 
@spec verify( source :: binary(), params :: %{optional(:expand) => [binary()], optional(:values) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Verify a given source.
Details
- Method: 
post - Path: 
/v1/sources/{source}/verify