Setup Tulusのロゴ

Setup Tulus

コミュニティ
afu-it
setup-tulus

Set up, build, debug, review, and explain Tulus (also branded SnapNPay) payment integrations using official Tulus Developer Portal docs, the Tulus PHP SDK, the Laravel handoff, /v2/checkout signed order POST, hosted pay URLs, HMAC-SHA256 truncated signatures with the UUID API key as 16 raw bytes, direct (signed) and indirect (browser) callbacks to returnUrl, fpx_debit_auth_code mapping, Report API reconciliation on reports.tulus.my, AuthToken and API key auth, QR and DuitNow QR generators, zakat agency codes and form schemas, and staging vs production. Use when working with Tulus Digital, SnapNPay, tulus.my, pay.tulus.my, reports.tulus.my, zakat, wakaf, infaq or sedekah collection, FPX, cards (MPGS), DuitNow, Touch 'n Go, callbacks, reconciliation, or production readiness.

概要

公開者afu-it
リポジトリmalaysia-payment-gateway
スキル名setup-tulus
スター
74
フォーク
11
同梱ファイル
6
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 6個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    afu-itがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルSetup TulusをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-tulus
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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-tulus .claude/skills/setup-tulus
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSetup Tulusを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にSetup Tulusを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Setup Tulusは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Tulus (SnapNPay) Payment Gateway

Use this skill for Tulus payment gateway integration work. Tulus Digital Sdn Bhd runs one gateway under two brands, Tulus and SnapNPay; the API, field names and signing are the same.

Source

Read references/tulus-api.md before giving factual API guidance or writing integration code. It holds the endpoint catalogue, hosts, auth, checkout fields, the signature algorithm with verified test vectors, callback fields, report API, QR generators, and the known doc inconsistencies.

Read references/tulus-codes.md for the full fpx_debit_auth_code table, status mapping, zakat agency codes, zakat type and state enums, and form schema fields.

Read references/tulus-partner-apis.md only when the user is a partner pushing transactions into Tulus (ADB, Grab webhooks) or customising receipts and receipt emails.

Read references/account-setup.md for onboarding, where the AuthToken and API key live, staging vs production, env var names, and settlement notes.

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

Core Workflow

  1. Confirm the agency code (assigned at onboarding) and that the merchant has an API key (UUID) from the merchant dashboard. The API key is required to sign orders and verify callbacks.
  2. Confirm the environment and checkout host with Tulus (see "Hosts" in tulus-api.md; docs and live behaviour differ).
  3. Create a local pending payment keyed by your refNo before redirecting.
  4. Server-side, build the order fields agency, refNo, amount, email, returnUrl (plus optional cancelUrl), add exp = now + 60, sign, and render an auto-submitting POST form to /v2/checkout.
  5. Handle both POSTs on returnUrl: the direct callback (has signature, server-to-server, authoritative) and the indirect browser return (no signature, display only).
  6. Verify the direct callback signature over all POST fields except signature, sorted, Go url.QueryEscape encoding, no path, no exp.
  7. Settle only on verified status=success, after matching refNo, agency and the net amount; answer HTTP 200 quickly.
  8. Reconcile pending or missed payments with the signed Report API (/api/report/v1/fpxrequest or /api/report/v1/payment).

Core Facts

  • Documented checkout: POST https://tulus.my/v2/checkout, application/x-www-form-urlencoded. On 2026-10-21 that URL returned 404 while https://pay.tulus.my/v2/checkout answered; the SDK playground posts to https://pay.tulus.my/ (production) and https://paydev.tulus.my/ (staging, FPX test banks). Confirm the host with Tulus.
  • Reporting host: https://reports.tulus.my (also the merchant dashboard).
  • Auth: AuthToken JWT (Authorization: Bearer) for reports, copied from the dashboard; or per-agency API key UUID used only as an HMAC key. The old token / username+password method is deprecated.
  • Signature: HMAC-SHA256(message, key) hex, first 16 characters. Key is the UUID with dashes removed, hex-decoded to 16 raw bytes.
  • Outbound message: <path>?<ksorted RFC 3986 query including exp>, for GET reports and POST checkout/QR alike. Checkout path is /v2/checkout.
  • Callback message: ksorted k=v&... of all POST fields except signature, Go url.QueryEscape encoding (space is +), no path, no exp.
  • amount is a ringgit string with 2 decimals; minimum 1.00 (FPX B2B 2.00). refNo must not contain ~; ~ appends extraData.
  • Direct callback status: success, pending, failed. Retried about every 30 seconds until HTTP 2xx.
  • Direct callback amount is net; addCharge is the platform fee; indirect return amount is gross.
  • Unsigned or wrongly signed checkouts are rejected with HTTP 403 in production.
  • Live test payments should use an amount ending in 12.34.
  • Refunds, cancel/void, recurring and tokenisation APIs: not documented in official docs (checked 2026-10-21).

Critical Rules

  • Keep the API key and AuthToken server-side only; the key never goes on the wire.
  • Never fulfil from the indirect browser return or from cancelUrl.
  • Never HMAC the ASCII UUID, never use the full 64-char digest, never add exp or a path when verifying callbacks.
  • Do not add unsigned fields (for example a CSRF _token) to the checkout form; every posted field is checked.
  • Exempt returnUrl from CSRF; respond 200 without redirects.
  • Compare signatures in constant time.
  • Settle idempotently: the same success can arrive more than once (retries and dashboard re-sends); a recorded success never regresses.
  • Cross-check the signed net amount against your stored amount.
  • Read fpx.payment_method to tell FPX from card (mpgs) and others; field names stay fpx_* for all methods.
  • Do not use the downloadable WooCommerce plugin as a reference for verification: its signature check is disabled and it does not add exp.

Completion Criteria

A Tulus integration is done only when:

  1. The signer passes both official test vectors in tulus-api.md.
  2. Checkout is signed server-side at redirect time (60-second exp) and posts only signed fields.
  3. returnUrl is public HTTPS, CSRF-exempt, and handles direct and indirect POSTs separately.
  4. Direct callbacks are verified, matched on refNo, agency, net amount, and settled once on success.
  5. pending stays pending; a scheduled job reconciles via the signed Report API.
  6. Tests cover bad signature (403), replayed success (no double fulfil), tampered amount, unsigned indirect POST, and pending then success.
  7. Deployment docs list TULUS_AGENCY, TULUS_API_KEY, TULUS_CHECKOUT_URL, TULUS_REPORT_URL, TULUS_RETURN_URL, and staging vs production values.

Loophole Review Loop

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

  1. List trust boundaries: checkout form, buyer browser, Tulus checkout host, bank/FPX, direct callback, indirect return, cancelUrl, database, fulfilment job, Report API, merchant dashboard.
  2. Check bypasses: forged indirect POST, callback without signature, signature over the ASCII key, wrong encoding of ~ or space, stale exp, unsigned extra form field, amount gross vs net confusion, wrong agency, duplicate success, late pending after success, wrong checkout host, staging key on production.
  3. Add fixes: server-side signing at redirect, constant-time verify, strict refNo/agency/amount match, row lock plus idempotent fulfil, terminal-state guard, signed Report API fallback, separate env config.
  4. Re-read references/tulus-api.md sections relevant to any gap.
  5. State remaining uncertainty: checkout host, staging credentials, payment methods and fees enabled for the agency, settlement timing, and any undocumented refund process.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Setup Tulus」では何ができますか?

Set up, build, debug, review, and explain Tulus (also branded SnapNPay) payment integrations using official Tulus Developer Portal docs, the Tulus PHP SDK, the Laravel handoff, /v2/checkout signed order POST, hosted pay URLs, HMAC-SHA256 truncated signatures with the UUID API key as 16 raw bytes, direct (signed) and indirect (browser) callbacks to returnUrl, fpx_debit_auth_code mapping, Report API reconciliation on reports.tulus.my, AuthToken and API key auth, QR and DuitNow QR generators, zakat agency codes and form schemas, and staging vs production. Use when working with Tulus Digital, S...

TypingMindでSetup Tulusを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Setup Tulusはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSetup Tulusをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-tulusを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Setup Tulusを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Setup Tulusは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSetup Tulusを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Setup Tulus」は無料ですか?

afu-itがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇