mirror of
https://github.com/Since-3/Kuma.git
synced 2026-10-12 21:41:17 +00:00
see comments
This commit is contained in:
parent
7aa887c5aa
commit
d91b353dc2
20 changed files with 593 additions and 151 deletions
|
|
@ -51,6 +51,28 @@ describe("refundStripePayment", () => {
|
|||
refundApplicationFee: false,
|
||||
});
|
||||
|
||||
expect(result).toEqual({ success: false, error: "insufficient balance" });
|
||||
expect(result).toEqual({ success: false, error: "insufficient balance", definitive: false });
|
||||
});
|
||||
|
||||
it("unterscheidet eine sichere Ablehnung von einem offenen Ausgang", async () => {
|
||||
const rejected = Object.assign(new Error("Charge already refunded"), {
|
||||
type: "StripeInvalidRequestError",
|
||||
code: "charge_already_refunded",
|
||||
});
|
||||
vi.mocked(stripe.refunds.create).mockRejectedValueOnce(rejected);
|
||||
const timeout = Object.assign(new Error("timeout"), { type: "StripeConnectionError" });
|
||||
vi.mocked(stripe.refunds.create).mockRejectedValueOnce(timeout);
|
||||
|
||||
const params = {
|
||||
paymentIntentId: "pi_1",
|
||||
stripeAccountId: "acct",
|
||||
refundApplicationFee: false,
|
||||
};
|
||||
expect(await refundStripePayment(params)).toMatchObject({
|
||||
success: false,
|
||||
definitive: true,
|
||||
code: "charge_already_refunded",
|
||||
});
|
||||
expect(await refundStripePayment(params)).toMatchObject({ success: false, definitive: false });
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue