Logo von Setup Betterpay

Setup Betterpay

Community
afu-it
setup-betterpay

Set up, build, debug, review, and explain Betterpay (formerly QlicknPay, Pay Direct Technology) payment integrations using official Betterpay docs, Postman collections and the WooCommerce plugin source, covering PRO and LITE accounts, Standard and Direct Payment, MD5 and HMAC-SHA256 hashing, callbacks, requery, FPX and DuitNow QR refunds, settlement reports, payment links, invoices, e-Mandate and card recurring, OCBC collection, card tokenization and pre-authorization. Use when working with Betterpay or QlicknPay Malaysia, FPX, DuitNow QR, cards, e-wallets, BNPL, IPP, callback verification, sandbox setup, or production readiness.

Übersicht

Herausgeberafu-it
Repositorymalaysia-payment-gateway
Skill-Namesetup-betterpay
Sterne
74
Forks
11
Mitgelieferte Dateien
7
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • 7 mitgelieferte Dateien

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von afu-it auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Setup Betterpay in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-betterpay
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

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-betterpay .claude/skills/setup-betterpay
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Setup Betterpay in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Setup Betterpay automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Setup Betterpay nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Betterpay Payment Gateway

Use this skill for Betterpay payment gateway integration work.

Source

Read references/betterpay-api.md before giving factual API guidance or writing integration code. It covers:

  • PRO vs LITE, environments and hosts, auth
  • Both hash algorithms, the endpoint catalogue
  • Standard and Direct Payment fields, callbacks, requery
  • Refunds, reports, payment links, invoices
  • Rate limit, sandbox data, errors

Read references/betterpay-recurring.md for e-Mandate direct debit, OCBC collection batches or LITE card recurring.

Read references/betterpay-tokenization.md for card tokens, token charge, batch charge, token pre-auth or Card Pre-authorization (MPGS).

Read references/betterpay-codes.md for any status, error, bank, channel or enum value.

Read references/account-setup.md for registration, where keys live, API Management settings, sandbox vs live, env vars, method activation, plugins or settlement.

Read references/source-map.md to pick the right official docs anchor or Postman collection.

Core Workflow

  1. Identify the product from the merchant ID: an R prefix (e.g. R1001) is LITE (HMAC-SHA256); numeric (e.g. 10001) is PRO (MD5).
  2. Identify the environment: sandbox https://www.demo.betterpay.me, or production. Confirm the production paths in the logged-in docs.
  3. Identify the surface: Standard Payment (hosted checkout), Direct Payment (bank/e-wallet/card/DuitNow QR), payment link, bill, invoice, recurring, token, pre-auth or plugin.
  4. Configure API Management: callback URL, Whitelist Domain (it must match the callback_url_be host), and return URLs.
  5. Create a local pending order with a unique invoice (max 14 chars, no & ' -) and the amount in ringgit with 2 decimals.
  6. Build the request and hash server-side with the endpoint's exact field order (PRO) or the sorted-values rule (LITE).
  7. Send the browser via form POST (Standard) or redirect to payment_url (Direct with respond=1).
  8. Treat callback_url_fe_succ / callback_url_fe_fail as UX only.
  9. On the callback_url_be POST:
    1. Verify the hash.
    2. Check invoice, amount and txn_status.
    3. Settle idempotently.
    4. Reply with plain OK.
  10. Requery (Get Payment Status) when no callback arrives or the status is pending.

Core Facts

  • Betterpay is the QlicknPay stack renamed. The docs say Betterpay.me and qnp.com hosts are both valid. The docs still say QlicknPay in many places.
  • Docs: https://www.betterpay.me/docs/ (one page, endpoints behind login). Sandbox paths are in https://github.com/betterpayme/POSTMAN-APIs.
  • PRO production host per the official WP plugin: https://www.betterpay.me. LITE plugin checkout: https://lite.betterpay.me/api/merchant/v1/checkout.
  • Auth: merchant_id + hash in the body. The API key only signs. HTTPS only. Every request is hashed.
  • PRO Standard hash: md5(api|merchant_id|invoice|amount|payment_desc|currency).
  • PRO callback check: md5(api . trx_id . invoice_no . txn_status . msg) with no separators. trx_id is fpx_fpxTxnId, paypal_trx_id, mastercard_trx_id or others_trx_id.
  • Some PRO calls put merchant_id before the API key: requery, refunds, refund status.
  • LITE hash: sort all sent fields except hash by name, concatenate the values, remove spaces, then hash_hmac('sha256', s, API_KEY). Verify the callback the same way over the received fields.
  • Status codes:
    • PRO: 00 approved, 09 pending, 99 pending authorization (B2B).
    • LITE: 00 success, 11 failed, 22 pending, failed cancelled.
  • Amount limits: RM1.50 minimum and under RM30,000 (B2C). Amounts are strings with 2 decimals.
  • Callback retry: Betterpay resends at most 3 times every 10 minutes until it gets OK.
  • Rate limit: GET endpoints share 100 requests per 5 minutes per IP or account. Over the limit gives HTTP 429 {"response":"99",...}.
  • FPX refund API: only with your own FPX seller ID, max 10 per request, within 5 days. DuitNow QR refunds have their own endpoint.

Critical Rules

  • Keep the API key server-side. Never put it in the browser form. Compute the hash on the server.
  • Never mix PRO and LITE hashing or endpoints. Never mix sandbox and live keys.
  • Use the exact per-endpoint field order from the reference tables. Never guess an order.
  • Hash the plain values exactly as sent (the PHP samples urldecode each value). Send amounts as strings.
  • Never fulfil from the return URL or a client-side message. Fulfil only from a hash-verified backend callback or a requery.
  • Compare hashes in constant time. Then check that the invoice exists, the amount and currency match, and txn_status is the success code.
  • Make the callback handler idempotent and always reply plain OK once the callback is stored. Retries and duplicates happen.
  • Keep callback_url_be on the Whitelist Domain host, or the payment is rejected ("Invalid URL variable specified").
  • Each invoice must be unique per transaction. Retrying with the same invoice fails.
  • Treat endpoints marked "Not published" and the doc/Postman conflicts in the references as unconfirmed. Test in sandbox and confirm with support.

Completion Criteria

A Betterpay integration is done only when:

  1. The product (PRO/LITE), environment, host, merchant ID and API key come from config, never hardcoded.
  2. Payment creation and hashing run server-side with the documented field order (PRO) or sort rule (LITE).
  3. API Management has the callback URL, Whitelist Domain and return URLs for the right environment.
  4. The callback handler:
    1. verifies the hash over the documented input,
    2. checks invoice, amount, currency and txn_status,
    3. settles once,
    4. replies OK.
  5. Pending results (09, 99, 22) and missing callbacks are resolved by Get Payment Status, idempotently.
  6. Tests cover a bad hash, a replayed callback, a wrong amount, an unknown invoice, a failed/cancelled status, a pending status and a successful payment.
  7. Deployment docs list BETTERPAY_PRODUCT, BETTERPAY_ENV, BETTERPAY_BASE_URL, BETTERPAY_MERCHANT_ID, BETTERPAY_API_KEY and the callback/return URLs, with sandbox and live kept apart.

Loophole Review Loop

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

  1. List trust boundaries: browser form POST, hosted checkout, bank/e-wallet page, return URLs, backend creator, Betterpay API, callback receiver, database, fulfilment, refund job, API Management settings, plugin.
  2. Check bypasses:
    • fake return redirect, forged callback, hash built from parsed or re-encoded values
    • wrong field order, PRO/LITE mix, sandbox/live key mix
    • wrong amount or invoice, reused invoice
    • pending treated as paid, duplicate callback
    • missing OK causing retries, callback host not whitelisted
    • stale requery, refund replay, failed (cancel) treated as error-free
  3. Add fixes:
    • server-side hashing, local pending order first
    • constant-time compare, strict amount/invoice/status checks
    • durable callback log, idempotent settlement
    • separate env config, requery fallback, sandbox tests for every unconfirmed formula
  4. Re-read the relevant section of references/betterpay-api.md (or the recurring/tokenization/codes file) for any gap.
  5. State remaining uncertainty: production endpoint paths (behind login), LITE callback field set, LITE payment link hash conflict, plan-to-product mapping, enabled channels, refund eligibility, settlement timing.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Setup Betterpay?

Set up, build, debug, review, and explain Betterpay (formerly QlicknPay, Pay Direct Technology) payment integrations using official Betterpay docs, Postman collections and the WooCommerce plugin source, covering PRO and LITE accounts, Standard and Direct Payment, MD5 and HMAC-SHA256 hashing, callbacks, requery, FPX and DuitNow QR refunds, settlement reports, payment links, invoices, e-Mandate and card recurring, OCBC collection, card tokenization and pre-authorization. Use when working with Betterpay or QlicknPay Malaysia, FPX, DuitNow QR, cards, e-wallets, BNPL, IPP, callback verification,...

Warum Setup Betterpay in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Setup Betterpay besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Setup Betterpay in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-betterpay ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Setup Betterpay nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Setup Betterpay verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Setup Betterpay damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Setup Betterpay kostenlos?

Der Skill wird von afu-it auf GitHub veröffentlicht. Die Lizenzbedingungen finden Sie im Repository. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇