Segurofacil
SeguroFacil ruby API library
Installation
Add this line to your application's Gemfile:
gem 'segurofacil-ruby', require: false
gem 'segurofacil-ruby', git: 'https://github.com/guilhermekfe/segurofacil-ruby.git', require: false
And then execute:
$ bundle
Or install it yourself as:
$ gem install segurofacil-ruby
And then create an initializer with that:
require 'segurofacil'
Usage
Make sure you have the following variables in your environment.
SEGUROFACIL_PARTNER_NAME - Your segurofacil identifier
SEGUROFACIL_EMAIL - Authentication email
SEGUROFACIL_PASSWORD - Authentication password
Insurance Policy
Creating a new insurance policy
Segurofacil::Apolice.create({
name: "Company Test",
razaoSocial: "Company Test",
cNPJ: "33.333.333/0001-33",
responsavel: "Test",
cPF: "333.333.333-33",
qualificacao: "Test",
email: "user@email.com",
telefone: "35555555",
atividade: "Test",
address1: "Test",
address2: "Test",
bairro: "Manhattan",
city: "NYC",
estado: "NY",
cep: "12345678"
})
Cancelling an insurance policy
Segurofacil::Apolice.cancel(cnpj)
Intern
Adding intern
Segurofacil::Estagiario.create(
{
nome: 'name',
cpf: 'document_cpf',
dob: 'date_of_birth',
sexoId: sex_id # 1 for male and 2 for female
},
cnpj
)
Listing interns
Segurofacil::Estagiarios.get(cnpj)
Remove intern from insurance policy
Segurofacil::Estagiario.remove(intern_document_cpf, cnpj)
License
The gem is available as open source under the terms of the MIT License.
TODO
- Create Apolice
- Cancel Apolice
- Add Estagiario
- Remove Estagiario
- Get Estagiarios