Telr Setup & Integration Guide
The telr provider integrates Telr Hosted Payment Pages and Transaction Advice (Webhooks) across Middle Eastern / GCC markets (AED, SAR, KWD, BHD, OMR, JOD, QAR, EGP, USD).
1. Prerequisites & Installation
Section titled “1. Prerequisites & Installation”Kirak connects to Telr directly via async REST API calls with httpx. No external Telr SDK or additional pip package is required.
pip install "kirak"2. Credentials & Configuration
Section titled “2. Credentials & Configuration”Step 1: Obtain Store ID & Authentication Key
Section titled “Step 1: Obtain Store ID & Authentication Key”In the Telr Merchant Administration System (MAS):
- Note your numeric Store ID.
- Under Hosted Payment Page settings, generate an Authentication Key.
Step 2: Configure Transaction Advice (Webhooks)
Section titled “Step 2: Configure Transaction Advice (Webhooks)”In MAS $\rightarrow$ Payment Page (or Security) $\rightarrow$ Transaction Advice:
- Set the URL to:
https://your-domain.com/payments/webhook/telr. - Configure a Secret Key (used to generate and verify the
tran_checkhash).
Step 3: Configure kirak.json
Section titled “Step 3: Configure kirak.json”{ "payments": { "default_provider": "telr", "providers": { "telr": { "type": "telr", "store_id": "15996", "environment": "test", "success_url": "https://your-domain.com/payment/return" } } }}[!IMPORTANT]
success_urlis mandatory and must be an absolute URL (http(s)://...). Telr redirects the buyer back to this return URL upon payment completion, decline, or cancellation.
Step 4: Set Environment Variables
Section titled “Step 4: Set Environment Variables”KIRAK_PAYMENT_TELR_AUTH_KEY=your_authentication_keyKIRAK_PAYMENT_TELR_ADVICE_SECRET=your_transaction_advice_secret_from_step23. Usage Examples
Section titled “3. Usage Examples”3.1 One-Time Hosted Payment Page
Section titled “3.1 One-Time Hosted Payment Page”Amounts are passed in minor units (e.g. fils for AED/SAR; 10,000 fils = 100.00 AED):
result = await kirak.payments.initiate_payment({ "provider": "telr", "user_id": "usr_1200", "amount": 10000, # 100.00 AED in fils "currency": "AED", "name": "Consulting Fee", "type": "one_time", "payment_email": "client@example.ae",})
payment_url = result["data"]["url"]3.2 Verification on Return
Section titled “3.2 Verification on Return”await kirak.payments.verify_payment({ "provider": "telr", "payment_id": result["data"]["reference"],})4. Feature Limitations
Section titled “4. Feature Limitations”| Feature | Support Status | Notes |
|---|---|---|
| Hosted Payment Page | Supported | Full 3-D Secure checkout |
| Transaction Advice (Webhooks) | Supported | Real-time transaction advice status |
Programmatic Refunds (refund_payment) |
Not Supported | Returns 501 NOT_SUPPORTED; refund inside Telr MAS admin |
| Subscriptions & Billing Portal | Not Supported | Returns 501 NOT_SUPPORTED |
| Saved Payment Methods | Not Supported | Returns 501 NOT_SUPPORTED |
5. Webhook Event Mapping
Section titled “5. Webhook Event Mapping”Normalized event |
Gateway Events | Description |
|---|---|---|
payment_completed |
sale |
Payment authorized and captured |
payment_failed |
declined, cancelled |
Order rejected or buyer cancelled |
refund_completed |
refund |
Refund processed in Telr MAS admin |