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()
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=demo
SP_PASSWORD=demowb4&n$6un28$
SP_ENDPOINT=https://dev.engine.shurjopayment.com
SP_RETURN=https://dev.engine.shurjopayment.com/response
SP_CANCEL=https://dev.engine.shurjopayment.com/response
SP_LOGDIR=/var/log/shurjopay/shurjopay.log
SP_PREFIX=SP_PLUGIN_PYTHON
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_RETURN=env('SP_RETURN'),
SP_CANCEL=env('SP_CANCEL'),
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
Metadata
Release files for shurjopay-plugin 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| shurjopay-plugin-0.1.9.tar.gz | 11.7 kB | Without provenance | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| shurjopay_plugin-0.1.9-py3.10.egg | Legacy Egg format | - | - | Details |
| shurjopay_plugin-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.9 kB
Release files / shurjopay-plugin-0.1.9.tar.gz
| Download URL | shurjopay-plugin-0.1.9.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee8785aada121b4758859e77e671360e6f7a7ace45786446c7cdd2b0d6d57568
|
|
BLAKE2b-256 checksum How to use checksums |
574ab39a23b603b1aa5bf9be49492713bb09a3887f6f5348db2d2a80f2d7f95f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / shurjopay_plugin-0.1.9-py3.10.egg
| Download URL | shurjopay_plugin-0.1.9-py3.10.egg |
|---|---|
| Size | 18.0 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
6e1bb47b68ae65f5af2c39eaad47c014a1e0748d42f1a5431dc23376b514ea3d
|
|
BLAKE2b-256 checksum How to use checksums |
17897ca576ad30a8071015cfdd2f1f43a84420ee6970e219439e1b1540266177
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / shurjopay_plugin-0.1.9-py3-none-any.whl
| Download URL | shurjopay_plugin-0.1.9-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a23f94e870405f489415d69c01aec1cde86c03ddc6efd56315122a62fb71360a
|
|
BLAKE2b-256 checksum How to use checksums |
3352df3791f70737a8239170e6ac214d90a83d88b40b34f390e85dd6cff21634
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for shurjopay-plugin 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.