Class: Boletoman::Services::Itau::Boleto::Formatter
- Inherits:
-
Object
- Object
- Boletoman::Services::Itau::Boleto::Formatter
- Defined in:
- lib/boletoman/services/itau/boleto/formatter.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(data) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize(data) ⇒ Formatter
Returns a new instance of Formatter.
8 9 10 |
# File 'lib/boletoman/services/itau/boleto/formatter.rb', line 8 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/boletoman/services/itau/boleto/formatter.rb', line 6 def data @data end |
Instance Method Details
#format ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/boletoman/services/itau/boleto/formatter.rb', line 12 def format { tipo_ambiente: env, tipo_registro: record_type, tipo_cobranca: billing_type, tipo_produto: '00006', subproduto: '00008', beneficiario: { cpf_cnpj_beneficiario: transferor_document, agencia_beneficiario: transferor_branch, conta_beneficiario: transferor_account, digito_verificador_conta_beneficiario: transferor_account_digit }, titulo_aceite: acceptance, pagador: { cpf_cnpj_pagador: payer_document, nome_pagador: payer_name, logradouro_pagador: payer_street, cidade_pagador: payer_city, uf_pagador: payer_state, cep_pagador: payer_zip_code }, tipo_carteira_titulo: wallet, moeda: { codigo_moeda_cnab: '09' }, nosso_numero: nosso_numero, digito_verificador_nosso_numero: nosso_numero_digit, data_vencimento: due_date, valor_cobrado: value, especie: '01', data_emissao: issue_date, tipo_pagamento: 1, indicador_pagamento_parcial: 'false', juros: { tipo_juros: 5 }, multa: { tipo_multa: 3 }, grupo_desconto: [{ tipo_desconto: '0' }], recebimento_divergente: { tipo_autorizacao_recebimento: '1' } }.to_json end |