stripe-sync-engine icon indicating copy to clipboard operation
stripe-sync-engine copied to clipboard

Unhandled webhook event on charge.refund.updated

Open yinghaochan opened this issue 5 months ago • 3 comments

Bug report

Looks like it's not on the list of webhooks in the README.md

Logs from docker

Error: Unhandled webhook event
    at /app/dist/routes/webhooks.js:262:44
    at step (/app/dist/routes/webhooks.js:33:23)
    at Object.next (/app/dist/routes/webhooks.js:14:53)
    at /app/dist/routes/webhooks.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/app/dist/routes/webhooks.js:4:12)
    at Object.handler (/app/dist/routes/webhooks.js:61:61)
    at preHandlerCallback (/app/node_modules/fastify/lib/handleRequest.js:137:37)
    at validationCompleted (/app/node_modules/fastify/lib/handleRequest.js:121:5)
    at preValidationCallback (/app/node_modules/fastify/lib/handleRequest.js:98:5)
{
    "level": "error",
    "time": "2024-08-28T12:46:04.707Z",
    "pid": 13,
    "hostname": "supabase-stripe-sync-engine-778859f98-7lnvx",
    "reqId": "req-7",
    "req": {
        "method": "POST",
        "url": "/webhooks",
        "hostname": "yhc-dev-kfwzw.ondigitalocean.app",
        "remoteAddress": "10.244.3.189",
        "remotePort": 40750
    },
    "res": { "statusCode": 500 },
    "err": {
        "type": "Error",
        "message": "Unhandled webhook event",
        "stack": "Error: Unhandled webhook event\n    at /app/dist/routes/webhooks.js:262:44\n    at step (/app/dist/routes/webhooks.js:33:23)\n    at Object.next (/app/dist/routes/webhooks.js:14:53)\n    at /app/dist/routes/webhooks.js:8:71\n    at new Promise (<anonymous>)\n    at __awaiter (/app/dist/routes/webhooks.js:4:12)\n    at Object.handler (/app/dist/routes/webhooks.js:61:61)\n    at preHandlerCallback (/app/node_modules/fastify/lib/handleRequest.js:137:37)\n    at validationCompleted (/app/node_modules/fastify/lib/handleRequest.js:121:5)\n    at preValidationCallback (/app/node_modules/fastify/lib/handleRequest.js:98:5)"
    },
    "msg": "Unhandled webhook event"
}

Logs from Stripe

Response body

{
  "statusCode": 500,
  "error": "Internal Server Error",
  "message": "Unhandled webhook event"
}

Request body

{
  "id": "evt_1PsbAsDZJ8Qwumi2PPwVK8gq",
  "object": "event",
  "api_version": "2024-06-20",
  "created": 1724810394,
  "data": {
    "object": {
      "id": "pyr_1PsbAmDZJ8Qwumi2synMmGaf",
      "object": "refund",
      "amount": 103,
      "balance_transaction": "txn_1PsbAmDZJ8Qwumi2hcRVlXqn",
      "charge": "py_3Psb7zDZJ8Qwumi20vvVEtQW",
      "created": 1724810388,
      "currency": "sgd",
      "destination_details": {
        "paynow": {},
        "type": "paynow"
      },
      "metadata": {},
      "payment_intent": "pi_3Psb7zDZJ8Qwumi20lg8AyBS",
      "reason": "duplicate",
      "receipt_number": null,
      "source_transfer_reversal": null,
      "status": "succeeded",
      "transfer_reversal": null
    },
    "previous_attributes": {}
  },
  "livemode": false,
  "pending_webhooks": 1,
  "request": {
    "id": null,
    "idempotency_key": null
  },
  "type": "charge.refund.updated"
}

yinghaochan avatar Aug 28 '24 13:08 yinghaochan