MCPcopy Create free account
hub / github.com/WebDevSimplified/course-platform / getUserCoupon

Function getUserCoupon

src/lib/userCountryHeader.ts:22–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22export async function getUserCoupon() {
23 const country = await getUserCountry()
24 if (country == null) return
25
26 const coupon = pppCoupons.find(coupon =>
27 coupon.countryCodes.includes(country)
28 )
29
30 if (coupon == null) return
31
32 return {
33 stripeCouponId: coupon.stripeCouponId,
34 discountPercentage: coupon.discountPercentage,
35 }
36}

Callers 3

PriceFunction · 0.90
getClientSessionSecretFunction · 0.90
PriceFunction · 0.90

Calls 1

getUserCountryFunction · 0.85

Tested by

no test coverage detected