Class: Io::Flow::V0::Models::VirtualCardRefund
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::VirtualCardRefund
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
A refund has been issued for the virtual credit card
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 = {}) ⇒ VirtualCardRefund
constructor
A new instance of VirtualCardRefund.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ VirtualCardRefund
Returns a new instance of VirtualCardRefund.
67300 67301 67302 67303 67304 67305 67306 67307 67308 67309 67310 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67300 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :issuer, :virtual_card, :authorization, :amount, :currency, :created_at], 'VirtualCardRefund') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @issuer = (x = opts.delete(:issuer); x.is_a?(::Io::Flow::V0::Models::IssuerV1) ? x : ::Io::Flow::V0::Models::IssuerV1.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)) @authorization = (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.
67298 67299 67300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67298 def amount @amount end |
#authorization ⇒ Object (readonly)
Returns the value of attribute authorization.
67298 67299 67300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67298 def @authorization end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
67298 67299 67300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67298 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
67298 67299 67300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67298 def currency @currency end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
67298 67299 67300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67298 def id @id end |
#issuer ⇒ Object (readonly)
Returns the value of attribute issuer.
67298 67299 67300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67298 def issuer @issuer end |
#virtual_card ⇒ Object (readonly)
Returns the value of attribute virtual_card.
67298 67299 67300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67298 def virtual_card @virtual_card end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
67316 67317 67318 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67316 def copy(incoming={}) VirtualCardRefund.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
67320 67321 67322 67323 67324 67325 67326 67327 67328 67329 67330 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67320 def to_hash { :id => id, :issuer => issuer.to_hash, :virtual_card => virtual_card.to_hash, :authorization => .to_hash, :amount => amount.to_f.to_s, :currency => currency, :created_at => created_at } end |
#to_json ⇒ Object
67312 67313 67314 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67312 def to_json JSON.dump(to_hash) end |