What problem does it solve?
Payment callbacks and webhook endpoints are exposed to the public internet, making them targets for forged notifications, replayed messages, and amount manipulation. This Skill provides a defensive checklist and code patterns to prevent fake payment confirmations, duplicate processing, and inconsistent reconciliation logic.
Core Features & Use Cases
- Signature Verification Enforcement: Ensures callbacks are verified with the platform public key (e.g., WeChat Pay platform certificate) before decryption or processing, with certificate rotation support via serial number matching.
- Replay & Idempotency Protection: Applies timestamp window checks, transaction_id deduplication, and order state machine guards so duplicate notifications are safely acknowledged without reprocessing.
- Amount & Identity Consistency Checks: Requires strict comparison of callback amounts, out_trade_no, appid, and mchid against local order and tenant configuration, shared between callback and reconciliation paths.
- Use Case: When implementing a WeChat Pay V3 or Alipay callback endpoint in a Java Spring service, use this Skill to audit the handler for missing signature verification, missing idempotency, or placeholder TODO implementations that return fake data.
Quick Start
Ask the AI to review your payment callback or webhook handler code against the payment-callback-safety checklist before deploying it.