Skip to main content

A Python library for the CredoPay payment gateway.

Project description

CredoPay Payment Gateway

CredoPay Payment Gateway is a Python library that provides an easy-to-use interface for interacting with the CredoPay 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 CredoPay.
  • 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 credopay-paymentgateway

Usage

Initializing the Gateway

To start using the CredoPay Gateway, initialize the CredoPayPaymentGateway class with your client ID and client secret:

from credopay_paymentgateway import CredoPayPaymentGateway

gateway = CredoPayPaymentGateway('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

credopay-paymentgateway-0.0.5.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for credopay-paymentgateway-0.0.5.tar.gz
Algorithm Hash digest
SHA256 f5eef40236422ebf9896545e465bf76bc80b40cbde57f1177d16a4badb97d042
MD5 fec5c786c8473edf5e5453975c0f9b6b
BLAKE2b-256 75ff57e0c309d9280de6531c50404fc3720647a4077f9c7d6582e4e50f6daf08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for credopay_paymentgateway-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1e08c3df9a6a6374e80b9a5359e17200e004916ac6613b02083efa752d54e16d
MD5 cdf64835848e8c93a14c17711d650039
BLAKE2b-256 774c6f0bba6522d63f9e0afb88094c26c9fd2e4cdbd5f1c165f4e40ad1ec2650

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