Class: Io::Flow::V0::Models::CardForm
- Inherits:
-
CardAuthorizationData
- Object
- CardAuthorizationData
- 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.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#token_type ⇒ Object
readonly
Returns the value of attribute token_type.
Attributes inherited from CardAuthorizationData
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CardForm
constructor
A new instance of CardForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from CardAuthorizationData
Constructor Details
#initialize(incoming = {}) ⇒ CardForm
Returns a new instance of CardForm.
18914 18915 18916 18917 18918 18919 18920 18921 18922 18923 18924 18925 18926 18927 18928 18929 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18914 def initialize(incoming={}) super(:discriminator => CardAuthorizationData::Types::CARD_FORM) 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))) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def address @address end |
#challenge_cipher ⇒ Object (readonly)
Returns the value of attribute challenge_cipher.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def challenge_cipher @challenge_cipher end |
#challenge_text ⇒ Object (readonly)
Returns the value of attribute challenge_text.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def challenge_text @challenge_text end |
#cipher ⇒ Object (readonly)
Returns the value of attribute cipher.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def cipher @cipher end |
#cvv ⇒ Object (readonly)
Returns the value of attribute cvv.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def cvv @cvv end |
#expiration_month ⇒ Object (readonly)
Returns the value of attribute expiration_month.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def expiration_month @expiration_month end |
#expiration_year ⇒ Object (readonly)
Returns the value of attribute expiration_year.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def expiration_year @expiration_year end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def ip @ip end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def number @number end |
#token_type ⇒ Object (readonly)
Returns the value of attribute token_type.
18912 18913 18914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18912 def token_type @token_type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
18935 18936 18937 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18935 def copy(incoming={}) CardForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
18939 18940 18941 18942 18943 18944 18945 18946 18947 18948 18949 18950 18951 18952 18953 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18939 def subtype_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 } end |
#to_json ⇒ Object
18931 18932 18933 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18931 def to_json JSON.dump(to_hash) end |