mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-05-18 17:52:31 +08:00
按照实时汇率进行充值
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -47,7 +47,6 @@ module.exports =
|
||||
bitcoin:
|
||||
forward_to: '1FjhhWrzAvb9YD4tVdbE6wrSoHSwxMJoWe'
|
||||
confirmations: 1
|
||||
sbtc2cny: 25000
|
||||
|
||||
plugins:
|
||||
mysql:
|
||||
|
||||
Reference in New Issue
Block a user