SDK Python
SDK de integração eRede
Utilizando
Autorizando uma transação
from erede import *
store = Store("PV", "TOKEN", Environment.sandbox())
transaction = Transaction(12345, "Reference")
transaction.credit_card("5448280000000007", "123", "12", "2020", "Fulano de Tal")
transaction.set_additional(3456, 12)
try:
transaction = eRede(store).create(transaction)
if transaction.returnCode == "00":
print("Transação aprovada com sucesso. O tid é: {}".format(transaction.tid))
except RedeError as e:
print("Opz[{}]: {}".format(e.code, e))
Por padrão, a transação é capturada automaticamente; caso seja necessário apenas autorizar a transação, o método Transaction.capture_transaction(False) deverá ser chamado com o parâmetro False:
from erede import *
store = Store("PV", "TOKEN", Environment.sandbox())
transaction = Transaction(12345, "Reference")
transaction.credit_card("5448280000000007", "123", "12", "2020", "Fulano de Tal").capture_transaction(False)
try:
transaction = eRede(store).create(transaction)
if transaction.returnCode == "00":
print("Transação aprovada com sucesso. O tid é: {}".format(transaction.tid))
except RedeError as e:
print("Opz[{}]: {}".format(e.code, e))
Autorizando uma transação com MCC dinâmico
from erede import *
store = Store("PV", "TOKEN", Environment.sandbox())
transaction = Transaction(12345, "Reference")
transaction.credit_card("5448280000000007", "123", "12", "2020", "Fulano de Tal")
transaction.mcc("LOJADOZE", "22349202212", SubMerchant("1234", "Sao Paulo", "Brasil"))
try:
transaction = eRede(store).create(transaction)
if transaction.returnCode == "00":
print("Transação aprovada com sucesso. O tid é: {}".format(transaction.tid))
except RedeError as e:
print("Opz[{}]: {}".format(e.code, e))
Autorizando uma transação com identificação de plataforma
from erede import *
store = Store("PV", "TOKEN", Environment.sandbox())
transaction = Transaction(12345, "Reference")
transaction.credit_card("5448280000000007", "123", "12", "2020", "Fulano de Tal")
transaction.set_additional(1234, 12)
try:
transaction = eRede(store).create(transaction)
if transaction.returnCode == "00":
print("Transação aprovada com sucesso. O tid é: {}".format(transaction.tid))
except RedeError as e:
print("Opz[{}]: {}".format(e.code, e))
Autorizando uma transação IATA
from erede import *
store = Store("PV", "TOKEN", Environment.sandbox())
transaction = Transaction(12345, "Reference")
transaction.credit_card("5448280000000007", "123", "12", "2020", "Fulano de Tal")
transaction.set_iata("code123", "250")
try:
transaction = eRede(store).create(transaction)
if transaction.returnCode == "00":
print("Transação aprovada com sucesso. O tid é: {}".format(transaction.tid))
except RedeError as e:
print("Opz[{}]: {}".format(e.code, e))
Metadata
Release files for rede-payments 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rede payments-1.0.0.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rede_payments-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.6 kB
Release files / rede payments-1.0.0.tar.gz
| Download URL | rede payments-1.0.0.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e083fcebcaa8cb448ac16e927a3f5c8d98ca5cc20251720c117642d9d7a1048
|
|
BLAKE2b-256 checksum How to use checksums |
d1e2836e5e9eee995e6079bd5b7d6625de75ab993d3921f8c49ab94b9f8bfedf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.0 CPython/3.7.4
|
Release files / rede_payments-1.0.0-py3-none-any.whl
| Download URL | rede_payments-1.0.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d408e82d1d7d09a43cccd5ebbc4bd5ca92f5c89e5993e2caa01feabf8a917bf9
|
|
BLAKE2b-256 checksum How to use checksums |
8b1ef55fabbb849ddc2d8a734e3c225e170896b282bf7a9f3af25304b3e2b5c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.0 CPython/3.7.4
|