(user)
| 53 | } |
| 54 | |
| 55 | getLifetimeSubscriptionForUser (user) { |
| 56 | let countrySpecificProduct |
| 57 | const country = ((user != null ? user.get('country') : undefined) || '').toLowerCase() |
| 58 | if ((country === 'hong-kong') || (country === 'taiwan')) { |
| 59 | return null |
| 60 | } |
| 61 | |
| 62 | const coupon = __guard__(user != null ? user.get('stripe') : undefined, x => x.couponID) |
| 63 | if (coupon) { |
| 64 | countrySpecificProduct = this.findWhere({ name: `${coupon}_lifetime_subscription` }) |
| 65 | } |
| 66 | if (!countrySpecificProduct) { |
| 67 | countrySpecificProduct = this.findWhere({ name: `${(user != null ? user.get('country') : undefined)}_lifetime_subscription` }) |
| 68 | } |
| 69 | return countrySpecificProduct || this.findWhere({ name: 'lifetime_subscription' }) |
| 70 | } |
| 71 | } |
| 72 | Products.initClass() |
| 73 | return Products |
no test coverage detected