class PR::Pin::Repositories::Refunds

Public Instance Methods

create_for_charge(charge_token, *args) click to toggle source
# File lib/pr/pin/repositories/refunds.rb, line 22
def create_for_charge(charge_token, *args)
  relation = root.for_charge(charge_token)

  API::Result.wrap(relation) do
    relation.command(:create).call(*args)
  end
end
find(token) click to toggle source
# File lib/pr/pin/repositories/refunds.rb, line 16
def find(token)
  relation = root.with_path(token)

  API::Result.wrap(relation) { relation.one }
end
for_charge(charge_token, page: 1, per_page: nil) click to toggle source
# File lib/pr/pin/repositories/refunds.rb, line 30
def for_charge(charge_token, page: 1, per_page: nil)
  relation = root.for_charge(charge_token).with_params(
    page: page,
    per_page: per_page
  )

  API::PaginatedResult.wrap(relation) { relation.paginate }
end
list(page: 1, per_page: nil) click to toggle source
# File lib/pr/pin/repositories/refunds.rb, line 7
def list(page: 1, per_page: nil)
  relation = root.with_params(
    page: page,
    per_page: per_page
  )

  API::PaginatedResult.wrap(relation) { relation.paginate }
end