Skip to main content

A python library for ipay.

Project description

Publish ipay-python PyPI version License: MIT codecov Maintainability Test Coverage Documentation Status .github/workflows/pylint.yml

iPay Python SDK

ipay_logo

The iPay Python SDK provides a comprehensive set of tools for interacting with the iPay API, making it easier to integrate iPay payment functionality into your Python applications.

Description

This SDK simplifies the process of initiating payments, querying transaction status, and handling various iPay functionalities. It includes classes and methods for working with different iPay data models, making it convenient for developers to integrate iPay into their projects.

Table of Contents

Installation

Install the iPay Python SDK using pip:

pip install python-ipay

Usage

Importing the SDK

Import the SDK into your project:

from ipay import Ipay

Initializing the service

c2b = C2B()

C2B

from ipay import C2B
from ipay import IPayDataV1

c2b = C2B()
i_pay_data = IPayDataV1(
         live=0,
         oid="123456789",
         inv="123456789",
         amount=100,
         tel="254712345678",
         eml="johndoe@email.com",
         vid="demo",
         curr="KES",
         cst=1,
         cbk="http://localhost:8000/api/v1/ipn",
         crl=0,
         hash_value="",
         auto_pay=1
     )
c2b.initiate_payment(i_pay_data)

C2BV2

from ipay import C2BV2
from ipay import IPayDataV2

c2b = C2BV2()
i_pay_data = IPayDataV2(
         live=0,
         oid="123456789",
         inv="123456789",
         amount=100,
         tel="254712345678",
         eml="johndoe@email.com",
         vid="demo",
         curr="KES",
         cst=1,
         cbk="http://localhost:8000/api/v1/ipn",
         crl=0,
         hash_value="",
         auto_pay=1,
         p1="",
         p2="",
         p3="",
         p4="",
         cst="",
         crl="",
         hsh="",
         secret_key="demoCHANHED",
         )
link = c2b.initiate_payment(i_pay_data)["link"]

Configuration

You can set the following environment variables to configure the SDK:

  • i_pay_secret: Your iPay vendor secret key.

Contribution

Contributions are welcome! If you would like to contribute to the development of this SDK, please follow the guidelines in CONTRIBUTING.md. You can also contribute by reporting a bug or suggesting a feature you would like to see.

License

This SDK 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

python-ipay-0.1.0.tar.gz (8.9 kB view hashes)

Uploaded Source

Built Distribution

python_ipay-0.1.0-py3-none-any.whl (12.3 kB view hashes)

Uploaded Python 3

Supported by

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