Class: EasyPost::Services::Refund

Inherits:
Service
  • Object
show all
Defined in:
lib/easypost/services/refund.rb

Constant Summary collapse

MODEL_CLASS =
EasyPost::Models::Refund

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from EasyPost::Services::Service

Instance Method Details

#all(params = {}) ⇒ Object

Retrieve all Refund objects



18
19
20
# File 'lib/easypost/services/refund.rb', line 18

def all(params = {})
  @client.make_request(:get, 'refunds', MODEL_CLASS, params)
end

#create(params = {}) ⇒ Object

Create a Refund object



7
8
9
10
# File 'lib/easypost/services/refund.rb', line 7

def create(params = {})
  wrapped_params = { refund: params }
  @client.make_request(:post, 'refunds', MODEL_CLASS, wrapped_params)
end

#get_next_page(collection, page_size = nil) ⇒ Object

Get the next page of refunds



23
24
25
# File 'lib/easypost/services/refund.rb', line 23

def get_next_page(collection, page_size = nil)
  get_next_page_helper(collection, collection.refunds, 'refunds', MODEL_CLASS, page_size)
end

#retrieve(id) ⇒ Object

Retrieve a Refund object



13
14
15
# File 'lib/easypost/services/refund.rb', line 13

def retrieve(id)
  @client.make_request(:get, "refunds/#{id}", MODEL_CLASS)
end