No project description provided
Reason this release was yanked:
used for init release only
Project description
epay-chargily-python
Chargily ePay Gateway (Python Package)
This Plugin is to integrate ePayment gateway with Chargily easily.
- Currently support payment by CIB / EDAHABIA cards and soon by Visa / Mastercard
- This repo is recently created for Python package, If you are a developer and want to collaborate to the development of this package, you are welcomed!
Requirements
- Python 2.7 or higher.
- API Key/Secret from ePay by Chargily dashboard for free.
- Requests.
Installation
1- Install the package:
pip install chargily-epay-gateway
or pipenv
pipenv install chargily-epay-gateway
2- Setup the Environment Variables:
- Mac/Linux:
export CHARGILY_API_KEY='YOUR_API_KEY'
export CHARGILY_SECRET_KEY='YOUR_SECRET_KEY'
Usage
1- Make Payment:
- Class based way:
import os
from chargily_epay_gateway.api import Invoice
CHARGILY_API_KEY = os.environ["CHARGILY_API_KEY"]
invoice = Invoice(CHARGILY_API_KEY)
invoice_payment = invoice.make_payment(
client='Client name goes here',
client_email='Client email goes here',
invoice_number='Invoice number as integer',
amount='Amount as float',
discount='Discount as float',
back_url='https://your-website-url/',
webhook_url='https://your-website-url/<webhook_path>/',
mode="CIB or EDAHABIA",
comment='Comment goes here',
)
invoice.get_invoice_content() # Return invoice data as python data structure
Invoice.load_invoice(invoice_payment) # Also return invoice data as python data structure
invoice.get_invoice() # Return the invoice as response
- Function based way:
import os
from chargily_epay_gateway.api import make_payment
CHARGILY_API_KEY = os.environ["CHARGILY_API_KEY"]
invoice = make_payment(
api_key=CHARGILY_API_KEY,
client='Client name goes here',
client_email='Client email goes here',
invoice_number='Invoice number as integer',
amount='Amount as float',
discount='Discount as float',
back_url='https://your-website-url/',
webhook_url='https://your-website-url/<webhook_path>/',
mode="CIB or EDAHABIA",
comment='Comment goes here',
)
2- Validate Chargily Signature:
from chargily_epay_gateway.utils import signature_is_valid
# Return True if signature is valid, otherwise False
valid_signature = webhook_is_valid(request)
Configurations
- Available Configurations
key | description | redirect url | process url |
---|---|---|---|
CHARGILY_APP_KEY | must be string given by organization | required | required |
CHARGILY_APP_SECRET | must be string given by organization | required | required |
back_url | must be string and valid url | required | not required |
webhook_url | must be string and valid url _ | required | required |
mode | must be in CIB,EDAHABIA | required | not required |
invoice_number | string or int | required | not required |
client_name | string | required | not required |
clientEmail | must be valid email This is where client receive payment receipt after confirmation | required | not required |
amount | must be numeric and greather or equal than 75 | required | not required |
discount | must be numeric and between 0 and 99 (discount in %) | required | not required |
description | must be string_ | required | not required |
Notice
- If you faced Issues Click here to open one
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
Close
Hashes for chargily_epay_gateway-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 448f43b7d0fdb8da2e7f1488dcc16c3fddad1622101fbeeb638b6860568a4159 |
|
MD5 | 163caf32bcc70bc120dc67c445ac15fa |
|
BLAKE2b-256 | b2b992da38966bf2934c65d70ebefa81f9b752df0321e4eb87938d2bc8005075 |