Verify status and amount fields on epay IPN, not just resultCd
Per MGP_Merchant_Interface_V1.4.7VN.md section 5.3.2: resultCd "00_000" alone does not mean "payment success" - MGP can send it for a refund IPN too (status field: "0" = payment, "2" = refund). epayIPN previously set status="success" purely off resultCd, which would have misclassified a refund event on a still-pending transaction. Now requires resultCd "00_000" AND status "0". Also adds an explicit amount cross-check between the IPN body and the stored transaction (spec's "Lưu ý đặc biệt 2") as a defense-in-depth, clearly-diagnosable guard alongside the existing signature verification (which already implicitly enforces this, but with a generic error). Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017KPzWwuTEeX2vXGXvyGn4q
Showing
Please
register
or
sign in
to comment