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
Hashes for magicway-payment-gateway-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dfa42fe10f6d20036ec5feada14ca92dbc2e7a45cd67a8fc786689149ce5128 |
|
MD5 | 5e8a489442c9eb8b779b6954e35524cc |
|
BLAKE2b-256 | 8d4ed78cbb4ab3f248341585a089048dc807b5167591ddd09c8e8a6740a2368a |
Hashes for magicway_payment_gateway-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6911c9d38d68c20160b880870c1781450fd4b9b0c1a0fb6a8b4ee884028eb333 |
|
MD5 | 928a80a76750b399912d6deaa28e7e62 |
|
BLAKE2b-256 | 73033be8579a41628c73a5c010d4531631d772bd5f396c47ea5713680c0eec53 |