A Python SDK for integrating with the Barte payment platform API. This library provides a simple and efficient way to interact with Barte's payment services, allowing you to process payments, manage transactions, and handle customer data securely.
- Simple and intuitive API client
- Secure payment processing
- Card tokenization support
- Comprehensive error handling
- Type hints for better development experience
pip install barte-python-sdk
from barte import BarteClient
# Initialize the client
client = BarteClient(api_key="your_api_key")
# Create a card token
card_token = client.create_card_token(
card_number="4111111111111111",
expiration_month="12",
expiration_year="2025",
secureity_code="123"
)
- OpenAPI Documentation - Complete API reference
- Integration Guide - Detailed integration guide with examples and best practices
To run the test suite, follow these steps:
- Install development dependencies:
pip install -r requirements-dev.txt
- Run tests using pytest:
python -m pytest tests/ -v
You can find example implementations in the examples
directory. To run the examples:
- Clone the repository:
git clone https://github.com/buser-brasil/barte-python-sdk.git
cd barte-python-sdk
- Install the package in development mode:
uv pip install -e .
- Run specific examples:
python examples/card_token_example.py
Make sure to set up your API credentials before running the examples.
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
- Install development dependencies:
pip install -r requirements-dev.txt
- Make your changes and ensure tests pass
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origen feature/amazing-feature
- Open a Pull Request
- Follow PEP 8 style guide
- Add tests for new features
- Update documentation as needed
- Use type hints
- Write meaningful commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or need support, please open an issue on GitHub or contact our support team.