class EasyPost::Services::Refund
Public Instance Methods
Source
# File lib/easypost/services/refund.rb, line 22 def all(params = {}) filters = { key: 'refunds' } get_all_helper('refunds', MODEL_CLASS, params, filters) end
Retrieve all Refund
objects
Source
# File lib/easypost/services/refund.rb, line 7 def create(params = {}) wrapped_params = { refund: params } response = @client.make_request(:post, 'refunds', wrapped_params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Create a Refund
object
Source
# File lib/easypost/services/refund.rb, line 29 def get_next_page(collection, page_size = nil) raise EasyPost::Errors::EndOfPaginationError.new unless more_pages?(collection) params = { before_id: collection.refunds.last.id } params[:page_size] = page_size unless page_size.nil? all(params) end
Get the next page of refunds
Source
# File lib/easypost/services/refund.rb, line 15 def retrieve(id) response = @client.make_request(:get, "refunds/#{id}") EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Retrieve a Refund
object