Logo de Setup M1pay

Setup M1pay

Comunidade
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.

Visão geral

Publicado porafu-it
Repositóriomalaysia-payment-gateway
Nome da habilidadesetup-m1pay
Estrelas
74
Forks
11
Arquivos incluídos
4
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    Habilidades de IA são Markdown simples, não código específico de um provedor, por isso funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • 4 arquivos incluídos

    Scripts, modelos de documentos e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente leitura e nunca são executados.

  • Código aberto

    Publicada por afu-it no GitHub. Leia o conteúdo-fonte antes de instalar.

Instalação

Instale a habilidade de IA Setup M1pay no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL da pasta da habilidade exibida abaixo e confirme.
    https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-m1pay
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Nova habilidade → Via URL GitHub, depois cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Setup M1pay em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Setup M1pay automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Setup M1pay não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

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.

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Setup M1pay faz?

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...

Por que usar Setup M1pay no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. Setup M1pay é escrito em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. O TypingMind usa suas próprias chaves de API, então o pagamento é feito diretamente aos provedores, em vez de uma assinatura por licença de usuário, e suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Setup M1pay no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-m1pay. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Setup M1pay?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Setup M1pay?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Setup M1pay com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Setup M1pay é gratuita?

A habilidade é publicada no GitHub por afu-it. Consulte os termos de licenciamento no repositório. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, modelos de documento ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas para chamar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA fornece conhecimento e um processo ao modelo: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇