Added check for balance with respect to quantity (#9469)

This commit is contained in:
Keith Holliday
2017-11-14 16:55:08 -07:00
committed by GitHub
parent 848883736d
commit c43ca62bc4
2 changed files with 19 additions and 2 deletions

View File

@@ -138,7 +138,7 @@ module.exports = function purchase (user, req = {}, analytics) {
throw new NotAuthorized(i18n.t('messageNotAvailable', req.language));
}
if (!user.balance || user.balance < price) {
if (!user.balance || user.balance < price * quantity) {
throw new NotAuthorized(i18n.t('notEnoughGems', req.language));
}