Overview
This Tingg Checkout SDK helps you streamline your integration to the Tingg Checkout API to facilitate secure processing of payments. It includes functionality for payload validation and encryption of payment data.
Prerequisites
You need a Tingg account to use this package. If you don’t have one you can contact our account managers through tingg-checkout@cellulant.io and have your business registered & activated.
Visit our official documentation to find out more on how you can get started using Tingg.
Once you’re signed in, you will need to retrieve your API Keys, that is the `API Key`, `client ID` and `client secret`.
Installation
We’ll create a sample project with Flask <https://flask.palletsprojects.com/en/3.0.x/> using a .venv directory.
Give the project any name you like
mkdir <project-name>
cd <project-name>
python3 -m venv .venv
. .venv/bin/activate
pip install Tingg Flask requests python-dotenv pycryptodome
Usage
import os
from tingg import Express
from dotenv import load_dotenv
from flask import Flask, request, jsonify
load_dotenv()
app = Flask(__name__)
# Recommended
@app.route('/express', methods=['POST'])
def express_checkout():
# Get these values from your .env file or CLI args
env = os.getenv("ENV")
api_key = os.getenv("API_KEY")
client_id = os.getenv("CLIENT_ID")
client_secret = os.getenv("CLIENT_SECRET")
# Get the JSON payload from the request
payload = request.json
# A sample for value for request.json
# {
# merchant_transaction_id: "mtr-dg9823euy3a",
# account_number: "acc-14n345j5599",
# msisdn: "254700000000",
# service_code: "JOHNDOEONLINE",
# country_code: "KEN",
# currency_code: "KES",
# customer_last_name: "John",
# customer_first_name: "Doe",
# customer_email: "tingg@cellulant.io",
# request_amount: "100",
# due_date: "2023-11-18 16:15:30",
# language_code: "en",
# request_description: "Dummy merchant transaction",
# fail_redirect_url: "https://webhook.site/88390df9-a496-432f-abe5-0cf3380fda54",
# success_redirect_url: "https://webhook.site/88390df9-a496-432f-abe5-0cf3380fda54",
# callback_url: "https://webhook.site/88390df9-a496-432f-abe5-0cf3380fda54",
# }
express = Express(env)
result = express.create(api_key, client_id, client_secret, payload)
# A sample response for the testing environment
"""
{
"long_url": "https://online.uat.tingg.africa/testing/express/checkout?access_key=...&encrypted_payload=...",
"short_url": "https://online.uat.tingg.africa/testing/express/checkout/..."
}
"""
return jsonify(result)
Features
Payload Validation: Ensures that the provided payment payload adheres to specified criteria.
Encryption: Uses AES encryption to secure payment data during processing.
For more detailed usage instructions and examples, refer to the documentation.
Feedback
Feel free to reach us through our discussion forum.
Metadata
Release files for Tingg 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Tingg-0.1.6.tar.gz | 46.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Tingg-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 80.7 kB
Release files / Tingg-0.1.6.tar.gz
| Download URL | Tingg-0.1.6.tar.gz |
|---|---|
| Size | 46.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acc6e666810c9b70005b99a2751d0fcc092f8e06bcdd3c00262f9fbd6565296a
|
|
BLAKE2b-256 checksum How to use checksums |
36a7aea2381e713935e04f50876788ae87c7f5f19429fbbb501b8293bcf05106
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / Tingg-0.1.6-py3-none-any.whl
| Download URL | Tingg-0.1.6-py3-none-any.whl |
|---|---|
| Size | 34.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
94b16203b3d8af0403d8a58e38b9e0587189743ba5040e74c833a7d7e1d1528c
|
|
BLAKE2b-256 checksum How to use checksums |
b3b7b86944137dbc62df6535618315aae0dbac2c693ec01dea2083c5c1637a49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|