Skip to main content

Python library for PlaceToPay Checkout integration.

Project description

Checkout-P2P Python Integration Library

pypi codecov Build Status

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

Replit Checkout P2P 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": "your_login",
        "tranKey": "your_trankey",
    })

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

checkout_p2p-0.1.7.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

checkout_p2p-0.1.7-py3-none-any.whl (72.1 kB view details)

Uploaded Python 3

File details

Details for the file checkout_p2p-0.1.7.tar.gz.

File metadata

  • Download URL: checkout_p2p-0.1.7.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

Hashes for checkout_p2p-0.1.7.tar.gz
Algorithm Hash digest
SHA256 9e514cab122ec8bd9a9e8e2e23f71e6694bd941d0e22d7105c52d60ac54fe187
MD5 c33b7894f7532183a0d45daa7231d650
BLAKE2b-256 d92fdc23615d9593adf282974202326f5b27d659391921df61e4e87821ee8978

See more details on using hashes here.

File details

Details for the file checkout_p2p-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: checkout_p2p-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 72.1 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

Hashes for checkout_p2p-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2001a42afa608301ac21dc945da11c0bdf295ab88a7919da9fac47742c8f2478
MD5 3481835b8e576d92b998c9a4a9ff60ee
BLAKE2b-256 fb1d7100128941498a6ad2a5d8400a04abb1bd5dab74f88225d4aeea42e46cd8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page