Class: Io::Flow::V0::Models::CardForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CardForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#challenge_cipher ⇒ Object
readonly
Returns the value of attribute challenge_cipher.
-
#challenge_text ⇒ Object
readonly
Returns the value of attribute challenge_text.
-
#cipher ⇒ Object
readonly
Returns the value of attribute cipher.
-
#cvv ⇒ Object
readonly
Returns the value of attribute cvv.
-
#expiration_month ⇒ Object
readonly
Returns the value of attribute expiration_month.
-
#expiration_year ⇒ Object
readonly
Returns the value of attribute expiration_year.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#requested_currency ⇒ Object
readonly
Returns the value of attribute requested_currency.
-
#token_type ⇒ Object
readonly
Returns the value of attribute token_type.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CardForm
constructor
A new instance of CardForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CardForm
Returns a new instance of CardForm.
33402 33403 33404 33405 33406 33407 33408 33409 33410 33411 33412 33413 33414 33415 33416 33417 33418 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33402 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:expiration_month, :expiration_year, :name, :cvv], 'CardForm') @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String)) @cipher = (x = opts.delete(:cipher); x.nil? ? nil : HttpClient::Preconditions.assert_class('cipher', x, String)) @expiration_month = HttpClient::Preconditions.assert_class('expiration_month', opts.delete(:expiration_month), Integer) @expiration_year = HttpClient::Preconditions.assert_class('expiration_year', opts.delete(:expiration_year), Integer) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @cvv = HttpClient::Preconditions.assert_class('cvv', opts.delete(:cvv), String) @address = (x = opts.delete(:address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::BillingAddress) ? x : ::Io::Flow::V0::Models::BillingAddress.new(x))) @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)) @challenge_text = (x = opts.delete(:challenge_text); x.nil? ? nil : HttpClient::Preconditions.assert_class('challenge_text', x, String)) @challenge_cipher = (x = opts.delete(:challenge_cipher); x.nil? ? nil : HttpClient::Preconditions.assert_class('challenge_cipher', x, String)) @token_type = (x = opts.delete(:token_type); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TokenType) ? x : ::Io::Flow::V0::Models::TokenType.apply(x))) @requested_currency = (x = opts.delete(:requested_currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('requested_currency', x, String)) @metadata = (x = opts.delete(:metadata); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::CardMetadata) ? x : ::Io::Flow::V0::Models::CardMetadata.new(x))) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def address @address end |
#challenge_cipher ⇒ Object (readonly)
Returns the value of attribute challenge_cipher.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def challenge_cipher @challenge_cipher end |
#challenge_text ⇒ Object (readonly)
Returns the value of attribute challenge_text.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def challenge_text @challenge_text end |
#cipher ⇒ Object (readonly)
Returns the value of attribute cipher.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def cipher @cipher end |
#cvv ⇒ Object (readonly)
Returns the value of attribute cvv.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def cvv @cvv end |
#expiration_month ⇒ Object (readonly)
Returns the value of attribute expiration_month.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def expiration_month @expiration_month end |
#expiration_year ⇒ Object (readonly)
Returns the value of attribute expiration_year.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def expiration_year @expiration_year end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def ip @ip end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def @metadata end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def number @number end |
#requested_currency ⇒ Object (readonly)
Returns the value of attribute requested_currency.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def requested_currency @requested_currency end |
#token_type ⇒ Object (readonly)
Returns the value of attribute token_type.
33400 33401 33402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33400 def token_type @token_type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33424 33425 33426 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33424 def copy(incoming={}) CardForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
33428 33429 33430 33431 33432 33433 33434 33435 33436 33437 33438 33439 33440 33441 33442 33443 33444 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33428 def to_hash { :number => number, :cipher => cipher, :expiration_month => expiration_month, :expiration_year => expiration_year, :name => name, :cvv => cvv, :address => address.nil? ? nil : address.to_hash, :ip => ip, :challenge_text => challenge_text, :challenge_cipher => challenge_cipher, :token_type => token_type.nil? ? nil : token_type.value, :requested_currency => requested_currency, :metadata => .nil? ? nil : .to_hash } end |
#to_json ⇒ Object
33420 33421 33422 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33420 def to_json JSON.dump(to_hash) end |