按照实时汇率进行充值

This commit is contained in:
jysperm
2014-06-21 13:48:55 +08:00
parent 71747bff27
commit def75ff1bc
2 changed files with 10 additions and 10 deletions

View File

@@ -30,13 +30,14 @@ exports.doCallback = (data, callback) ->
unless data.secret == account.blockchain_secret
return callback 'Invalid Secret'
if data.confirmations > config.bitcoin.confirmations
amount = parseFloat(data.value) / config.bitcoin.sbtc2cny
exports.getExchangeRate (rate) ->
if data.confirmations > config.bitcoin.confirmations
amount = parseFloat(data.value) / 100000000 / rate
mAccount.incBalance account, 'deposit', amount,
type: 'bitcoin'
order_id: data.input_transaction_hash
, ->
callback '*OK*'
else
callback 'Confirmations Insufficient'
mAccount.incBalance account, 'deposit', amount,
type: 'bitcoin'
order_id: data.input_transaction_hash
, ->
callback '*OK*'
else
callback 'Confirmations Insufficient'

View File

@@ -47,7 +47,6 @@ module.exports =
bitcoin:
forward_to: '1FjhhWrzAvb9YD4tVdbE6wrSoHSwxMJoWe'
confirmations: 1
sbtc2cny: 25000
plugins:
mysql: