Skip to main content

Uma biblioteca desenvolvida para ser utilizada em projetos Django para emular pagamentos com cartão bancário.

Project description

Payment Emulation

codecov CI docs

Descrição

Payment Emulation é uma biblioteca desenvolvida para ser usada em projetos Django para emular pagamentos com cartões bancários. Ela é ideal para ser usada em seus projetos para implementar um método de pagamento.

Requisitos

Payment Emulation requer o seguinte:

  • Django (>=5.1)
  • Python (>=3.10)

Instalação

1. Instalar a biblioteca Payment Emulation:

pip install payment-emulation

2. Adicione em INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'payment_emulation.payment',
]

3. Realize as migrações:

python manage.py migrate

Exemplo

Vamos dar uma olhada em um exemplo rápido de como usar a biblioteca Payment Emulation.

from payment_emulation.payment.paymentSDK import PaymentSDK

items = [
    {'id': 1, 'title': 'T-shirt', 'quantity': 3, 'unit_price': 49.99},
    {'id': 2, 'title': 'shoe', 'quantity': 1, 'unit_price': 149.99},
    {'id': 3, 'title': 'sweater', 'quantity': 2, 'unit_price': 80},
]

sdk = PaymentSDK(items)

response = sdk.payment(
    cpf='45230544015',
    card_namber='4763871810133150',
    validity='12/29',
    cvv='342',
    holder='PROBATUS'
)

print(response)

expected output:
>>>{
        "transaction": "success", 
        "items": [
            {"id": 1, "title": "T-shirt", "quantity": 3, "unit_price": 49.99}, 
            {"id": 2, "title": "shoe", "quantity": 1, "unit_price": 149.99}, 
            {"id": 3, "title": "sweater", "quantity": 2, "unit_price": 80}
        ], 
        "redirect_urls": null, 
        "address": null, 
        "payer": null,
        "amount": 459.96, 
        "created_at": "2024-12-31T10:38:12.465986-03:00"
    }

Documentação

Veja a documentação completa para obter mais detalhes de como usar este pacote clicando nesse link.

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

payment_emulation-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

payment_emulation-0.1.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file payment_emulation-0.1.0.tar.gz.

File metadata

  • Download URL: payment_emulation-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Windows/10

File hashes

Hashes for payment_emulation-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9fb66c8e3a08038ae8e695ec728ebafbc23800e8a5ed9f5be60e99a2fae99773
MD5 f6efc5738ca48026cbaad26f25f87748
BLAKE2b-256 369cdd7c27eb9842e776d0771a9156b1f5d01bde190a15e9b1b04cac1bbb92ac

See more details on using hashes here.

File details

Details for the file payment_emulation-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: payment_emulation-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Windows/10

File hashes

Hashes for payment_emulation-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6de876397242afa1ef5a207ea580f6e1268a99801d759435db2e05df8dc13d0e
MD5 4c96d05fe764435ddb59f89bb7f190b7
BLAKE2b-256 dbb6bf4d7ef02b1380f0b83188d6f357e082274fda1b3cbc19bc53b9ed0393ce

See more details on using hashes here.

Supported by

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