From 972ea530e8139a0357b6b45ccdf9742d19ba6a26 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 8 Mar 2024 04:31:34 +0000 Subject: validate tips --- lib/payments.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/payments.js') diff --git a/lib/payments.js b/lib/payments.js index 76286938..03085280 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -73,6 +73,7 @@ export let debit = async ({ } let tip = parseInt(invoice?.tip) || null; + if (tip < 0) fail("Invalid tip"); if (!amount || amount < 0) fail("Amount must be greater than zero"); -- cgit v1.2.3