Class: Io::Flow::V0::Models::OrderPayment
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderPayment
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
An Order Payment represents an individual payment applied to an order. The type of the payment can be used to further lookup transaction level detail
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderPayment
constructor
A new instance of OrderPayment.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderPayment
Returns a new instance of OrderPayment.
21954 21955 21956 21957 21958 21959 21960 21961 21962 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21954 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :type, :reference, :description, :total], 'OrderPayment') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::OrderPaymentType) ? x : ::Io::Flow::V0::Models::OrderPaymentType.apply(x)) @reference = HttpClient::Preconditions.assert_class('reference', opts.delete(:reference), String) @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String) @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x)) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
21952 21953 21954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21952 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
21952 21953 21954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21952 def id @id end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
21952 21953 21954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21952 def reference @reference end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
21952 21953 21954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21952 def total @total end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
21952 21953 21954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21952 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
21968 21969 21970 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21968 def copy(incoming={}) OrderPayment.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
21972 21973 21974 21975 21976 21977 21978 21979 21980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21972 def to_hash { :id => id, :type => type.value, :reference => reference, :description => description, :total => total.to_hash } end |
#to_json ⇒ Object
21964 21965 21966 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21964 def to_json JSON.dump(to_hash) end |