Skip to main content

PayU payment gateway integration for python-getpaid ecosystem.

Project description

python-getpaid-payu

PyPI version Python versions License: MIT

PayU payment processor plugin for the python-getpaid ecosystem.

Provides a fully async HTTP client (PayUClient) and a payment processor (PayUProcessor) implementing the getpaid-core BaseProcessor interface. Communicates with PayU via their REST API v2.1 using OAuth2 authentication.

Features

  • Full Payment Lifecycle: Supports prepared, locked, paid, failed, and refunded states.
  • Pre-authorization: Reserve funds on customer's card (lock) and capture them later (charge).
  • Refunds: Full and partial refund support via API.
  • Multiple Currencies: Support for 15 currencies across Europe and beyond.
  • Asynchronous: Built with httpx for non-blocking API communication.
  • Security: Robust callback signature verification (SHA-256 and MD5).
  • Comprehensive API: Wraps every PayU REST API v2.1 endpoint.

Supported Currencies

The following 15 currencies are supported: BGN, CHF, CZK, DKK, EUR, GBP, HRK, HUF, NOK, PLN, RON, RUB, SEK, UAH, USD.

Installation

pip install python-getpaid-payu

Configuration

To use the PayU backend, register it in your getpaid configuration and provide the following settings:

Key Type Default Description
pos_id int PayU POS (point of sale) identifier
second_key str Second key (MD5) from PayU panel, used for signature verification
oauth_id int OAuth client ID from PayU panel
oauth_secret str OAuth client secret from PayU panel
sandbox bool True Use sandbox (secure.snd.payu.com) or production (secure.payu.com)
notify_url str None Notification callback URL template, e.g. https://example.com/payments/{payment_id}/notify
continue_url str None Redirect URL template after payment, e.g. https://example.com/payments/{payment_id}/continue

Example configuration:

GETPAID_BACKENDS = {
    "payu": {
        "pos_id": "300746",
        "second_key": "b6ca15b0d1020e8094d9b5f8d163db54",
        "oauth_id": "300746",
        "oauth_secret": "2ee86a66e5d97e3fadc400c9f19b065d",
        "notify_url": "https://your-domain.com/payments/payu/callback/",
        "continue_url": "https://your-domain.com/payments/payu/success/",
        "sandbox": True,
    }
}

Sandbox Mode

PayU provides a sandbox environment for testing. You can use the example keys provided above for testing in PLN.

Ecosystem

python-getpaid-payu is part of the larger python-getpaid ecosystem. Use it with one of our web framework wrappers:

Requirements

  • Python 3.12+
  • python-getpaid-core >= 3.0.0a3
  • httpx >= 0.27.0

License

MIT

Credits

Created by Dominik Kozaczko.

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

python_getpaid_payu-3.0.0a3.tar.gz (72.2 kB view details)

Uploaded Source

Built Distribution

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

python_getpaid_payu-3.0.0a3-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file python_getpaid_payu-3.0.0a3.tar.gz.

File metadata

  • Download URL: python_getpaid_payu-3.0.0a3.tar.gz
  • Upload date:
  • Size: 72.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for python_getpaid_payu-3.0.0a3.tar.gz
Algorithm Hash digest
SHA256 f599529a54a813c0075c31f9b3c2fc45ffa9b2c57d531a435bc4efb2b3a57a33
MD5 5a8fe6fe731f0b03c841b95815d18329
BLAKE2b-256 c887aed758585021b305e7624dccf36e59f3a779ce9192e34849e56d029432f1

See more details on using hashes here.

File details

Details for the file python_getpaid_payu-3.0.0a3-py3-none-any.whl.

File metadata

  • Download URL: python_getpaid_payu-3.0.0a3-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for python_getpaid_payu-3.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 cc88b9555232b6b923efb51cfa4e0d144fe405b88dbc9fd96dd06145ddf5659d
MD5 123c6ce770dfbef43ad297ece387b127
BLAKE2b-256 768b78d02c37531182fb923105e45ad8dd3c03edc91eaf78e969b329b2d30b6e

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