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 e-commerce 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
Returns a new instance of RefundOrderSummaryAmounts.
29896 29897 29898 29899 29900 29901 29902 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29896 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.
29894 29895 29896 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29894 def balance @balance end |
#balance_excluding_shipping ⇒ Object (readonly)
Returns the value of attribute balance_excluding_shipping.
29894 29895 29896 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29894 def balance_excluding_shipping @balance_excluding_shipping end |
#shipping ⇒ Object (readonly)
Returns the value of attribute shipping.
29894 29895 29896 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29894 def shipping @shipping end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
29908 29909 29910 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29908 def copy(incoming={}) RefundOrderSummaryAmounts.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
29912 29913 29914 29915 29916 29917 29918 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29912 def to_hash { :balance => balance, :balance_excluding_shipping => balance_excluding_shipping, :shipping => shipping } end |
#to_json ⇒ Object
29904 29905 29906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29904 def to_json JSON.dump(to_hash) end |