Class: Io::Flow::V0::Models::RefundForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::RefundForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Refund actually transfers funds. You can refund as many times as you’d like up until the total amount of captured funds has been refunded. Note when creating a refund you can specify either an order authorization id, a capture id, or an order number (or all of them as long as they match).
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#authorization_id ⇒ Object
readonly
Returns the value of attribute authorization_id.
-
#capture_id ⇒ Object
readonly
Returns the value of attribute capture_id.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#rma_key ⇒ Object
readonly
Returns the value of attribute rma_key.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ RefundForm
constructor
A new instance of RefundForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ RefundForm
Returns a new instance of RefundForm.
36304 36305 36306 36307 36308 36309 36310 36311 36312 36313 36314 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36304 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @authorization_id = (x = opts.delete(:authorization_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('authorization_id', x, String)) @capture_id = (x = opts.delete(:capture_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('capture_id', x, String)) @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String)) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) @amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal)) @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)) @rma_key = (x = opts.delete(:rma_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('rma_key', x, String)) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
36302 36303 36304 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36302 def amount @amount end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
36302 36303 36304 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36302 def attributes @attributes end |
#authorization_id ⇒ Object (readonly)
Returns the value of attribute authorization_id.
36302 36303 36304 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36302 def @authorization_id end |
#capture_id ⇒ Object (readonly)
Returns the value of attribute capture_id.
36302 36303 36304 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36302 def capture_id @capture_id end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
36302 36303 36304 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36302 def currency @currency end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
36302 36303 36304 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36302 def key @key end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
36302 36303 36304 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36302 def order_number @order_number end |
#rma_key ⇒ Object (readonly)
Returns the value of attribute rma_key.
36302 36303 36304 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36302 def rma_key @rma_key end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36320 36321 36322 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36320 def copy(incoming={}) RefundForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
36324 36325 36326 36327 36328 36329 36330 36331 36332 36333 36334 36335 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36324 def to_hash { :authorization_id => , :capture_id => capture_id, :order_number => order_number, :key => key, :amount => amount, :currency => currency, :rma_key => rma_key, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
36316 36317 36318 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36316 def to_json JSON.dump(to_hash) end |