Implements SSLCOMMERZ payment gateway in python based web apps.
Project description
SSLCOMMERZ Payment Gateway implementation in Python
Provides a python module to implement payment gateway in python based web apps.
Installation
Via PIP
pip install git+https://github.com/dreygur/sslcommerz-payment-gateway-python.git
Projected use
from sslcommerz_python.payment import SSLCSession
from decimal import Decimal
mypayment = SSLCSession(sslc_is_sandbox=True, sslc_store_id='your_sslc_store_id', sslc_store_pass='your_sslc_store_passcode')
mypayment.set_urls(success_url='example.com/success', fail_url='example.com/failed', cancel_url='example.com/cancel', ipn_url='example.com/payment_notification')
mypayment.set_product_integration(total_amount=Decimal('20.20'), currency='BDT', product_category='clothing', product_name='demo-product', num_of_item=2, shipping_method='YES', product_profile='None')
mypayment.set_customer_info(name='John Doe', email='johndoe@email.com', address1='demo address', address2='demo address 2', city='Dhaka', postcode='1207', country='Bangladesh', phone='01711111111')
mypayment.set_shipping_info(shipping_to='demo customer', address='demo address', city='Dhaka', postcode='1209', country='Bangladesh')
# If you want to post some additional values
mypayment.set_additional_values(value_a='cusotmer@email.com', value_b='portalcustomerid', value_c='1234', value_d='uuid')
response_data = mypayment.init_payment()
Response parameters
When Successfull with Auth and Payloads provided
- status
- sessionkey
- GatewayPageURL
Example
>>> response_data['status']
SUCCESS
>>> response_data['sessionkey']
F650E87F23DD2A8FFCB4E4E333C13B28
>>> response_data['GatewayPageURL']
https://sandbox.sslcommerz.com/EasyCheckOut/testcdef650e87f23dd2a8ffcb4234fasf3b28
When Failed
- status
- failedreason
Example
>>> response_data['status']
FAILED
>>> response_data['failedreason']
'Store Credential Error Or Store is De-active'
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
Close
Hashes for sslcommerz-python-api-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e3a3cd93f4d31fcc2d1ca1ee544f2f0670fde036e960f8d04fc490a19767da2 |
|
MD5 | 304783415866243cad5e675f64a9eb15 |
|
BLAKE2b-256 | df1958a723a22de7496487aa4a18edfbca001caa82ffa0cce4555d255cab736e |
Close
Hashes for sslcommerz_python_api-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84d2e2fc515cd72634a326e4682b638aa5908815e11cc0702049f522609bd7c9 |
|
MD5 | b7875d6cf32427e4ed938fc2797814bd |
|
BLAKE2b-256 | 942c7eed8c1d4c663366b873172222edebed1d7aa5c6c87915348d3847f891d5 |