Payment Emulation
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.
Metadata
Release files for payment-emulation 0.2.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 | |
|---|---|---|---|
| payment_emulation-0.2.0.tar.gz | 25.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| payment_emulation-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.3 kB
Release files / payment_emulation-0.2.0.tar.gz
| Download URL | payment_emulation-0.2.0.tar.gz |
|---|---|
| Size | 25.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13f436191f1776cded3ecd8daba078b3edfee0b05709b1fa3c58337a245ffe91
|
|
BLAKE2b-256 checksum How to use checksums |
74f617cf848f474c3f359872bfde0184cf50ec53117542d9521a318538ee3652
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.13.2 Linux/6.8.0-1021-azure
|
Release files / payment_emulation-0.2.0-py3-none-any.whl
| Download URL | payment_emulation-0.2.0-py3-none-any.whl |
|---|---|
| Size | 31.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f7c6b698bc76362a67ce95f903fc5a57a6c5e22034eb698bd193e7dfbfffabc
|
|
BLAKE2b-256 checksum How to use checksums |
0b2c990f694ac26c3e116c1e6e0cba0c5f92e81b2067f135e90a96d30cc4f871
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.13.2 Linux/6.8.0-1021-azure
|