{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://goodgo.vn/schemas/events/payment.completed.schema.json", "title": "payment.completed", "description": "Emitted when a Payment aggregate transitions to SUCCEEDED after a verified gateway IPN (VNPay / MoMo / ZaloPay).", "type": "object", "additionalProperties": false, "required": [ "paymentId", "orderId", "userId", "amount", "currency", "gateway", "gatewayTransactionId", "paidAt" ], "properties": { "paymentId": { "type": "string", "minLength": 1 }, "orderId": { "type": "string", "minLength": 1 }, "userId": { "type": "string", "minLength": 1 }, "amount": { "type": "string", "pattern": "^-?\\d+(\\.\\d+)?$", "description": "Decimal as string to preserve VND precision (no float rounding)." }, "currency": { "type": "string", "enum": ["VND", "USD"] }, "gateway": { "type": "string", "enum": ["vnpay", "momo", "zalopay"] }, "gatewayTransactionId": { "type": "string", "minLength": 1 }, "paidAt": { "type": "string", "format": "date-time" } } }