class Moip2::RefundApi
Attributes
client[R]
Public Class Methods
new(client)
click to toggle source
# File lib/moip2/refund_api.rb, line 5 def initialize(client) @client = client end
Public Instance Methods
base_path(id)
click to toggle source
# File lib/moip2/refund_api.rb, line 9 def base_path(id) "/v2/#{base_resource(id)}/#{id}/refunds" end
create(id, refund = {})
click to toggle source
# File lib/moip2/refund_api.rb, line 13 def create(id, refund = {}) Resource::Refund.new client, client.post(base_path(id), refund) end
show(id)
click to toggle source
# File lib/moip2/refund_api.rb, line 17 def show(id) Resource::Refund.new client, client.get("/v2/refunds/#{id}") end
Private Instance Methods
base_resource(id)
click to toggle source
# File lib/moip2/refund_api.rb, line 23 def base_resource(id) id.start_with?("PAY") ? "payments" : "orders" end