The Ekhoni Digital Payment Gateway enables merchants to securely receive payments from their customers. Our PCI-compliant flow ensures that you can accept payments with minimal effort while maintaining the highest level of security.
You can use our RESTful APIs to integrate into any environment (PHP, Node, Python, etc.) or use our pre-built plugins for popular platforms like WordPress.
Base URL: https://pay.modirdokan.com/api/
| Field | Description | Constraint |
|---|---|---|
| API-KEY | Your unique brand API key from dashboard | Required |
| amount | Payment amount in decimal (e.g. 10.00) | Required |
| success_url | The URL we redirect to after success | Required |
| cancel_url | The URL we redirect to after cancellation | Required |
You can send custom metadata to track customer information. This will be returned in the response.
| Field | Description |
|---|---|
| Customer's email address | |
| phone | Customer's mobile number |
| order_id | Your internal order reference ID |
Initiate a new payment request and receive a secure payment link.
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://pay.modirdokan.com/api/payment/create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'success_url' => 'https://site.com/success',
'cancel_url' => 'https://site.com/cancel',
'amount' => '100'
]),
CURLOPT_HTTPHEADER => [
'API-KEY: YOUR_KEY',
'Content-Type: application/json'
],
]);
$res = curl_exec($curl);
curl_close($curl);
echo $res;
?> <?php
$client = new \GuzzleHttp\Client();
$res = $client->post('https://pay.modirdokan.com/api/payment/create', [
'headers' => [
'API-KEY' => 'YOUR_KEY',
'Content-Type' => 'application/json',
],
'json' => [
'success_url' => 'https://site.com/success',
'cancel_url' => 'https://site.com/cancel',
'amount' => '100',
]
]);
echo $res->getBody();
?> const axios = require('axios');
const data = {
success_url: 'https://site.com/success',
cancel_url: 'https://site.com/cancel',
amount: 100
};
axios.post('https://pay.modirdokan.com/api/payment/create', data, {
headers: {
'API-KEY': 'YOUR_KEY',
'Content-Type': 'application/json'
}
}).then(res => console.log(res.data)); import requests
import json
url = "https://pay.modirdokan.com/api/payment/create"
payload = json.dumps({
"success_url": "https://site.com/success",
"cancel_url": "https://site.com/cancel",
"amount": 100
})
headers = {
"API-KEY": "YOUR_KEY",
"Content-Type": "application/json"
}
res = requests.post(url, headers=headers, data=payload)
print(res.text) package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://pay.modirdokan.com/api/payment/create"
payload := strings.NewReader(`{
"success_url": "https://site.com/success",
"cancel_url": "https://site.com/cancel",
"amount": "100"
}`)
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-KEY", "YOUR_KEY")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
} Verify the status of a transaction using the transaction ID returned to your success URL.
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://pay.modirdokan.com/api/payment/verify',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{"transaction_id":"T123"}',
CURLOPT_HTTPHEADER => [
'API-KEY: YOUR_KEY',
'Content-Type: application/json'
],
]);
$res = curl_exec($curl);
curl_close($curl);
echo $res;
?> <?php
$client = new \GuzzleHttp\Client();
$res = $client->post('https://pay.modirdokan.com/api/payment/verify', [
'headers' => [
'API-KEY' => 'YOUR_KEY',
'Content-Type' => 'application/json',
],
'json' => [
'transaction_id' => 'T123'
]
]);
echo $res->getBody();
?> const axios = require('axios');
axios.post('https://pay.modirdokan.com/api/payment/verify', {
transaction_id: 'T123'
}, {
headers: {
'API-KEY': 'YOUR_KEY',
'Content-Type': 'application/json'
}
}).then(res => console.log(res.data)); import requests
import json
url = "https://pay.modirdokan.com/api/payment/verify"
payload = json.dumps({"transaction_id": "T123"})
headers = {
"API-KEY": "YOUR_KEY",
"Content-Type": "application/json"
}
res = requests.post(url, headers=headers, data=payload)
print(res.text) package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://pay.modirdokan.com/api/payment/verify"
payload := strings.NewReader(`{"transaction_id":"T123"}`)
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-KEY", "YOUR_KEY")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
} Webhooks allow your application to receive real-time notifications when a payment status changes. Configure your Webhook URL in your merchant dashboard. Our system will automatically send a POST request to your URL when a transaction is completed or failed.
| Field | Type | Description |
|---|---|---|
| paymentMethod | String | The method used for payment (e.g. bkash, nagad) |
| transactionId | String | The unique transaction ID (TrxID) |
| paymentAmount | Decimal | The total amount paid by the customer |
| paymentFee | Decimal | The gateway processing fee deducted |
| status | String | The payment status (e.g. completed, failed, pending) |
{ "paymentMethod": "bkash", "transactionId": "7FE3A8BC", "paymentAmount": "500.00", "paymentFee": "0.00", "status": "completed"}