diff options
| author | Adam Soltys <[email protected]> | 2023-09-02 17:12:10 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-09-02 17:12:10 +0000 |
| commit | 0d7574597d33bad78f4ebad3c38b956debb0e699 (patch) | |
| tree | b969b38d31922124a8fde1e4a01ab2c9ff4a75e1 | |
| parent | 68a2aede36519b4d5891c9427e5cddc699082189 (diff) | |
| download | coinos-server-0d7574597d33bad78f4ebad3c38b956debb0e699.tar.gz coinos-server-0d7574597d33bad78f4ebad3c38b956debb0e699.zip | |
fix swedish currency
| -rw-r--r-- | lib/countries.js | 2 | ||||
| -rw-r--r-- | lib/payments.js | 21 |
2 files changed, 19 insertions, 4 deletions
diff --git a/lib/countries.js b/lib/countries.js index 9220a886..5fc19683 100644 --- a/lib/countries.js +++ b/lib/countries.js @@ -213,7 +213,7 @@ export default { SR: "SUR", SJ: "NOK", SZ: "SWZ", - SE: "SWE", + SE: "SEK", CH: "CHE", SY: "SYR", TW: "TWN", diff --git a/lib/payments.js b/lib/payments.js index c8e74201..2764df18 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -181,13 +181,28 @@ 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 raw = `/app/data/uploads/${p.id}-raw.mp3`; let out = `/app/data/uploads/${p.id}.mp3`; |
