0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

🐛 Fixed paid subscription alert showing incorrect offer amount

closes https://github.com/TryGhost/Team/issues/1876

- the offer portion of new paid subscription alert was showing the wrong amount as the value is denoted in cents and needs conversion
- the value shown was 100x as the actual amount needs to be transformed (X/100)
This commit is contained in:
Rishabh 2022-09-05 23:13:40 +05:30
parent 27704794d4
commit a8368a261c
2 changed files with 4 additions and 3 deletions

View file

@ -230,7 +230,8 @@ class StaffServiceEmails {
if (offer.type === 'percent') {
offAmount = `${offer.amount}% off`;
} else if (offer.type === 'fixed') {
offAmount = `${this.getFormattedAmount({currency: offer.currency, amount: offer.amount})} off`;
const amount = this.getAmount(offer.amount);
offAmount = `${this.getFormattedAmount({currency: offer.currency, amount})} off`;
} else if (offer.type === 'trial') {
offAmount = `${offer.amount} days free`;
}

View file

@ -308,7 +308,7 @@ describe('StaffService', function () {
duration_in_months: 3,
type: 'fixed',
currency: 'USD',
amount: 10
amount: 1000
};
await service.notifyPaidSubscriptionStart({member, offer, tier, subscription}, options);
@ -333,7 +333,7 @@ describe('StaffService', function () {
duration: 'forever',
type: 'fixed',
currency: 'USD',
amount: 20
amount: 2000
};
await service.notifyPaidSubscriptionStart({member, offer, tier, subscription}, options);