qqlib-node-boleto 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +11 -0
- package/.eslintignore +1 -0
- package/.eslintrc +10 -0
- package/.idea/encodings.xml +4 -0
- package/.idea/modules.xml +8 -0
- package/.idea/node-boleto.git_master.iml +8 -0
- package/.idea/vcs.xml +7 -0
- package/LICENSE +20 -0
- package/README.md +92 -0
- package/assets/layout.ejs +433 -0
- package/banks/banco do brasil/index.js +172 -0
- package/banks/bradesco/index.js +154 -0
- package/banks/caixa/index.js +66 -0
- package/banks/santander/helper.js +3 -0
- package/banks/santander/index.js +145 -0
- package/examples/bradesco-edi.js +6 -0
- package/examples/bradesco-emission.js +35 -0
- package/examples/retorno.txt +8 -0
- package/examples/santander-edi.js +6 -0
- package/examples/santander-emission.js +32 -0
- package/index.js +12 -0
- package/lib/barcode.js +93 -0
- package/lib/boleto.js +105 -0
- package/lib/edi-helper.js +13 -0
- package/lib/edi-parser.js +7 -0
- package/lib/formatters.js +109 -0
- package/package.json +30 -0
- package/public/images/b.png +0 -0
- package/public/images/bb.png +0 -0
- package/public/images/bradesco.jpg +0 -0
- package/public/images/santander.png +0 -0
- package/public/images/w.png +0 -0
- package/readme.will.md +11 -0
- package/sonar-project.properties +9 -0
- package/test/e2e/boleto-output.js +420 -0
- package/test/e2e/boleto-render.spec.js +104 -0
- package/test/integration/bradesco/boleto.spec.js +216 -0
- package/test/integration/bradesco/edi.spec.js +113 -0
- package/test/integration/caixa/edi.spec.js +99 -0
- package/test/integration/santander/boleto.spec.js +45 -0
- package/test/integration/santander/edi.spec.js +73 -0
- package/test/mocks/banks.js +13 -0
- package/test/mocks/boleto-2018-10-31.js +25 -0
- package/test/mocks/boleto-2018-11-09.js +25 -0
- package/test/unit/boleto-object.spec.js +134 -0
- package/test/unit/boleto-render.spec.js +34 -0
- package/test/unit/formatters.spec.js +62 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
const moment = require('moment')
|
|
2
|
+
const chai = require('chai')
|
|
3
|
+
chai.use(require('chai-string'))
|
|
4
|
+
const expect = chai.expect
|
|
5
|
+
|
|
6
|
+
const Boleto = require('../../index').Boleto
|
|
7
|
+
const boletoOutput = require('./boleto-output')
|
|
8
|
+
|
|
9
|
+
const createBoleto = (bank) => new Boleto({
|
|
10
|
+
'banco': bank,
|
|
11
|
+
'data_emissao': moment('2017-01-01').format(),
|
|
12
|
+
'data_vencimento': moment('2017-01-05').format(),
|
|
13
|
+
'valor': 1500,
|
|
14
|
+
'nosso_numero': '6',
|
|
15
|
+
'numero_documento': '1',
|
|
16
|
+
'cedente': 'Pagar.me Pagamentos S/A',
|
|
17
|
+
'cedente_cnpj': '18727053000174',
|
|
18
|
+
'agencia': '1229',
|
|
19
|
+
'codigo_cedente': '469',
|
|
20
|
+
'carteira': '25',
|
|
21
|
+
'pagador': 'Nome do pagador\nCPF: 000.000.000-00<script>alert(1)</script>',
|
|
22
|
+
'local_de_pagamento': 'PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO.',
|
|
23
|
+
'instrucoes': 'Sr. Caixa, aceitar o pagamento e não cobrar juros após o vencimento.<script>alert(1)</script>'
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
describe('Boleto Rendering', () => {
|
|
27
|
+
describe('when using img rendering engine', () => {
|
|
28
|
+
before(() => {
|
|
29
|
+
Boleto.barcodeRenderEngine = 'img'
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
describe('when rendering a valid bradesco boleto', () => {
|
|
33
|
+
let output
|
|
34
|
+
before((done) => {
|
|
35
|
+
const boleto = createBoleto('bradesco')
|
|
36
|
+
boleto.renderHTML((html) => {
|
|
37
|
+
output = html
|
|
38
|
+
done()
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it('should produce proper HTML', () => {
|
|
43
|
+
const barcode = '<img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/>'
|
|
44
|
+
// '
|
|
45
|
+
expect(output).to.equalIgnoreSpaces(boletoOutput('https://assets.pagar.me/boleto/images/bradesco.jpg', '237-2', '23791.22928 50000.000005 06000.046901 4 70300000001500', barcode, ''))
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
describe('when rendering a valid santander boleto', () => {
|
|
50
|
+
let output
|
|
51
|
+
before((done) => {
|
|
52
|
+
const boleto = createBoleto('santander')
|
|
53
|
+
boleto.renderHTML((html) => {
|
|
54
|
+
output = html
|
|
55
|
+
done()
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it('should produce proper HTML', () => {
|
|
60
|
+
const barcode = '<img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="3px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/b.png" height="50px" width="1px;" border=0/> <img class="barcode-line" src="https://assets.pagar.me/boleto/images/w.png" height="50px" width="1px;" border=0/>'
|
|
61
|
+
// '
|
|
62
|
+
expect(output).to.equalIgnoreSpaces(boletoOutput('https://assets.pagar.me/boleto/images/santander.png', '033-7', '03399.00003 46900.000004 00006.00254 6 70300000001500', barcode, ''))
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
describe('when using bmp rendering engine', () => {
|
|
68
|
+
before(() => {
|
|
69
|
+
Boleto.barcodeRenderEngine = 'bmp'
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
describe('when rendering a valid bradesco boleto', () => {
|
|
73
|
+
let output
|
|
74
|
+
before((done) => {
|
|
75
|
+
const boleto = createBoleto('bradesco')
|
|
76
|
+
boleto.renderHTML((html) => {
|
|
77
|
+
output = html
|
|
78
|
+
done()
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it('should produce proper HTML', () => {
|
|
83
|
+
const bmpBarcode = 'background-image: url(data:image/bmp;base64,Qk2VAQAAAAAAADYAAAAoAAAAlQEAAAEAAAABACAAAAAAAAAAAAATCwAAEwsAAAAAAAAAAAAAAAAAAP///wAAAAAA////AAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAAAAAAAAAAAA////AAAAAAD///8AAAAAAP///wD///8A////AAAAAAD///8AAAAAAAAAAAAAAAAA////AP///wD///8AAAAAAAAAAAAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8AAAAAAP///wD///8A////AAAAAAAAAAAAAAAAAP///wD///8A////AAAAAAD///8A////AP///wAAAAAA////AP///wD///8AAAAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8A////AP///wAAAAAA////AAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAAAAAAD///8AAAAAAP///wD///8A////AAAAAAAAAAAAAAAAAP///wAAAAAA////AAAAAAAAAAAAAAAAAP///wD///8A////AAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8A////AP///wAAAAAA////AAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAAAAAAD///8AAAAAAP///wD///8A////AAAAAAD///8AAAAAAAAAAAAAAAAA////AP///wD///8AAAAAAP///wAAAAAA////AAAAAAAAAAAAAAAAAP///wD///8A////AAAAAAD///8AAAAAAAAAAAAAAAAA////AP///wD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8AAAAAAP///wD///8A////AAAAAAAAAAAAAAAAAP///wAAAAAA////AAAAAAAAAAAAAAAAAP///wD///8A////AAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wD///8A////AAAAAAAAAAAAAAAAAP///wD///8A////AAAAAAAAAAAAAAAAAP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wD///8A////AAAAAAAAAAAAAAAAAP///wD///8A////AAAAAAD///8AAAAAAAAAAAAAAAAA////AAAAAAD///8AAAAAAAAAAAAAAAAA////AAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAAAAAAAAAAAAP///wAAAAAA////AA==);background-repeat: repeat-y;'
|
|
84
|
+
expect(output).to.equalIgnoreSpaces(boletoOutput('https://assets.pagar.me/boleto/images/bradesco.jpg', '237-2', '23791.22928 50000.000005 06000.046901 4 70300000001500', '', bmpBarcode))
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
describe('when rendering a valid santander boleto', () => {
|
|
89
|
+
let output
|
|
90
|
+
before((done) => {
|
|
91
|
+
const boleto = createBoleto('santander')
|
|
92
|
+
boleto.renderHTML((html) => {
|
|
93
|
+
output = html
|
|
94
|
+
done()
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it('should produce proper HTML', () => {
|
|
99
|
+
const bmpBarcode = 'background-image: url(data:image/bmp;base64,Qk2VAQAAAAAAADYAAAAoAAAAlQEAAAEAAAABACAAAAAAAAAAAAATCwAAEwsAAAAAAAAAAAAAAAAAAP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAAAAAAAAAAAAP///wD///8A////AAAAAAAAAAAAAAAAAP///wD///8A////AAAAAAD///8AAAAAAP///wAAAAAA////AAAAAAD///8AAAAAAAAAAAAAAAAA////AP///wD///8AAAAAAP///wD///8A////AAAAAAAAAAAAAAAAAP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAA////AP///wD///8AAAAAAAAAAAAAAAAA////AP///wD///8AAAAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAAAAAAD///8AAAAAAP///wD///8A////AAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAAAAAAAAAAAAP///wD///8A////AAAAAAD///8AAAAAAP///wD///8A////AAAAAAD///8AAAAAAAAAAAAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAAAAAAAAAAAA////AAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8AAAAAAP///wD///8A////AAAAAAD///8AAAAAAAAAAAAAAAAA////AP///wD///8AAAAAAAAAAAAAAAAA////AAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8AAAAAAP///wD///8A////AAAAAAAAAAAAAAAAAP///wD///8A////AAAAAAAAAAAAAAAAAP///wAAAAAA////AAAAAAD///8AAAAAAP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8A////AP///wAAAAAA////AAAAAAD///8A////AP///wAAAAAAAAAAAAAAAAD///8AAAAAAP///wD///8A////AAAAAAD///8AAAAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAP///wAAAAAA////AA==);background-repeat: repeat-y;'
|
|
100
|
+
expect(output).to.equalIgnoreSpaces(boletoOutput('https://assets.pagar.me/boleto/images/santander.png', '033-7', '03399.00003 46900.000004 00006.00254 6 70300000001500', '', bmpBarcode))
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
})
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
const Boleto = require('../../../index').Boleto
|
|
2
|
+
const moment = require('moment')
|
|
3
|
+
const expect = require('chai').expect
|
|
4
|
+
|
|
5
|
+
describe('Bradesco Boleto', () => {
|
|
6
|
+
describe('when creating a valid boleto', () => {
|
|
7
|
+
let boletos = [
|
|
8
|
+
{
|
|
9
|
+
boleto: new Boleto({
|
|
10
|
+
'banco': 'bradesco',
|
|
11
|
+
'data_emissao': moment('2017-01-01T00:00:00Z').valueOf(),
|
|
12
|
+
'data_vencimento': moment('2017-01-05T00:00:00Z').valueOf(),
|
|
13
|
+
'valor': 1500,
|
|
14
|
+
'nosso_numero': '6',
|
|
15
|
+
'numero_documento': '1',
|
|
16
|
+
'cedente': 'Pagar.me Pagamentos S/A',
|
|
17
|
+
'cedente_cnpj': '18727053000174',
|
|
18
|
+
'agencia': '1229',
|
|
19
|
+
'codigo_cedente': '469',
|
|
20
|
+
'carteira': '25',
|
|
21
|
+
'pagador': 'Nome do pagador\nCPF: 000.000.000-00',
|
|
22
|
+
'local_de_pagamento': 'PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO.',
|
|
23
|
+
'instrucoes': 'Sr. Caixa, aceitar o pagamento e não cobrar juros após o vencimento.'
|
|
24
|
+
}),
|
|
25
|
+
barcode: '23794703000000015001229250000000000600004690',
|
|
26
|
+
linha_digitavel:
|
|
27
|
+
'23791.22928 50000.000005 06000.046901 4 70300000001500'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
boleto: new Boleto({
|
|
31
|
+
'banco': 'bradesco',
|
|
32
|
+
'data_emissao': moment('2017-01-01T00:00:00Z').toDate(),
|
|
33
|
+
'data_vencimento': moment('2017-01-05T01:00:00Z').toDate(),
|
|
34
|
+
'valor': 1500,
|
|
35
|
+
'nosso_numero': '6',
|
|
36
|
+
'numero_documento': '1',
|
|
37
|
+
'cedente': 'Pagar.me Pagamentos S/A',
|
|
38
|
+
'cedente_cnpj': '18727053000174',
|
|
39
|
+
'agencia': '1229',
|
|
40
|
+
'codigo_cedente': '469',
|
|
41
|
+
'carteira': '25',
|
|
42
|
+
'pagador': 'Nome do pagador\nCPF: 000.000.000-00',
|
|
43
|
+
'local_de_pagamento': 'PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO.',
|
|
44
|
+
'instrucoes': 'Sr. Caixa, aceitar o pagamento e não cobrar juros após o vencimento.'
|
|
45
|
+
}),
|
|
46
|
+
barcode: '23794703000000015001229250000000000600004690',
|
|
47
|
+
linha_digitavel: '23791.22928 50000.000005 06000.046901 4 70300000001500'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
boleto: new Boleto({
|
|
51
|
+
'banco': 'bradesco',
|
|
52
|
+
'data_emissao': moment('2017-01-01T00:00:00Z').format(),
|
|
53
|
+
'data_vencimento': moment('2017-01-05T02:00:00Z').format(),
|
|
54
|
+
'valor': 1500,
|
|
55
|
+
'nosso_numero': '6',
|
|
56
|
+
'numero_documento': '1',
|
|
57
|
+
'cedente': 'Pagar.me Pagamentos S/A',
|
|
58
|
+
'cedente_cnpj': '18727053000174',
|
|
59
|
+
'agencia': '1229',
|
|
60
|
+
'codigo_cedente': '469',
|
|
61
|
+
'carteira': '25',
|
|
62
|
+
'pagador': 'Nome do pagador\nCPF: 000.000.000-00',
|
|
63
|
+
'local_de_pagamento': 'PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO.',
|
|
64
|
+
'instrucoes': 'Sr. Caixa, aceitar o pagamento e não cobrar juros após o vencimento.'
|
|
65
|
+
}),
|
|
66
|
+
barcode: '23794703000000015001229250000000000600004690',
|
|
67
|
+
linha_digitavel: '23791.22928 50000.000005 06000.046901 4 70300000001500'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
boleto: new Boleto({
|
|
71
|
+
'banco': 'bradesco',
|
|
72
|
+
'data_emissao': new Date('2017-01-01T23:00:00Z').getTime(),
|
|
73
|
+
'data_vencimento': new Date('2017-01-05T23:00:00Z').getTime(),
|
|
74
|
+
'valor': 1500,
|
|
75
|
+
'nosso_numero': '6',
|
|
76
|
+
'numero_documento': '1',
|
|
77
|
+
'cedente': 'Pagar.me Pagamentos S/A',
|
|
78
|
+
'cedente_cnpj': '18727053000174',
|
|
79
|
+
'agencia': '1229',
|
|
80
|
+
'codigo_cedente': '469',
|
|
81
|
+
'carteira': '25',
|
|
82
|
+
'pagador': 'Nome do pagador\nCPF: 000.000.000-00',
|
|
83
|
+
'local_de_pagamento': 'PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO.',
|
|
84
|
+
'instrucoes': 'Sr. Caixa, aceitar o pagamento e não cobrar juros após o vencimento.'
|
|
85
|
+
}),
|
|
86
|
+
barcode: '23794703000000015001229250000000000600004690',
|
|
87
|
+
linha_digitavel: '23791.22928 50000.000005 06000.046901 4 70300000001500'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
boleto: new Boleto({
|
|
91
|
+
'banco': 'bradesco',
|
|
92
|
+
'data_emissao': new Date('2017-01-01T00:00:00Z').getTime(),
|
|
93
|
+
'data_vencimento': new Date('2017-01-05T00:00:00Z').getTime(),
|
|
94
|
+
'valor': 1500,
|
|
95
|
+
'nosso_numero': '6',
|
|
96
|
+
'numero_documento': '1',
|
|
97
|
+
'cedente': 'Pagar.me Pagamentos S/A',
|
|
98
|
+
'cedente_cnpj': '18727053000174',
|
|
99
|
+
'agencia': '1229',
|
|
100
|
+
'codigo_cedente': '469',
|
|
101
|
+
'carteira': '25',
|
|
102
|
+
'pagador': 'Nome do pagador\nCPF: 000.000.000-00',
|
|
103
|
+
'local_de_pagamento': 'PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO.',
|
|
104
|
+
'instrucoes': 'Sr. Caixa, aceitar o pagamento e não cobrar juros após o vencimento.'
|
|
105
|
+
}),
|
|
106
|
+
barcode: '23794703000000015001229250000000000600004690',
|
|
107
|
+
linha_digitavel: '23791.22928 50000.000005 06000.046901 4 70300000001500'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
boleto: new Boleto({
|
|
111
|
+
'banco': 'bradesco',
|
|
112
|
+
'data_emissao': new Date('2024-04-05T00:00:00Z').getTime(),
|
|
113
|
+
'data_vencimento': new Date('2025-02-23T12:35:46Z').getTime(),
|
|
114
|
+
'valor': 200,
|
|
115
|
+
'nosso_numero': '00056631487',
|
|
116
|
+
'numero_documento': '1',
|
|
117
|
+
'cedente': 'Pagar.me Pagamentos S/A',
|
|
118
|
+
'cedente_cnpj': '18727053000174',
|
|
119
|
+
'agencia': '0001',
|
|
120
|
+
'codigo_cedente': '1234567',
|
|
121
|
+
'carteira': '25',
|
|
122
|
+
'pagador': 'Ramon\nCPF: 000.000.000-00',
|
|
123
|
+
'local_de_pagamento': 'PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO.',
|
|
124
|
+
'instrucoes': 'Sr. Caixa, aceitar o pagamento e não cobrar juros após o vencimento.'
|
|
125
|
+
}),
|
|
126
|
+
barcode: '23798100100000002000001250005663148712345670',
|
|
127
|
+
linha_digitavel: '23790.00124 50005.663146 87123.456706 8 10010000000200'
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
boleto: new Boleto({
|
|
131
|
+
'banco': 'bradesco',
|
|
132
|
+
'data_emissao': new Date('2024-04-05T00:00:00Z').getTime(),
|
|
133
|
+
'data_vencimento': new Date('2027-11-19T12:35:46Z').getTime(),
|
|
134
|
+
'valor': 200,
|
|
135
|
+
'nosso_numero': '00022019139',
|
|
136
|
+
'numero_documento': '1',
|
|
137
|
+
'cedente': 'Pagar.me Pagamentos S/A',
|
|
138
|
+
'cedente_cnpj': '18727053000174',
|
|
139
|
+
'agencia': '0001',
|
|
140
|
+
'codigo_cedente': '1234567',
|
|
141
|
+
'carteira': '25',
|
|
142
|
+
'pagador': 'Ramon\nCPF: 000.000.000-00',
|
|
143
|
+
'local_de_pagamento': 'PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO.',
|
|
144
|
+
'instrucoes': 'Sr. Caixa, aceitar o pagamento e não cobrar juros após o vencimento.'
|
|
145
|
+
}),
|
|
146
|
+
barcode: '23792200000000002000001250002201913912345670',
|
|
147
|
+
linha_digitavel: '23790.00124 50002.201916 39123.456707 2 20000000000200'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
boleto: new Boleto({
|
|
151
|
+
'banco': 'bradesco',
|
|
152
|
+
'data_emissao': new Date('2024-04-05T00:00:00Z').getTime(),
|
|
153
|
+
'data_vencimento': new Date('2027-11-18T12:35:46Z').getTime(),
|
|
154
|
+
'valor': 200,
|
|
155
|
+
'nosso_numero': '00075507288',
|
|
156
|
+
'numero_documento': '1',
|
|
157
|
+
'cedente': 'Pagar.me Pagamentos S/A',
|
|
158
|
+
'cedente_cnpj': '18727053000174',
|
|
159
|
+
'agencia': '0001',
|
|
160
|
+
'codigo_cedente': '1234567',
|
|
161
|
+
'carteira': '25',
|
|
162
|
+
'pagador': 'Ramon\nCPF: 000.000.000-00',
|
|
163
|
+
'local_de_pagamento': 'PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO.',
|
|
164
|
+
'instrucoes': 'Sr. Caixa, aceitar o pagamento e não cobrar juros após o vencimento.'
|
|
165
|
+
}),
|
|
166
|
+
barcode: '23797199900000002000001250007550728812345670',
|
|
167
|
+
linha_digitavel: '23790.00124 50007.550721 88123.456704 7 19990000000200'
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
boleto: new Boleto({
|
|
171
|
+
'banco': 'bradesco',
|
|
172
|
+
'data_emissao': new Date('2024-04-05T00:00:00Z').getTime(),
|
|
173
|
+
'data_vencimento': new Date('2049-10-13T12:35:46Z').getTime(),
|
|
174
|
+
'valor': 200,
|
|
175
|
+
'nosso_numero': '00036084454',
|
|
176
|
+
'numero_documento': '1',
|
|
177
|
+
'cedente': 'Pagar.me Pagamentos S/A',
|
|
178
|
+
'cedente_cnpj': '18727053000174',
|
|
179
|
+
'agencia': '0001',
|
|
180
|
+
'codigo_cedente': '1234567',
|
|
181
|
+
'carteira': '25',
|
|
182
|
+
'pagador': 'Ramon\nCPF: 000.000.000-00',
|
|
183
|
+
'local_de_pagamento': 'PAGÁVEL EM QUALQUER BANCO ATÉ O VENCIMENTO.',
|
|
184
|
+
'instrucoes': 'Sr. Caixa, aceitar o pagamento e não cobrar juros após o vencimento.'
|
|
185
|
+
}),
|
|
186
|
+
barcode: '23794999900000002000001250003608445412345670',
|
|
187
|
+
linha_digitavel: '23790.00124 50003.608440 54123.456706 4 99990000000200'
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
|
|
191
|
+
it('contains correct bank options', () => {
|
|
192
|
+
boletos.forEach(({boleto}) => {
|
|
193
|
+
expect(boleto.bank.options).to.have.property('logoURL').that.contains('bradesco.jpg')
|
|
194
|
+
expect(boleto.bank.options).to.have.property('codigo', '237')
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
it('contains correct codigo_banco', () => {
|
|
199
|
+
boletos.forEach(({boleto}) => {
|
|
200
|
+
expect(boleto.codigo_banco).to.equal('237-2')
|
|
201
|
+
})
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
it('contains correct barcode_data', () => {
|
|
205
|
+
boletos.forEach(({boleto, barcode}) => {
|
|
206
|
+
expect(boleto.barcode_data).to.equal(barcode)
|
|
207
|
+
})
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
it('contains correct linha_digitavel', () => {
|
|
211
|
+
boletos.forEach((boleto) => {
|
|
212
|
+
expect(boleto.boleto.linha_digitavel).to.equal(boleto.linha_digitavel)
|
|
213
|
+
})
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
})
|