Merge pull request #3201 from dpalou/MOBILE-4012

MOBILE-4012 enrol: Support 'fee' enrolment method
main
Noel De Martin 2022-03-23 15:54:22 +01:00 committed by GitHub
commit b531182666
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -40,6 +40,8 @@ import { CoreColors } from '@singletons/colors';
import { CoreText } from '@singletons/text'; import { CoreText } from '@singletons/text';
import { CorePromisedValue } from '@classes/promised-value'; import { CorePromisedValue } from '@classes/promised-value';
const ENROL_BROWSER_METHODS = ['fee', 'paypal'];
/** /**
* Page that shows the summary of a course including buttons to enrol and other available options. * Page that shows the summary of a course including buttons to enrol and other available options.
*/ */
@ -256,7 +258,7 @@ export class CoreCourseSummaryPage implements OnInit, OnDestroy {
} }
// enrollmentmethods contains ALL enrolment methods including manual. // enrollmentmethods contains ALL enrolment methods including manual.
if (!this.isEnrolled && courseByField.enrollmentmethods?.some((method) => method === 'paypal')) { if (!this.isEnrolled && courseByField.enrollmentmethods?.some((method) => ENROL_BROWSER_METHODS.includes(method))) {
this.otherEnrolments = true; this.otherEnrolments = true;
} }