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.2.0.tar.gz (25.8 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.2.0-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: payment_emulation-0.2.0.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Linux/6.8.0-1021-azure

File hashes

Hashes for payment_emulation-0.2.0.tar.gz
Algorithm Hash digest
SHA256 13f436191f1776cded3ecd8daba078b3edfee0b05709b1fa3c58337a245ffe91
MD5 f734ecb2ca2823692441877c3df73d24
BLAKE2b-256 74f617cf848f474c3f359872bfde0184cf50ec53117542d9521a318538ee3652

See more details on using hashes here.

File details

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

File metadata

  • Download URL: payment_emulation-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Linux/6.8.0-1021-azure

File hashes

Hashes for payment_emulation-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f7c6b698bc76362a67ce95f903fc5a57a6c5e22034eb698bd193e7dfbfffabc
MD5 4bc94785af2a47d1be861025f64e7e34
BLAKE2b-256 0b2c990f694ac26c3e116c1e6e0cba0c5f92e81b2067f135e90a96d30cc4f871

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