aba-payway-purchase
Create a signed ABA PayWay checkout purchase with aba-payway-ts.
Skill by Ruzaid-aman
Chalk Labs
Need help deploying aba-payway-purchase?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ruzaid-aman-aba-payway-purchase
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/aba-payway-purchase
What's inside
- Skill name
aba-payway-purchase- Description
- Create a signed ABA PayWay checkout purchase with aba-payway-ts.
- License
- MIT
- Metadata
- version: 1.4.1
- Instructions
- 123 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- files: referenced but missing: scripts/checkout-link-poll.ts, scripts/checkout-cards-close.ts, scripts/close-transaction-verify.ts
Files (1)
- SKILL.md
SKILL.md (first lines)
# ABA PayWay Purchase
## Quick Start
For onboarding, start with [first payment](../aba-payway-first-payment/SKILL.md).
Use the shared lifecycle: `created`, `pending`, `approved`, `failed`, `unknown`.
Creation is not approval. Verify order ID, amount, and currency before fulfilling once.
A timeout means unknown; query the existing attempt before replacing it.
Expiry and closure remain local policy, even when the gateway reads PENDING.
See [webhook production](../aba-payway-webhook-production/SKILL.md) for callback trust and recovery.
Run the installed CLI as `npm exec -- payway-sdk`.
```ts
import { PayWay } from 'aba-payway-ts';
const payway = new PayWay();
const payload = payway.checkout.createTransaction({ transactionId: 'order-123', amount: 10, currency: 'USD' });
```
Post the returned signed payload from your server-rendered checkout form. Keep API credentials server-side.
## Default checkout presentation
Follow the installed public guides `integration-ui` and `ui-customization` (`npm exec -- payway-sdk docs <topic>`). Show **Select payment method** with all profile-enabled methods and current official assets; KHQR must read **ABA KHQR** / **Scan to pay with any banking app**. Above Pay, link Terms & Conditions / Refund Policy and require the acceptance checkbox before any frontend submission. For the expected web popup use `checkout2-0.js` and `AbaPayway.checkout()`; `viewType` alone is insufficient. Mobile app WebViews use full-screen hosted checkout, a static merchant header and no browser toolbar; ordinary browsers own their address bars.
Configure `continueSuccessUrl` for the customer web return or `returnDeeplink` for the app. Purchase `returnUrl` is the notification destination. Clear purchased cart contents, update the order and show merchant confirmation only after verified backend acceptance, with fulfillment tracked separately. Obtain Integration Team review of checkout/KHQR screens before production credentials. Request current approved logo files; design examples do not enable methods or authorize redistributing assets.
> **Local vs. network:** `createTransaction()` (and `createCheckoutPayload()`) only **builds a LOCAL signed payload** — it performs no network request. By contrast, `purchase()` (and the agentic `create_checkout_purchase` tool) performs the actual **NETWORK request** to PayWay. Use the local builder when you want to render your own checkout form; use `purchase()` when you want the SDK to submit the payment.
## Two hosted routes — pick the shape you need
There is **no single `checkout_qr_url` default**. The 200 response body depends on the request shape (sandbox-verified 2026-08-25, §10b/W2-1):
| Route | Request | Response |
|---|---|---|
| **A: hosted URL (JSON)** | `paymentOption: 'abapay_khqr_deeplink'` + `viewType: 'hosted_view'` + `paymentGate: 0` | `PurchaseQrResponse` JSON that **includes `checkout_qr_url`** (plus `qr_string`/`abapay_deeplink`) |
| **B: hosted HTML page** | any option + `paymentGate: 0` **without** the deeplink+hosted_view combo (e.g. `cards`) | full hosted "PayWay - Checkout" HTML page as the BODY — no URL field; use `purchaseHosted()` for the typed result |
Route A — hosted URL, typed, no casts (SDK ≥ 1.5.0):
```ts
const res = await payway.checkout.purchase({
transactionId: 'order-123', amount: 12.12, currency: 'USD',
paymentOption: 'abapay_khqr_deeplink', viewType: 'hosted_view', paymentGate: 0,
lifetime: 600, // MINUTES (min 3, max 43200) — 600 = a 10-hour window, NOT 10 minutes!
});
if ('qr_string' in res) { // narrows to PurchaseQrResponse (Route A)
const url = res.checkout_qr_url; // string | undefined — hosted page, open in browser/app
}
```
Route B — hosted HTML, typed:
```ts
const page = await payway.checkout.purchaseHosted({
transactionId: 'order-123', amount: 15, currency: 'USD', paymentOption: 'cards',
returnUrl: 'https://merchant.com/api/payway/callback',
continueSuccessUrl: 'https://merchant.com/orders/result',
}); // PurchaseHostedHtmlResult { hosted_checkout: true, content_type, html }
res.type(page.content_type).send(page.html); // Express — but see the CORS warning below
```
> ⚠️ **`lifetime` on the purchase/checkout path is MINUTES** (minimum 3 — the SDK
> throws below 3; the gateway would answer error 69). Only the **QR domain's**
> `lifetime` is seconds. A copied `lifetime: 600` "seconds" habit silently buys a
> 10-hour checkout window. On the CLI, prefer the explicit-units flag
> `--lifetime-minutes` (`--lifetime` remains a deprecated minutes alias).
> ⚠️ **Serving Route B's captured HTML from your own origin is NOT supported**:
> the page references relative `/_nuxt/*` assets and breaks with CORS/file-origin
> errors outside the gateway origin. For a browser-hosted flow, POST the signed
> form directly to the gateway (Route C below) instead of re-serving gateway HTML.
## CLI flag set (generate-checkout)
`generate-checkout` forwards the full purchase param surface:
`--ctid --token-flag --frequency --type --firstname --lastname --email --phone --items --shipping --lifetime-minutes <minutes> --custom-fields --return-params --skip-success-page --view-type --continue-success-url --payout --additional-params --google-pay-token --return-deeplink --payment-gate <0|1> --payment-option`.
- `--payout` is JSON `[{acc, amt}]` or string (purchase-path keys — NOT the standalone payout domain's `{account, amount}`).
- `--additional-params` is a object or string; `--return-deeplink` is JSON `{ios_scheme, android_scheme}` or string (both base64-encoded before hashing).
- `--google-pay-token` is required by the gateway when `--payment-option google_pay` (the SDK throws without it).
- `--payment-gate 0` returns the hosted HTML page in the response (Route B); the CLI prints/records it as an artifact rather than a URL. For browser navigation use `checkout-form --payment-gate 0`, which renders the local signed form that POSTs directly to the gateway.
### Card-payment response matrix (`paymentOption: 'cards'`, sandbox-verified 2026-08-25)
| Request | Response |
|---|---|
| `cards` (no gate, or gate 1) via `purchase()` | JSON PurchaseQrResponse — but with **KHQR data** (qr_string/abapay_deeplink), no checkout URL |
| `cards` + `paymentGate: 0` via `purchase()`/`purchaseHosted()` | the hosted card-checkout page as **HTML** (`PurchaseHostedHtmlResult`) — transaction IS created, but you cannot re-serve that HTML from your own origin (relative `/_nuxt/*` assets → CORS/file-origin errors) |
**Correct card integration (official):** build the signed payload LOCALLY with `checkout.createTransaction({ paymentOption: 'cards', ... })`, embed all fields as hidden inputs in a `<form method="POST" target="aba_webservice" action="…/v1/payments/purchase">`, load `<script src="https://checkout.payway.com.kh/plugins/checkout2-0.js" defer></script>`, and call `AbaPayway.checkout()` on submit — PayWay's HTML renders in a modal (iframe POST, no CORS). The SDK's `getCheckoutFormHtml()` / CLI `checkout-form` build exactly this form. Docs: https://developer.payway.com.kh/ecommerce-checkout-3158159f0
## Error Handling
```ts
import { PayWayConfigError } from 'aba-payway-ts';
try { payway.checkout.createTransaction({ transactionId: 'order-123', amount: 10 }); }
catch (error) { if (error instanceof PayWayConfigError) console.error(error.message); }
```
## Tools
The purchase flow needs no bundled scripts — the CLI covers the whole lifecycle:
```sh
# Create + auto-poll a checkout (lifetime in MINUTES):
payway-sdk generate-checkout -a 12.12 -c USD --return-url https://example.com/r --lifetime-minutes 5 -y
# Hosted checkout URL (checkout_qr_url) — Route A (deeplink + hosted_view + gate 0):
# payway.checkout.purchase({ ..., paymentOption: 'abapay_khqr_deeplink', viewType: 'hosted_view', paymentGate: 0 })
# Hosted HTML page — Route B, or local browser form:
# payway.checkout.purchaseHosted({ ... }) | payway-sdk checkout-form -a 10 -o form.html
# Card integration — local form (official pattern, no API call):
payway-sdk checkout-form -a 10 -o form.html
# Close an unpaid transaction, then verify:
payway-sdk close-transaction -t <txId> -y && payway-sdk check-transaction -t <txId>
```
> Repo-clone note: `scripts/checkout-link-poll.ts`, `scripts/checkout-cards-close.ts`,
> and `scripts/close-transaction-verify.ts` exist in the SDK repository's `scripts/`
> directory (development probes, not shipped in the npm package) — the CLI commands
> above are the supported equivalents.
## Related SkillsFrom Ruzaid-aman/ABA-Payway-SDK-unofficial, MIT.
More from Ruzaid-aman/ABA-Payway-SDK-unofficial
- 0.570score
aba-payway-integration
Ruzaid-aman
Explain how to use this skill, select a PayWay flow, or integrate, test, review and troubleshoot ABA PayWay in a merchant project.
SkillAFreshness: AClaude Code +9 - 0.567score
aba-payway-customer-qr
Ruzaid-aman
Handle Merchant Portal Customer Module static QRs (Printed QR channel) — decoded payload anatomy, callback handling, and reconciliation via…
SkillAFreshness: AClaude Code +9 - 0.565score
aba-payway-agent
Ruzaid-aman
Use when operating the agentic PayWay CLI with provider modes, the 14 tools (incl.
SkillAFreshness: AClaude Code +9 - 0.565score
aba-payway-knowledge-base
Ruzaid-aman
Use when you need PayWay integration guidance offline — the built-in knowledge base of integration and support topics (setup…
SkillAFreshness: AClaude Code +9 - 0.564score
aba-payway-first-payment
Ruzaid-aman
Start an ABA PayWay payment, choose QR or hosted checkout or payment link, verify it, and fulfill once.
SkillAFreshness: AClaude Code +9 - 0.564score
aba-payway-hash
Ruzaid-aman
Verify ABA PayWay webhook signatures with timing-safe HMAC verification.
SkillAFreshness: AClaude Code +9 - 0.558score
aba-payway-journal
Ruzaid-aman
Query the local ABA PayWay transaction journal — timelines, stats, reconciliation, anomalies, and RCA for AI agents.
SkillAFreshness: AClaude Code +9 - 0.551score
aba-payway-qr
Ruzaid-aman
Generate an online ABA PayWay KHQR payment QR code.
SkillAFreshness: AClaude Code +9 - 0.521score
aba-payway-bulk-operations
Ruzaid-aman
Run one transaction operation (close, check, detail) across many ABA PayWay transaction IDs with per-item results, rate-limit pacing, and evidence reports.
SkillBFreshness: BClaude Code +9 - 0.521score
aba-payway-beneficiary
Ruzaid-aman
Manage the ABA PayWay payout beneficiary whitelist — add payees, update status, and test with seeded sandbox beneficiaries.
SkillBFreshness: BClaude Code +9 - 0.518score
aba-payway-offline-qr
Ruzaid-aman
Generate an offline EMVCo KHQR payload without calling ABA PayWay APIs.
SkillBFreshness: BClaude Code +9 - 0.518score
aba-payway-payout
Ruzaid-aman
Make an ABA PayWay payout / split-payout and manage payout beneficiaries (whitelist, currency matching, error codes).
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 2, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.4.1
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Ruzaid-aman
- 0.570score
aba-payway-integration
Ruzaid-aman
Explain how to use this skill, select a PayWay flow, or integrate, test, review and troubleshoot ABA PayWay in a merchant project.
SkillAFreshness: AClaude Code +9 - 0.567score
aba-payway-customer-qr
Ruzaid-aman
Handle Merchant Portal Customer Module static QRs (Printed QR channel) — decoded payload anatomy, callback handling, and reconciliation via…
SkillAFreshness: AClaude Code +9 - 0.565score
aba-payway-knowledge-base
Ruzaid-aman
Use when you need PayWay integration guidance offline — the built-in knowledge base of integration and support topics (setup…
SkillAFreshness: AClaude Code +9 - 0.565score
aba-payway-agent
Ruzaid-aman
Use when operating the agentic PayWay CLI with provider modes, the 14 tools (incl.
SkillAFreshness: AClaude Code +9 - 0.564score
aba-payway-first-payment
Ruzaid-aman
Start an ABA PayWay payment, choose QR or hosted checkout or payment link, verify it, and fulfill once.
SkillAFreshness: AClaude Code +9 - 0.564score
aba-payway-hash
Ruzaid-aman
Verify ABA PayWay webhook signatures with timing-safe HMAC verification.
SkillAFreshness: AClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get aba-payway-purchase running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
aba-payway-purchase skill. Agent Mart. https://agentmart.dev/skills/ruzaid-aman-aba-payway-purchase (last updated 2026-10-24)