Logo vun Setup Commercepay

Setup Commercepay

Communautéit
afu-it
setup-commercepay

Set up, build, debug, review, and explain CommercePay (Commerce DotAsia Payments) payment integrations using official CommercePay docs, TokenAuth bearer tokens, Abp-TenantId header, cap-signature HMAC-SHA256 request signing, Direct Integration RequestPayment, Hosted Session Checkout InitialSession, signed host-to-host callbacks, Query Payment, refunds, saved payments and tokenisation, recurring payments, pre-auth ProcessPayment, payouts via bank account or DuitNow Proxy, payout wallets, channel and provider channel codes, and staging/production setup. Use when working with CommercePay Malaysia, FPX B2C/B2B, DuitNow Online Banking, DuitNow QR, cards, Apple Pay, Google Pay, TNG eWallet, GrabPay, ShopeePay, Boost, Alipay, Atome, callback verification, settlement, or production readiness.

Iwwersiicht

Editeurafu-it
Repositorymalaysia-payment-gateway
Skill-Nummsetup-commercepay
Stären
74
Forks
11
Matgeliwwert Fichieren
5
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum afu-it op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Setup Commercepay an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-commercepay
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

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-commercepay .claude/skills/setup-commercepay
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Setup Commercepay an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Setup Commercepay automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Setup Commercepay net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

CommercePay Payment Gateway

Use this skill for CommercePay (payments.commerce.asia) payment gateway integration work.

Source

Read references/commercepay-api.md before giving factual API guidance or writing integration code. It holds environments, auth, headers, the exact cap-signature algorithm with verified test vectors, the endpoint catalogue, request/response field tables, callback verification, status enums, refunds, saved payments, recurring, payouts, wallets, and error codes.

Read references/commercepay-codes.md when you need channelId values, FPX/DuitNow providerChannelId bank codes, payout bank codes, DuitNow Proxy codes, or staging payout test accounts.

Read references/account-setup.md when the user asks how to register, which credentials are issued, back-office location, staging vs production, env var names, recurring/payout enablement, plugins, settlement, or pricing.

Read references/source-map.md to pick the right official page for a topic.

Core Workflow

  1. Identify environment: staging (https://staging-payments.commerce.asia/) or production (https://payments.commerce.asia/).
  2. Identify surface: Direct Integration (merchant renders channels), Hosted Session Checkout (CommercePay page), recurring, saved payment, pre-auth, refund, or payout.
  3. Confirm the four credentials for that environment: Merchant Id, Username, Password, Secret Key.
  4. Call POST /api/TokenAuth/Authenticate (header Abp-TenantId, no signature) and cache the accessToken for up to 24 hours.
  5. Create a local pending payment with your unique referenceCode and expected amount in sen before calling CommercePay.
  6. Sign every other request: lowercase(full URL + recursively key-sorted, minified, null-free camelCase JSON) then HMAC-SHA256 hex with the Secret Key into cap-signature.
  7. Call RequestPayment (Direct) or InitialSession (Hosted) server-side with a callbackUrl; store transactionNumber or sessionNumber.
  8. Send the browser to result.redirectUrl (or run clientScript when redirectionType is 2).
  9. Treat returnUrl as UX only. Verify the callback cap-signature (computed with YOUR callbackUrl as the prefix), answer HTTP 200, then confirm with GET Query.
  10. Settle idempotently when status is 1 (Success) and referenceCode, transactionNumber, amount, currency and environment match.

Core Facts

  • Base URLs: staging https://staging-payments.commerce.asia/, production https://payments.commerce.asia/.
  • Every API call except Authenticate needs Content-Type: application/json, Authorization: Bearer <accessToken>, Abp-TenantId: <MERCHANT_ID>, cap-signature.
  • Token: POST /api/TokenAuth/Authenticate body userNameOrEmailAddress, password; returns accessToken, expireInSeconds 86400.
  • Payment: POST /api/services/app/PaymentGateway/RequestPayment. Hosted session: POST /api/services/app/PaymentGateway/InitialSession.
  • Status: GET /api/services/app/PaymentGateway/Query?TransactionNumber=...&Timestamp=... (or SessionNumber).
  • Refund: POST .../PaymentGateway/RefundPayment; refund status: GET .../PaymentGateway/QueryRefund.
  • Amounts are integers in minor units: 1000 = MYR 10.00.
  • timestamp is Unix epoch milliseconds (new Date().getTime()), required on signed bodies.
  • Responses use an ABP envelope: { result, targetUrl, success, error: { code, message }, unAuthorizedRequest, __abp }.
  • Callback is a POST to callbackUrl with amount, channelId, currencyCode, referenceCode, status, transactionNumber, providerTransactionNumber (+ paymentSessionNumber for sessions), signed in cap-signature.
  • Payment status 0 Pending, 1 Success, 2 Failed, 3 Cancelled, 8 UserCancelled, 9 Authorized, 10 TransactionExpired, 11 Refunded (full table in api reference).
  • No callbackUrl means no callback; you must poll Query Payment.
  • Payout uses the same RequestPayment endpoint with payout channelId (staging 15, production 9) and a funded payout wallet.
  • Channel IDs differ between staging and production (for example TNG is 10 in staging, 7 in production).
  • Signature Validator Tool (staging back office): https://staging-backoffice-payments.commerce.asia/app/paymentgateway/signaturevalidator.

Critical Rules

  • Keep Password, Secret Key and access token server-side only.
  • Do not mark paid from returnUrl, browser query strings, or frontend state.
  • Verify callback cap-signature with constant-time comparison before trusting any field.
  • Sign with raw UTF-8 (no \uXXXX escapes), only JSON-required escaping (+ < > & ' stay literal), Unicode-aware lowercase.
  • Omit null fields at every nesting level before signing; keep empty strings.
  • For GET, sign the URL without the query string plus the query params as sorted JSON, numbers unquoted.
  • Use the Secret Key, channel IDs, and callback URL of the same environment.
  • Pass providerChannelId only when the channel has isProviderHostChannel: true; otherwise omit it.
  • Keep referenceCode unique per payment attempt (max 50) and the callback handler idempotent.
  • Refunds only on Success transactions; omit amount for full refund; reason is required; cross-border refunds are not supported.
  • Recurring (Credit Card, TNG only) and payouts require Business Development approval first.

Completion Criteria

A CommercePay integration is done only when:

  1. Token is fetched server-side, cached, and refreshed on expiry or auth failure.
  2. All signed requests pass in staging (use the Signature Validator Tool when debugging).
  3. RequestPayment or InitialSession runs server-side with callbackUrl, and the returned id is stored before redirect.
  4. Callback handler verifies cap-signature, returns HTTP 200, and requeries Query before settling.
  5. Settlement checks referenceCode, transactionNumber/paymentSessionNumber, amount, currency, status 1, and environment.
  6. Duplicate callbacks, missing callbacks (Query polling fallback), and expired/failed statuses are handled idempotently.
  7. Tests cover invalid signature, null-field and non-ASCII signing, duplicate callback, wrong amount/reference, and status 0, 2, 8, 10.
  8. Deployment docs list COMMERCEPAY_MERCHANT_ID, COMMERCEPAY_USERNAME, COMMERCEPAY_PASSWORD, COMMERCEPAY_SECRET_KEY, COMMERCEPAY_BASE_URL, callback and return URLs per environment.

Loophole Review Loop

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

  1. List trust boundaries: browser return, hosted session page, provider page, backend payment creator, token cache, CommercePay API, callback receiver, database, fulfilment, refund job, payout job, wallet balance, back office.
  2. Check bypasses: forged return URL, forged callback, signature over the wrong URL (request path instead of your callbackUrl), escaped Unicode, nulls left in, unsorted nested keys, staging/production key or channel mix, expired token, reused referenceCode, wrong amount unit, session with several attempts, refund double-submit, payout to unregistered DuitNow proxy.
  3. Add fixes: server-side creation, local pending record first, canonical signing helper with the published test vectors, constant-time compare, strict field matching, Query requery, durable event log, idempotency keys, per-environment config.
  4. Re-read references/commercepay-api.md sections relevant to any gap.
  5. State remaining uncertainty: callback retry schedule, IP allowlist, timestamp tolerance, return URL parameters, and rate limits are not documented in official docs (checked 2026-10-21).

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Setup Commercepay?

Set up, build, debug, review, and explain CommercePay (Commerce DotAsia Payments) payment integrations using official CommercePay docs, TokenAuth bearer tokens, Abp-TenantId header, cap-signature HMAC-SHA256 request signing, Direct Integration RequestPayment, Hosted Session Checkout InitialSession, signed host-to-host callbacks, Query Payment, refunds, saved payments and tokenisation, recurring payments, pre-auth ProcessPayment, payouts via bank account or DuitNow Proxy, payout wallets, channel and provider channel codes, and staging/production setup. Use when working with CommercePay Malay...

Firwat Setup Commercepay op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Setup Commercepay besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Setup Commercepay an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-commercepay an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Setup Commercepay benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Setup Commercepay benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Setup Commercepay domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Setup Commercepay gratis?

De Skill gëtt vum afu-it op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇