diff options
| author | Adam Soltys <[email protected]> | 2023-03-11 10:20:46 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-03-11 10:20:46 -0800 |
| commit | 5955ff6969a5301c4413631b76cf2300d193f8ed (patch) | |
| tree | 92d1269a098cb7c764ca92f7a40af9ee236ae5b1 /lib/invoices.js | |
| parent | 7fec7cc3e7c51a9892869732b5bfe65922ee7818 (diff) | |
| download | coinos-server-5955ff6969a5301c4413631b76cf2300d193f8ed.tar.gz coinos-server-5955ff6969a5301c4413631b76cf2300d193f8ed.zip | |
separate tips from amounts
Diffstat (limited to 'lib/invoices.js')
| -rw-r--r-- | lib/invoices.js | 4 |
1 files changed, 2 insertions, 2 deletions
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, |
