mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-29 03:55:42 +08:00
/panel/pay & bitcoin & rpvhost
This commit is contained in:
@@ -4,7 +4,7 @@ path = require 'path'
|
||||
bitcoin = require './bitcoin'
|
||||
|
||||
{mAccount} = app.models
|
||||
{pluggable, config} = app
|
||||
{pluggable, config, utils} = app
|
||||
|
||||
module.exports = pluggable.createHelpers exports =
|
||||
name: 'bitcoin'
|
||||
@@ -12,7 +12,7 @@ module.exports = pluggable.createHelpers exports =
|
||||
|
||||
exports.registerHook 'account.before_register',
|
||||
filter: (account, callback) ->
|
||||
bitcoin_secret = exports.randomSalt()
|
||||
bitcoin_secret = utils.randomSalt()
|
||||
|
||||
bitcoin.genAddress bitcoin_secret, (address) ->
|
||||
account.pluggable.bitcoin =
|
||||
@@ -21,12 +21,14 @@ exports.registerHook 'account.before_register',
|
||||
|
||||
callback()
|
||||
|
||||
exports.registerHook 'billing.payment_method',
|
||||
exports.registerHook 'billing.payment_methods',
|
||||
widget_generator: (account, callback) ->
|
||||
jade.renderFile path.join(__dirname, 'view/payment_method.jade'),
|
||||
account: account
|
||||
, (err, html) ->
|
||||
callback html
|
||||
bitcoin.getExchangeRate config.billing.currency, (rate) ->
|
||||
jade.renderFile path.join(__dirname, 'view/payment_method.jade'),
|
||||
account: account
|
||||
exchange_rate: rate
|
||||
, (err, html) ->
|
||||
callback html
|
||||
|
||||
app.post '/bitcoin/coinbase_callback', (req, res) ->
|
||||
mAccount.findOne
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
div
|
||||
h2 比特币
|
||||
p 你可以直接向该地址发送比特币。在经过一次确认后,系统会实时地,自动为你折算充值金额,最小支付金额 0.0005。
|
||||
p 你可以直接向该地址发送比特币。在经过一次确认后,系统会实时地,自动为你折算充值金额,最小支付金额为 0.0005.
|
||||
p 实时汇率:10 CNY = #{(exchange_rate * 10).toFixed(4)} BTC
|
||||
pre= account.attribute.bitcoin_deposit_address
|
||||
pre= account.pluggable.bitcoin.bitcoin_deposit_address
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
path = require 'path'
|
||||
jade = require 'jade'
|
||||
|
||||
{pluggable} = app
|
||||
{pluggable, config} = app
|
||||
{renderAccount} = app.middleware
|
||||
|
||||
module.exports = pluggable.createHelpers exports =
|
||||
@@ -12,10 +13,11 @@ exports.registerHook 'view.layout.menu_bar',
|
||||
target: '_blank'
|
||||
body: '官方博客'
|
||||
|
||||
exports.registerHook 'billing.payment_method',
|
||||
exports.registerHook 'billing.payment_methods',
|
||||
widget_generator: (account, callback) ->
|
||||
jade.renderFile path.join(__dirname, 'view/payment_method.jade'),
|
||||
account: account
|
||||
config: config
|
||||
, (err, html) ->
|
||||
callback html
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
div
|
||||
h2 淘宝
|
||||
p 拍下对应宝贝后付款即可,购买时注意选择服务器节点选项,备注填写你的用户名。
|
||||
a.btn.btn-success(href='http://item.taobao.com/item.htm?id=#{config.billing.taobao_item_id}') 淘宝购买
|
||||
a.btn.btn-success(href='http://item.taobao.com/item.htm?id=#{config.plugins.rpvhost.taobao_item_id}') 淘宝购买
|
||||
|
||||
Reference in New Issue
Block a user