Skip to content

Commit

Permalink
added the new requested changes in lums-161
Browse files Browse the repository at this point in the history
  • Loading branch information
umer farooq committed Jan 29, 2021
1 parent f05b28f commit 4bcf21d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 35 deletions.
11 changes: 3 additions & 8 deletions ecommerce/extensions/payment/views/lumsxpay.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import datetime

from django.contrib.auth.views import redirect_to_login
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db import transaction
from django.http import HttpResponseNotFound
from django.shortcuts import render_to_response
Expand Down Expand Up @@ -93,16 +94,10 @@ def get(self, request):
configuration_helpers = request.site.siteconfiguration.edly_client_theme_branding_settings
url = configuration_helpers.get('LUMSXPAY_VOUCHER_API_URL')

if request.user.is_anonymous or not (url and basket):
msg = 'user is anonymous cannot proceed to checkout page so redirecting to login. '
if not url:
msg = 'LUMSXPAY_VOUCHER_API_URL is not defined in site configurations'
logger.info(msg)

if not url:
msg = 'Site configuration in ecommerce does not include payment API url'
logger.info(msg)

return redirect_to_login(get_lms_dashboard_url)

existing_basket_challan = self.get_existing_basket_challan(request)
if existing_basket_challan.exists():
context = self.request_existing_challan_context(request, existing_basket_challan.first())
Expand Down
85 changes: 58 additions & 27 deletions ecommerce/templates/payment/lumsxpay.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "edx/base.html" %}
{% load i18n %}
{% block title %}Bootstrap Demo{% endblock title %}
{% block title %}Check out | LUMSx{% endblock title %}


{% block content %}
Expand Down Expand Up @@ -36,9 +36,9 @@
Payment clearance to the course might take upto {{ configuration_helpers.CRON_DELAY_TIME }} minutes.
</div>

<div class="col-md-12" style="margin-bottom: 20px;">
<div class="col-md-12" style="margin-top: 30px;">
<div class="col-md-5">
<div class="col-md-12" style="margin-top: 50px;">
<div class="col-md-12">
<h5><strong>In Your Cart</strong></h5>
</div>
<div class="col-md-12">
Expand All @@ -49,7 +49,7 @@ <h5><strong>Your purchases are the following:</strong></h5>
<thead>
<tr>
<th>Product Name</th>
<th>Price</th>
<th>Price(PKR)</th>
</tr>
</thead>
<tbody>
Expand All @@ -71,42 +71,73 @@ <h5><strong>Your purchases are the following:</strong></h5>
</div>
<div class="col-md-12" style="margin-bottom: 30px;">
<div class="col-ms-12">
<div style="margin: 40px;">
<div style="margin-top: 40px; margin-left: 40px;">
<a type="button" class="btn btn-primary" target="_blank" href="{{ url_for_online_payment }}">Pay
Voucher Online</a>
<a type="button" class="btn btn-primary required" target="_blank"
href="{{ url_for_download_voucher }}">Download
Challan Voucher</a>
</div>
</div>
<div class="col-md-8">
<p>
<span class="required"></span>
Download the Challan Voucher for payments through, Cash, Pay Order, Bank Drafts, ATM machines,
Internet banking portals at selected banks in Pakistan
</p>
</div>
<div class="col-md-4"></div>
</div>
<div class="col-md-12" style="margin-top: 15px;">
<div class="col-md-12">
<div class="col-md-8">
<p>
<span class="required"></span>
Download the Challan Voucher for payments through, Cash, Pay Order, Bank Drafts, ATM
machines,
Internet banking portals at selected banks in Pakistan
</p>
</div>
<div class="col-md-4"></div>
</div>

<div class="col-ms-12" style="margin-top: 80px;">
<h3><strong>Next Steps</strong></h3>
<h5>
A confirmation email will be sent to you when you have made the payment and been enrolled in the course.
Please follow the steps in this email to access the course. </br></br>
Alternatively, after making the payment you go to your Dashboard to view the course. Please note that it
may take up to {{ configuration_helpers.CRON_DELAY_TIME }} minutes for your course to be made available to you. Kindly contact
<a>{{ support_email }}</a> for further queries
</h5>
</div>
<div class="col-md-12">
<a type="button" class="btn btn-primary"
href="{{ lms_dashboard_url }}">View my courses</a>

</div>
</div>

<div class="container">
<div class="col-md-12">
<div class="col-md-12">
<h3><strong>Next Steps</strong></h3>
<div class="col-md-12">
<h5>
A confirmation email will be sent to you after you have made the payment and been enrolled
in
the
course.
Please follow the steps in this email to access the course. </br></br>
Alternatively, after making the payment you can go to your Dashboard to view the course.
Please
note
that it
may take up to {{ configuration_helpers.CRON_DELAY_TIME }} minutes for your course to be
made
available
to you. Kindly contact
<a>{{ support_email }}</a> for further queries
</h5>
</div>
<div class="col-md-12" style="margin-bottom: 50px;">
<a type="button" class="btn btn-primary"
href="{{ lms_dashboard_url }}">View my courses</a>
</div>

</div>
</div>
</div>
</div>

<footer class="footer">
<div class="container">
<div class="row">
<div class="col-xs-12 text-right">
<em>{% blocktrans %}{{ platform_name }} Course Administration Tool{% endblocktrans %}</em>
</div>
</div>
</div>
</footer>

<style>
.required:after {
content: " *";
Expand Down

0 comments on commit 4bcf21d

Please sign in to comment.