Skip to main content

shurjoPay

ShurjoPay

shurjopay python integration steps

Prerequisite

To integrate ShurjoPay you need few credentials to access shurjopay:

:param prefix: Any string not more than 5 characters. It distinguishes the stores of a merchant.
:param currency: ISO format,(only BDT and USD are allowed).
:param return_url: Merchant should provide a GET Method return url to verify users initiated transaction status. 
:param cancel_url: Merchant should provide a cancel url to redirect the user if he/she cancels the transaction in midway. 
:param client_ip: User's ip
:param username: Merchant Username provided by shurjopay.
:param password: Merchant Password provided by shurjopay.
:param post_address: Live shurjopay version 2 URL.

📝 NOTE For shurjoPay version 2 live engine integration all necessary credential will be given to merchant after subscription completed on shurjoPay gateway.


Installation

Use the package manager pip to install Shuropay python package

pip install shurjopay-V2

To install Python package from github, you need to clone that repository.

git clone https://github.com/shurjoPay-Plugins/Python.git

Then just run the setup.py file from that directory,

sudo python setup.py install

Usage

from shurjopay_v2.shurjopay import ShurjoPay

#initialize with the test credentials

testpay = ShurjoPay(prefix="NOC", currency="BDT", return_url=[URL],cancel_url=[URL], client_ip=[IP],  username=[USERNAME], password=[PASSWORD], post_address=[SURJOPAY_URL])
testpay.checkout(1, "xyz123456789", "demo", "01682803595", "N/a", "dhaka")
testpay.check_status(order_id="NOC6188d03129212")

In return url controller to verify and get the sp order_id

from shurjopay_v2.shurjopay import ShurjoPay

#initialize with the test credentials

verifypayment = ShurjoPay(prefix="NOC", currency="BDT", return_url=[URL],cancel_url=[URL], client_ip=[IP],  username=[USERNAME], password=[PASSWORD], post_address=[SURJOPAY_URL])
verifypayment.verify(order_id="NOC6188d03129212")

ShurjoPay

You can use the ShurjoPay class as an instance, within a class or by subclassing. The general usage flow is as follows:

  • Create a ShurjoPay instance with these parameters

    :param prefix: Any string not more than 5 characters. It distinguishes the stores of a merchant.
    :param currency: ISO format,(only BDT and USD are allowed).
    :param return_url: Merchant should provide a GET Method return url to verify users initiated transaction status. 
    :param cancel_url: Merchant should provide a cancel url to redirect the user if he/she cancels the transaction in midway. 
    :param client_ip: User's ip
    :param username: Merchant Username provided by shurjopay.
    :param password: Merchant Password provided by shurjopay.
    :param post_address: Live shurjopay version 2 URL.
    
    • Initialize the payment transaction with the checkout() functions
      • Arguments:
        :param amount: Transaction Amount [float] 
        :param order_id: Provide a Unique ORDER ID [string]
        :param customer_name: Customer Full Name [string]
        :param customer_phone: Customer Active Contact Number [string]
        :param customer_address: Customer Address [string]
        :param customer_city: Customer City [string]
        
      • Response : a JSON response with dynamic checkout_url will be provided. Example response
        { 
          'checkout_url': 'https://sandbox.securepay.shurjopayment.com/spaycheckout/?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvc2FuZGJveC5zaHVyam9wYXltZW50LmNvbVwvYXBpXC9sb2dpbiIsImlhdCI6MTYzNjM1MzYyMCwiZXhwIjoxNjM2MzU3MjIwLCJuYmYiOjE2MzYzNTM2MjAsImp0aSI6Ikt1MW1salZFQlBmaHdBRW8iLCJzdWIiOjEsInBydiI6IjgwNWYzOWVlZmNjNjhhZmQ5ODI1YjQxMjI3ZGFkMGEwNzZjNDk3OTMifQ.AVChXtT-g5De5OmenIucKvWF0PXx4x23PBjQFMsukJk&order_id=NOC6188d03129212',
          'amount': 1,
          'currency': 'BDT',
          'sp_order_id': 'NOC6188d03129212',
          'customer_order_id': 'xyz123456789',
          'customer_name': 'demo',
          'customer_address': 'N/a',
          'customer_city': 'dhaka',
          'customer_phone': '01682803595',
          'customer_email': None,
          'client_ip': '192.168.0.99',
          'intent': 'sale',
          'transactionStatus': 'Initiated'
        }
        
  • This checkout_url will return an HTML shurjopay form you need to render this in your application for your users to complete the transaction.

    spform

  • After the transaction initialized customer action status will be sent through the return_url/cancel_url with a query string ?order_id=[SpOrderId] merchant should store the id for future use.

  • Use verify() to verify the transaction. This call is required only once for each transaction that initialized

    • Arguments:
    :param order_id: For verification, merchants must use order_id that is sent from shurjoPay during callback.
    
    • Response JSON
  • Use check_status() to check the customer transaction status.

    • Arguments:
    :param order_id:For transaction status, merchants must use order_id that is sent from shurjoPay during callback.
    
    • Response JSON

Postman Documentations

This document will illustrate the overall request and response flow.
URL : https://documenter.getpostman.com/view/6335853/U16dS8ig	

Who do I talk to?

For any technical assistance please contact to: https://shurjopay.com.bd/#contacts

Metadata

Release files for shurjopay-V2 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shurjopay-V2 0.0.3
File Size Uploaded Provenance
shurjopay-V2-0.0.3.tar.gz 9.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for shurjopay-V2 0.0.3
File Interpreter ABI Platform
shurjopay_V2-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 19.8 kB

Release files / shurjopay-V2-0.0.3.tar.gz

Download URL shurjopay-V2-0.0.3.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3572bad1ea5dfa38d0155ec7a5217ae0c9b04b8a29abf07c792a76e8c1f7e345
BLAKE2b-256 checksum
How to use checksums
267ba06e89ee6fcc87472a7b41fb610a05393a6251a8c1a6621d7bbd65b91ff8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Release files / shurjopay_V2-0.0.3-py3-none-any.whl

Download URL shurjopay_V2-0.0.3-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9f4cb5646813f58bf35b6724ab5fb72390cd0010122e6e59bcc47c41609f676
BLAKE2b-256 checksum
How to use checksums
a18200cddb378db3f6dbafee049b4e5defd43950202834d3ef01ea0fe315a7e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Security for shurjopay-V2 0.0.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page