From bb5c5718377df9c3eb6e99807bf78075ca157488 Mon Sep 17 00:00:00 2001 From: gunshiz Date: Fri, 2 Oct 2026 11:25:28 +0700 Subject: [PATCH] fix : dupe slip issue --- lib/commission/payment.test.ts | 3 ++- lib/commission/payment.ts | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/commission/payment.test.ts b/lib/commission/payment.test.ts index 4caf91f..781cf5d 100644 --- a/lib/commission/payment.test.ts +++ b/lib/commission/payment.test.ts @@ -36,9 +36,10 @@ describe("commission slip verification", () => { const fetch = vi.fn(async (_url: URL, init: RequestInit) => { expect(init.headers).toEqual({ Authorization: "Bearer secret" }); const payload = JSON.parse((init.body as FormData).get("payload") as string); - expect(payload).toMatchObject({ checkDuplicate: true, + expect(payload).toMatchObject({ checkReceiver: [{ accountType: "02001", accountNumber: "0812345678" }], checkAmount: { type: "eq", amount: "100.00" } }); + expect(payload).not.toHaveProperty("checkDuplicate"); return Response.json(response); }); vi.stubGlobal("fetch", fetch); diff --git a/lib/commission/payment.ts b/lib/commission/payment.ts index d15cad5..184487d 100644 --- a/lib/commission/payment.ts +++ b/lib/commission/payment.ts @@ -38,7 +38,6 @@ export async function verifyCommissionSlip(file: File, amountBaht: number, check const form = new FormData(); form.set("file", file); form.set("payload", JSON.stringify({ - checkDuplicate: true, checkReceiver: [{ accountType: { mobile: "02001", nationalId: "02003", ewallet: "02004" }[identifier.type], accountNumber: receiverNumber,