diff options
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); |
