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,