Setup Paycoolsのロゴ

Setup Paycools

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

公式PayCools Malaysia Open APIドキュメント、WebPayホスト型チェックアウト、DuitNow動的QR、決済通知、パラメータ文字列に対するRSA SHA256withRSA署名、appIdとRSA鍵の交換、注文ステータスの再照会、返金、返金通知、入金/支払い、口座確認、残高照会、チャネルコード、レスポンスコードを使って、PayCools決済連携の設定、構築、デバッグ、レビュー、説明を行います。PayCools(Micro Bluetech Sdn Bhd)、FPX、DuitNow QR、DuitNow RPPオンラインバンキング、Touch 'n Go、Boost、GrabPay、MCash、カード、マレーシアの銀行口座や電子ウォレットへの入金、コールバック検証、冪等性を保った精算、本番環境への移行準備に関する作業で使用してください。

Add to TypingMind

概要

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

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

  • どのLLMでも利用可能

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

  • 4個の同梱ファイル

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

  • オープンソース

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

インストール

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

TypingMindで使用

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

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

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

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

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

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

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

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

スキルの指示

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

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.

同梱ファイル

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

よくある質問

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

公式PayCools Malaysia Open APIドキュメント、WebPayホスト型チェックアウト、DuitNow動的QR、決済通知、パラメータ文字列に対するRSA SHA256withRSA署名、appIdとRSA鍵の交換、注文ステータスの再照会、返金、返金通知、入金/支払い、口座確認、残高照会、チャネルコード、レスポンスコードを使って、PayCools決済連携の設定、構築、デバッグ、レビュー、説明を行います。PayCools(Micro Bluetech Sdn Bhd)、FPX、DuitNow QR、DuitNow RPPオンラインバンキング、Touch 'n Go、Boost、GrabPay、MCash、カード、マレーシアの銀行口座や電子ウォレットへの入金、コールバック検証、冪等性を保った精算、本番環境への移行準備に関する作業で使用してください。

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

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

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

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

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

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

Setup Paycoolsで使えるAIモデルの数に制限はありますか?

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

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

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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