Setup Paycools logo

Setup Paycools

Community
afu-it
setup-paycools

Set up, build, debug, review, and explain PayCools payment integrations using official PayCools Malaysia Open API docs, WebPay hosted checkout, DuitNow dynamic QR, payment notifications, RSA SHA256withRSA signatures over the param string, appId and RSA key exchange, order status requery, refunds, refund notifications, payouts/disbursement, account validation, balance inquiry, channel codes, and response codes. Use when working with PayCools (Micro Bluetech Sdn Bhd), FPX, DuitNow QR, DuitNow RPP online banking, Touch 'n Go, Boost, GrabPay, MCash, cards, payouts to Malaysian banks or e-wallets, callback verification, idempotent settlement, or production readiness.

Overview

Publisherafu-it
Repositorymalaysia-payment-gateway
Skill namesetup-paycools
Stars
74
Forks
11
Bundled files
4
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by afu-it on GitHub. Read the source before you install it.

Installation

Install the Setup Paycools AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-paycools
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/afu-it/malaysia-payment-gateway.git /tmp/malaysia-payment-gateway
mkdir -p .claude/skills
cp -r /tmp/malaysia-payment-gateway/setup-paycools .claude/skills/setup-paycools
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Setup Paycools in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Setup Paycools on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Setup Paycools is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

PayCools Payment Gateway

Use this skill for PayCools (Malaysia) Open API integration work.

Source

Read references/paycools-api.md before giving factual API guidance or writing integration code. It contains the endpoint catalogue, the request envelope, the RSA signature method (verified against the docs' own example), every request/response/notification field table, channel codes, status enums, response codes, and documented gaps and inconsistencies.

Read references/account-setup.md when the user asks how to become a merchant, what credentials exist, how the RSA key exchange works, env var names, sandbox/UAT, channel activation, pricing, or settlement.

Read references/source-map.md when choosing which official PayCools docs page applies, or to check coverage.

Core Workflow

  1. Get from PayCools: appId, the API base URL (not published in the docs), UAT/sandbox details if any, and the PayCools platform RSA public key.
  2. Generate a 4096-bit RSA key pair; send the public key to PayCools; keep the private key server-side.
  3. Create a local pending payment with a unique alphanumeric mchOrderId (max 32) and the expected amount in cents.
  4. Build the business param object, serialize it to a JSON string once, sign that exact string with SHA256withRSA, and POST {appId, sign, param} as JSON.
  5. WebPay: call POST /open-api/webpay/generate with a channelCode, redirect the customer to data.payUrl. DuitNow QR: call POST /open-api/qr/generate and render data.qrCodeContent.
  6. Treat redirectUrl as browser UX only.
  7. On the merchant notifyUrl, verify sign over the received param string with the PayCools public key before parsing param.
  8. Settle idempotently only when transactionStatus is COMPLETED and mchOrderId, transactionId, amount, and channelCode match the local record. Reply {"code":10000,"message":"Success"}.
  9. Requery with POST /open-api/webpay/detail or POST /open-api/qr/detail when a notification is missing or the order is still pending.
  10. Refunds use POST /open-api/payment/refund with the PayCools originalTransactionId; settle refunds from the verified refund notification or POST /open-api/refund/payments.

Core Facts

  • Every merchant-to-PayCools call is POST, Content-Type: application/json, body {"appId","sign","param"}.
  • param is a JSON-serialized string; sign is Base64 of SHA256withRSA (RSASSA-PKCS1-v1_5) over the exact param bytes, signed with the merchant private key (PKCS#8).
  • PayCools-to-merchant notifications are {"sign","param"}, signed with the PayCools private key; verify with the PayCools public key (X.509 SubjectPublicKeyInfo), which the merchant must request from PayCools.
  • RSA key length must be 4096.
  • Response envelope: {code, message, data}; 10000 means success. Codes 21000 to 21016 are errors (sign, param, appId, duplicate order id, timestamp, IP forbidden, and others).
  • Amounts are integers in cents (sen) for WebPay, QR, refund, and payout.
  • Every param carries timestamp (current time, documented as milliseconds on several pages).
  • WebPay create requires timestamp, channelCode, mchOrderId, amount, notifyUrl, redirectUrl, customerName, email, mobile; optional remark, expireSeconds (30 to 3600, default 3600).
  • Transaction status values: PENDING, COMPLETED, FAILED.
  • WebPay notification events: order.payment.success, order.payment.failed. QR events: qrcode.payment.success, qrcode.payment.failed.
  • Refund status enum: PENDING, PROCESS, COMPLETED, FAILED, CANCELLED (examples also show COMPLETE). Transaction fees are not returned on refunds.
  • WebPay channel codes include FPX_*_URL, RPP_*_URL, TOUCHNGO_URL, BOOST_URL, GRPY_URL, MCASH_URL, CARD_URL. QR channel: DUITNOW_DYNAMIC_QR.
  • API base URL, sandbox host, callback retry policy, and PayCools egress IPs are not documented publicly (checked 2026-10-21).

Critical Rules

  • Keep the merchant RSA private key server-side only. Never use the example key pair printed in the docs.
  • Sign the exact string you send as param; do not re-serialize after signing.
  • Verify notifications over the param string value as received (after decoding the outer JSON), never over a re-serialized object.
  • Use a constant-time-safe library verify call; reject on any verify failure or missing sign.
  • Do not mark paid from redirectUrl, payUrl creation, QR display, or a PENDING status.
  • Check amount (cents), mchOrderId, transactionId, and channelCode against the local record before settling.
  • Make notification handling idempotent; duplicate or late notifications must not double-fulfil.
  • mchOrderId must be unique (21007 on duplicate); payouts also need a unique idempotencyId (21015).
  • Send notifyUrl in WebPay create (the docs' example shows callbackUrl; the field table says notifyUrl). Confirm with PayCools.
  • Expect IP restrictions (21016 Merchant ip forbidden); ask PayCools to allowlist your server egress IPs.
  • Confirm base URL, UAT environment, enabled channels, and pricing with PayCools before claiming production readiness.

Completion Criteria

A PayCools integration is done only when:

  1. All Open API calls run server-side with appId and a SHA256withRSA signature over the exact param string.
  2. The local payment record exists before WebPay or QR creation and stores mchOrderId, transactionId, amount in cents, and channelCode.
  3. Redirect returns only show status; fulfilment waits for a verified notification or a requery showing COMPLETED.
  4. The notification handler verifies sign with the PayCools public key, parses param after verification, settles idempotently, and replies {"code":10000,"message":"Success"}.
  5. Requery via the detail endpoint covers missing notifications and pending orders.
  6. Tests cover invalid signature, tampered param, duplicate notification, wrong amount, wrong mchOrderId, FAILED, expired order, and successful COMPLETED.
  7. Deployment docs list PAYCOOLS_APP_ID, PAYCOOLS_PRIVATE_KEY, PAYCOOLS_PLATFORM_PUBLIC_KEY, PAYCOOLS_API_BASE_URL, the notify URL, redirect URL, and UAT/live separation.

Loophole Review Loop

When asked whether a PayCools strategy is "100% confident", run this loop until no factual gaps remain:

  1. List trust boundaries: browser redirect, payUrl page, QR display, backend order creator, PayCools API, notification receiver, JSON parser, database, fulfilment job, refund job, payout job, and key storage.
  2. Check bypasses: fake redirect, forged notification, signature checked over re-serialized JSON, wrong public key (merchant key instead of PayCools key), UAT/live key mix, wrong amount unit (ringgit vs cents), reused mchOrderId, stale PENDING requery, duplicate notification, refund status COMPLETE vs COMPLETED mismatch, timestamp unit mismatch, IP not allowlisted, and duplicate payout without idempotencyId.
  3. Add fixes: server-side signing, local pending record first, verify-then-parse, strict amount/order/channel checks, durable event log, unique constraints, separate env config, requery fallback, and tolerant refund status mapping.
  4. Re-read references/paycools-api.md sections relevant to any gap.
  5. State remaining uncertainty where it depends on undocumented items: base URL, UAT host, retry policy, notification source IPs, timestamp unit, and channel activation for the merchant account.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Setup Paycools AI skill do?

Set up, build, debug, review, and explain PayCools payment integrations using official PayCools Malaysia Open API docs, WebPay hosted checkout, DuitNow dynamic QR, payment notifications, RSA SHA256withRSA signatures over the param string, appId and RSA key exchange, order status requery, refunds, refund notifications, payouts/disbursement, account validation, balance inquiry, channel codes, and response codes. Use when working with PayCools (Micro Bluetech Sdn Bhd), FPX, DuitNow QR, DuitNow RPP online banking, Touch 'n Go, Boost, GrabPay, MCash, cards, payouts to Malaysian banks or e-wallet...

Why use Setup Paycools on TypingMind?

Because you install it once and use it with any model. Setup Paycools is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Setup Paycools in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-paycools. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Setup Paycools?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Setup Paycools?

As many as you like. As long as a model supports skills, you can use Setup Paycools with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Setup Paycools AI skill free?

It is published on GitHub by afu-it. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇