Class: KillBillClient::Model::Refund
- Inherits:
-
RefundAttributes
- Object
- Resource
- RefundAttributes
- KillBillClient::Model::Refund
- Defined in:
- lib/killbill_client/models/refund.rb
Constant Summary collapse
- KILLBILL_API_REFUNDS_PREFIX =
"#{KILLBILL_API_PREFIX}/refunds"
Constants inherited from Resource
KillBillClient::Model::Resource::KILLBILL_API_PREFIX
Instance Attribute Summary
Attributes inherited from Resource
#etag, #response, #session_id, #uri
Class Method Summary collapse
- .find_all_by_payment_id(payment_id, options = {}) ⇒ Object
- .find_by_id(refund_id, options = {}) ⇒ Object
Instance Method Summary collapse
-
#create(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
end class methods.
Methods inherited from Resource
attribute, create_alias, delete, extract_session_id, from_json, from_response, get, has_many, has_one, head, instantiate_record_from_json, post, put, #refresh, #to_hash, #to_json
Class Method Details
.find_all_by_payment_id(payment_id, options = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/killbill_client/models/refund.rb', line 17 def find_all_by_payment_id payment_id, = {} get "#{Payment::KILLBILL_API_PAYMENTS_PREFIX}/#{payment_id}/refunds", {}, end |
.find_by_id(refund_id, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/killbill_client/models/refund.rb', line 11 def find_by_id refund_id, = {} get "#{KILLBILL_API_REFUNDS_PREFIX}/#{refund_id}", {}, end |
Instance Method Details
#create(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
end class methods
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/killbill_client/models/refund.rb', line 25 def create(user = nil, reason = nil, comment = nil, = {}) created_refund = self.class.post "#{Payment::KILLBILL_API_PAYMENTS_PREFIX}/#{@payment_id}/refunds", to_json, {}, { :user => user, :reason => reason, :comment => comment, }.merge() created_refund.refresh() end |