Shurjopay version 2.1 payment gateway integration package for python users
Project description
Python package (plugin)
Official shurjoPay python package (plugin) for merchants or service providers to connect with shurjoPay Payment Gateway v2.1 developed and maintained by shurjoMukhi Limited.
This plugin package can be used with any python application or framework (e.g. django, flask, FastAPI etc.).
This plugin package makes it easy for you to integrate with shurjoPay v2.1 with just three method calls:
- make_payment()
- verify_payment()
- check_payment()
Also reduces many of the things that you had to do manually
- Handles http request and errors
- JSON serialization and deserialization
- Authentication during checkout and verification of payments
Audience
This document is intended for the developers and technical personnel of merchants and service providers who want to integrate the shurjoPay online payment gateway using python.
How to use this shurjoPay Plugin
Use pip
to install this plugin inside your project environment.
pip install shurjopay-plugin
Create a .env file inside your project's root directory. Here is a sample .env configuration.
SP_USERNAME=sp_sandbox
SP_PASSWORD=pyyk97hu&6u6
SP_ENDPOINT=https://sandbox.shurjopayment.com/api/
SP_CALLBACK=https://www.sandbox.shurjopayment.com/response/
SP_PREFIX=sp-plugin-python
SP_LOGDIR=/var/log/shurjopay/shurjopay.log (optional)
After that, you can initiate payment request to shurjoPay using our package the way you want based on your application. Here we are providing a basic example code snippet for you.
import environ
from shurjopay_plugin import *
env = environ.Env()
environ.Env.read_env('.env')
sp_config = ShurjoPayConfigModel(
SP_USERNAME = env('SP_USERNAME'),
SP_PASSWORD = env('SP_PASSWORD'),
SP_ENDPOINT = env('SP_ENDPOINT'),
SP_CALLBACK = env('SP_CALLBACK'),
SP_PREFIX = env('SP_PREFIX'),
SP_LOGDIR= env('SP_LOGDIR')
)
shurjopay_plugin = ShurjopayPlugin(sp_config)
payment_request = PaymentRequestModel(
amount=1000,
order_id='001',
currency='BDT',
customer_name='Mahabubul Hasan',
customer_address='Mohakhali',
customer_phone='01311310975',
customer_city='Dhaka',
customer_post_code='1229',
)
payment_details = shurjopay_plugin.make_payment(payment_request)
Payment verification can be done after each transaction with shurjopay order id.
shurjopay_plugin.verify_payment(order_id)
That's all! Now you are ready to use the python plugin to seamlessly integrate with shurjoPay to make your payment system easy and smooth.
References
- Django example application showing usage of the python plugin.
- Sample applications and projects in many different languages and frameworks showing shurjopay integration.
- shurjoPay Postman site illustrating the request and response flow using the sandbox system.
- shurjopay Plugins home page on github
License
This code is under the MIT open source License.
Please contact with shurjoPay team for more detail.
Copyright ©️2022 ShurjoMukhi Limited
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 Distributions
Hashes for shurjopay_plugin-0.1.2-py3.8.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 831b7c4dfd0fd171ee6196160fcbb6a11a60fa1cb27f978bf8af58589585ecea |
|
MD5 | 45afd45f3a57b3e66aa57e0f888cae2a |
|
BLAKE2b-256 | 208f2e18cbb02a0455fc79e0cc51b4589040eb8db262abc2473ad2a0011de654 |
Hashes for shurjopay_plugin-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7adc5e035645179a7ca65e1591e0ad9b7a4416eb5b3d8c273d32822cc83fcf32 |
|
MD5 | e54c1c494f0e1612aec666110bb3f259 |
|
BLAKE2b-256 | 1bc21235b7206cdc71835a78561149105b941b351f620d3b226f2d05c209ea92 |