Class: Vpsa::Api::ThirdParties
- Inherits:
-
Client
- Object
- Client
- Vpsa::Api::ThirdParties
show all
- Defined in:
- lib/vpsa/api/third_parties.rb
Instance Attribute Summary
Attributes inherited from Client
#access_token
Instance Method Summary
collapse
Methods inherited from Client
#category_levels, #client_classes, #companies, #credit_limits, #default_entries, #entities, #initialize, #installments, #orders, #payment_conditions, #product_categories, #products, #provisions, #receipts, #sales_history, #sellers, #third_parties, #user_data
#require_all
Constructor Details
This class inherits a constructor from Vpsa::Client
Instance Method Details
#block_credit_limit(id, justification) ⇒ Object
44
45
46
|
# File 'lib/vpsa/api/third_parties.rb', line 44
def block_credit_limit(id, justification)
return parse_response(self.class.put("/#{id}/limites_credito/bloquear", :body => build_body({"motivo" => justification}), :headers => ))
end
|
#create(data) ⇒ Object
Also known as:
new
21
22
23
24
25
|
# File 'lib/vpsa/api/third_parties.rb', line 21
def create(data)
return parse_response(self.class.post("/", :body => build_body(data), :headers => )) if data.is_a?(Hash)
return parse_response(self.class.post("/", :body => build_body(data.as_parameter), :headers => )) if data.is_a?(Vpsa::Entity::Administrative::ThirdParty)
raise ArgumentError
end
|
34
35
36
|
# File 'lib/vpsa/api/third_parties.rb', line 34
def credit_limit_information(id)
return parse_response(self.class.get("/#{id}/limites_credito", :body => build_body, :headers => ))
end
|
#find(id) ⇒ Object
17
18
19
|
# File 'lib/vpsa/api/third_parties.rb', line 17
def find(id)
return parse_response(self.class.get("/#{id}", :body => build_body, :headers => ))
end
|
#list(searcher = nil) ⇒ Object
10
11
12
13
14
15
|
# File 'lib/vpsa/api/third_parties.rb', line 10
def list(searcher = nil)
raise ArgumentError unless searcher.nil? || searcher.is_a?(Vpsa::Searcher::Administrative::ThirdPartySearcher)
return parse_response(self.class.get("/", :body => build_body(searcher.as_parameter), :headers => )) if searcher
return parse_response(self.class.get("/", :body => build_body, :headers => )) unless searcher
end
|
#unlock_credit_limit(id, justification) ⇒ Object
48
49
50
|
# File 'lib/vpsa/api/third_parties.rb', line 48
def unlock_credit_limit(id, justification)
return parse_response(self.class.put("/#{id}/limites_credito/desbloquear", :body => build_body({"motivo" => justification}), :headers => ))
end
|
#update(id, data) ⇒ Object
28
29
30
31
32
|
# File 'lib/vpsa/api/third_parties.rb', line 28
def update(id, data)
return parse_response(self.class.put("/#{id}", :body => build_body(data), :headers => )) if data.is_a?(Hash)
return parse_response(self.class.put("/#{id}", :body => build_body(data.as_parameter), :headers => )) if data.is_a?(Vpsa::Entity::Administrative::ThirdParty)
raise ArgumentError
end
|
#update_credit_limit(id, data) ⇒ Object
38
39
40
41
42
|
# File 'lib/vpsa/api/third_parties.rb', line 38
def update_credit_limit(id, data)
return parse_response(self.class.put("/#{id}/limites_credito/#{id}", :body => build_body(data), :headers => )) if data.is_a?(Hash)
return parse_response(self.class.put("/#{id}/limites_credito/#{id}", :body => build_body(data.as_parameter), :headers => )) if data.is_a?(Vpsa::Entity::Commercial::CreditLimit)
raise ArgumentError
end
|