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.
-
#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.
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.
16622 16623 16624 16625 16626 16627 16628 16629 16630 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16622 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)) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
16620 16621 16622 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16620 def amount @amount end |
#authorization_id ⇒ Object (readonly)
Returns the value of attribute authorization_id.
16620 16621 16622 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16620 def @authorization_id end |
#capture_id ⇒ Object (readonly)
Returns the value of attribute capture_id.
16620 16621 16622 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16620 def capture_id @capture_id end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
16620 16621 16622 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16620 def currency @currency end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
16620 16621 16622 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16620 def key @key end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
16620 16621 16622 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16620 def order_number @order_number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16636 16637 16638 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16636 def copy(incoming={}) RefundForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
16640 16641 16642 16643 16644 16645 16646 16647 16648 16649 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16640 def to_hash { :authorization_id => , :capture_id => capture_id, :order_number => order_number, :key => key, :amount => amount, :currency => currency } end |
#to_json ⇒ Object
16632 16633 16634 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16632 def to_json JSON.dump(to_hash) end |