diff options
| author | Adam Soltys <[email protected]> | 2023-09-03 20:49:34 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-09-03 20:49:34 -0700 |
| commit | c8043f25ff3c9fc6e17724061c0fec456b9f3c2c (patch) | |
| tree | 71d27f182563394eef30d84a553676baf30db276 /lib/payments.js | |
| parent | dd93caa76eee95ace50f05ca13a344bc3bc5ad4a (diff) | |
| parent | 3aa200db295438827bfff48f80e3f4b25f44e8ea (diff) | |
| download | coinos-server-c8043f25ff3c9fc6e17724061c0fec456b9f3c2c.tar.gz coinos-server-c8043f25ff3c9fc6e17724061c0fec456b9f3c2c.zip | |
Merge branch 'prod'
Diffstat (limited to 'lib/payments.js')
| -rw-r--r-- | lib/payments.js | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/payments.js b/lib/payments.js index c8e74201..48fc36a8 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -181,9 +181,26 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => { callWebhook(invoice, p); if (user.hasprinter) { - let words = dollarsToWords( - parseFloat(((amount * p.rate) / 100000000).toFixed(2)) - ); + let fiat = parseFloat(((amount * p.rate) / 100000000).toFixed(2)); + let words = dollarsToWords(fiat); + + let client = mqtt.connect("mqtt://ln.coinos.io", config.mqtt); + client.subscribe(username); + + if (fiat === 0.02) { + words = "there is no second best"; + client.publish(username, "easter"); + } + + if (fiat === 0.21) { + words = "tick tock, next block"; + client.publish(username, "easter"); + } + + if (fiat === 0.69) { + words = "have fun staying poor"; + client.publish(username, "easter"); + } let client = mqtt.connect("mqtt://ln.coinos.io", config.mqtt); client.subscribe(username); |
