Логотип Setup 2c2p

Setup 2c2p

Спільнота
afu-it
setup-2c2p

Set up, build, debug, review, and explain 2C2P payment integrations using official 2C2P docs, PGW v4.3/v4.5 Payment Token API with JWT HS256, hosted redirect checkout, Direct API Do Payment, Secure Pay JS, Drop-In UI, backend notifications, Payment Inquiry, Payment Maintenance refund/void/settle with JWE and JWS, recurring plans, card and customer tokens, QuickPay links, payouts, mobile SDK, batch SFTP and reconciliation, sandbox demo merchants and test cards. Use when working with 2C2P Malaysia, MYR, FPX online banking, DuitNow QR, Touch 'n Go, GrabPay, Boost, ShopeePay, cards, MyDebit, IPP instalments, Atome, SPayLater, Apple Pay, Google Pay, webhook settlement, refunds, or production readiness.

Огляд

Видавецьafu-it
Репозиторійmalaysia-payment-gateway
Назва навичкиsetup-2c2p
Зірки
74
Форки
11
Файли в пакеті
10
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 10

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: afu-it. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Setup 2c2p у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-2c2p
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

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-2c2p .claude/skills/setup-2c2p
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Setup 2c2p в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Setup 2c2p, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Setup 2c2p не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

2C2P Payment Gateway

Use this skill for 2C2P (PGW v4.x) payment gateway integration work.

Source

Read references/2c2p-api.md first, before giving factual API guidance or writing integration code. It has environments, the four security schemes, the full endpoint catalogue, Payment Token fields, the redirect flow, backend and frontend notification formats, Payment Inquiry, amount rules, the settlement checklist and sandbox data.

Read references/2c2p-direct-api.md for an own checkout UI (Payment Option, Do Payment, Transaction Status, Secure Pay JS, Drop-In UI, Apple Pay, Google Pay, Malaysian channel shapes).

Read references/2c2p-maintenance.md for refund, void, settle, refund status, refund notification, recurring maintenance, card and customer token maintenance, and JWE + JWS key setup.

Read references/2c2p-codes.md for response codes, Malaysian channel, FPX and agent codes, cut-off times and test cards.

Read references/2c2p-mobile-sdk.md for Android, iOS, Flutter and React Native apps; references/2c2p-quickpay-payout.md for payment links and payouts; references/2c2p-batch-recon.md for SFTP batch, reconciliation, SoftPOS, plugins and SNAP.

Read references/account-setup.md for onboarding, keys, sandbox, pricing and settlement questions, and references/source-map.md to find the official page behind any fact.

Core Workflow

  1. Identify environment (sandbox or production) and surface: hosted redirect, Direct API, Drop-In UI, mobile SDK, plugin, QuickPay link, recurring plan, payout or SoftPOS.
  2. Confirm credentials and setup: Merchant ID, Secret Key, enabled channels, return URLs, and for maintenance the RSA key pair and 2C2P public key.
  3. Create a local pending order with a unique invoiceNo, expected amount and currency before calling 2C2P.
  4. Call Payment Token server-side with a JWT HS256 {"payload"} body. Continue only if respCode is 0000.
  5. Redirect to webPaymentUrl, or run the Direct API / SDK flow with the paymentToken.
  6. Treat the frontend return (paymentResponse, unsigned base64url) and Transaction Status as UX only.
  7. Verify the backend notification JWT with the Secret Key, then check merchant, invoice, amount, currency and respCode.
  8. Settle idempotently. Use Payment Inquiry for missing, late or doubtful results.
  9. Run refunds, voids and captures through Payment Maintenance with JWE + JWS, with idempotency and status checks.

Core Facts

  • PGW API hosts: sandbox https://sandbox-pgw.2c2p.com, production https://pgw.2c2p.com.
  • Payment Token: POST /payment/4.5/paymentToken (docs pages) or /payment/4.3/paymenttoken (OpenAPI 4.3). Use one version consistently.
  • Payment Inquiry: POST /payment/4.5/paymentInquiry with merchantID plus invoiceNo or paymentToken.
  • PGW signing: JWT HS256 with the merchant Secret Key string; request and response bodies are {"payload":"<jwt>"}.
  • Payment Token mandatory fields: merchantID, invoiceNo, description, amount, currencyCode. paymentToken is valid 30 minutes.
  • amount is a decimal in ringgit (150.00), not sen; currencyCode is MYR.
  • Backend notification: POST {"payload":"<JWT>"} to backendReturnUrl (or the portal default); claims match Payment Inquiry.
  • Success is respCode 0000; 0001 pending; flow code 2000 means "completed, check backend or inquire".
  • Payment Maintenance: https://demo2.2c2p.com/PaymentAction/2.0/action (sandbox), https://t.2c2p.com/PaymentAction/2.0/action (production); XML PaymentProcessRequest v4.6, JWE RSA-OAEP + A256GCM with the 2C2P public key, then JWS PS256 with the merchant private key, text/plain.
  • processType: I inquiry, R refund, RS refund status, V void, S settle. Maintenance respCode 00 is success.
  • FPX uses channel 123, agent channel WEBPAY, agent codes MY... (for example MYM2U); legacy FPX_* codes must be migrated.
  • Malaysian sandbox demo merchant JT07 (MYR); FPX test banks MYSBIA, MYSBIB, MYSBIC; test Visa 4111111111111111, OTP 123456.

Critical Rules

  • Keep the Secret Key and merchant private key server-side only; never in browser, app or repo.
  • Do not mark paid from the frontend return, Transaction Status, Do Payment response, SDK result, iframe postMessage or QR display.
  • Verify every JWT with HS256 and reject other algorithms; verify JWS PS256 before decrypting maintenance responses.
  • Match merchantID, invoiceNo, amount, currencyCode and respCode against the stored order before settling.
  • Make notification handling and settlement idempotent; notifications can repeat or arrive out of order.
  • Never reuse an invoiceNo; it triggers duplicate-invoice errors (9015, 5005).
  • Refund only settled transactions; void only same day before the acquirer cut-off; send idempotencyID and check RS / I before retrying.
  • Treat REFUND_PENDING (RP, code 42) as unfinished; poll refund status or verify the notifyURL callback.
  • Do not quote fees or settlement times; 2C2P publishes no Malaysian rate card.
  • Say "Not documented in official docs" for rate limits, notification IP ranges and retry schedules instead of guessing.

Completion Criteria

A 2C2P integration is done only when:

  1. Payment Token runs server-side with JWT HS256, the correct host and one consistent API version.
  2. The browser or app only carries webPaymentUrl or paymentToken; no secrets reach the client.
  3. The backend notification handler verifies the JWT and checks merchant, invoice, amount, currency and respCode.
  4. Payment Inquiry is used as the fallback for missing or doubtful results, with the same checks.
  5. Settlement, refunds and voids are idempotent and logged.
  6. Tests cover a forged or wrong-key JWT, a wrong amount or currency, a duplicate notification, a pending (0001) result, a failed result, an expired token and a successful payment.
  7. Deployment docs list Merchant ID, Secret Key, return URLs, maintenance keys and separate sandbox and production values.

Loophole Review Loop

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

  1. List trust boundaries: browser return, iframe, Drop-In UI, mobile SDK, Payment Token creator, PGW API, backend notification receiver, Payment Inquiry, maintenance client, key storage, database, fulfilment job, refund job, merchant portal settings and enabled channels.
  2. Check bypasses: forged paymentResponse, unsigned or alg:none JWT, wrong Secret Key, sandbox and live mix, 4.3 and 4.5 path mix, reused invoiceNo, wrong amount or currency, Transaction Status used for settlement, duplicate or late notification, pending FPX or wallet marked failed too early, refund retried after timeout, void after cut-off, legacy FPX_* agent codes, and a plugin notification blocked by the store firewall.
  3. Add fixes: server-side token creation, local pending order first, strict JWT verification, amount, currency and invoice checks, durable event log, idempotency keys, Payment Inquiry fallback, maintenance status checks, separate environment config, and channel checks with Payment Option.
  4. Re-read the relevant sections of references/2c2p-api.md, references/2c2p-maintenance.md and references/2c2p-codes.md for any gap.
  5. State remaining uncertainty where it depends on the merchant profile version, enabled channels, acquirer support for card-on-file, settlement terms, or anything marked "Not documented in official docs".

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Setup 2c2p?

Set up, build, debug, review, and explain 2C2P payment integrations using official 2C2P docs, PGW v4.3/v4.5 Payment Token API with JWT HS256, hosted redirect checkout, Direct API Do Payment, Secure Pay JS, Drop-In UI, backend notifications, Payment Inquiry, Payment Maintenance refund/void/settle with JWE and JWS, recurring plans, card and customer tokens, QuickPay links, payouts, mobile SDK, batch SFTP and reconciliation, sandbox demo merchants and test cards. Use when working with 2C2P Malaysia, MYR, FPX online banking, DuitNow QR, Touch 'n Go, GrabPay, Boost, ShopeePay, cards, MyDebit, IP...

Навіщо використовувати Setup 2c2p у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Setup 2c2p — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Setup 2c2p у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-2c2p. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Setup 2c2p?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Setup 2c2p?

Зі скількома забажаєте. У TypingMind ви можете використовувати Setup 2c2p із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Setup 2c2p?

На GitHub цю навичку публікує afu-it. Умови ліцензування дивіться в репозиторії. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇