01
Do‘kon oching
Botdan Shop ID va Shop KEY oling.
Kartaga tushgan to‘lovlarni avtomatik tekshiring.
Botdan Shop ID va Shop KEY oling.
Karta xabarnomasi keladigan akkauntni ulang.
Namunadagi kalitlarni o‘zingiznikiga almashtiring.
Tasdiqlangan to‘lovga qarab xizmatni faollashtiring.
Kirim xabari kelishi bilan to‘lov kuzatiladi.
Har bir do‘kon o‘z maxfiy kalitiga ega.
Ikki karta tizimi bilan ishlaydi.
Do‘kon va to‘lovlar bot ichida boshqariladi.
PHP, Python, Node.js va cURL namunalari.
Bir to‘lov qayta tasdiqlanmaydi.
Demo — haqiqiy to‘lov yuborilmaydi.
Kalitlarni o‘zingizniki bilan almashtiring.
# To‘lov so‘rovi yaratilgan Unix vaqtini since ga qo‘ying.
# Qayta tekshirganda ham aynan shu vaqtni yuboring.
curl --get "https://tolov.run.place/api/" \
--data-urlencode "action=check" \
--data-urlencode "shop_id=SHOP_ID" \
--data-urlencode "shop_key=SHOP_KEY" \
--data-urlencode "amount=50000" \
--data-urlencode "since=PAYMENT_CREATED_AT"
# To‘lov topilgandagi javob:
{
"ok": true,
"found": true,
"amount": 50000,
"matched_at": 1735689600
}
# Do‘kon holati:
curl "https://tolov.run.place/api/?action=status&shop_id=SHOP_ID&shop_key=SHOP_KEY"// Tolov API — PHP
const TOLOV_API_URL = 'https://tolov.run.place/api/';
const SHOP_ID = 'SHOP_ID';
const SHOP_KEY = 'SHOP_KEY';
function checkPayment($amount, $createdAt) {
$query = http_build_query([
'action' => 'check',
'shop_id' => SHOP_ID,
'shop_key' => SHOP_KEY,
'amount' => $amount,
'since' => $createdAt
]);
$ch = curl_init(TOLOV_API_URL . '?' . $query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
$body = curl_exec($ch);
curl_close($ch);
return json_decode($body ?: '{}', true);
}
// So‘rov yaratilganda saqlang; tekshirganda o‘zgartirmang.
$paymentCreatedAt = time();
$result = checkPayment(50000, $paymentCreatedAt);
if (!empty($result['ok']) && !empty($result['found'])) {
// Mijozga xizmatni faollashtiring.
}# Tolov API — Python
import time
import requests
API_URL = "https://tolov.run.place/api/"
SHOP_ID = "SHOP_ID"
SHOP_KEY = "SHOP_KEY"
def check_payment(amount, created_at):
response = requests.get(API_URL, params={
"action": "check",
"shop_id": SHOP_ID,
"shop_key": SHOP_KEY,
"amount": amount,
"since": created_at,
}, timeout=15)
response.raise_for_status()
return response.json()
# So‘rov yaratilganda saqlang; tekshirganda o‘zgartirmang.
payment_created_at = int(time.time())
result = check_payment(50000, payment_created_at)
if result.get("ok") and result.get("found"):
pass # Mijozga xizmatni faollashtiring.// Tolov API — Node.js 18+
const API_URL = 'https://tolov.run.place/api/';
const SHOP_ID = 'SHOP_ID';
const SHOP_KEY = 'SHOP_KEY';
async function checkPayment(amount, createdAt) {
const params = new URLSearchParams({
action: 'check',
shop_id: SHOP_ID,
shop_key: SHOP_KEY,
amount: String(amount),
since: String(createdAt)
});
const response = await fetch(`${API_URL}?${params}`, {
signal: AbortSignal.timeout(15000)
});
if (!response.ok) throw new Error('API so‘rovi bajarilmadi');
return response.json();
}
// So‘rov yaratilganda saqlang; tekshirganda o‘zgartirmang.
const paymentCreatedAt = Math.floor(Date.now() / 1000);
checkPayment(50000, paymentCreatedAt).then(result => {
if (result.ok && result.found) {
// Mijozga xizmatni faollashtiring.
}
}).catch(console.error);