Python library for PlaceToPay Checkout integration.
Project description
Checkout-P2P Python Integration Library
This project is a Python library inspired by the PlaceToPay PHP Redirection Library. It is designed to simplify integration with the PlaceToPay Web Checkout payment gateway. This library provides a robust and user-friendly solution for managing diverse payment scenarios, including single payments, recurring subscriptions, and payments using subscription tokens.
Integration demo
https://github.com/user-attachments/assets/b2363b94-f59d-4ce4-8a44-72e2e503b6c2
Documentation
See the Web Checkout API docs.
Installation
You don’t need this source code unless you intend to modify the package. To simply use the package, you can install it directly by running:
pip install checkout-p2p
Contribution
If you’d like to contribute, request, or suggest adding new features to the library, please follow the installation guide in our Contribution Wiki.
Requirements
- Python 3.13+
Usage
Here’s a quick example to get you started with the library:
1.Configuration
Set up your Settings object with the necessary credentials:
from checkout import Checkout, RedirectRequest
checkout = Checkout({
"base_url": "https://checkout-co.placetopay.dev/",
"login": "e3bba31e633c32c48011a4a70ff60497",
"tranKey": "ak5N6IPH2kjljHG3",
})
2.Create a Payment Request
from checkout import RedirectRequest
redirect_request = RedirectRequest(
returnUrl="https://example.com/return",
ipAddress="192.168.1.1",
userAgent="Test User Agent",
payment={"reference": "TEST _q", "description": "Test Payment", "amount": {"currency": "COP", "total": 10000}}
)
response = checkout.request(redirect_request)
print("Redirect to:", response.process_url)
3.Query a Payment Request
query_response = checkout.query(123456) # Replace with your request ID
print("Request Status:", query_response.status)
4.Reverse a Payment
# Reverse a transaction. Returns a `ReverseResponse` object.
reverse_response = checkout.reverse("internal_reference")
print("Reverse Status:", reverse_response.status)
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
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 checkout_p2p-0.1.6.tar.gz.
File metadata
- Download URL: checkout_p2p-0.1.6.tar.gz
- Upload date:
- Size: 40.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.1 Linux/6.8.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b166690428560a5851c3b6d92f89803af6a8b1f2c9cfa49002a6b174595b505
|
|
| MD5 |
c8a0ecff9276125fef9179e5a8ca3630
|
|
| BLAKE2b-256 |
e82fc1c388a47c9c417d50040959233cbd5534ec7ebb1ff17b6e2f59b577783a
|
File details
Details for the file checkout_p2p-0.1.6-py3-none-any.whl.
File metadata
- Download URL: checkout_p2p-0.1.6-py3-none-any.whl
- Upload date:
- Size: 72.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.1 Linux/6.8.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36106c276bd57fd85a6df38b185e8086c7484dace7b41f37097619e6075f2dd3
|
|
| MD5 |
7b2b3caeb6be902f8528722caef56e33
|
|
| BLAKE2b-256 |
3929ee2e27ebfef19f01caf3db244c7e9142d38c61f90d3d6030321b1c4b0aa5
|