mpos-payoo-reconciliation

Reconciles mPOS and Payoo card transactions against payment lines via a Chrome extension crawler.

1|Updated May 23, 2026
One-click install
npx skills add https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2 --skill mpos-payoo-reconciliation-palfish-t-i-u
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mpos-payoo-reconciliation
Source: https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2/tree/main/.claude/skills/mpos-payoo-reconciliation
Command: npx skills add https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2 --skill mpos-payoo-reconciliation-palfish-t-i-u

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Accounting staff must manually match card-terminal (mPOS) and online-payment (Payoo) transactions against payment lines in payment requests, but neither portal offers a public API. This Skill documents and guides work on a Manifest V3 Chrome extension that crawls both portals using the accountant's existing browser session and posts data to a FastAPI backend for reconciliation. ## Core Features & Use Cases - Session-cookie crawling: The extension service worker reads portal cookies via chrome.cookies and crawls Payoo orders in sequential 3-day windows plus mPOS xlsx/csv exports, posting results to ingest endpoints. - Backend ingest and matching: FastAPI routes upsert gateway_transactions with ON CONFLICT dedup and rank match candidates from payment_lines by amount and date proximity. - Use Case: An accountant clicks "Đồng bộ ngay" in the GMV app, the extension syncs the latest mPOS and Payoo transactions, and they then link each gateway transaction to the correct payment line in CardReconciliationTab. ## Quick Start Ask the assistant to walk you through the mPOS/Payoo reconciliation architecture and help debug a failing gateway sync using this skill.

Frequently Asked Questions about mpos-payoo-reconciliation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync mPOS and Payoo transactions without a public API?

Use a Manifest V3 Chrome extension that runs in the accountant's browser, reads portal session cookies via chrome.cookies.getAll, and crawls mPOS exports and the Payoo order feed. The extension posts the data to FastAPI ingest endpoints authenticated with a shared token header.

How does the card transaction matching flow work?

The backend lists gateway_transactions with match_status other than matched, then ranks candidates from payment_lines filtered to card or installment methods by amount and date proximity. The accountant selects a candidate and the backend sets match_status to matched with matched_by and matched_at recorded.

Why does the Chrome extension use explicit Cookie headers instead of credentials include?

Cross-origin fetches from the MV3 service worker to export.mpos.vn and portal.payoo.vn silently drop cookies when using credentials include. The fix reads cookies with chrome.cookies.getAll and sets an explicit Cookie header on every fetch request.

Why did parallel Payoo crawling crash the backend?

Parallelizing all 3-day crawl windows with Promise.allSettled made every batch arrive at the 512MB Render backend simultaneously, exhausting memory. The crawl was reverted to sequential window processing and must not be re-parallelized without addressing the memory constraint.

What are the limitations of the Payoo data coverage?

Only the online order feed at /api/ecom/order/ is pulled; the card payment tab, bank account tab, and installment feed are not covered. Payoo online payment data also only starts from March 2026, so no earlier transactions exist to retrieve.

What should I do after changing the Chrome extension code?

Bump the version in manifest.json and run scripts/build_extension_zip.py to regenerate the distributed zip and ext-version.json. Skipping this causes app-downloaded installs to drift from repo code, which previously caused 180-second sync timeouts.