class

Stripe::Source

Inherits OpenApi::Json < OpenApi::Validatable < JSON::Serializable::Unmapped < JSON::Serializable < Reference < Object

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.

Constants

ERROR_MESSAGE_FOR__TYPE = "invalid value for \"_type\", must be one of [ach_credit_transfer, ach_debit, acss_debit, alipay, au_becs_debit, bancontact, card, card_present, eps, giropay, ideal, klarna, multibanco, p24, sepa_credit_transfer, sepa_debit, sofort, three_d_secure, wechat]."
ERROR_MESSAGE_FOR_OBJECT = "invalid value for \"object\", must be one of [source]."
MAX_LENGTH_FOR_CLIENT_SECRET = 5000
MAX_LENGTH_FOR_CUSTOMER = 5000
MAX_LENGTH_FOR_FLOW = 5000
MAX_LENGTH_FOR_ID = 5000
MAX_LENGTH_FOR_STATEMENT_DESCRIPTOR = 5000
MAX_LENGTH_FOR_STATUS = 5000
MAX_LENGTH_FOR_USAGE = 5000
VALID_VALUES_FOR__TYPE = String.static_array("ach_credit_transfer", "ach_debit", "acss_debit", "alipay", "au_becs_debit", "bancontact", "card", "card_present", "eps", "giropay", "ideal", "klarna", "multibanco", "p24", "sepa_credit_transfer", "sepa_debit", "sofort", "three_d_secure", "wechat")
VALID_VALUES_FOR_OBJECT = String.static_array("source")

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
new(*, amount : Int64 | Nil = nil, client_secret : String | Nil = nil, created : Int64 | Nil = nil, currency : String | Nil = nil, flow : String | Nil = nil, id : String | Nil = nil, livemode : Bool | Nil = nil, metadata : Hash(String, String) | Nil = nil, object : String | Nil = nil, owner : Stripe::SourceOwner1 | Nil = nil, statement_descriptor : String | Nil = nil, status : String | Nil = nil, _type : String | Nil = nil, usage : String | Nil = nil, ach_credit_transfer : Stripe::SourceTypeAchCreditTransfer | Nil = nil, ach_debit : Stripe::SourceTypeAchDebit | Nil = nil, acss_debit : Stripe::SourceTypeAcssDebit | Nil = nil, alipay : Stripe::SourceTypeAlipay | Nil = nil, au_becs_debit : Stripe::SourceTypeAuBecsDebit | Nil = nil, bancontact : Stripe::SourceTypeBancontact | Nil = nil, card : Stripe::SourceTypeCard | Nil = nil, card_present2 : Stripe::SourceTypeCardPresent | Nil = nil, code_verification : Stripe::SourceCodeVerificationFlow | Nil = nil, customer : String | Nil = nil, eps : Stripe::SourceTypeEps | Nil = nil, giropay : Stripe::SourceTypeGiropay | Nil = nil, ideal : Stripe::SourceTypeIdeal | Nil = nil, klarna : Stripe::SourceTypeKlarna | Nil = nil, multibanco : Stripe::SourceTypeMultibanco | Nil = nil, p24 : Stripe::SourceTypeP24 | Nil = nil, receiver : Stripe::SourceReceiverFlow | Nil = nil, redirect : Stripe::SourceRedirectFlow | Nil = nil, sepa_credit_transfer : Stripe::SourceTypeSepaCreditTransfer | Nil = nil, sepa_debit : Stripe::SourceTypeSepaDebit | Nil = nil, sofort : Stripe::SourceTypeSofort | Nil = nil, source_order : Stripe::SourceOrder | Nil = nil, three_d_secure : Stripe::SourceTypeThreeDSecure | Nil = nil, wechat : Stripe::SourceTypeWechat | Nil = nil)

Initializes the object @param [Hash] attributes Model attributes in the form of hash

Source

Instance methods

==(other : self)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

_type

The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used.

Source
_type=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] _type Object to be assigned

Source
ach_credit_transfer
Source
ach_credit_transfer=(new_value : Stripe::SourceTypeAchCreditTransfer | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] ach_credit_transfer Object to be assigned

Source
ach_debit
Source
ach_debit=(new_value : Stripe::SourceTypeAchDebit | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] ach_debit Object to be assigned

Source
acss_debit
Source
acss_debit=(new_value : Stripe::SourceTypeAcssDebit | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] acss_debit Object to be assigned

Source
alipay
Source
alipay=(new_value : Stripe::SourceTypeAlipay | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] alipay Object to be assigned

Source
amount

A 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 for single_use sources.

Source
amount=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount Object to be assigned

Source
au_becs_debit
Source
au_becs_debit=(new_value : Stripe::SourceTypeAuBecsDebit | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] au_becs_debit Object to be assigned

Source
bancontact
Source
bancontact=(new_value : Stripe::SourceTypeBancontact | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] bancontact Object to be assigned

Source
card
Source
card=(new_value : Stripe::SourceTypeCard | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] card Object to be assigned

Source
card_present
Source
card_present=(new_value : Stripe::SourceTypeCardPresent | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] card_present Object to be assigned

Source
client_secret

The client secret of the source. Used for client-side retrieval using a publishable key.

Source
client_secret=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] client_secret Object to be assigned

Source
code_verification
Source
code_verification=(new_value : Stripe::SourceCodeVerificationFlow | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] code_verification Object to be assigned

Source
created

Time at which the object was created. Measured in seconds since the Unix epoch.

Source
created=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] created Object to be assigned

Source
currency

Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources.

Source
currency=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] currency Object to be assigned

Source
customer

The 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.

Source
customer=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] customer Object to be assigned

Source
eps=(new_value : Stripe::SourceTypeEps | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] eps Object to be assigned

Source
flow

The authentication flow of the source. flow is one of redirect, receiver, code_verification, none.

Source
flow=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] flow Object to be assigned

Source
giropay
Source
giropay=(new_value : Stripe::SourceTypeGiropay | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] giropay Object to be assigned

Source
hash(hasher)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

id

Unique identifier for the object.

Source
id=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] id Object to be assigned

Source
ideal
Source
ideal=(new_value : Stripe::SourceTypeIdeal | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] ideal Object to be assigned

Source
klarna
Source
klarna=(new_value : Stripe::SourceTypeKlarna | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] klarna Object to be assigned

Source
list_invalid_properties

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

Source
livemode

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

Source
livemode=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] livemode Object to be assigned

Source
metadata
Source
metadata=(new_value : Hash(String, String) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] metadata Object to be assigned

Source
multibanco
Source
multibanco=(new_value : Stripe::SourceTypeMultibanco | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] multibanco Object to be assigned

Source
object

String representing the object's type. Objects of the same type share the same value.

Source
object=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] object Object to be assigned

Source
owner
Source
owner=(new_value : Stripe::SourceOwner1 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] owner Object to be assigned

Source
p24=(new_value : Stripe::SourceTypeP24 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] p24 Object to be assigned

Source
receiver
Source
receiver=(new_value : Stripe::SourceReceiverFlow | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] receiver Object to be assigned

Source
redirect
Source
redirect=(new_value : Stripe::SourceRedirectFlow | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] redirect Object to be assigned

Source
sepa_credit_transfer
Source
sepa_credit_transfer=(new_value : Stripe::SourceTypeSepaCreditTransfer | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] sepa_credit_transfer Object to be assigned

Source
sepa_debit
Source
sepa_debit=(new_value : Stripe::SourceTypeSepaDebit | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] sepa_debit Object to be assigned

Source
sofort
Source
sofort=(new_value : Stripe::SourceTypeSofort | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] sofort Object to be assigned

Source
source_order
Source
source_order=(new_value : Stripe::SourceOrder | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] source_order Object to be assigned

Source
statement_descriptor

Extra information about a source. This will appear on your customer's statement every time you charge the source.

Source
statement_descriptor=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] statement_descriptor Object to be assigned

Source
status

The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge.

Source
status=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] status Object to be assigned

Source
three_d_secure
Source
three_d_secure=(new_value : Stripe::SourceTypeThreeDSecure | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] three_d_secure Object to be assigned

Source
usage

Either reusable or single_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.

Source
usage=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] usage Object to be assigned

Source
valid?

Check to see if the all the properties in the model are valid @return true if the model is valid

Source
wechat
Source
wechat=(new_value : Stripe::SourceTypeWechat | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] wechat Object to be assigned

Source