Skip to main content

A Python library for the ompay payment gateway.

Project description

Ompay Payment Gateway

Ompay Payment Gateway is a Python library that provides an easy-to-use interface for interacting with the Ompay payment gateway API. This library allows you to create orders, check order statuses, and manage transactions securely and efficiently.

Features

  • Order Management: Create and manage orders through Ompay.
  • Transaction Management: Handle transactions with ease.
  • Secure Authentication: Uses secure basic authentication for API requests.
  • System Information: Attaches system and server information to each request for better tracking and security.

Installation

You can install the package via pip. Run the following command:

pip install ompay-paymentgateway

Usage

Initializing the Gateway

To start using the Ompay Gateway, initialize the OmpayPaymentGateway class with your client ID and client secret:

from ompay_paymentgateway import OmpayPaymentGateway

gateway = OmpayPaymentGateway('your-client-id', 'your-client-secret')

Creating an Order

To create an order, use the create_order method of the OrderAPI class:

order_data = {
    'receiptId': '00000001',
    'amount': 100,
    'currency': 'INR',
    'description': 'Test Payment',
    'customerFields': {
        'name': 'Sample User',
        'email': 'xxx@yyy.xom',
        'phone': '1234567890'
    },
    'uiMode': 'checkout',
    'redirectType' : 'post' // or 'redirect'
}

try:
    order_response = gateway.order.create_order(order_data)
    print("Order Response:", order_response)
except Exception as e:
    print('Error:', e)

Checking Order Status

To check the status of an existing order, use the check_status method:

order_id = 'order-id'

try:
    status_response = gateway.order.check_status(order_id)
    print("Order Status:", status_response)
except Exception as e:
    print('Error:', e)

License

This project is licensed under the MIT License.

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

ompay-paymentgateway-0.0.5.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

ompay_paymentgateway-0.0.5-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file ompay-paymentgateway-0.0.5.tar.gz.

File metadata

  • Download URL: ompay-paymentgateway-0.0.5.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for ompay-paymentgateway-0.0.5.tar.gz
Algorithm Hash digest
SHA256 dd8ec617d0a8d61e4648612057e6d49ee9c7335b5de838656dbb2544fcacb413
MD5 c36302b19b9c587bd135ff34c88b7eec
BLAKE2b-256 9f0402448e4e69c6d4ef9f7d1b5528dd4e4120a22a0a44099f7c1743ee93b9cb

See more details on using hashes here.

File details

Details for the file ompay_paymentgateway-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ompay_paymentgateway-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 53815a063e5d58b30e828f46522196d8dfea4cbdfc47d5f24c8495587ba158c5
MD5 36cc21c0b99b2b21c049cba93777d8ef
BLAKE2b-256 b278db9d5b0d28f0505576a8e1c418b5c819d74cf6d0c9d88afd609d06502f35

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