mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
update API's monthly Gem cap messages to use the friendly website version (#12150)
* allow subscribers to buy their final monthly gem * replace old montly Gem cap messages with friendlier new ones
This commit is contained in:
@@ -119,7 +119,7 @@ describe('shared.ops.buyGem', () => {
|
|||||||
buyGem(user, { params: { type: 'gems', key: 'gem' } });
|
buyGem(user, { params: { type: 'gems', key: 'gem' } });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
expect(err).to.be.an.instanceof(NotAuthorized);
|
expect(err).to.be.an.instanceof(NotAuthorized);
|
||||||
expect(err.message).to.equal(i18n.t('reachedGoldToGemCap', { convCap: planGemLimits.convCap }));
|
expect(err.message).to.equal(i18n.t('maxBuyGems', { convCap: planGemLimits.convCap }));
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
"buyGemsGold": "Buy Gems with Gold",
|
"buyGemsGold": "Buy Gems with Gold",
|
||||||
"buyGemsGoldText": "Alexander the Merchant will sell you Gems at a cost of 20 Gold per Gem. His monthly shipments are initially capped at 25 Gems per month, but for every 3 consecutive months that you are subscribed, this cap increases by 5 Gems, up to a maximum of 50 Gems per month!",
|
"buyGemsGoldText": "Alexander the Merchant will sell you Gems at a cost of 20 Gold per Gem. His monthly shipments are initially capped at 25 Gems per month, but for every 3 consecutive months that you are subscribed, this cap increases by 5 Gems, up to a maximum of 50 Gems per month!",
|
||||||
"mustSubscribeToPurchaseGems": "Must subscribe to purchase gems with GP",
|
"mustSubscribeToPurchaseGems": "Must subscribe to purchase gems with GP",
|
||||||
"reachedGoldToGemCap": "You've reached the Gold=>Gem conversion cap <%= convCap %> for this month. We have this to prevent abuse / farming. The cap resets within the first three days of each month.",
|
"reachedGoldToGemCapQuantity": "Your requested amount <%= quantity %> exceeds the amount you can buy for this month (<%= convCap %>). The full amount becomes available within the first three days of each month. Thanks for subscribing!",
|
||||||
"reachedGoldToGemCapQuantity": "Your requested amount <%= quantity %> exceeds the Gold=>Gem conversion cap <%= convCap %> for this month. We have this to prevent abuse / farming. The cap resets within the first three days of each month.",
|
|
||||||
"retainHistory": "Retain additional history entries",
|
"retainHistory": "Retain additional history entries",
|
||||||
"retainHistoryText": "Makes completed To-Dos and task history available for longer.",
|
"retainHistoryText": "Makes completed To-Dos and task history available for longer.",
|
||||||
"doubleDrops": "Daily drop caps doubled",
|
"doubleDrops": "Daily drop caps doubled",
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export class BuyGemOperation extends AbstractGoldItemOperation { // eslint-disab
|
|||||||
super.canUserPurchase(user, item);
|
super.canUserPurchase(user, item);
|
||||||
|
|
||||||
if (user.purchased.plan.gemsBought >= this.convCap) {
|
if (user.purchased.plan.gemsBought >= this.convCap) {
|
||||||
throw new NotAuthorized(this.i18n('reachedGoldToGemCap', { convCap: this.convCap }));
|
throw new NotAuthorized(this.i18n('maxBuyGems', { convCap: this.convCap }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.purchased.plan.gemsBought + this.quantity > this.convCap) {
|
if (user.purchased.plan.gemsBought + this.quantity > this.convCap) {
|
||||||
|
|||||||
Reference in New Issue
Block a user