Metadata-Version: 2.3
Name: payment-emulation
Version: 0.1.0
Summary: Uma biblioteca desenvolvida para ser utilizada em projetos Django para emular pagamentos com cartão bancário.
License: MIT License
         
         Copyright (c) 2024 Valdean José
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Keywords: payment,emulation,SDK,implementation,e-commerce,pagamento,emulação,implementação
Author: Valdean
Author-email: valdeanjose6@gmail.com
Requires-Python: >=3.10
Classifier: Framework :: Django
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Dist: django (>=5.1.5,<6.0.0)
Requires-Dist: pycpfcnpj (>=1.8) ; python_version >= "3.8" and python_version < "4.0"
Project-URL: Bug Tracker, https://github.com/valdean7/payment_emulation/issues
Project-URL: Documentation, https://payment-emulation.readthedocs.io/latest/
Project-URL: Repository, https://github.com/valdean7/payment_emulation
Description-Content-Type: text/markdown

# Payment Emulation

[![codecov](https://codecov.io/gh/valdean7/payment_emulation/graph/badge.svg?token=IHKF7WUWDY)](https://codecov.io/gh/valdean7/payment_emulation)  ![CI](https://github.com/valdean7/payment_emulation/actions/workflows/pipiline.yaml/badge.svg)  ![docs](https://readthedocs.org/projects/payment-emulation/badge/?version=latest&style=default)

## 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:

```bash
pip install payment-emulation
```

### 2. Adicione em `INSTALLED_APPS`: 

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

### 3. Realize as migrações:

```bash
python manage.py migrate
```

## Exemplo

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

```python
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.](https://payment-emulation.readthedocs.io/latest/)

