Class: Io::Flow::V0::Models::RefundOrderSummaryAmounts
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::RefundOrderSummaryAmounts
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Detailed examples of amount to refund following common ecommerce use cases.
Instance Attribute Summary collapse
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#balance_excluding_shipping ⇒ Object
readonly
Returns the value of attribute balance_excluding_shipping.
-
#shipping ⇒ Object
readonly
Returns the value of attribute shipping.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ RefundOrderSummaryAmounts
constructor
A new instance of RefundOrderSummaryAmounts.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ RefundOrderSummaryAmounts
16694 16695 16696 16697 16698 16699 16700 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16694 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:balance], 'RefundOrderSummaryAmounts') @balance = HttpClient::Preconditions.assert_class('balance', HttpClient::Helper.to_big_decimal(opts.delete(:balance)), BigDecimal) @balance_excluding_shipping = (x = opts.delete(:balance_excluding_shipping); x.nil? ? nil : HttpClient::Preconditions.assert_class('balance_excluding_shipping', HttpClient::Helper.to_big_decimal(x), BigDecimal)) @shipping = (x = opts.delete(:shipping); x.nil? ? nil : HttpClient::Preconditions.assert_class('shipping', HttpClient::Helper.to_big_decimal(x), BigDecimal)) end |
Instance Attribute Details
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
16692 16693 16694 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16692 def balance @balance end |
#balance_excluding_shipping ⇒ Object (readonly)
Returns the value of attribute balance_excluding_shipping.
16692 16693 16694 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16692 def balance_excluding_shipping @balance_excluding_shipping end |
#shipping ⇒ Object (readonly)
Returns the value of attribute shipping.
16692 16693 16694 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16692 def shipping @shipping end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16706 16707 16708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16706 def copy(incoming={}) RefundOrderSummaryAmounts.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
16710 16711 16712 16713 16714 16715 16716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16710 def to_hash { :balance => balance, :balance_excluding_shipping => balance_excluding_shipping, :shipping => shipping } end |
#to_json ⇒ Object
16702 16703 16704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16702 def to_json JSON.dump(to_hash) end |