Provide hard-limit info
This commit is contained in:
parent
0d8a8547f5
commit
51ebfe6a1d
2 changed files with 18 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ function getDailyVolume (id) {
|
||||||
db.one(`select coalesce(sum(fiat), 0) as total from cash_in_txs
|
db.one(`select coalesce(sum(fiat), 0) as total from cash_in_txs
|
||||||
where customer_id=$1
|
where customer_id=$1
|
||||||
and created > now() - interval '1 day'`, [id]),
|
and created > now() - interval '1 day'`, [id]),
|
||||||
db.one(`select COALESCE(sum(fiat), 0) as total from cash_out_txs
|
db.one(`select coalesce(sum(fiat), 0) as total from cash_out_txs
|
||||||
where customer_id=$1
|
where customer_id=$1
|
||||||
and created > now() - interval '1 day'`, [id])
|
and created > now() - interval '1 day'`, [id])
|
||||||
]).then(([cashInTotal, cashOutTotal]) => {
|
]).then(([cashInTotal, cashOutTotal]) => {
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,8 @@ function poll (req, res, next) {
|
||||||
idVerificationEnabled: config.idVerificationEnabled,
|
idVerificationEnabled: config.idVerificationEnabled,
|
||||||
smsVerificationActive: config.smsVerificationActive,
|
smsVerificationActive: config.smsVerificationActive,
|
||||||
smsVerificationThreshold: config.smsVerificationThreshold,
|
smsVerificationThreshold: config.smsVerificationThreshold,
|
||||||
|
hardLimitVerificationActive: config.hardLimitVerificationActive,
|
||||||
|
hardLimitVerificationThreshold: config.hardLimitVerificationThreshold,
|
||||||
cassettes,
|
cassettes,
|
||||||
twoWayMode: config.cashOutEnabled,
|
twoWayMode: config.cashOutEnabled,
|
||||||
zeroConfLimit: config.zeroConfLimit,
|
zeroConfLimit: config.zeroConfLimit,
|
||||||
|
|
@ -188,6 +190,19 @@ function pair (req, res, next) {
|
||||||
.catch(next)
|
.catch(next)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function phoneCode (req, res, next) {
|
||||||
|
const pi = plugins(req.settings, req.deviceId)
|
||||||
|
const phone = req.body.phone
|
||||||
|
|
||||||
|
return pi.getPhoneCode(phone)
|
||||||
|
.then(code => respond(req, res, {code}))
|
||||||
|
.catch(err => {
|
||||||
|
if (err.name === 'BadNumberError') throw httpError('Bad number', 410)
|
||||||
|
throw err
|
||||||
|
})
|
||||||
|
.catch(next)
|
||||||
|
}
|
||||||
|
|
||||||
function errorHandler (err, req, res, next) {
|
function errorHandler (err, req, res, next) {
|
||||||
const statusCode = err.name === 'HTTPError'
|
const statusCode = err.name === 'HTTPError'
|
||||||
? err.code || 500
|
? err.code || 500
|
||||||
|
|
@ -283,6 +298,8 @@ app.get('/tx', getPhoneTx)
|
||||||
|
|
||||||
app.use(errorHandler)
|
app.use(errorHandler)
|
||||||
app.use((req, res) => {
|
app.use((req, res) => {
|
||||||
|
console.log('DEBUG98')
|
||||||
|
console.log(req.route)
|
||||||
res.status(404).json({error: 'No such route'})
|
res.status(404).json({error: 'No such route'})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue