Consumes the API given by Santander in order to register a *boleto bancário*.
In Brazil, Santander requires the use of a client ssl certificate.
## Example
Notice that one may not use the same ticket twice. Thus, in this examples, it is necessary to request two tickets, one to register the *boleto bancário* and the other to retrieve the status.
```
nosso_numero = '1'
data = {
'cod_convenio': 'CONVENIO',
'tp_doc': '01', # 01=CPF, 02=CNPJ
'num_doc': '11111111111',
'pagador_nome': '',
'pagador_endereco': '',
'pagador_bairro': '',
'pagador_cidade': '',
'pagador_uf': '',
'pagador_cep': '',
'nosso_numero': nosso_numero,
'seu_numero': nosso_numero,
'data_vencimento': '30062017',
'data_emissao': '27062017',
'especie': '02', # Duplicada mercantil
'valor_nominal': '102', # R$ 1,02
'multa': '0',
'qt_dias_multa': '0',
'juros': '0',
'tipo_desconto': '0', # Isento
'valor_desconto': '0',
'data_limite_desconto': '00000000',
'valor_abatimento': '0',
'tipo_protesto': '0', # Não protestar
'qt_dias_protesto': '0',
'qt_dias_baixa': '15',
'mensagem': 'Teste',
}
estacao = 'SUA_ESTACAO'
nsu = '1'
data_nsu = '28062017'
cert = ('path to certificate', 'path to private key')
ret1 = get_ticket(data, cert=cert)
print '-- solicita ticket --'
print 'retCode', ret1.return_code
print 'ticket', ret1.ticket
print ''
ret2 = incluir_titulo(ret1.ticket, estacao=estacao, nsu=nsu, data_nsu=data_nsu, cert=cert, teste=False)
print '-- incluir titulo --'
print 'nsu', nsu
print 'data nsu', data_nsu
print 'situacao', ret2.situacao
print 'descricao', ret2.descricao
print ''
ret3 = get_ticket(data, cert=cert)
print '-- solicita ticket --'
print 'retCode', ret3.return_code
print 'ticket', ret3.ticket
print ''
ret4 = consultar_titulo(ret3.ticket, estacao=estacao, nsu=nsu, data_nsu=data_nsu, cert=cert, teste=False)
print '-- consulta titulo --'
print 'situacao', ret4.situacao
print 'descricao', ret4.descricao
print ''
```
## Testing
I have tested using my company's client ssl certificate and it worked fine.
Metadata
Release files for santander-cobranca-xml 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| santander-cobranca-xml-1.0.1.tar.gz | 3.8 kB | Without provenance | Details for santander-cobranca-xml-1.0.1.tar.gz |
Release files / santander-cobranca-xml-1.0.1.tar.gz
| Download URL | santander-cobranca-xml-1.0.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bcc3bf03068f14010e0e1447e7e354303cad6779bde2b33911c9dd3987fbf7c
|
|
BLAKE2b-256 checksum How to use checksums |
c57d1da3a0ae6f8b7ac1de9b8dbb09e5b852a1fbd81a1a7e72e390c3714a4ea9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for santander-cobranca-xml 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.