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_put_with_object, #perform_request, #perform_request_with_array, #perform_request_with_object, #perform_request_with_objects

Instance Method Details

#create_refund(options = {}) ⇒ Object



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

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

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



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

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

#list_refunds(options = {}) ⇒ Object



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

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

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



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

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

#update_refund(options = {}) ⇒ Object



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

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