feat: Refund payment (#6610)
Essentially the same as #6601 but for refunds
This commit is contained in:
+17
-17
@@ -642,23 +642,23 @@ moduleIntegrationTestRunner({
|
||||
)
|
||||
})
|
||||
|
||||
// it("should throw if refund is greater than captured amount", async () => {
|
||||
// await service.capturePayment({
|
||||
// amount: 50,
|
||||
// payment_id: "pay-id-1",
|
||||
// })
|
||||
//
|
||||
// const error = await service
|
||||
// .refundPayment({
|
||||
// amount: 100,
|
||||
// payment_id: "pay-id-1",
|
||||
// })
|
||||
// .catch((e) => e)
|
||||
//
|
||||
// expect(error.message).toEqual(
|
||||
// "Refund amount for payment: pay-id-1 cannot be greater than the amount captured on the payment."
|
||||
// )
|
||||
// })
|
||||
it("should throw if refund is greater than captured amount", async () => {
|
||||
await service.capturePayment({
|
||||
amount: 50,
|
||||
payment_id: "pay-id-1",
|
||||
})
|
||||
|
||||
const error = await service
|
||||
.refundPayment({
|
||||
amount: 100,
|
||||
payment_id: "pay-id-1",
|
||||
})
|
||||
.catch((e) => e)
|
||||
|
||||
expect(error.message).toEqual(
|
||||
"You cannot refund more than what is captured on the payment."
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe("cancel", () => {
|
||||
|
||||
Reference in New Issue
Block a user