Class: Io::Flow::V0::Models::PaymentRefundForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentRefundForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Returns already captured funds back to the customer. You can refund as many times as you’d like up until the total captured amount has been refunded. Refunds are allowed up to one year after the capture (depending on the payment method) unless a dispute has been raised for a transaction.
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PaymentRefundForm
constructor
A new instance of PaymentRefundForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PaymentRefundForm
Returns a new instance of PaymentRefundForm.
58547 58548 58549 58550 58551 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58547 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @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.
58545 58546 58547 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58545 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
58545 58546 58547 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58545 def currency @currency end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
58557 58558 58559 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58557 def copy(incoming={}) PaymentRefundForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
58561 58562 58563 58564 58565 58566 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58561 def to_hash { :amount => amount.to_f.to_s, :currency => currency } end |
#to_json ⇒ Object
58553 58554 58555 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58553 def to_json JSON.dump(to_hash) end |