// The answer of POST /api/orders/:uuid/capture/:paypalOrderId: the paid order, or, when the order is already paid with this // PayPal order (a repeated capture), { success: true, alreadyCaptured: true } (libreshop/cms src/api/order/controllers/order.ts). // Pure: no Nuxt or Vue imports, tested in tests/unit/captureResponse.test.ts. /** The CMS's answer to a repeated capture: the payment went through before, and the order is paid. */ export type AlreadyCaptured = { success: true; alreadyCaptured: true }; export const isAlreadyCaptured = (response: unknown): response is AlreadyCaptured => typeof response === "object" && response !== null && (response as Record).success === true && (response as Record).alreadyCaptured === true;