Class: Io::Flow::V0::Models::VirtualCardCapture
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::VirtualCardCapture
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#authorization ⇒ Object
readonly
Returns the value of attribute authorization.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#issuer ⇒ Object
readonly
Returns the value of attribute issuer.
-
#virtual_card ⇒ Object
readonly
Returns the value of attribute virtual_card.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ VirtualCardCapture
constructor
A new instance of VirtualCardCapture.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ VirtualCardCapture
Returns a new instance of VirtualCardCapture.
40708 40709 40710 40711 40712 40713 40714 40715 40716 40717 40718 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40708 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :issuer, :virtual_card, :authorization, :amount, :currency, :created_at], 'VirtualCardCapture') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @issuer = (x = opts.delete(:issuer); x.is_a?(::Io::Flow::V0::Models::Issuer) ? x : ::Io::Flow::V0::Models::Issuer.new(x)) @virtual_card = (x = opts.delete(:virtual_card); x.is_a?(::Io::Flow::V0::Models::VirtualCardReference) ? x : ::Io::Flow::V0::Models::VirtualCardReference.new(x)) = (x = opts.delete(:authorization); x.is_a?(::Io::Flow::V0::Models::AuthorizationReference) ? x : ::Io::Flow::V0::Models::AuthorizationReference.new(x)) @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
40706 40707 40708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40706 def amount @amount end |
#authorization ⇒ Object (readonly)
Returns the value of attribute authorization.
40706 40707 40708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40706 def end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
40706 40707 40708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40706 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
40706 40707 40708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40706 def currency @currency end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
40706 40707 40708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40706 def id @id end |
#issuer ⇒ Object (readonly)
Returns the value of attribute issuer.
40706 40707 40708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40706 def issuer @issuer end |
#virtual_card ⇒ Object (readonly)
Returns the value of attribute virtual_card.
40706 40707 40708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40706 def virtual_card @virtual_card end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
40724 40725 40726 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40724 def copy(incoming={}) VirtualCardCapture.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
40728 40729 40730 40731 40732 40733 40734 40735 40736 40737 40738 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40728 def to_hash { :id => id, :issuer => issuer.to_hash, :virtual_card => virtual_card.to_hash, :authorization => .to_hash, :amount => amount, :currency => currency, :created_at => created_at } end |
#to_json ⇒ Object
40720 40721 40722 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40720 def to_json JSON.dump(to_hash) end |