Skip to main content

A package to handle rede payments api

Project description

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))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

erede payments-1.0.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

erede_payments-1.0.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file erede payments-1.0.1.tar.gz.

File metadata

  • Download URL: erede payments-1.0.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.10

File hashes

Hashes for erede payments-1.0.1.tar.gz
Algorithm Hash digest
SHA256 11e996612a20cd277b52b52861bd368f9b7a1f9a768ed1ebe96b783233f7665a
MD5 c6011f3095c8c6fe701b39c569890d4a
BLAKE2b-256 ef3d799ffef5a9e12560a1cf30efa2cd8ff5f784d8cd9845e4af1e9a1b2d6571

See more details on using hashes here.

File details

Details for the file erede_payments-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: erede_payments-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.10

File hashes

Hashes for erede_payments-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b94dc855c3783eb5d07f6e90d7fee680d18d26674669dbbbe31243a4dfd727c0
MD5 2a1a306ac08600da8abb5f39e39397ef
BLAKE2b-256 fd8bb89e05df841548f6026cb0abbd7510491ffd43c3d73a5d28be4cfe2031b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page