From 5955ff6969a5301c4413631b76cf2300d193f8ed Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 11 Mar 2023 10:20:46 -0800 Subject: separate tips from amounts --- lib/invoices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/invoices.js') diff --git a/lib/invoices.js b/lib/invoices.js index 5d68d09d..95a81104 100644 --- a/lib/invoices.js +++ b/lib/invoices.js @@ -13,7 +13,7 @@ export let generate = async ({ invoice, user, sender, memo }) => { let { currency, tip, amount, rate, request_id, prompt, type } = invoice; amount = parseInt(amount || 0); - tip = parseInt(tip || 0); + tip = parseInt(tip) || null; if (amount < 0) fail("amount out of range"); @@ -54,7 +54,7 @@ export let generate = async ({ invoice, user, sender, memo }) => { invoice = { amount, - created: Date.now(), + created: Date.now(), currency, hash, rate, -- cgit v1.2.3