Um cliente (não oficial) para o serviço SOAP da Credigy.
Consulte o manual para mais informações.
Adicione a linha no seu Gemfile
gem 'credigy'
Execute:
$ bundle
Ou instale você mesmo:
$ gem install credigy
- Login
- AcceptLegalTerms
- GetExceptionStatus
- GeneratePromise
- GetAccounts
- GetBoleto
- GetCampaignNegotiation
- GetEmails
- GetInstallments
- GetLinhaDigitavel
- GetProviders
- SaveEmail
response = Credigy::Login.new(user: 'user', password: '123456', cpf: '987654321').call
authorization_token = response.authorization_token
Credigy::LegalTermsAcceptance.new(authorization_token).call
response = Credigy::AgreementExceptionStatus.new(authorization_token, agreement_id: 12345).call
response.exception_id # id da exceção provisionada
response.status # status da exceção provisionada
Credigy::Promise.new(
authorization_token,
accounts: ['123'], installments: 3, first_installment_date: Date.today, agreement_value: 1580.7
).call
response = Credigy::Account.new(authorization_token).call
response.all # array de contas
response = Credigy::Boleto.new(authorization_token, debtor_agreement_id: '123', installment_number: '2').call
response.pdf # pdf stream
response = Credigy::CampaignNegotiation.new(authorization_token, owner_id: 'z', accounts: ['y'], provider_ids: ['x']).call
response.all # array de negociações possíveis
response = Credigy::Email.new(authorization_token).call
response.all # array de emails
response = Credigy::Installment.new(authorization_token, debtor_agreement_id: 'z').call
response.all # installments
response = Credigy::Line.new(authorization_token, debtor_agreement_id: 'z', installment_number: 'y').call
response.line # linha digitavel
response = Credigy::Provider.new(authorization_token).call
response.all # array de provedores
Credigy::EmailCreation.new(authorization_token, address: '[email protected]').call
É 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
.
rake spec
bundle console
Atualize o número da versão em version.rb
e rode:
bundle exec rake release
The gem is available as open source under the terms of the MIT License.