buy now flow complete except email confirmation
This commit is contained in:
113
rowers/templates/paymentconfirm.html
Normal file
113
rowers/templates/paymentconfirm.html
Normal file
@@ -0,0 +1,113 @@
|
||||
{% extends "newbase.html" %}
|
||||
{% block title %}Rowsandall Paid Membership{% endblock title %}
|
||||
{% load rowerfilters %}
|
||||
{% block main %}
|
||||
|
||||
<h1>Confirm Your Payment</h1>
|
||||
|
||||
<h2>Order Overview</h2>
|
||||
|
||||
<ul class="main-content">
|
||||
<li class="grid_2">
|
||||
<p>
|
||||
<table class="plantable shortpadded" width="80%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Plan</th><td>{{ plan.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Payment Type</th><td>{{ plan.paymenttype }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Plan Duration</th><td>1 year starting today</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Total</th><td>€ {{ plan.price|currency }}
|
||||
{% if plan.paymenttype == 'recurring' %}
|
||||
/year
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
<table class="plantable shortpadded" width="80%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Street Address</th><td>{{ user.rower.street_address }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>City</th><td>{{ user.rower.city }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Posstal Code</th><td>{{ user.rower.postal_code }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Country</th><td>{{ user.rower.country }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<p>
|
||||
<a href="/rowers/billing">Change Order</a>
|
||||
</li>
|
||||
<li class="grid_4">
|
||||
<form id="payment-form" method="post" action="/rowers/checkouts"
|
||||
autocomplete="off">
|
||||
<section>
|
||||
<label for="amount">
|
||||
<div class="input-wrapper amount-wrapper">
|
||||
<input id="amount" name="amount" type="hidden" min="1" placeholder="Amount"
|
||||
value="{{ plan.price }}" readonly>
|
||||
</div>
|
||||
</label>
|
||||
<div class="bt-drop-in-wrapper">
|
||||
<div id="bt-dropin"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<input type="hidden" id="nonce" name="payment_method_nonce" />
|
||||
<input type="hidden" id="plan" name="plan" value="{{ plan.id }}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" id="submit-button"><span>Pay € {{ plan.price|currency }}</span></button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<script src="https://js.braintreegateway.com/web/dropin/1.14.1/js/dropin.min.js"></script>
|
||||
<script>
|
||||
var form = document.querySelector('#payment-form');
|
||||
var client_token = '{{ client_token }}';
|
||||
braintree.dropin.create({
|
||||
authorization: client_token,
|
||||
container: '#bt-dropin',
|
||||
paypal: {
|
||||
flow: 'checkout'
|
||||
}
|
||||
}, function (createErr, instance) {
|
||||
form.addEventListener('submit', function (event) {
|
||||
event.preventDefault();
|
||||
instance.requestPaymentMethod(function (err, payload) {
|
||||
if (err) {
|
||||
console.log('Error', err);
|
||||
return;
|
||||
}
|
||||
// Add the nonce to the form and submit
|
||||
document.querySelector('#nonce').value = payload.nonce;
|
||||
form.submit();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% include 'menu_profile.html' %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user