setup-curlec

$npx mdskill add afu-it/malaysia-payment-gateway/setup-curlec

Integrate and debug Razorpay Curlec payment gateway for Malaysia.

  • Set up Curlec Standard Checkout, FPX, or redirect payment flows.
  • Depends on Curlec/Razorpay APIs, Orders, Payments, Refunds, and webhooks.
  • Reads reference docs to decide integration flow, keys, and environment.
  • Provides code, configuration, and troubleshooting for go-live checks.

SKILL.md

.github/skills/setup-curlecView on GitHub ↗
---
name: setup-curlec
description: Set up, build, debug, review, and explain Razorpay Curlec payment gateway integrations using Curlec and shared Razorpay documentation. Use when working with Curlec/Razorpay Standard Checkout, FPX or redirect payment methods, Orders API, Payments API, Refunds API, Payment Links, Basic Auth API keys, checkout.js options, callback_url, payment signature verification, webhook setup, webhook HMAC validation, sandbox/test mode, payment capture, payment status reconciliation, or Malaysia payment gateway go-live checks.
---

# Curlec Payment Gateway

Use this skill for Razorpay Curlec payment gateway integration work.

## Source

Read `references/curlec-payment-gateway.md` before giving factual API guidance or writing integration code. It contains source URLs, integration flow, endpoint map, signature rules, webhook rules, sandbox notes, and common failure fixes from Curlec docs.

Read `references/account-setup.md` when user asks how to register, which API keys are needed, where credentials come from, or what dashboard setup is required.

## Core Workflow

1. Identify product surface: Standard Checkout, redirect/FPX flow, Payment Links, Orders/Payments/Refunds API, mobile SDK, plugin, or payout/RazorpayX.
2. Identify environment: Test mode or Live mode. Keep keys, orders, webhooks, and dashboard checks separated by mode.
3. Create an internal transaction/order row first, then create a Curlec Order server-side.
4. Pass only the public Key ID and Curlec `order_id` to Checkout. Keep Key Secret server-side only.
5. On Checkout success, store `razorpay_payment_id`, `razorpay_order_id`, and `razorpay_signature`, then verify the signature on the server.
6. Use webhooks for durable asynchronous fulfilment and API fetches for immediate user-facing confirmation where needed.
7. Before fulfilment, verify amount, currency, order mapping, payment status, capture state, signature, idempotency, and duplicate events.

## Critical Rules

- Base URL for most APIs is `https://api.razorpay.com/v1`.
- API auth is Basic Auth with `Key ID:Key Secret`; do not expose Key Secret in browser code.
- Use smallest currency units for amounts, for example sen for MYR. Confirm currency/account support when integrating non-MYR flows.
- Payment signature message is `order_id + "|" + razorpay_payment_id`, where `order_id` is the server-stored Curlec Order ID. Do not trust or substitute client-sent `razorpay_order_id` while generating the signature.
- Webhook signature uses raw request body as message, webhook secret as key, SHA-256 HMAC, and `X-Razorpay-Signature` header. Do not JSON-parse, stringify, or mutate the body before verification.
- Webhooks can be duplicated and out of order. Deduplicate with `x-razorpay-event-id` and use monotonic state transitions.
- Checkout success means successful authorization; verify capture state (`captured`) before irreversible fulfilment unless your business explicitly fulfils on authorization.
- For redirect payment methods such as FPX, configure `callback_url` and `redirect: true`; browser `handler` alone is not enough.
- Old webhook retries may need the old webhook secret after rotation.
- For latest pricing, enabled methods, account limits, webhook IP ranges, dashboard-only settings, or production credentials, verify live Dashboard/docs.

## Loophole Review Loop

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

1. List every trust boundary: browser, backend, Curlec API, webhook receiver, database, fulfilment job, admin dashboard.
2. Check each bypass: fake success callback, wrong amount/currency, replayed webhook, duplicate event, out-of-order event, late authorization, uncaptured payment, secret leakage, test/live key mix, order mismatch, retry timeout, refund double-submit.
3. Add fixes for each bypass: server-side order creation, server-stored order ID for HMAC, raw-body webhook verification, idempotency keys/unique constraints, API status re-fetch, durable event log, strict status machine, env separation, audit logs.
4. Re-read `references/curlec-payment-gateway.md` sections relevant to any gap.
5. State remaining uncertainty explicitly if it depends on account configuration, enabled payment methods, pricing, or current Dashboard state.

More from afu-it/malaysia-payment-gateway

SkillDescription
malaysia-payment-gatewayBuild, debug, review, and explain Malaysia payment gateway integrations. Use when implementing checkout, payment links, hosted payment pages, redirects, callbacks, webhooks, HMAC/signature verification, idempotent settlement, paid-access unlocking, refunds, reconciliation, sandbox/live setup, or provider switching for Malaysian gateways such as CHIP Collect, Curlec/Razorpay, Xendit Malaysia, Bayarcash, BCL Pay, toyyibPay, Billplz, FPX, DuitNow QR, cards, or e-wallets.
setup-bayarcashSet up, build, debug, and explain Bayarcash payment integrations using Bayarcash API docs, Web Impian API docs, Bayarcash PHP SDK, WordPress plugins, Boost.space integration links, and Bayarcash MCP server references. Use when working with Bayarcash API v2/v3, payment intents, FPX banks, DuitNow banks or wallets, portals, payment channels, callbacks/webhooks, checksums, transaction lookups, direct debit/e-Mandate flows, enterprise partner merchant/payout APIs, Laravel/PHP SDK usage, WordPress Bayarcash integrations, or Bayarcash MCP tooling.
setup-bclSet up, build, debug, review, and explain BCL payment gateway, BCL Pay, BCL Payment Link, BCL QR Terminal, BCL Forms, Bayarcash-linked setup, portal keys, transactions, webhooks, direct debit forms, client info, payment redirects, and BCL operating procedures using BCL docs.
setup-billplzSet up, build, debug, review, and explain Billplz payment integrations using Billplz API docs, help center, GitHub plugins, status pages, payment collections, payment forms, Payment Order payouts, X Signature callbacks/redirects, V5 checksums, sandbox/live setup, API Secret Key, Collection ID, and X Signature Key.
setup-chipSet up, build, debug, and explain CHIP Collect payment integrations using the official CHIP Collect API documentation. Use when working with CHIP Collect purchases, checkout URLs, payment links, direct post, FPX, DuitNow QR, cards, e-wallets, callbacks, webhooks, signature verification, clients, recurring tokens, subscriptions, pre-authorization, refunds, captures, releases, payment methods, statements, account balance, account turnover, API keys, Brand ID, or CHIP Collect endpoint schemas.
setup-fiuuSet up, build, debug, review, and explain Fiuu payment integrations using official Fiuu API specs, Seamless Integration, Inpage Checkout, Mobile XDK, SDKs, and shopping cart plugin references. Use when working with Fiuu hosted payment pages, payment requests, vcode/skey verification, Return URL, Notify/Notification URL, Callback URL, IPN ACK/retry behavior, payment status requery, refunds, captures, recurring/token payments, channel status, mobile Flutter/Android/iOS/React Native XDK, JavaScript Seamless Integration, Inpage Checkout, WooCommerce, Magento, OpenCart, WHMCS, Shopify, or Fiuu account/dashboard setup.
setup-hitpaySet up, build, debug, review, and explain HitPay payment integrations using official HitPay docs, Payment Request API, hosted checkout, Drop-In UI, webhooks, HMAC-SHA256 signatures, sandbox/live setup, API keys, webhook salt, payment methods, plugins, refunds, recurring billing, payouts, platform APIs, and status page checks. Use when working with HitPay Malaysia, FPX, DuitNow, Touch 'n Go, cards, e-wallets, QR payments, Payment Links, API checkout, webhook settlement, refunds, or production readiness.
setup-senangpaySet up, build, debug, review, and explain senangPay payment integrations using official senangPay guide pages, Manual Integration API, Direct API, callbacks, return URLs, query status APIs, refund API, sandbox/live setup, Merchant ID, Secret Key, Hash Type, shopping cart plugins, e-commerce integrations, recurring payments, payout API, tokenisation, split settlements, and DOKU migration references. Use when working with senangPay hosted checkout, payment forms, callbacks, SHA256/MD5 hash verification, Direct API client sessions, JavaScript Web SDK, FPX bank lists, refunds, package capabilities, sandbox testing, or senangPay dashboard setup.
setup-stripe-malaysiaSet up, build, debug, review, and explain Stripe payment gateway integrations for Malaysia. Use when working with Stripe Checkout Sessions, Payment Intents, Payment Links, Elements, webhooks, Stripe.js, Stripe CLI, refunds, sandbox/live setup, MYR payments, cards, FPX, GrabPay, and production readiness.
setup-toyyibpaySet up, build, debug, review, and explain toyyibPay payment integrations using official toyyibPay API references, onboarding manuals, DuitNow QR notes, pricing/support pages, WooCommerce plugin notes, and WorkDo setup docs. Use when working with toyyibPay categories, bills, payment links, FPX, cards, DuitNow QR, callbacks, return URLs, MD5 callback verification, transaction lookups, inactive bills, sandbox/live setup, secret keys, category codes, WooCommerce setup, or ToyyibPay settlement checks.