Skip to content

Commit

Permalink
feat(payments): auto-redirect success page
Browse files Browse the repository at this point in the history
Make it obvious this is not the page to stare at because apparently one
student left it open overnight expecting the page to do something.
  • Loading branch information
vEnhance committed Sep 4, 2023
1 parent 1545bd0 commit 50b32cd
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion payments/templates/payments/success.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,30 @@ <h1>Payment pending</h1>
<p>
Your card was charged successfully and the
payment is now pending from the credit/debit card company.
Please check back later, usually it only takes a few moments to process.
Please check back later, usually it only takes a few seconds to process.
Once the payment is processed, your
<a href="{% url "invoice" %}">invoice page</a>
will be automatically updated.
(There is no email confirmation, just check the link above.)
</p>
<p>
You will be redirected back to the invoice page in
<span id="num_seconds">10</span>
seconds.
</p>
</div>
{% endblock base-content %}
{% block scripts %}
<script type="text/javascript">
$(document).ready(function() {
setTimeout(function() {
window.location = "{% url 'invoice' %}";
}, 10000);
let t = 10;
setInterval(function() {
t--;
$("#num_seconds").html(t);
}, 1000);
});
</script>
{% endblock scripts %}

0 comments on commit 50b32cd

Please sign in to comment.