Skip to main content

Python

shopify

Python

Server-side development

Integrate Hesabe Payment Gateway into your Python application. This comprehensive script provides encryption, decryption, and transaction handling for seamless payment processing.

📦 Prerequisites

📦

Required Libraries

Before you begin, ensure you have the necessary encryption library installed for AES functions:

pip install pycryptodome

🛠️ Setup Instructions

1

Obtain Live Credentials

To use this payment integration in a live environment, you need to obtain live credentials from Hesabe. Please contact our support team to request these credentials.

2

Set Return URLs

You must configure the return URLs for both successful and failed transactions. These URLs will be used to redirect users after a transaction is processed. Set these URLs in your application's homepage or backend configuration.

Handle Transaction Responses

The script will receive transaction responses in the form of encrypted data. You need to decrypt this data and handle it accordingly:

response_data = request.args.get('data')
if response_data:
decrypted_data = HesabeCrypt.decrypt(
response_data,
HesabeConfig.MERCHANT_SECRET_KEY,
HesabeConfig.MERCHANT_IV
)
response_json = json.loads(decrypted_data)
# Process the response_json as needed

📥 Download & Support

📦

Python Kit

Complete Python integration kit with demo examples


🔧

Technical Support

For technical integration assistance with Python


🔍 Integration Overview

📋

What's Included

This Python script provides a comprehensive demo for integrating the payment gateway into your application. It includes functions for encrypting and decrypting data, handling transaction responses, and managing credentials. The downloadable kit contains plugin code alongside readymade examples to help you integrate Hesabe payment processing in your Python application effectively.