MagicWay Payment Gateway
Project description
MagicWay Payment Gateway Integration - Python Package
Note: If you're using this package with our sandbox environment is_sandbox is True and live is_sandbox is False. Please contact info@momagicbd.com to get credentials.
Package Directory
|-- magicway_payment_gateway/
|-- __init__.py
|-- momagic_connector.py (core file)
|-- status_code.py (core file)
|-- sample_checkout.py
|-- sample_ipn.py
|-- setup.py
|-- LICENSE
|-- README.md
|-- .gitignore
Installation
pip install magicway-payment-gateway
Usage
Sample Payment Session API example:
from magicway_payment_gateway import MoMagic
settings = { 'store_id': '', 'store_secret': '', 'store_username': '', 'store_email': '', 'is_sandbox': True }
mmbd_connector = MoMagic(settings)
Organize the checkout data and all fields must be filled up proper value
checkout_data = { 'currency': "BDT", 'amount': "10.00", # amount must be greater than or equal to 10 'cus_name': "test name", 'email': "test@test.com", 'msisdn': "01800000000", 'cus_country': "BD", 'cus_state': "customer state", 'cus_city': "customer city", 'cus_postcode': "customer postcode", 'cus_address': "customer address", 'product_name': "product name", 'num_of_item': 1, "success_url": "success url", "fail_url": "fail url", "cancel_url": "cancel url", "ipn_url": "ipn url" }
response=mmbd_connector.checkout(checkout_data)
print(response)
response['status_code'] == 200, Need to customer post redirection response['checkout_url'] and save response['order_id'] for payment validation
Sample Payment Validation API example:
from magicway_payment_gateway import MoMagic
settings = { 'store_id': '', 'store_secret': '', 'store_username': '', 'store_email': '', 'is_sandbox': True }
mmbd_connector = MoMagic(settings)
Organize the payment validation data
payment_validation_data = { 'opr': "", 'order_id': "", 'reference_id': "**********" }
response=mmbd_connector.instant_payment_notification(payment_validation_data)
print(response)
If response['status_code'] == 200 and response['charge_status'], then we can decide transaction is successful
Contributors
Arifur Rahman
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
File details
Details for the file magicway-payment-gateway-1.0.0.tar.gz
.
File metadata
- Download URL: magicway-payment-gateway-1.0.0.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5dfa42fe10f6d20036ec5feada14ca92dbc2e7a45cd67a8fc786689149ce5128
|
|
MD5 |
5e8a489442c9eb8b779b6954e35524cc
|
|
BLAKE2b-256 |
8d4ed78cbb4ab3f248341585a089048dc807b5167591ddd09c8e8a6740a2368a
|
File details
Details for the file magicway_payment_gateway-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: magicway_payment_gateway-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6911c9d38d68c20160b880870c1781450fd4b9b0c1a0fb6a8b4ee884028eb333
|
|
MD5 |
928a80a76750b399912d6deaa28e7e62
|
|
BLAKE2b-256 |
73033be8579a41628c73a5c010d4531631d772bd5f396c47ea5713680c0eec53
|