Setup Payright logo

Setup Payright

Community
afu-it
setup-payright

Set up, build, debug, review, and explain Payright (Malaysia, payright.my) payment integrations using official Payright docs, the Collection and Bill APIs, FPX bank (payment provider) selection, hosted payment_url redirect, JWT (HS256) encoded callbacks decoded with the Hash Key, Get Bill status requery, optional X-Signature JWT request signing, auth-token header auth, sandbox/live setup, Payout API, payout providers, payout callbacks, and Get Balance. Use when working with Payright Sdn Bhd, payright.my, FPX B2C/B2B online banking, Payright bills, collections, callbacks, payouts, virtual pool balance, or production readiness. Not for Payright Australia (payright.com.au BNPL).

Overview

Publisherafu-it
Repositorymalaysia-payment-gateway
Skill namesetup-payright
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 Payright 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-payright
  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-payright .claude/skills/setup-payright
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Setup Payright 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 Payright 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 Payright 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.

Payright Payment Gateway

Use this skill for Payright (Payright Sdn Bhd, Kuala Lumpur) payment gateway integration work.

Source

Read references/payright-api.md before giving factual API guidance or writing integration code. It contains the endpoint catalogue, base URLs, auth header, Collection and Bill request/response fields, the JWT callback format and decode rules, Get Bill requery, request signing (X-Signature), payout and balance APIs, error codes, payment provider IDs, and documented gaps.

Read references/account-setup.md when the user asks how to register, where the Auth Token and Hash Key live, sandbox vs live, env var names, JWT verification toggle, payment methods, settlement, or pricing.

Read references/source-map.md when choosing which official Payright page applies, or to see which areas are undocumented and which legacy (2022) plugin sources must not be copied.

Core Workflow

  1. Identify environment: sandbox (https://api.payright-sandbox.my/api/v1) or production (https://api.payright.my/api/v1).
  2. Identify surface: Bill API (FPX checkout), Payout API (disbursement), or no-code (Payment Forms, Bills in the portal, plugins).
  3. Confirm dashboard setup: Auth Token, Hash Key, JWT Verification on/off, a Collection (collection_uuid), and active payment services.
  4. Create a local pending payment with your own unique invoice_ref before calling Payright.
  5. Fetch providers with POST /merchant/list-payment-provider and let the payer choose a bank; provider_id is required on the bill.
  6. Create the bill server-side with POST /merchant/bills; store invoice_no, invoice_ref, amount; redirect the payer to payment_url.
  7. Treat redirect_url as browser UX only; nothing in the docs makes it a trusted payment result.
  8. On callback, read the JSON body {"data": "<JWT>", "response_code": ...} and verify the JWT with HS256 and the Hash Key. Reject on any verification failure.
  9. Settle idempotently after invoice_ref, amount, and invoice_status == "SUCCESS" match; then confirm with GET /merchant/bills/{invoice_ref}.
  10. Use Get Bill as the fallback for missing callbacks; the docs only promise callbacks after successful transactions.

Core Facts

  • Production API base: https://api.payright.my/api/v1. Sandbox: https://api.payright-sandbox.my/api/v1.
  • Auth header: auth-token: <AUTH_TOKEN> (docs prose says "Authorization header with value auth-token {token}", but every example and the official Postman collection send a header named auth-token).
  • Auth Token: Accounts > API Keys > View API Keys > Auth Token. Hash Key: Account > API Keys > View API Key > Hash Key.
  • Create Bill: POST /merchant/bills, required collection_uuid, amount (MYR, decimal 10,2), provider_id, callback_url, redirect_url, full_name, email, phone_number; invoice_ref is in the example (your reference, error 425 "Invoice already exists" on reuse).
  • Create Bill returns invoice_no (e.g. Py...rgt), invoice_ref, payment_url.
  • Get Bill: GET /merchant/bills/{invoice_no} or GET /merchant/bills/{invoice_ref}; returns transaction_details.status (e.g. PENDING) and fpx_invoice_no.
  • Callback body is JSON with data (HS256 JWT signed with the Hash Key) and response_code (sample 2100). Decoded fields include invoice_no, invoice_ref, invoice_status (SUCCESS), amount (string "240.00").
  • The callback invoice_no is the FPX invoice number (FPX...), which matches Get Bill fpx_invoice_no, not the Py... bill invoice_no. Match on invoice_ref.
  • Request signing is optional: when JWT Verification is enabled (Account > API Keys > Edit), send x-signature, an HS256 JWT of {auth-token, http_method, url_path, iat, exp} signed with the Hash Key.
  • Amounts are ringgit with two decimals, not sen. MYR only.
  • Response envelope: status (ok/fail), code, data, uuid, message, error. Business errors can arrive with HTTP 200; always check status and code.
  • Payout: POST /merchant/payout, GET /merchant/payout/{invoice_no|external_invoice_ref}, providers via POST /merchant/list-payout-providers, balance via GET /merchant/balance.
  • Duplicate payout guard: error 10149 if amount, account_no and recipient_reference repeat within 3 hours.
  • Sandbox failed bills do not count toward dashboard or settlement totals.

Critical Rules

  • Keep Auth Token and Hash Key server-side only. Never ship them to the browser or a mobile app.
  • Never mark paid from redirect_url or any browser query string.
  • Verify the callback JWT signature (HS256, Hash Key) and pin the algorithm to HS256; never accept alg: none or decode without verifying.
  • Match on invoice_ref (and amount), not on the callback invoice_no, because it is the FPX number.
  • Compare amounts as decimal strings or integer sen; the callback sends "240.00" as a string.
  • Make callback handling idempotent; a late or repeated callback must not double-fulfil.
  • After a verified callback, requery Get Bill when possible and settle from server-side state.
  • Generate a unique invoice_ref per attempt; reusing one returns 425.
  • Do not use the 2022 GitHub plugins (payright.my/api, Bearer auth, HMAC signature field) as a reference for the current API; they target a retired API.
  • Do not confuse Payright Malaysia with Payright Australia (payright-engineering GitHub, BNPL).
  • Verify current payment method activation, settlement schedule and pricing in the portal before claiming production certainty.

Completion Criteria

A Payright integration is done only when:

  1. Bill creation runs server-side with the auth-token header against the correct environment base URL.
  2. A local pending payment with a unique invoice_ref exists before the bill is created, and invoice_no is stored after.
  3. provider_id comes from the live list-payment-provider response for that environment, not a hardcoded table.
  4. The callback handler verifies the data JWT with HS256 and the Hash Key, then matches invoice_ref, amount, and invoice_status.
  5. Settlement is idempotent and confirmed with Get Bill; a scheduled requery covers missing callbacks.
  6. If JWT Verification is enabled in the portal, every request carries a fresh x-signature.
  7. Tests cover a forged or tampered JWT, wrong Hash Key, duplicate callback, wrong amount, unknown invoice_ref, non-SUCCESS status, and a successful payment.
  8. Deployment docs list PAYRIGHT_AUTH_TOKEN, PAYRIGHT_HASH_KEY, PAYRIGHT_COLLECTION_UUID, PAYRIGHT_BASE_URL, callback URL, redirect URL, and sandbox/live separation.

Loophole Review Loop

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

  1. List trust boundaries: browser redirect, bank selection UI, backend bill creator, Payright API, callback receiver, JWT verifier, database, fulfilment job, payout job, portal settings.
  2. Check bypasses: fake redirect success, forged callback JWT, unverified decode, alg confusion, wrong Hash Key, sandbox/live mix, matching on FPX invoice_no instead of invoice_ref, wrong amount, reused invoice_ref, stale Get Bill, duplicate callback, missing callback for failed payments, HTTP 200 with status: fail, expired x-signature, duplicate payout within 3 hours, insufficient payout pool.
  3. Add fixes: server-side bill creation, local pending payment first, HS256-pinned JWT verification, strict invoice_ref/amount/status checks, durable callback log, idempotency keys, separate environment config, Get Bill requery job, short-lived x-signature.
  4. Re-read references/payright-api.md sections relevant to any gap.
  5. State remaining uncertainty where the docs are silent: refunds, status enum beyond PENDING/SUCCESS, callback retries, redirect parameters, rate limits, IP allowlists, and callback exp/iat.

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 Payright AI skill do?

Set up, build, debug, review, and explain Payright (Malaysia, payright.my) payment integrations using official Payright docs, the Collection and Bill APIs, FPX bank (payment provider) selection, hosted payment_url redirect, JWT (HS256) encoded callbacks decoded with the Hash Key, Get Bill status requery, optional X-Signature JWT request signing, auth-token header auth, sandbox/live setup, Payout API, payout providers, payout callbacks, and Get Balance. Use when working with Payright Sdn Bhd, payright.my, FPX B2C/B2B online banking, Payright bills, collections, callbacks, payouts, virtual po...

Why use Setup Payright on TypingMind?

Because you install it once and use it with any model. Setup Payright 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 Payright in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-payright. 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 Payright?

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 Payright?

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

Is the Setup Payright 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 👇