Help us improve
Share bugs, ideas, or general feedback.
From kryptogo-pay
Implements KryptoGO payment webhook endpoints to handle status notifications (success, expired, insufficient, refunded). Ensures idempotency, order updates; for Express, Flask, FastAPI, NestJS backends.
npx claudepluginhub paid-tw/skills --plugin kryptogo-payHow this skill is triggered — by the user, by Claude, or both
Slash command
/kryptogo-pay:kryptogo-pay-webhookThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
你的任務是在用戶的專案中實作 KryptoGO Payment Webhook 回調處理。
Implements KryptoGO Payment checkout for stablecoin crypto payments using React SDK usePayment hook, Payment Intent creation, Direct API, and webhooks. For React/Next.js, Node.js, Python apps.
Implements 統一金流 (PAYUNi) webhook endpoints with CheckCode signature verification, replay attack prevention, and order status updates for Next.js, Express, or other backends.
Webhook validation patterns with signature verification, event logging, and testing tools. Use when implementing webhooks, validating webhook signatures, securing payment webhooks, testing webhook endpoints, preventing replay attacks, or when user mentions webhook security, Stripe webhooks, signature verification, webhook testing, or event validation.
Share bugs, ideas, or general feedback.
你的任務是在用戶的專案中實作 KryptoGO Payment Webhook 回調處理。
詢問用戶:
框架類型:你使用什麼後端框架?
資料庫:使用什麼資料庫儲存訂單?
用戶輸入: $ARGUMENTS
建立 POST 端點接收 KryptoGO 的回調通知。
端點路徑建議: /api/payment/callback 或 /webhook/kryptogo
必要行為:
payment_intent_id 存在於資料庫status 更新訂單狀態必須處理以下 5 種狀態:
| 狀態 | 處理邏輯 |
|---|---|
pending | 通常不會收到此狀態的回調 |
success | 更新訂單為已付款,記錄 payment_tx_hash |
expired | 標記訂單為過期 |
insufficient_not_refunded | 記錄異常,等待退款 |
insufficient_refunded | 記錄退款資訊 refund_tx_hash、refund_amount |
確保同一個 payment_intent_id 的回調不會被重複處理:
payment_intent_id 作為冪等鍵callback_url){
"payment_intent_id": "0h39QkYfZps7AUD1xQsj3MDFVLIMaGoV",
"client_id": "9c5a79fc1117310f976b53752659b61d",
"fiat_amount": "300.0",
"fiat_currency": "TWD",
"payment_deadline": 1715462400,
"status": "success",
"payment_chain_id": "arb",
"symbol": "USDT",
"crypto_amount": "2.53",
"payment_tx_hash": "0x1234567890abcdef...",
"received_crypto_amount": "2.53",
"aggregated_crypto_amount": "2.50",
"order_data": {
"order_id": "uid_12345",
"item_id": "100"
},
"callback_url": "https://example.com/callback",
"group_key": "buy_stone_with_usdt"
}
| 欄位 | 說明 |
|---|---|
payment_intent_id | 用來比對你資料庫中的訂單 |
status | 判斷該做什麼處理 |
payment_tx_hash | 成功時的區塊鏈交易 Hash |
received_crypto_amount | 實際收到的加密貨幣金額 |
aggregated_crypto_amount | 扣除手續費後的金額 |
refund_tx_hash | 退款時的區塊鏈交易 Hash |
refund_amount | 退款金額 |
order_data | 你建立 Payment Intent 時傳入的自訂資料 |