Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
用 Node.js SDK 校验并处理 UQPAY 发来的 webhook 事件。
constructEvent
webhookSecret
const client = new UQPayClient({ clientId: 'your-client-id', apiKey: 'your-api-key', webhookSecret: 'whsec_...', })
express.json()
Buffer
import express from 'express' const app = express() app.post('/webhooks', express.raw({ type: 'application/json' }), (req, res) => { let event try { event = client.webhooks.constructEvent(req.body, req.headers) } catch (err) { return res.status(400).send(`Webhook error: ${err.message}`) } switch (event.event_name) { case 'card.create.succeeded': // 处理事件 break } res.json({ received: true }) })
req.body