Mutualise mandatory_params call
This commit is contained in:
parent
9daf0ee608
commit
6902f502d3
1 changed files with 6 additions and 5 deletions
|
@ -8,25 +8,26 @@ class SIADE::API
|
|||
|
||||
def self.entreprise(siren, procedure_id)
|
||||
endpoint = "/v2/entreprises/#{siren}"
|
||||
call(base_url + endpoint, mandatory_params(siren, procedure_id))
|
||||
call(base_url + endpoint, siren, procedure_id)
|
||||
end
|
||||
|
||||
def self.etablissement(siret, procedure_id)
|
||||
endpoint = "/v2/etablissements/#{siret}"
|
||||
call(base_url + endpoint, mandatory_params(siret, procedure_id))
|
||||
call(base_url + endpoint, siret, procedure_id)
|
||||
end
|
||||
|
||||
def self.exercices(siret, procedure_id)
|
||||
endpoint = "/v2/exercices/#{siret}"
|
||||
call(base_url + endpoint, mandatory_params(siret, procedure_id))
|
||||
call(base_url + endpoint, siret, procedure_id)
|
||||
end
|
||||
|
||||
def self.rna(siret, procedure_id)
|
||||
endpoint = "/v2/associations/#{siret}"
|
||||
call(base_url + endpoint, mandatory_params(siret, procedure_id))
|
||||
call(base_url + endpoint, siret, procedure_id)
|
||||
end
|
||||
|
||||
def self.call(url, params)
|
||||
def self.call(url, siret_or_siren, procedure_id)
|
||||
params = mandatory_params(siret_or_siren, procedure_id)
|
||||
params[:token] = SIADETOKEN
|
||||
|
||||
verify_ssl_mode = OpenSSL::SSL::VERIFY_NONE
|
||||
|
|
Loading…
Reference in a new issue