MCPcopy Create free account
hub / github.com/codecombat/codecombat / getLtvMultiplier

Function getLtvMultiplier

app/lib/paymentUtils.js:32–44  ·  view source on GitHub ↗
(duration)

Source from the content-addressed store, hash-verified

30}
31
32function getLtvMultiplier (duration) {
33 if (!duration)
34 return 1
35 if (duration.includes('year'))
36 return 2
37 if (duration.includes('month')) {
38 const interval = parseInt(duration.split('_')[0])
39 // assuming user will pay us for a year, so if user pays monthly, multiply by 12.
40 // If user pays quarterly, multiply by 12 / 3 = 4
41 return Math.round(12 / interval)
42 }
43 return 1
44}
45
46module.exports = {
47 setTemporaryPremiumAccess,

Callers 1

getTrackingDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected