Skip to content

Commit 92b5df2

Browse files
Merge pull request #16 from meiazero/docs/update-readme
Docs:update readme
2 parents a9bdd61 + a09e18c commit 92b5df2

3 files changed

Lines changed: 273 additions & 324 deletions

File tree

README-pt.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# AbacatePay SDK
2+
3+
![PyPI Version](https://img.shields.io/pypi/v/abacatepay?label=pypi%20package)
4+
![PyPI Downloads](https://img.shields.io/pypi/dm/abacatepay)
5+
6+
> Um SDK Python para simplificar a interação com a API do AbacatePay. <br />
7+
> Esse SDK fornece ferramentas para gerenciamento de faturamento, gerenciamento de clientes e muito mais.
8+
9+
[Inglês](README.md) | [Português](README-pt.md)
10+
11+
---
12+
13+
## Índice
14+
15+
- [Instalação](#instalação)
16+
- [Iniciando](#iniciando)
17+
- [Exemplos de Uso](#exemplos-de-uso)
18+
- [Criar uma fatura](#criar-uma-fatura)
19+
- [Listar todas as faturas](#listar-todas-as-faturas)
20+
- [Gerenciamento de clientes](#gerenciamento-de-clientes)
21+
- [Contribuindo](#contribuindo)
22+
23+
---
24+
25+
## Instalação
26+
27+
### Usando pip
28+
29+
```bash
30+
pip install abacatepay
31+
```
32+
33+
### Usando Poetry
34+
35+
```bash
36+
poetry add abacatepay
37+
```
38+
39+
---
40+
41+
## Iniciando
42+
43+
Para usar o SDK, importe-o e inicialize o cliente com sua chave de API:
44+
45+
```python
46+
import abacatepay
47+
48+
client = abacatepay.AbacatePay(api_key="<your-api-key>")
49+
```
50+
51+
---
52+
53+
## Exemplos de Uso
54+
55+
### Criar uma fatura
56+
57+
```python
58+
from abacatepay.models import Product
59+
60+
client = abacatepay.AbacatePay(api_key="<your-api-key>")
61+
62+
products = [
63+
Product(
64+
externalId="123",
65+
name="Test Product",
66+
quantity=1,
67+
price=5000,
68+
description="Example product"
69+
)
70+
]
71+
72+
billing = client.billing.create(
73+
products=products,
74+
returnURL="https://yourwebsite.com/return",
75+
completionUrl="https://yourwebsite.com/complete"
76+
)
77+
78+
print(billing.data.url)
79+
```
80+
81+
### Listar todas as faturas
82+
83+
```python
84+
billings = client.billing.list()
85+
for billing in billings:
86+
print(billing.id, billing.status)
87+
```
88+
89+
### Gerenciamento de clientes
90+
91+
```python
92+
from abacatepay.models import Customer
93+
94+
customer = Customer(
95+
email="customer@example.com",
96+
name="Customer Name",
97+
cellphone="+1234567890"
98+
)
99+
100+
created_customer = client.customers.create(customer=customer)
101+
print(created_customer.id)
102+
```
103+
104+
---
105+
106+
## Contribuindo
107+
108+
Bom-vindo a contribuições para o SDK do AbacatePay! Siga os passos abaixo para começar:
109+
110+
1. Fork o repositório no GitHub.
111+
112+
2. Clone seu fork localmente:
113+
114+
```bash
115+
git clone https://github.com/your-username/abacatepay.git
116+
cd abacatepay
117+
```
118+
119+
3. Configure o ambiente virtual usando [poetry](https://python-poetry.org/):
120+
> Se você não tiver poetry instalado, você pode instalar seguindo as instruções [aqui](https://python-poetry.org/docs/#installing-with-the-official-installer).
121+
122+
```bash
123+
poetry install
124+
```
125+
126+
4. Faça suas alterações em uma nova branch:
127+
128+
```bash
129+
git checkout -b feature-name
130+
```
131+
132+
5. Execute os testes para garantir que suas alterações não quebrem a funcionalidade existente:
133+
134+
```bash
135+
poetry run pytest
136+
```
137+
138+
6. Commit suas alterações e envie a branch:
139+
140+
```bash
141+
git add .
142+
git commit -m "Add feature or fix description"
143+
git push origin feature-name
144+
```
145+
146+
7. Abra um pull request no GitHub e descreva suas alterações.

README.md

Lines changed: 127 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,147 @@
1-
# AbacatePay
2-
SDK Python para interagir com a API da AbacatePay (https://abacatepay.com)
1+
# AbacatePay SDK
32

4-
![PyPI](https://img.shields.io/pypi/v/abacatepay?label=pypi%20package)
5-
![PyPI - Downloads](https://img.shields.io/pypi/dm/abacatepay)
6-
## Instalação
3+
![PyPI Version](https://img.shields.io/pypi/v/abacatepay?label=pypi%20package)
4+
![PyPI Downloads](https://img.shields.io/pypi/dm/abacatepay)
75

8-
### Instalação via PyPI
9-
```bash
10-
pip install abacatepay
11-
```
6+
> A Python SDK to simplify interactions with the AbacatePay API. <br />
7+
> This SDK provides tools for billing management, customer handling, and more.
8+
9+
10+
[English](README.md) | [Português](README-pt.md)
11+
12+
---
1213

13-
### Instalação via desenvolvimento
14+
## Table of Contents
1415

15-
Para o desenvolvimento, você deve clonar o repositório e instalar o pacote com o instalador de pacotes `uv` (https://docs.astral.sh/uv/). Este instalador é recomendado para projetos Python e já possui a criação de ambientes virtuais e outras dependências necessárias para o desenvolvimento:
16+
- [Installation](#installation)
17+
- [Getting Started](#getting-started)
18+
- [Usage Examples](#usage-examples)
19+
- [Create a Billing](#create-a-billing)
20+
- [List All Billings](#list-all-billings)
21+
- [Customer Management](#customer-management)
22+
- [Contributing](#contributing)
23+
24+
---
25+
26+
## Installation
27+
28+
### Using pip
1629

1730
```bash
18-
uv sync
19-
uv run pip install -e .
20-
uv venv
31+
pip install abacatepay
2132
```
2233

23-
#### Rodando os testes
34+
### Using Poetry
2435

2536
```bash
26-
uv run pytest
37+
poetry add abacatepay
2738
```
2839

40+
---
41+
42+
## Getting Started
2943

30-
## Usage/Examples
44+
To use the SDK, import it and initialize the client with your API key:
3145

3246
```python
3347
import abacatepay
48+
49+
client = abacatepay.AbacatePay(api_key="<your-api-key>")
50+
```
51+
52+
---
53+
54+
## Usage Examples
55+
56+
### Create a Billing
57+
58+
```python
3459
from abacatepay.models import Product
3560

36-
token = "<your enviroment api token>"
37-
client = AbacatePay(token)
61+
client = abacatepay.AbacatePay(api_key="<your-api-key>")
62+
63+
products = [
64+
Product(
65+
externalId="123",
66+
name="Test Product",
67+
quantity=1,
68+
price=5000,
69+
description="Example product"
70+
)
71+
]
72+
73+
billing = client.billing.create(
74+
products=products,
75+
returnURL="https://yourwebsite.com/return",
76+
completionUrl="https://yourwebsite.com/complete"
77+
)
3878

39-
billing = client.billing.create(products=[Product(externalId="123", name="Teste", quantity=1, price=101, description="Teste")], returnURL="https://abacatepay.com", completionUrl="https://abacatepay.com")
4079
print(billing.data.url)
41-
# > https://abacatepay.com/pay/aaaaaaa
42-
```
80+
```
81+
82+
### List All Billings
83+
84+
```python
85+
billings = client.billing.list()
86+
for billing in billings:
87+
print(billing.id, billing.status)
88+
```
89+
90+
### Customer Management
91+
92+
```python
93+
from abacatepay.models import Customer
94+
95+
customer = Customer(
96+
email="customer@example.com",
97+
name="Customer Name",
98+
cellphone="+1234567890"
99+
)
100+
101+
created_customer = client.customers.create(customer=customer)
102+
print(created_customer.id)
103+
```
104+
105+
---
106+
107+
## Contributing
108+
109+
We welcome contributions to the AbacatePay SDK! Follow the steps below to get started:
110+
111+
1. Fork the repository on GitHub.
112+
113+
2. Clone your fork locally:
114+
115+
```bash
116+
git clone https://github.com/your-username/abacatepay.git
117+
cd abacatepay
118+
```
119+
120+
3. Set up the virtual environment using [poetry](https://python-poetry.org/):
121+
> If you don't have poetry installed, you can install following the instructions [here](https://python-poetry.org/docs/#installing-with-the-official-installer).
122+
123+
```bash
124+
poetry install
125+
```
126+
127+
4. Make your changes in a new branch:
128+
129+
```bash
130+
git checkout -b feature-name
131+
```
132+
133+
5. Run tests to ensure your changes don’t break existing functionality:
134+
135+
```bash
136+
poetry run pytest
137+
```
138+
139+
6. Commit your changes and push the branch:
140+
141+
```bash
142+
git add .
143+
git commit -m "Add feature or fix description"
144+
git push origin feature-name
145+
```
146+
147+
7. Open a pull request on GitHub and describe your changes.

0 commit comments

Comments
 (0)