Python SDK to interact with AbacatePay's API
Project description
AbacatePay SDK
A Python SDK to simplify interactions with the AbacatePay API.
This SDK provides tools for billing management, customer handling, and more.
Table of Contents
Installation
Using pip
pip install abacatepay
Using Poetry
poetry add abacatepay
Getting Started
To use the SDK, import it and initialize the client with your API key:
import abacatepay
client = abacatepay.AbacatePay("<your-api-key>")
Usage Examples
Create a Billing
from abacatepay.products import Product
products = [
Product(
external_id="123",
name="Test Product",
quantity=1,
price=50_00,
description="Example product"
),
# or as dict
{
'external_id': "321",
'name': "Product as dict",
'quantity': 1,
'price': 10_00,
'description': "Example using dict"
}
]
billing = client.billing.create(
products=products,
return_url="https://yourwebsite.com/return",
completion_url="https://yourwebsite.com/complete"
)
print(billing.data.url)
List All Billings
billings = client.billing.list()
for billing in billings:
print(billing.id, billing.status)
print(len(billings))
Customer Management
from abacatepay.customers import CustomerMetadata
customer = CustomerMetadata( # Its can also be only a dict
email="customer@example.com",
name="Customer Name",
cellphone="(12) 3456-7890",
tax_id="123-456-789-10"
)
created_customer = client.customers.create(customer)
print(created_customer.id)
Contributing
We welcome contributions to the AbacatePay SDK! Follow the steps below to get started:
-
Fork the repository on GitHub.
-
Clone your fork locally:
git clone https://github.com/your-username/abacatepay.git cd abacatepay
-
Set up the virtual environment using poetry:
If you don't have poetry installed, you can install following the instructions here.
poetry install
-
Make your changes in a new branch:
git checkout -b feature-name
-
Run tests to ensure your changes don’t break existing functionality:
poetry run pytest
-
Commit your changes and push the branch:
git add . git commit -m "Add feature or fix description" git push origin feature-name
-
Open a pull request on GitHub and describe your changes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abacatepay-1.0.3.tar.gz.
File metadata
- Download URL: abacatepay-1.0.3.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dca6f85ff682dbe8aa36df96fd80ecc3136ef883061f2ad51cda9c29d2e15fcb
|
|
| MD5 |
15b34e5aed4bb6dc3b8656deb289908a
|
|
| BLAKE2b-256 |
4e2a47492e3216b2bf236c43369d36bb5c9fc4a1c95983f6a02f173ece6152c2
|
File details
Details for the file abacatepay-1.0.3-py3-none-any.whl.
File metadata
- Download URL: abacatepay-1.0.3-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6643c56dde3b9e430a4b8fae48b4c20e131d073edfec15dd241b15f2d69c6a6d
|
|
| MD5 |
87a907598b76277da52144acd6ec0fad
|
|
| BLAKE2b-256 |
d2bc22b5f9815c37370f66ce53a04aa5dd00bafba017b5c4868abd29b4b53a6d
|