Setup M1payのロゴ

Setup M1pay

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

Set up, build, debug, review, and explain M1Pay (MobilityOne) payment integrations using official M1Pay docs, Keycloak OAuth2 client-credentials tokens, the M1Pay Payment Wall transaction API, individual payment channels, FPX bank list API, Get Transaction status requery, Host-to-Host callback URL, SHA1withRSA signedData signing and verification, UAT/sandbox vs production setup, merchant portal keys, IP whitelisting, and FPX error codes. Use when working with M1Pay, MobilityOne, m1pay.com.my, m1payall.com, FPX B2C/B2B1, cards, eM-ONEi, Alipay, Boost, UMobile, e-wallet checkout, callback settlement, or production readiness.

概要

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

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

  • どのLLMでも利用可能

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

  • 4個の同梱ファイル

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

  • オープンソース

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

インストール

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

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

M1Pay Payment Gateway

Use this skill for M1Pay (MobilityOne Sdn Bhd) payment gateway integration work.

Source

Read references/m1pay-api.md before giving factual API guidance or writing integration code. It holds the endpoint catalogue, environments, OAuth2 token call, create transaction fields, Get Transaction fields, callback fields, the exact signing and verification strings, status values, channels, FPX bank list, FPX error codes, and documented gaps.

Read references/account-setup.md when the user asks how to register, which credentials are needed, where the Client ID, Client Secret and key files live, sandbox (UAT) setup, merchant portal settings, env var names, payment channels, pricing, or payout timing.

Read references/source-map.md when choosing which official M1Pay page applies, or to check what the docs do and do not cover.

Core Workflow

  1. Identify environment: UAT (sandbox, m1payall.com hosts) or production (m1pay.com.my hosts).
  2. Confirm merchant portal setup: whitelisted server IP, Web Redirect URL, Host-to-Host Callback URL, Client ID, Client Secret, private key file, M1Pay public certificate.
  3. Create a local pending payment with a unique merchantOrderNo before calling M1Pay.
  4. Get an access_token server-side from the Keycloak token endpoint (grant_type=client_credentials).
  5. Build the signing string, sign it with SHA1withRSA using the merchant private key, hex-encode it as signedData.
  6. POST the create transaction call (form-urlencoded, Authorization: Bearer <token>); store the returned transactionId; redirect the customer to the returned M1Pay URL.
  7. Treat the browser return to the Web Redirect URL as UX only. Call Get Transaction server-side to read the real status.
  8. On the Host-to-Host callback, verify signedData with the M1Pay public certificate over the documented callback string before trusting it.
  9. Settle idempotently only when merchantOrderNo, amount, currency and the channel's success status all match.
  10. Requery with Get Transaction when the callback is missing or the redirect result is unclear.

Core Facts

  • Token: POST https://keycloak.m1pay.com.my/auth/realms/master/protocol/openid-connect/token (sandbox) or .../realms/m1pay-users/... (production).
  • Create transaction: POST https://gateway.m1payall.com/m1paywall/api/transaction (sandbox) or https://gateway.m1pay.com.my/wall/api/transaction (production).
  • Get Transaction: GET .../m1paywall/api/m-1-pay-transactions/{transactionId} (sandbox) or .../wall/api/m-1-pay-transactions/{transactionId} (production).
  • FPX bank list: GET .../bank-list/B2C and .../bank-list/B2B1 (public, no auth).
  • Request and callback bodies are x-www-form-urlencoded; currency is the constant MYR.
  • Amount is in ringgit (1000 or 1000.00, no commas); the signing string needs 2 decimals (10.00).
  • Request signing string: productDescription|transactionAmount|exchangeOrderNo|merchantOrderNo|transactionCurrency|emailAddress|merchantId.
  • Callback verification string: transactionAmount|fpxTxnId|sellerOrderNo|status|merchantOrderNo.
  • Algorithm both ways: SHA1withRSA (RSA PKCS#1 v1.5 with SHA-1), signature as a hex string.
  • Success status differs per channel: FPX APPROVED, CARD_PAYMENT CAPTURED, EMONEI/ALIPAY/UMOBILE SUCCESSFUL, BOOST COMPLETED.
  • Omit channel and fpxBank to show the M1Pay Payment Wall; sending them empty returns an error.
  • Callback retries up to 15 times at 10-minute intervals.
  • UAT supports only ONLINE_BANKING and CARD_PAYMENT; test FPX bank is SBI Bank A.
  • Merchant server IPs must be registered with M1Pay (IP filtering).

Critical Rules

  • Keep Client Secret, private key file and tokens server-side only.
  • Never mark paid from the Web Redirect URL alone; requery Get Transaction.
  • Verify callback signedData with the M1Pay certificate before parsing it into business state.
  • Compare against the success value for the channel actually used; a generic "success" check is wrong.
  • Format transactionAmount with exactly 2 decimals in the signing string, and send the same value in the body.
  • Use the token, key, certificate and hosts of one environment only; never mix UAT and production.
  • Make callback and requery handling idempotent; retries can arrive up to 15 times.
  • Do not invent refund, cancel, recurring, payout or settlement APIs; M1Pay does not document them publicly.
  • Flag undocumented details (callback ack body, redirect parameters, token lifetime, extra e-wallet channel codes) and ask M1Pay support to confirm.

Completion Criteria

An M1Pay integration is done only when:

  1. Token, create transaction and Get Transaction calls run server-side from a whitelisted IP.
  2. signedData is generated with SHA1withRSA over the exact documented string with a 2-decimal amount.
  3. The returned transactionId is stored against the local merchantOrderNo before redirecting.
  4. The redirect handler only triggers a server-side Get Transaction requery.
  5. The callback handler verifies signedData with the M1Pay public certificate and rejects failures.
  6. Settlement checks merchantOrderNo, amount, MYR, channel and the channel's success status.
  7. Duplicate callbacks, retries and requeries cannot double-fulfil.
  8. Tests cover bad signature, wrong amount, wrong order number, failed/expired status, duplicate callback, and success per channel.
  9. Deployment docs list M1PAY_ENV, M1PAY_MERCHANT_ID, M1PAY_CLIENT_ID, M1PAY_CLIENT_SECRET, M1PAY_PRIVATE_KEY_PATH, M1PAY_PUBLIC_CERT_PATH, redirect URL, callback URL and server IP.

Loophole Review Loop

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

  1. List trust boundaries: browser redirect, merchant checkout, backend token client, Keycloak, M1Pay wall API, callback receiver, form parser, database, fulfilment job, merchant portal settings, key files.
  2. Check bypasses: fake redirect success, forged callback, wrong field order in the signing string, amount without 2 decimals, uppercase vs lowercase hex mismatch, wrong certificate, UAT/production mix, expired token, wrong channel success value, reused merchantOrderNo, duplicate callback, callback never sent, IP not whitelisted, rotated private key.
  3. Add fixes: server-side requery, strict signature verification, constant-time comparisons for local fields, per-channel success map, unique order numbers, durable event log, idempotent settlement, separate env config, key rotation runbook.
  4. Re-read references/m1pay-api.md sections relevant to any gap.
  5. State remaining uncertainty where the docs are silent: refunds, callback ack, redirect parameters, token expiry, extra channel codes, fpxTxnId for non-FPX callbacks, empty exchangeOrderNo handling.

同梱ファイル

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

よくある質問

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

Set up, build, debug, review, and explain M1Pay (MobilityOne) payment integrations using official M1Pay docs, Keycloak OAuth2 client-credentials tokens, the M1Pay Payment Wall transaction API, individual payment channels, FPX bank list API, Get Transaction status requery, Host-to-Host callback URL, SHA1withRSA signedData signing and verification, UAT/sandbox vs production setup, merchant portal keys, IP whitelisting, and FPX error codes. Use when working with M1Pay, MobilityOne, m1pay.com.my, m1payall.com, FPX B2C/B2B1, cards, eM-ONEi, Alipay, Boost, UMobile, e-wallet checkout, callback set...

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

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

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

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

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

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

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

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

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

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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