aba-payway
10
总安装量
9
周安装量
#29622
全站排名
安装命令
npx skills add https://github.com/lowintechie/skills --skill aba-payway
Agent 安装分布
opencode
9
gemini-cli
9
github-copilot
9
codex
9
kimi-cli
9
amp
9
Skill 文档
ABA PayWay
Implement and troubleshoot ABA PayWay checkout flows across frameworks, using Next.js as the primary profile in this version.
Quick Workflow
- Confirm server configuration and runtime.
- Build or verify purchase payload fields in the exact PayWay hash order.
- Sign payload server-side only.
- Open checkout from the hidden form after script readiness.
- Verify callback parsing and logging behavior.
Framework Profiles (Next.js First)
- Next.js (primary profile): implement signing and callback routes with App Router route handlers.
- React SPA / Vue SPA: implement a separate backend endpoint for signing and callback handling, then call it from the client.
- Nuxt: implement signing and callback handlers with Nuxt server routes.
- Any framework: keep identical unsigned fields, field order, and hash algorithm.
Implement Server Checkout Endpoint
- Keep checkout signing in a server endpoint running in a Node-compatible runtime.
- Validate
amountearly and return400for invalid input. - Resolve required env vars:
ABA_PAYWAY_API_KEY,ABA_PAYWAY_MERCHANT_ID,ABA_PAYWAY_API_URL. - Build unsigned fields using normalized values from user payload.
- Build hash input in canonical field order and sign with
HMAC-SHA512plus base64. - Return
{ apiUrl, formFields }to the client for hidden-form submission.
Use canonical field order from .agents/skills/aba-payway/references/integration.md.
Implement Client Checkout UI
- Load jQuery before the PayWay checkout script.
- Ensure only one checkout form instance exists on the page (fixed PayWay ids).
- POST checkout data to your server checkout endpoint (for example,
/api/payway/checkout). - Fill hidden input fields from
formFields. - Call
AbaPayway.checkout()only after script readiness. - Surface user-facing errors when script load or payload prep fails.
Implement Callback Endpoint
- Accept both
application/jsonandapplication/x-www-form-urlencodedpayloads. - Support both
POSTandGETcallback shapes. - Keep logging guarded by
PAYWAY_DEBUG_LOGso production logs stay clean. - Replace temporary
{ ok: true }response with domain-specific reconciliation once available.
Debugging
Use the hash debugger when signatures mismatch:
node .agents/skills/aba-payway/scripts/payway-purchase-hash-debug.js \
--payload /absolute/path/to/purchase-fields.json
The script prints hashInput and hash so you can compare with server route output.
References
- Integration details and field map:
.agents/skills/aba-payway/references/integration.md - Framework adaptation notes:
.agents/skills/aba-payway/references/framework-profiles.md - Next.js checkout route example:
src/app/api/payway/checkout/route.ts - Next.js callback route example:
src/app/api/payway/callback/route.ts - Next.js client component example:
src/components/payway/payway.tsx