A python library for ipay.
Project description
iPay Python SDK
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for python_ipay-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d94744800fe2c02818cb4d32d3ca713a3130ee77e7cb09fc9bee967890cd5af4 |
|
MD5 | 815b54496fde681e868da760c7cb8903 |
|
BLAKE2b-256 | 22de98b6ea6a24179d169eb8b0b7ae4de3f828bc596273088a0944d91eccc7ee |