()
| 524 | } |
| 525 | |
| 526 | hasSubscription () { |
| 527 | if (this.isStudent() || this.isTeacher()) { return false } |
| 528 | const payPal = this.get('payPal') |
| 529 | const stripe = this.get('stripe') |
| 530 | const products = this.get('products') |
| 531 | if (payPal) { |
| 532 | if (payPal.billingAgreementID) { return true } |
| 533 | } |
| 534 | if (stripe) { |
| 535 | if (stripe.free === true) { return true } |
| 536 | if (_.isString(stripe.free) && (new Date() < new Date(stripe.free))) { return true } |
| 537 | } |
| 538 | if (products) { |
| 539 | const homeProducts = this.activeProducts('basic_subscription') |
| 540 | const maxFree = _.max(homeProducts, p => new Date(p.endDate)).endDate |
| 541 | if (new Date() < new Date(maxFree)) { return true } |
| 542 | } |
| 543 | return false |
| 544 | } |
| 545 | |
| 546 | isPaidOnlineClassUser () { |
| 547 | const products = this.get('products') |
no test coverage detected