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
#client_classes, #credit_limits, #default_entries, #entities, #initialize, #installments, #provisions, #receipts, #sales, #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
38
39
40
|
# File 'lib/vpsa/api/third_parties.rb', line 38
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
|
28
29
30
|
# File 'lib/vpsa/api/third_parties.rb', line 28
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
42
43
44
|
# File 'lib/vpsa/api/third_parties.rb', line 42
def unlock_credit_limit(id, justification)
return parse_response(self.class.put("/#{id}/limites_credito/desbloquear", :body => build_body({"motivo" => justification}), :headers => ))
end
|
#update_credit_limit(id, data) ⇒ Object
32
33
34
35
36
|
# File 'lib/vpsa/api/third_parties.rb', line 32
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
|