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.
用 UQPAY Node.js SDK 处理带 PGP 加密的卡交易实时授权决策。
import { generateAuthDecisionKeyPair } from '@uqpay/sdk' const { publicKey, privateKey } = await generateAuthDecisionKeyPair({ name: 'Acme Corp', email: 'issuing.tech@acme.com', })
.asc
.pgp
.gpg
await client.issuing.authDecision.configure({ privateKey: './keys/my-private.asc', uqpayPublicKey: './keys/uqpay-public.asc', passphrase: process.env.PGP_PASSPHRASE, // optional })
createHandler
decide
const handler = client.issuing.authDecision.createHandler({ decide: async (transaction) => { // transaction contains: billing_amount, merchant_name, card_id, etc. if (transaction.billing_amount > 10000) { return { response_code: '51' } // Insufficient Funds } return { response_code: '00', partner_reference_id: 'ref-001' } }, onError: (err) => console.error('Auth decision error:', err), }) app.post('/auth-decision', handler)
transaction_id