Skip to content

Commit b32b62a

Browse files
committed
Plan updates for yearly addon pricing
1 parent 7381347 commit b32b62a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

firebase/functions/src/subscriptions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const getCheckoutLink = functions.https.onCall(
4444

4545
if (data?.pioneerDonationAmount) {
4646
checkoutOptions.addons = [{
47-
"id": "pioneer",
47+
"id": `pioneer${data.planId.includes('yearly') ? '-yearly' : ''}`,
4848
unit_price: Math.max(data.pioneerDonationAmount * 100,100),
4949
quantity: 1,
5050
}]

firebase/functions/src/subscriptions/subscriptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const refreshUserSubscriptionStatus = async (userId: string, { getSubscri
7777
if (existingSubscription == null || existingSubscription.expiry < expiry) {
7878

7979
const donationAddOnObject = entry.subscription?.addons?.find(
80-
(addOn: any) => addOn.id === 'pioneer'
80+
(addOn: any) => addOn.id === 'pioneer' || addOn.id === 'pioneer-yearly'
8181
)
8282
const donation = (donationAddOnObject) ? {
8383
donation: donationAddOnObject.unit_price * donationAddOnObject.amount

0 commit comments

Comments
 (0)