Skip to main content
Build Status Docs Build Status Coverage
Python Versions PyPI Version MIT Licence

Python SDK for SSLCOMMERZ configurable with Sqlalchemy, PynamoDB or Django ORM.

Getting Started

Install it via pip (python>=3.0).

pip install sslcommerz-sdk

How to Use

Create the views below depending on framework you are using.

from sslcommerz_sdk.enums import TransactionStatus

# TODO: create payment_handler.py file
from .payment_handler import payment_handler, store


def payment_init_view():
    # TODO: Freeze the cart, see what cart freezing is
    session, created = payment_handler.get_or_create_session(
        store=store,
        tran_id="test",
        currency="BDT",
        total_amount=100,
        cus_name="test",
        cus_email="test@test.com",
        cus_add1="test",
        cus_city="test",
        cus_postcode="1234",
        cus_country="test",
        cus_phone="123456",
        success_url="<URL to redirect cutomer when transaction is successful>",
        fail_url="<URL to redirect cutomer when transaction is failed>",
        cancel_url="<URL to redirect cutomer when transaction is cancelled>",
        ipn_url="<URL of ipn_view>",
    )
    # TODO: Redirect customer to session.redirect_url


def ipn_view():
    # TODO: Make this URL public, i.e accessible without logging in
    # TODO: Disable CSRF protection for this view
    # TODO: post_dict = {dict of request POST values}
    session, verified_right_now = payment_handler.verify_transaction(
        payload=post_dict,
    )
    if verified_right_now:
        if session.status == TransactionStatus.VALID:
            print(f"Tran ID: {session.tran_id} successful...")
            # TODO: Update order payment status in your database
        else:
            print("Transaction failed/cancelled!")
            # TODO: Unfreeze the cart sothat customer can modify/delete the cart

Next Steps

Contributing

PR should pass the tests and lint commands, checkout the following to get started.

License

This project is published under MIT LICENSE.

Metadata

Release files for sslcommerz-sdk 1.0.4

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

Source distribution (sdist)

Source distribution for sslcommerz-sdk 1.0.4
File Size Uploaded Provenance Actions
sslcommerz-sdk-1.0.4.tar.gz 12.6 kB Without provenance Details for sslcommerz-sdk-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sslcommerz-sdk 1.0.4
File Interpreter ABI Platform Actions
sslcommerz_sdk-1.0.4-py3-none-any.whl Python 3 none any Details for sslcommerz_sdk-1.0.4-py3-none-any.whl

Total release size: 30.4 kB

Release files / sslcommerz-sdk-1.0.4.tar.gz

Download URL sslcommerz-sdk-1.0.4.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7cd8c9d0d459629fb83638f264bca8cf3694902d12c7abae79a2b9074068a3fe
BLAKE2b-256 checksum
How to use checksums
9331a0a3111a84d293e29ef769b291e0b3b2bed857c23ccbec72d6c35f3e4584
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

Release files / sslcommerz_sdk-1.0.4-py3-none-any.whl

Download URL sslcommerz_sdk-1.0.4-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4a7c282c662790fdf1cda8bcfc20262f0e2b96169bfaa54a9350aa5083cb9a3
BLAKE2b-256 checksum
How to use checksums
3379f33e3a854afc00cbb6f1b7237fca4ce5558f104383c62f62cab728e1de9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

Security for sslcommerz-sdk 1.0.4

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