class Stripe::Source

Overview

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.

Included Modules

Defined in:

stripe/models/source.cr

Constant Summary

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

Instance Method Summary

Instance methods inherited from module OpenApi::Json

after_initialize after_initialize, clone clone, eql?(o : self) eql?, to_hash : Hash(String, JSON::Any) to_hash, to_json_any : JSON::Any to_json_any

Class methods inherited from module OpenApi::Json

build_from_hash(hash : Hash) build_from_hash, build_from_json_any(json_any : JSON::Any) build_from_json_any

Instance methods inherited from module OpenApi::Validatable

list_invalid_properties : Array(String) list_invalid_properties, list_invalid_properties_for(key : String) : Array(String) list_invalid_properties_for, valid? : Bool valid?, validate : Nil validate

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.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


[View source]

Instance Method Detail

def ==(other : self) #

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


def _type : String | Nil #

[View source]
def _type=(new_value : String | Nil) #

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


[View source]
def ach_credit_transfer : Stripe::SourceTypeAchCreditTransfer | Nil #

[View source]
def 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


[View source]
def ach_debit : Stripe::SourceTypeAchDebit | Nil #

[View source]
def ach_debit=(new_value : Stripe::SourceTypeAchDebit | Nil) #

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


[View source]
def acss_debit : Stripe::SourceTypeAcssDebit | Nil #

[View source]
def acss_debit=(new_value : Stripe::SourceTypeAcssDebit | Nil) #

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


[View source]
def alipay : Stripe::SourceTypeAlipay | Nil #

[View source]
def alipay=(new_value : Stripe::SourceTypeAlipay | Nil) #

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


[View source]
def amount : Int64 | Nil #

[View source]
def amount=(new_value : Int64 | Nil) #

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


[View source]
def au_becs_debit : Stripe::SourceTypeAuBecsDebit | Nil #

[View source]
def 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


[View source]
def bancontact : Stripe::SourceTypeBancontact | Nil #

[View source]
def bancontact=(new_value : Stripe::SourceTypeBancontact | Nil) #

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


[View source]
def card : Stripe::SourceTypeCard | Nil #

[View source]
def card=(new_value : Stripe::SourceTypeCard | Nil) #

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


[View source]
def card_present : Stripe::SourceTypeCardPresent | Nil #

[View source]
def card_present=(new_value : Stripe::SourceTypeCardPresent | Nil) #

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


[View source]
def client_secret : String | Nil #

[View source]
def client_secret=(new_value : String | Nil) #

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


[View source]
def code_verification : Stripe::SourceCodeVerificationFlow | Nil #

[View source]
def code_verification=(new_value : Stripe::SourceCodeVerificationFlow | Nil) #

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


[View source]
def created : Int64 | Nil #

[View source]
def created=(new_value : Int64 | Nil) #

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


[View source]
def currency : String | Nil #

[View source]
def currency=(new_value : String | Nil) #

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


[View source]
def customer : String | Nil #

[View source]
def customer=(new_value : String | Nil) #

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


[View source]
def eps : Stripe::SourceTypeEps | Nil #

[View source]
def eps=(new_value : Stripe::SourceTypeEps | Nil) #

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


[View source]
def flow : String | Nil #

[View source]
def flow=(new_value : String | Nil) #

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


[View source]
def giropay : Stripe::SourceTypeGiropay | Nil #

[View source]
def giropay=(new_value : Stripe::SourceTypeGiropay | Nil) #

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


[View source]
def hash(hasher) #

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


def id : String | Nil #

[View source]
def id=(new_value : String | Nil) #

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


[View source]
def ideal : Stripe::SourceTypeIdeal | Nil #

[View source]
def ideal=(new_value : Stripe::SourceTypeIdeal | Nil) #

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


[View source]
def klarna : Stripe::SourceTypeKlarna | Nil #

[View source]
def klarna=(new_value : Stripe::SourceTypeKlarna | Nil) #

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


[View source]
def list_invalid_properties : Array(String) #

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


[View source]
def livemode : Bool | Nil #

[View source]
def livemode=(new_value : Bool | Nil) #

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


[View source]
def metadata : Hash(String, String) | Nil #

[View source]
def metadata=(new_value : Hash(String, String) | Nil) #

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


[View source]
def multibanco : Stripe::SourceTypeMultibanco | Nil #

[View source]
def multibanco=(new_value : Stripe::SourceTypeMultibanco | Nil) #

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


[View source]
def object : String | Nil #

[View source]
def object=(new_value : String | Nil) #

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


[View source]
def owner : Stripe::SourceOwner1 | Nil #

[View source]
def owner=(new_value : Stripe::SourceOwner1 | Nil) #

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


[View source]
def p24 : Stripe::SourceTypeP24 | Nil #

[View source]
def p24=(new_value : Stripe::SourceTypeP24 | Nil) #

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


[View source]
def receiver : Stripe::SourceReceiverFlow | Nil #

[View source]
def receiver=(new_value : Stripe::SourceReceiverFlow | Nil) #

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


[View source]
def redirect : Stripe::SourceRedirectFlow | Nil #

[View source]
def redirect=(new_value : Stripe::SourceRedirectFlow | Nil) #

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


[View source]
def sepa_credit_transfer : Stripe::SourceTypeSepaCreditTransfer | Nil #

[View source]
def 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


[View source]
def sepa_debit : Stripe::SourceTypeSepaDebit | Nil #

[View source]
def sepa_debit=(new_value : Stripe::SourceTypeSepaDebit | Nil) #

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


[View source]
def sofort : Stripe::SourceTypeSofort | Nil #

[View source]
def sofort=(new_value : Stripe::SourceTypeSofort | Nil) #

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


[View source]
def source_order : Stripe::SourceOrder | Nil #

[View source]
def source_order=(new_value : Stripe::SourceOrder | Nil) #

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


[View source]
def statement_descriptor : String | Nil #

[View source]
def statement_descriptor=(new_value : String | Nil) #

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


[View source]
def status : String | Nil #

[View source]
def status=(new_value : String | Nil) #

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


[View source]
def three_d_secure : Stripe::SourceTypeThreeDSecure | Nil #

[View source]
def 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


[View source]
def usage : String | Nil #

[View source]
def usage=(new_value : String | Nil) #

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


[View source]
def valid? : Bool #

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


[View source]
def wechat : Stripe::SourceTypeWechat | Nil #

[View source]
def wechat=(new_value : Stripe::SourceTypeWechat | Nil) #

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


[View source]