Rynaro / credigy

Um cliente (não oficial) para o serviço SOAP da Credigy.

Home Page:https://rubygems.org/gems/credigy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Credigy

Build Status Coverage Status Maintainability

Um cliente (não oficial) para o serviço SOAP da Credigy.

Consulte o manual para mais informações.

Instalação

Adicione a linha no seu Gemfile

gem 'credigy'

Execute:

$ bundle

Ou instale você mesmo:

$ gem install credigy

Chamadas implementadas

Login

response = Credigy::Login.new(user: 'user', password: '123456', cpf: '987654321').call
authorization_token = response.authorization_token

AcceptLegalTerms

Credigy::LegalTermsAcceptance.new(authorization_token).call

GeneratePromise

Credigy::Promise.new(
  authorization_token,
  accounts: ['123'], installments: 3, first_installment_date: Date.today, agreement_value: 1580.7
).call

GetAccounts

response = Credigy::Account.new(authorization_token).call
response.all # array de contas

GetBoleto

response = Credigy::Boleto.new(authorization_token, debtor_agreement_id: '123', installment_number: '2').call
response.pdf # pdf stream

GetCampaignNegotiation

response = Credigy::CampaignNegotiation.new(authorization_token, owner_id: 'z', accounts: ['y'], provider_ids: ['x']).call
response.all # array de negociações possíveis

GetEmails

response = Credigy::Email.new(authorization_token).call
response.all # array de emails

GetInstallments

response = Credigy::Installment.new(authorization_token, debtor_agreement_id: 'z').call
response.all # installments

GetLinhaDigitavel

response = Credigy::Line.new(authorization_token, debtor_agreement_id: 'z', installment_number: 'y').call
response.line # linha digitavel

GetProviders

response = Credigy::Provider.new(authorization_token).call
response.all # array de provedores

SaveEmail

Credigy::EmailCreation.new(authorization_token, address: 'foo@test.com').call

Configuração (opcional)

É possível configurar o comportamento dessa gem via:

Credigy.configure do |config|
  config.verbose = true # default é false
  config.env = :production # qualquer outro symbol será considerado ambiente de desenvolvimento
  config.wsdl = 'http://proxy.meusite.com/wsdl' # caso queira adicionar um proxy
end

Se estiver no Rails, esse arquivo pode ser colocado em config/initializers/credigy.rb.

Desenvolvimento

Testes

rake spec

Console

bundle console

Release

Atualize o número da versão em version.rb e rode:

bundle exec rake release

License

The gem is available as open source under the terms of the MIT License.

About

Um cliente (não oficial) para o serviço SOAP da Credigy.

https://rubygems.org/gems/credigy

License:MIT License


Languages

Language:Ruby 99.5%Language:Shell 0.5%