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:
parent
27704794d4
commit
a8368a261c
2 changed files with 4 additions and 3 deletions
|
@ -230,7 +230,8 @@ class StaffServiceEmails {
|
||||||
if (offer.type === 'percent') {
|
if (offer.type === 'percent') {
|
||||||
offAmount = `${offer.amount}% off`;
|
offAmount = `${offer.amount}% off`;
|
||||||
} else if (offer.type === 'fixed') {
|
} 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') {
|
} else if (offer.type === 'trial') {
|
||||||
offAmount = `${offer.amount} days free`;
|
offAmount = `${offer.amount} days free`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,7 +308,7 @@ describe('StaffService', function () {
|
||||||
duration_in_months: 3,
|
duration_in_months: 3,
|
||||||
type: 'fixed',
|
type: 'fixed',
|
||||||
currency: 'USD',
|
currency: 'USD',
|
||||||
amount: 10
|
amount: 1000
|
||||||
};
|
};
|
||||||
|
|
||||||
await service.notifyPaidSubscriptionStart({member, offer, tier, subscription}, options);
|
await service.notifyPaidSubscriptionStart({member, offer, tier, subscription}, options);
|
||||||
|
@ -333,7 +333,7 @@ describe('StaffService', function () {
|
||||||
duration: 'forever',
|
duration: 'forever',
|
||||||
type: 'fixed',
|
type: 'fixed',
|
||||||
currency: 'USD',
|
currency: 'USD',
|
||||||
amount: 20
|
amount: 2000
|
||||||
};
|
};
|
||||||
|
|
||||||
await service.notifyPaidSubscriptionStart({member, offer, tier, subscription}, options);
|
await service.notifyPaidSubscriptionStart({member, offer, tier, subscription}, options);
|
||||||
|
|
Loading…
Add table
Reference in a new issue