Module: Taxjar::API::Refund

Includes:
Utils
Included in:
Client
Defined in:
lib/taxjar/api/refund.rb

Instance Method Summary collapse

Methods included from Utils

#perform_delete_with_object, #perform_get_with_array, #perform_get_with_object, #perform_get_with_objects, #perform_post_with_object, #perform_post_with_objects, #perform_put_with_object, #perform_request, #perform_request_with_array, #perform_request_with_object, #perform_request_with_objects

Instance Method Details

#create_refund(options = {}) ⇒ Object



16
17
18
# File 'lib/taxjar/api/refund.rb', line 16

def create_refund(options = {})
  perform_post_with_object("/v2/transactions/refunds", 'refund', options, Taxjar::Refund)
end

#delete_refund(id, options = {}) ⇒ Object



25
26
27
# File 'lib/taxjar/api/refund.rb', line 25

def delete_refund(id, options={})
  perform_delete_with_object("/v2/transactions/refunds/#{id}", 'refund', options, Taxjar::Refund)
end

#list_refunds(options = {}) ⇒ Object



8
9
10
# File 'lib/taxjar/api/refund.rb', line 8

def list_refunds(options = {})
  perform_get_with_array("/v2/transactions/refunds", 'refunds', options)
end

#show_refund(id, options = {}) ⇒ Object



12
13
14
# File 'lib/taxjar/api/refund.rb', line 12

def show_refund(id, options = {})
  perform_get_with_object("/v2/transactions/refunds/#{id}", 'refund', options, Taxjar::Refund)
end

#update_refund(options = {}) ⇒ Object



20
21
22
23
# File 'lib/taxjar/api/refund.rb', line 20

def update_refund(options = {})
  id = options.fetch(:transaction_id)
  perform_put_with_object("/v2/transactions/refunds/#{id}", 'refund', options, Taxjar::Refund)
end