Class: CatarseMoip::V2::Refund
- Inherits:
-
Object
- Object
- CatarseMoip::V2::Refund
- Includes:
- HTTParty
- Defined in:
- app/models/catarse_moip/v2/refund.rb
Instance Attribute Summary collapse
-
#payment ⇒ Object
Returns the value of attribute payment.
-
#refund_options ⇒ Object
Returns the value of attribute refund_options.
Class Method Summary collapse
Instance Method Summary collapse
- #define_refund_options ⇒ Object
-
#initialize(payment) ⇒ Refund
constructor
A new instance of Refund.
- #refund ⇒ Object
Constructor Details
#initialize(payment) ⇒ Refund
Returns a new instance of Refund.
15 16 17 18 |
# File 'app/models/catarse_moip/v2/refund.rb', line 15 def initialize(payment) self.payment = payment self. = end |
Instance Attribute Details
#payment ⇒ Object
Returns the value of attribute payment.
8 9 10 |
# File 'app/models/catarse_moip/v2/refund.rb', line 8 def payment @payment end |
#refund_options ⇒ Object
Returns the value of attribute refund_options.
8 9 10 |
# File 'app/models/catarse_moip/v2/refund.rb', line 8 def end |
Class Method Details
.start(payment) ⇒ Object
10 11 12 13 |
# File 'app/models/catarse_moip/v2/refund.rb', line 10 def self.start(payment) _instance = new(payment) _instance.refund end |
Instance Method Details
#define_refund_options ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/models/catarse_moip/v2/refund.rb', line 26 def if refund_method == 'BANK_ACCOUNT' check_bank_account! { amount: amount_to_refund, method: refund_method, refundingInstrument: refund_instrument } else {} end end |
#refund ⇒ Object
20 21 22 23 24 |
# File 'app/models/catarse_moip/v2/refund.rb', line 20 def refund self.class.post("/v2/payments/#{parsed_payment_id}/refunds", { body: self..to_json }.merge!(basic_auth_params)) end |