Logo Setup Securepay

Setup Securepay

Cộng đồng
afu-it
setup-securepay

Set up, build, debug, review, and explain SecurePay (Malaysia) payment integrations using official SecurePay docs, API v1 FPX payments, Payment Session, API v2 payment intents, HMAC-SHA256 checksums, callback and redirect URLs, status requery, transaction list and search, FPX B2C/B2B1 bank lists, DuitNow, eMandate direct debit, split settlement, sandbox/live setup, API UID, Auth Token, Checksum Token, client ID/secret, and the official WooCommerce plugin. Use when working with SecurePay, securepay.my, FPX online banking, DuitNow, direct debit mandates, callback checksum verification, payment status checks, settlement timing, or production readiness.

Tổng quan

Nhà phát hànhafu-it
Kho mãmalaysia-payment-gateway
Tên kỹ năngsetup-securepay
Sao
74
Bản fork
11
Tệp đi kèm
6
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 6 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được afu-it công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Setup Securepay trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-securepay
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân 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-securepay .claude/skills/setup-securepay
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Setup Securepay trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Setup Securepay ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Setup Securepay không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

SecurePay Payment Gateway

Use this skill for SecurePay Sdn Bhd (securepay.my) payment gateway integration work.

Source

Read references/securepay-api.md before giving factual API guidance or writing integration code. It is the entry point: version choice, environments, credentials, the full endpoint catalogue, v1 payment creation, the request checksum, callback/redirect fields and checksum verification (with test vectors), status, list, search, errors and gaps.

Read references/securepay-v2.md when the merchant uses API v2 (SecurePay Console, client ID/secret, auth_token, payment intents, DuitNow, eMandate, split settlement, closed wallet, memberships, partner API, certificates).

Read references/securepay-codes.md for FPX bank codes, status values, auth codes, enums and sandbox test banks.

Read references/account-setup.md for registration, documents, where credentials live, sandbox vs live, interface settings, settlement schedule, refunds policy, plugins and support.

Read references/source-map.md to pick the right official page, and for docs coverage notes.

Core Workflow

  1. Pick the API version. SecurePay's docs hub marks v1 as the production API and v2 as a preview. Default to v1 unless the merchant's account is on SecurePay Console (v2 client ID/secret).
  2. Identify environment: sandbox or production. v1 sandbox https://sandbox.securepay.my/api, production https://securepay.my/api.
  3. Get the interface credentials for that environment: API UID, Auth Token, Checksum Token (v1).
  4. Create a local pending order with a unique order_number and the expected amount before calling SecurePay.
  5. v1: build the request checksum, then POST the form fields to /v1/payments (usually as an auto-submitted browser form, like the official plugin), or create a Payment Session and redirect to payment_url.
  6. Treat redirect_url as browser UX only. Fulfil from the server-to-server callback_url POST.
  7. Verify the callback checksum: sort all received keys ascending (excluding checksum), join values with |, HMAC-SHA256 with the Checksum Token, constant-time compare.
  8. Requery GET /v1/payments/status/:order_number with Basic auth before settling, and confirm payment_status, transaction_amount_received, currency and order_number.
  9. Settle idempotently. For FPX B2B1 treat fpx_debit_auth_code 99 as pending; wait for the later 00 callback.
  10. Reconcile with GET /v1/transactions/list or /v1/transactions/search when callbacks are missed.

Core Facts

  • v1 create payment: POST /v1/payments (form-encoded). v1 Payment Session (beta): POST /apis/payments returning JSON payment_url.
  • v1 request checksum string order: buyer_email|buyer_name|buyer_phone|callback_url|order_number|product_description|redirect_url|transaction_amount|uid, HMAC-SHA256 hex, key = Checksum Token. Empty optional values keep an empty slot.
  • v1 amounts are ringgit with two decimals (1540.40). v2 payment intents use amount in cents (154040).
  • v1 auth for status/list/search/validate/session: HTTP Basic uid:auth_token. The payment form POST carries token (Auth Token) and checksum as fields.
  • Validate credentials: POST /v1/merchants/validate with Basic auth and checksum_token.
  • Public FPX bank list (no auth): GET /public/v1/banks/b2c and /public/v1/banks/b2b, optional ?status=online|offline. Discard a response whose VerifySign is not true.
  • Callback/redirect are POSTed with fields such as payment_status, transaction_amount, transaction_amount_received, order_number, exchange_number, fpx_debit_auth_code, checksum.
  • v2 base URLs: production https://console.securepay.my/api, staging https://sandbox.securepay.dev/api. Auth: POST /v1/auth with Basic client_id:client_secret, then Authorization: Bearer <auth_token>.
  • No refund, void or capture API is documented. Refunds are manual via support (Refund & Cancellation Policy).
  • Settlement is T+1 business day per SecurePay; cut-off 11:59pm MYT; Friday to Sunday settle Monday.
  • Rate limits and callback source IPs are not documented.

Critical Rules

  • Keep Auth Token, Checksum Token, client secret and partner secrets server-side. The browser form may carry token and checksum (as the official plugin does) but never the Checksum Token itself.
  • Compute the request checksum server-side; never let the browser supply amount or checksum inputs.
  • Do not mark paid from the redirect POST, the SecurePay status page, or payment_status alone. The official WooCommerce plugin does not verify the callback checksum; do not copy that.
  • Verify the callback checksum over the exact received parameters (all keys, including ones you do not use). SecurePay says params keep being added, so never hard-code the key list.
  • Strip zero-width characters if you copy strings from the docs; several doc samples contain U+200B.
  • Always requery status server-side and check amount, currency (MYR), order_number and environment before settling.
  • Keep order_number unique per attempt; status lookups use it.
  • Use sandbox credentials only with sandbox URLs, and production with production.
  • v2 callbacks carry a nested payment object and the docs do not define how to flatten it for the checksum; settle v2 from an authenticated status requery.
  • Confirm live payment method availability, pricing, settlement arrangement and B2B1 enablement with SecurePay before claiming production certainty.

Completion Criteria

A SecurePay integration is done only when:

  1. Payment creation runs from server-generated fields with a correct HMAC-SHA256 checksum, or via Payment Session / v2 intent created server-side.
  2. Redirect handling only shows status; it does not fulfil.
  3. Callback handler verifies checksum with the Checksum Token over all received params, constant-time.
  4. Settlement requeries status and checks order_number, payment_status, transaction_amount_received, currency and environment.
  5. Duplicate callbacks, redirect-before-callback, B2B1 99 then 00, and failed payments are idempotent.
  6. Tests cover bad checksum, tampered amount, unknown order, failed payment, duplicate callback, and the documented checksum test vectors.
  7. Deployment docs list SECUREPAY_UID, SECUREPAY_AUTH_TOKEN, SECUREPAY_CHECKSUM_TOKEN (or v2 SECUREPAY_CLIENT_ID, SECUREPAY_CLIENT_SECRET), base URL, callback URL, redirect URL and sandbox/live separation.

Loophole Review Loop

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

  1. List trust boundaries: browser form POST, SecurePay bank selection page, redirect POST, callback POST, checksum verifier, status requery, database, fulfilment job, dashboard interface settings, settlement account.
  2. Check bypasses: forged redirect POST, forged callback without checksum, checksum over a hard-coded key subset, wrong Checksum Token (other interface), sandbox/live mix, tampered transaction_amount, reused order_number, B2B1 99 treated as paid, duplicate callback, callback before order commit, offline bank selected, USD Payment Session amount converted to MYR, nested v2 payload.
  3. Add fixes: server-side checksum, local pending order first, full-param checksum verification, constant-time compare, status requery, strict amount/currency/order checks, unique order numbers, idempotent settle, per-environment config, reconciliation via list/search.
  4. Re-read references/securepay-api.md (and securepay-v2.md for v2) for any gap.
  5. State remaining uncertainty: undocumented v1 /v1/payments response format, uid as a form field, v2 response bodies, v2 checksum for nested payloads, PQC request signing, rate limits, callback IPs, retry policy, pricing.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Setup Securepay làm được gì?

Set up, build, debug, review, and explain SecurePay (Malaysia) payment integrations using official SecurePay docs, API v1 FPX payments, Payment Session, API v2 payment intents, HMAC-SHA256 checksums, callback and redirect URLs, status requery, transaction list and search, FPX B2C/B2B1 bank lists, DuitNow, eMandate direct debit, split settlement, sandbox/live setup, API UID, Auth Token, Checksum Token, client ID/secret, and the official WooCommerce plugin. Use when working with SecurePay, securepay.my, FPX online banking, DuitNow, direct debit mandates, callback checksum verification, paymen...

Vì sao nên dùng Setup Securepay trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Setup Securepay là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Setup Securepay trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-securepay. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Setup Securepay?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Setup Securepay với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Setup Securepay với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Setup Securepay có miễn phí không?

Kỹ năng này được afu-it phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇