From bc64c668353e54b1148882cc2d59d6df5138bd03 Mon Sep 17 00:00:00 2001 From: Ahsan Ulhaq Date: Fri, 20 Nov 2015 14:24:53 +0500 Subject: [PATCH] Refund Policy on Prof Ed Receipts ECOM-2562 --- common/djangoapps/student/models.py | 6 ++++++ lms/djangoapps/shoppingcart/models.py | 10 +++++++++- lms/djangoapps/shoppingcart/tests/test_models.py | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index 4696404716..daec221983 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -1419,6 +1419,12 @@ class CourseEnrollment(models.Model): """ return CourseMode.is_verified_slug(self.mode) + def is_professional_enrollment(self): + """ + Check the course enrollment mode is professional or not + """ + return CourseMode.is_professional_slug(self.mode) + @classmethod def is_enrolled_as_verified(cls, user, course_key): """ diff --git a/lms/djangoapps/shoppingcart/models.py b/lms/djangoapps/shoppingcart/models.py index 65d718df21..9a935a2d89 100644 --- a/lms/djangoapps/shoppingcart/models.py +++ b/lms/djangoapps/shoppingcart/models.py @@ -1984,7 +1984,10 @@ class CertificateItem(OrderItem): def additional_instruction_text(self): verification_reminder = "" + refund_reminder_msg = _("You can unenroll in the course and receive a full refund for 14 days after the course " + "start date. ") is_enrollment_mode_verified = self.course_enrollment.is_verified_enrollment() + is_professional_mode_verified = self.course_enrollment.is_professional_enrollment() if is_enrollment_mode_verified: domain = microsite.get_value('SITE_NAME', settings.SITE_NAME) @@ -1995,12 +1998,17 @@ class CertificateItem(OrderItem): "If you haven't verified your identity yet, please start the verification process ({verification_url})." ).format(verification_url=verification_url) + if is_professional_mode_verified: + refund_reminder_msg = _("You can unenroll in the course and receive a full refund for 2 days after the " + "course start date. ") + refund_reminder = _( - "You have up to two weeks into the course to unenroll and receive a full refund." + "{refund_reminder_msg}" "To receive your refund, contact {billing_email}. " "Please include your order number in your email. " "Please do NOT include your credit card information." ).format( + refund_reminder_msg=refund_reminder_msg, billing_email=settings.PAYMENT_SUPPORT_EMAIL ) diff --git a/lms/djangoapps/shoppingcart/tests/test_models.py b/lms/djangoapps/shoppingcart/tests/test_models.py index 6dbfdffc24..a22b91a791 100644 --- a/lms/djangoapps/shoppingcart/tests/test_models.py +++ b/lms/djangoapps/shoppingcart/tests/test_models.py @@ -1059,6 +1059,10 @@ class CertificateItemTest(ModuleStoreTestCase): email = mail.outbox[0] self.assertEquals('Order Payment Confirmation', email.subject) self.assertNotIn("If you haven't verified your identity yet, please start the verification process", email.body) + self.assertIn( + "You can unenroll in the course and receive a full refund for 2 days after the course start date. ", + email.body + ) class DonationTest(ModuleStoreTestCase):