feat: payment verification and membership
This commit is contained in:
@@ -222,9 +222,9 @@
|
||||
</a>
|
||||
|
||||
{% elif course.paid_course %}
|
||||
<div class="btn btn-primary wide-button" id="buy-course" data-course="{{ course.name | urlencode }}">
|
||||
<a class="btn btn-primary wide-button" href="/billing/{{ course.name | urlencode }}">
|
||||
{{ _("Buy This Course") }}
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{% elif show_start_learing_cta(course, membership) %}
|
||||
<div class="btn btn-primary wide-button enroll-in-course" data-course="{{ course.name | urlencode }}">
|
||||
@@ -257,9 +257,6 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
@@ -280,9 +277,4 @@
|
||||
{{ _("You have exceeded the maximum number of attempts allowed to appear for evaluations of this course.") }}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{%- block script %}
|
||||
{{ super() }}
|
||||
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
|
||||
{% endblock %}
|
||||
{% endmacro %}
|
||||
@@ -20,10 +20,6 @@ frappe.ready(() => {
|
||||
$("#submit-for-review").click((e) => {
|
||||
submit_for_review(e);
|
||||
});
|
||||
|
||||
$("#buy-course").click((e) => {
|
||||
generate_checkout_link(e);
|
||||
});
|
||||
});
|
||||
|
||||
const hide_wrapped_mentor_cards = () => {
|
||||
@@ -146,24 +142,3 @@ const submit_for_review = (e) => {
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
generate_checkout_link = (e) => {
|
||||
e.preventDefault();
|
||||
let course = decodeURIComponent($(e.currentTarget).attr("data-course"));
|
||||
|
||||
if (frappe.session.user == "Guest") {
|
||||
window.location.href = `/login?redirect-to=/courses/${course}`;
|
||||
return;
|
||||
}
|
||||
|
||||
frappe.call({
|
||||
method: "lms.lms.doctype.lms_course.lms_course.get_payment_options",
|
||||
args: {
|
||||
course: course,
|
||||
},
|
||||
callback: (data) => {
|
||||
let rzp1 = new Razorpay(data.message);
|
||||
rzp1.open();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user