Logo Setup Payhalal

Setup Payhalal

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

Set up, build, debug, review, and explain Payhalal payment integrations using official Payhalal docs, hosted payment page V1 and V2 payment link API, QR Code API, SHA256 request hash, callback hash verification, return/success/cancel/callback URLs, transaction reconciliation APIs with MD5 hash, UAT sandbox/live setup, app ID and app secret, official WooCommerce/OpenCart/PrestaShop plugins, and recurring (plugin-only) flow. Use when working with Payhalal or Souqa Fintech, Shariah-compliant checkout, FPX, cards, e-wallets, BNPL, callback settlement, reconciliation, or production readiness.

Tổng quan

Nhà phát hànhafu-it
Kho mãmalaysia-payment-gateway
Tên kỹ năngsetup-payhalal
Sao
74
Bản fork
11
Tệp đi kèm
4
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ộ.

  • 4 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 Payhalal 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-payhalal
  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-payhalal .claude/skills/setup-payhalal
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 Payhalal 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 Payhalal 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 Payhalal 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.

Payhalal Payment Gateway

Use this skill for Payhalal (operated by Souqa Fintech Sdn Bhd) payment gateway integration work.

Source

Read references/payhalal-api.md before giving factual API guidance or writing integration code. It contains environments, payment request fields, the exact request and callback hash strings, callback fields, statuses, reconciliation APIs, errors, and the known conflicts between the docs and the official plugins.

Read references/account-setup.md when the user asks how to register, which documents are needed, where the App ID and secret live, UAT vs live, dashboard URL configuration, merchant requirements, or pricing.

Read references/source-map.md when choosing which official page or plugin file applies.

Core Workflow

  1. Identify environment: UAT (testing keys) or production (live keys).
  2. Identify surface: V1 hosted page (form POST/GET redirect), V2 JSON payment link (selected merchants only), QR Code API, or an official plugin.
  3. Confirm dashboard setup in Merchant Dashboard > Developer Tools: App ID, App Secret, Return URL, Success URL, Cancel URL, Callback URL.
  4. Create a local pending payment with your own order_id and the exact amount string before redirecting.
  5. Build the request server-side and compute hash = sha256(app_secret + amount + currency + product_description + order_id + customer_name + customer_email + customer_phone).
  6. Send the browser to Payhalal with an auto-submitting form (V1) or the returned payment_link (V2).
  7. Treat the browser return as UX only; verify its hash too, but settle from the server callback.
  8. Verify the callback hash over the posted values (see the hash conflict note in the API reference), compare with constant-time equality.
  9. Settle idempotently only after order_id, amount, currency, app_id/environment and status == SUCCESS all match the local record.
  10. Reconcile with the single/batch transaction reconcile API or the transaction list API when a callback is missing.

Core Facts

  • V1 production pay URL: https://api.payhalal.my/pay. V1 UAT pay URL: https://api-testing.payhalal.my/pay.
  • V2 URL (JSON response with payment_link): https://api.payhalal.my/v2/pay.php. Live or testing is chosen by the key, not the URL. V2 is "in testing phase and only opened to selected merchants".
  • QR Code API: production https://api.payhalal.my/qrCreate, UAT https://api-testing.payhalal.my/qrCreate.
  • Pay endpoints accept both GET and POST.
  • Required request fields: app_id, currency, amount, product_description, order_id, hash. Optional: customer_name, customer_email, customer_phone.
  • Request hash: SHA256 hex of APP_SECRET.AMOUNT.CURRENCY.PRODUCT_DESCRIPTION.ORDER_ID.CUSTOMER_NAME.CUSTOMER_EMAIL.CUSTOMER_PHONE (plain concatenation, no separators).
  • Callback hash per GitBook docs: same string plus .TRANSACTION_ID.STATUS. Every official plugin (WooCommerce 2018 and 2026, OpenCart 3.x) verifies WITHOUT transaction_id. Confirm in UAT.
  • Callback status values: docs list SUCCESS, FAILED, PENDING; official plugins also handle FAIL and TIMEOUT.
  • Request amount is a decimal "without thousand separators"; callback amount is documented "with thousand separator".
  • Minimum amount error: Minimum Amount is RM5.00.
  • Callback URL is optional; if not set, Payhalal sends no server data. Set at Merchant Dashboard > Developer Tools > Edit App.
  • Reconcile APIs: https://api-merchant.payhalal.my/ (production) and https://api-merchant-uat.payhalal.my/ (UAT), hash md5(merchant_id.app_key.app_secret).
  • Unvalidated new merchants are in UAT mode with sandbox keys only.
  • Refunds, rate limits, IP allowlists and test cards: not documented in official docs (checked 2026-10-21).

Critical Rules

  • Keep the App Secret server-side only; never compute the hash in browser JavaScript.
  • Use the App ID, secret and URL of the same environment; a live key against api-testing (or the reverse) will not work.
  • Build the hash from the exact strings you send, including empty strings for omitted optional customer fields.
  • Format the request amount yourself as a fixed two-decimal string with no thousand separators (for example 1200.00).
  • Verify the callback hash over the raw posted values, then compare amount separately after removing thousand separators.
  • Use constant-time comparison (hash_equals, crypto.timingSafeEqual).
  • Do not mark paid from the Return/Success URL redirect without a verified hash and matching local record; prefer the server callback.
  • Treat every status other than SUCCESS as not paid; PENDING must stay pending, not failed.
  • Make callback handling idempotent: duplicate callbacks or a callback plus a return must not double-fulfil.
  • Store transaction_id from the callback; reconcile APIs look up by transaction_id, not by your order id.
  • Do not use the "Quick integration" snippet on the payhalal.my developers page (/pay_v2, Bearer token, payhalal-signature header). It is labelled pseudo-example and does not match the GitBook API docs or any official plugin.

Completion Criteria

A Payhalal integration is done only when:

  1. The request hash is computed server-side with the correct environment secret, over the exact sent values.
  2. The browser is sent to the correct V1 URL (or V2 link) for the environment, with all required fields.
  3. Return, Success, Cancel and Callback URLs are configured in Developer Tools for both UAT and live apps.
  4. The callback handler verifies the hash, checks order_id, amount, currency, app_id and status, and settles idempotently.
  5. The callback hash variant (with or without transaction_id) was confirmed with a real UAT transaction and the other variant is not silently accepted forever.
  6. A reconciliation job uses the reconcile or transaction list API for orders stuck in pending.
  7. Tests cover invalid hash, wrong amount, thousand-separator amount, duplicate callback, FAIL/FAILED/TIMEOUT/PENDING, and success.
  8. Deployment docs list PAYHALAL_APP_ID, PAYHALAL_APP_SECRET, PAYHALAL_MERCHANT_ID (merchant email for reconcile), environment flag, and the four dashboard URLs.

Loophole Review Loop

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

  1. List trust boundaries: checkout form, browser return/success/cancel redirect, Payhalal hosted page, callback receiver, hash function, database, fulfilment job, reconcile job, dashboard Developer Tools settings.
  2. Check bypasses: forged return POST, tampered amount or order id in the form, hash computed in browser, hash variant mismatch, accepting both variants indefinitely, amount compared with thousand separator, sandbox/live key mix, missing callback URL, PENDING treated as failed, duplicate callback, callback for an unknown order, currency forced to non-MYR, reused order_id.
  3. Add fixes: server-side hash, local pending record first, constant-time verification, strict amount/currency/order/app_id checks, idempotent settlement keyed on order_id + transaction_id, reconcile job, separate UAT and live config.
  4. Re-read references/payhalal-api.md sections relevant to any gap.
  5. State remaining uncertainty: callback hash variant, exact status strings, refund process, V2 access, recurring enablement, and anything the docs mark as not documented.

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 Payhalal làm được gì?

Set up, build, debug, review, and explain Payhalal payment integrations using official Payhalal docs, hosted payment page V1 and V2 payment link API, QR Code API, SHA256 request hash, callback hash verification, return/success/cancel/callback URLs, transaction reconciliation APIs with MD5 hash, UAT sandbox/live setup, app ID and app secret, official WooCommerce/OpenCart/PrestaShop plugins, and recurring (plugin-only) flow. Use when working with Payhalal or Souqa Fintech, Shariah-compliant checkout, FPX, cards, e-wallets, BNPL, callback settlement, reconciliation, or production readiness.

Vì sao nên dùng Setup Payhalal 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 Payhalal 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 Payhalal 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-payhalal. 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 Payhalal?

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 Payhalal 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 Payhalal 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 Payhalal 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 👇