We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ccee27f commit e458c8cCopy full SHA for e458c8c
1 file changed
src/lib/user-entitlement.ts
@@ -31,7 +31,10 @@ export async function processPurchaseInfo(fsPurchase: PurchaseInfo): Promise<voi
31
}
32
33
function getCreditsForPurchase(fsPurchase: PurchaseInfo): number {
34
- return resourceRecord[pricingToResourceMap[fsPurchase.pricingId]] ?? 0;
+ const credits = resourceRecord[pricingToResourceMap[fsPurchase.pricingId]] ?? 0;
35
+
36
+ // Return sum total of 12 months of credits if annual billing cycle
37
+ return fsPurchase.isAnnual() ? credits * 12 : credits;
38
39
40
async function processEntitlementFromPurchase(user: User, fsPurchase: PurchaseInfo): Promise<number> {
0 commit comments