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 the capture has been refunded.
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#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.
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.
12699 12700 12701 12702 12703 12704 12705 12706 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12699 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:capture_id], 'RefundForm') @capture_id = HttpClient::Preconditions.assert_class('capture_id', opts.delete(:capture_id), 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.
12697 12698 12699 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12697 def amount @amount end |
#capture_id ⇒ Object (readonly)
Returns the value of attribute capture_id.
12697 12698 12699 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12697 def capture_id @capture_id end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
12697 12698 12699 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12697 def currency @currency end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
12697 12698 12699 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12697 def key @key end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
12712 12713 12714 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12712 def copy(incoming={}) RefundForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
12716 12717 12718 12719 12720 12721 12722 12723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12716 def to_hash { :capture_id => capture_id, :key => key, :amount => amount, :currency => currency } end |
#to_json ⇒ Object
12708 12709 12710 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12708 def to_json JSON.dump(to_hash) end |