commit
e57bccf750
14 changed files with 565 additions and 24 deletions
|
|
@ -23,7 +23,7 @@ const customers = require('./customers')
|
|||
const commissionMath = require('./commission-math')
|
||||
const loyalty = require('./loyalty')
|
||||
|
||||
const { cassetteMaxCapacity } = require('./constants')
|
||||
const { cassetteMaxCapacity, CASH_OUT_DISPENSE_READY, CONFIRMATION_CODE } = require('./constants')
|
||||
|
||||
const notifier = require('./notifier')
|
||||
|
||||
|
|
@ -366,19 +366,19 @@ function plugins (settings, deviceId) {
|
|||
|
||||
const phone = tx.phone
|
||||
const timestamp = dateFormat(new Date(), 'UTC:HH:MM Z')
|
||||
const rec = {
|
||||
sms: {
|
||||
toNumber: phone,
|
||||
body: `Your cash is waiting! Go to the Cryptomat and press Redeem within 24 hours. [${timestamp}]`
|
||||
}
|
||||
}
|
||||
return sms.getSms(CASH_OUT_DISPENSE_READY, phone, { timestamp })
|
||||
.then(smsObj => {
|
||||
const rec = {
|
||||
sms: smsObj
|
||||
}
|
||||
|
||||
return sms.sendMessage(settings, rec)
|
||||
.then(() => {
|
||||
const sql = 'UPDATE cash_out_txs SET notified=$1 WHERE id=$2'
|
||||
const values = [true, tx.id]
|
||||
|
||||
return sms.sendMessage(settings, rec)
|
||||
.then(() => {
|
||||
const sql = 'update cash_out_txs set notified=$1 where id=$2'
|
||||
const values = [true, tx.id]
|
||||
|
||||
return db.none(sql, values)
|
||||
return db.none(sql, values)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -754,15 +754,15 @@ function plugins (settings, deviceId) {
|
|||
? '123'
|
||||
: randomCode()
|
||||
|
||||
const rec = {
|
||||
sms: {
|
||||
toNumber: phone,
|
||||
body: 'Your cryptomat code: ' + code
|
||||
}
|
||||
}
|
||||
|
||||
return sms.sendMessage(settings, rec)
|
||||
.then(() => code)
|
||||
return sms.getSms(CONFIRMATION_CODE, phone, { code })
|
||||
.then(smsObj => {
|
||||
const rec = {
|
||||
sms: smsObj
|
||||
}
|
||||
|
||||
return sms.sendMessage(settings, rec)
|
||||
.then(() => code)
|
||||
})
|
||||
}
|
||||
|
||||
function sweepHdRow (row) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue