pluggable.createHelpers & payment_method pluggable

This commit is contained in:
jysperm
2014-09-30 10:43:36 +08:00
parent 4a29e4d5bc
commit 45b4e2c4a2
8 changed files with 39 additions and 10 deletions

View File

@@ -80,7 +80,7 @@ module.exports =
amount = billing_traffic / BILLING_BUCKET * config.plugins.shadowsocks.price_bucket
mAccount.update _id: account._id,
mAccount.update {_id: account._id},
$unset:
'attribute.plugin.shadowsocks': true
$inc:
@@ -152,7 +152,7 @@ module.exports =
if billing_bucket > 0
amount = billing_bucket * config.plugins.shadowsocks.price_bucket
mAccount.update _id: account._id,
mAccount.update {_id: account._id},
$set:
'attribute.plugin.shadowsocks.pending_traffic': new_pending_traffic
'attribute.plugin.shadowsocks.last_traffic_value': bytes
@@ -166,7 +166,7 @@ module.exports =
, ->
callback()
else if pending_traffic != new_pending_traffic or last_traffic_value != bytes
mAccount.update _id: account._id,
mAccount.update {_id: account._id},
$set:
'attribute.plugin.shadowsocks.pending_traffic': new_pending_traffic
'attribute.plugin.shadowsocks.last_traffic_value': bytes