Class: Octobat::CreditNote
Instance Attribute Summary
#api_key, #parent_obj
Class Method Summary
collapse
Instance Method Summary
collapse
list, set_parent_resource
#save, #serialize_metadata, #serialize_params
included
Methods inherited from APIResource
class_name, #refresh, retrieve, url, #url
#[], #[]=, #_dump, _load, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #respond_to?, #to_hash, #to_json, #to_s, #values
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Octobat::OctobatObject
Class Method Details
.pdf_export(params = {}, opts = {}) ⇒ Object
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/octobat/credit_note.rb', line 8
def self.pdf_export(params = {}, opts={})
api_key, = Util.parse_opts(opts)
api_key ||= @api_key
opts[:api_key] = api_key
instance = self.new(nil, opts)
response, api_key = Octobat.request(:post, url + '/pdf_export', api_key, params, )
return true
end
|
Instance Method Details
#cancel(params = {}, opts = {}) ⇒ Object
31
32
33
34
|
# File 'lib/octobat/credit_note.rb', line 31
def cancel(params = {}, opts = {})
response, api_key = Octobat.request(:patch, cancel_url, @api_key, params, opts)
refresh_from(response, api_key)
end
|
#confirm(params = {}, opts = {}) ⇒ Object
25
26
27
28
|
# File 'lib/octobat/credit_note.rb', line 25
def confirm(params = {}, opts = {})
response, api_key = Octobat.request(:patch, confirm_url, @api_key, params, opts)
refresh_from(response, api_key)
end
|
#items(params = {}, opts = {}) ⇒ Object
38
39
40
|
# File 'lib/octobat/credit_note.rb', line 38
def items(params = {}, opts = {})
Item.list(params.merge({ credit_note: id }), {api_key: @api_key}.merge(opts))
end
|
#send_by_email(params = {}, opts = {}) ⇒ Object
20
21
22
23
|
# File 'lib/octobat/credit_note.rb', line 20
def send_by_email(params = {}, opts = {})
response, api_key = Octobat.request(:post, send_url, @api_key, params, opts)
refresh_from(response, api_key)
end
|
#transactions(params = {}, opts = {}) ⇒ Object
42
43
44
|
# File 'lib/octobat/credit_note.rb', line 42
def transactions(params = {}, opts = {})
Transaction.list(params.merge(credit_note: id), {api_key: @api_key}.merge(opts))
end
|