点按钮就能付款
机器人把收银台链接做成按钮发送。顾客打开后连接 TON 钱包,确认一次即可。
从机器人或 Mini App 发送付款按钮给顾客。他们用 Telegram Wallet、Tonkeeper 或任何 TON 钱包支付 USDT,钱一到账,你的机器人就会收到通知。
机器人把收银台链接做成按钮发送。顾客打开后连接 TON 钱包,确认一次即可。
确认一次,你的货款和手续费一起转出,直接到你的 TON 钱包,不需要提现。
付款确认后,签名 Webhook 立刻通知你的服务器,机器人马上就能交付订单。
# 1. Create a USDT payment on TON
curl https://api.kokiwa.com/v1/payment_intents \
-H "Authorization: Bearer $KOKIWA_KEY" \
-H "Content-Type: application/json" \
-d '{
"currency": "USDT",
"amount": "25.00",
"chains": ["ton"],
"customer": "tg_123456789"
}'
# 2. Send checkout_url from the response as a bot button
curl https://api.telegram.org/bot$BOT_TOKEN/sendMessage \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789,
"text": "Order 10086: 25 USDT",
"reply_markup": { "inline_keyboard": [[
{ "text": "Pay 25 USDT", "url": "https://pay.kokiwa.com/p/pi_7Gm4Rk2Wp9Ls1Qv8Bd3Zt6" }
]] }
}'