agentleFS
hit-payhit-pay/claude-code-plugin/skills/qr-checkout/SKILL.md

qr-checkout

Skill1 starsChanged 8 months agoMITView on GitHub

Generate a local QR payment checkout page using HitPay MCP tools. Use when user says "create a QR checkout page", "QR payment page", "show QR code for PayNow", "QR checkout for QRIS", "build a QR payment page", "QR page for [country] customer", or "embedded QR checkout page".

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the customer's country differs from the merchant's currency country:

    line 72
  2. Very specific:

    Use the borderless method code from the table above (e.g., gcash_qr not gcash)

    line 75
  3. Very specific:

    If the user requests multiple methods, make separate create_embedded_qr calls for each method (the tool accepts only one method at a time).

    line 94
  4. Very specific:

    Check the qr_code_data.qr_code value:

    line 125
  5. Very specific:

    Use Python's qrcode library to convert text payloads to base64 PNG data URIs:

    line 132
  6. Very specific:

    If the qr_code starts with iVBOR, it's already a base64 PNG:

    line 166
  7. Very specific:

    Read the template from references/html-template.md and inject the data:

    line 176

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

HitPay QR Checkout — Local Payment Page Generator

Generate a self-contained HTML file that displays a branded QR payment page. Orchestrates create_embedded_qr → pre-renders QR images with Python → assembles HTML → opens in browser.

Key difference from agent-skills version: This skill generates local HTML files with pre-rendered QR images (no CDN dependencies). Works offline, on file:// protocol, and via email.

Collecting QR payments without a visual page? Use the payment-methods skill instead. Writing backend integration code? Use the payment-integration skill instead.

When to Apply

  • User wants a visual QR payment page as a local HTML file
  • User says "create a QR checkout page", "QR payment page", "show a QR to collect payment"
  • User mentions a specific payment method + amount and wants a rendered page

Step 1: Parse Natural Language

Map the user's request to create_embedded_qr parameters:

Payment Method Mapping

User Sayspayment_methodsDefault Currency
PayNowpaynow_onlineSGD
QRPH / InstaPayqrph_netbankPHP
GCashgcash_qrPHP
PromptPayopn_prompt_payTHB
TrueMoneyopn_true_money_qrTHB
QRISifpay_qrisIDR
UPIupi_qrSGD
ShopeePayshopee_paySGD
GrabPaygrabpay_directSGD
Touch 'n Go / TNGtouch_n_goMYR

Customer Country Mapping

User SaysRecommended MethodCode
Filipino / Philippine customerQR Ph (InstaPay)qrph_netbank
Thai customerPromptPayopn_prompt_pay
Indonesian customerQRISifpay_qris
Malaysian customerTouch 'n Gotouch_n_go
Singapore customerPayNowpaynow_online

Display Name Lookup

API CodeDisplay Name
paynow_onlinePayNow
qrph_netbankQRPH (InstaPay)
gcash_qrGCash
opn_prompt_payPromptPay
opn_true_money_qrTrueMoney
ifpay_qrisQRIS
doku_qrisQRIS (DOKU)
upi_qrUPI
shopee_payShopeePay
grabpay_directGrabPay
touch_n_goTouch 'n Go

Step 2: Detect Borderless (Cross-Border)

If the customer's country differs from the merchant's currency country:

  1. Set currency to the merchant's currency (e.g., SGD for a Singapore merchant)
  2. Use the borderless method code from the table above (e.g., gcash_qr not gcash)
  3. The response will include borderless_fx with FX conversion details

Example: Singapore merchant + Filipino customer → currency: "SGD", payment_methods: ["qrph_netbank"]

Step 3: Call MCP Tool

For each payment method, call create_embedded_qr:

Tool: create_embedded_qr
Parameters:
  amount: "<amount>"
  currency: "<resolved currency>"
  payment_methods: ["<resolved method>"]
  purpose: "<optional description>"
  reference_number: "<optional reference>"

If the user requests multiple methods, make separate create_embedded_qr calls for each method (the tool accepts only one method at a time).

Expected Response Shape

{
  "id": "abc-123",
  "amount": "SGD 100.00",
  "status": "pending",
  "payment_methods": ["qrph_netbank"],
  "checkout_url": "https://securecheckout.hit-pay.com/...",
  "qr_code_data": {
    "qr_code": "<raw QR payload string or base64 PNG>",
    "qr_code_expiry": "2025-01-01T12:15:00Z"
  },
  "borderless_fx": {
    "customer_pays": "PHP 4,557.00",
    "merchant_receives": "SGD 100.00",
    "fx_rate": "45.57",
    "display_rate": "1 SGD = 45.57 PHP",
    "fee_note": "1.5% cross-border processing fee applies"
  }
}

Step 4: Pre-Render QR Images with Python

This is the critical step. Convert QR payloads to base64 data URIs so the HTML works on file:// without any CDN.

QR Format Detection

Check the qr_code_data.qr_code value:

  • Starts with iVBOR → Already a base64 PNG. Prefix with data:image/png;base64, to create the data URI.
  • Anything else → Raw text payload (e.g., PayNow EMV string, QRIS TLV). Must be rendered to a QR image.

Rendering Text Payloads

Use Python's qrcode library to convert text payloads to base64 PNG data URIs:

# First, ensure qrcode is installed
pip3 install qrcode[pil] 2>/dev/null

# Then render the QR payload to a base64 data URI
python3 -c "
import qrcode, io, base64
qr = qrcode.make('PASTE_QR_PAYLOAD_HERE', error_correction=qrcode.constants.ERROR_CORRECT_M)
buf = io.BytesIO()
qr.save(buf, format='PNG')
print('data:image/png;base64,' + base64.b64encode(buf.getvalue()).decode())
"

Important: The QR payload may contain special characters. Pass it as a Python string literal (use raw strings or escape properly). For very long payloads, write to a temp file first:

# For long/complex payloads
echo 'PAYLOAD_HERE' > /tmp/qr_payload.txt
python3 -c "
import qrcode, io, base64
with open('/tmp/qr_payload.txt') as f:
    payload = f.read().strip()
qr = qrcode.make(payload, error_correction=qrcode.constants.ERROR_CORRECT_M)
buf = io.BytesIO()
qr.save(buf, format='PNG')
print('data:image/png;base64,' + base64.b64encode(buf.getvalue()).decode())
"

Handling Base64 PNG Payloads

If the qr_code starts with iVBOR, it's already a base64 PNG:

data:image/png;base64,iVBOR...

Just prepend data:image/png;base64, — no Python rendering needed.

Step 5: Assemble HTML Page

Read the template from references/html-template.md and inject the data:

  1. Replace all {{PLACEHOLDER}} markers with actual values
  2. For single method: use the single-card layout
  3. For multiple methods: use the grid layout (the template handles both)
  4. Set borderless section visibility based on whether borderless_fx is present

Save the file and open it:

# Save to a descriptive filename
open /tmp/hitpay-qr-checkout-{method}-{amount}.html

Error Handling

SituationAction
Missing amountAsk user: "What amount should I create the QR for?"
Missing payment methodAsk user: "Which payment method? (PayNow, QRPH, GCash, etc.)"
Ambiguous methodDefault to PayNow (SGD) or ask if multi-market
pip3 install qrcode failsFall back: use the checkout_url and tell user to open in browser
Provider not enabledTell user to enable in HitPay dashboard
API errorSurface the error message from the MCP response
qr_code_data is nullUse checkout_url — generate an HTML page with just the checkout link

Brand Colors

TokenHexUsage
Deep Blue#002771Dark gradient background
Logo Blue#0E2859Card background
Action Blue#2465DEAccents, links, badges
White#FFFFFFQR container, text on dark
Success Green#4DAB80Merchant receives amount
Danger#E5484DExpired timer

Skill Boundaries

  • This skill: Orchestrates MCP call → pre-render QR → local HTML file (no CDN, works offline)
  • payment-methods: Country-to-method lookup tables, API values
  • payment-integration: Backend integration code — API routes, webhook handlers
  • drop-in-ui: HitPay.js embedded checkout (requires network)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.