@@ -46,27 +46,25 @@
} else { // Token was created!
console.log(response);
// Get the token ID:
var token = response.id;
// Insert the token ID into the form so it gets submitted to the server:
$form = $form.append($('<input type="hidden" name="stripe_token" />').val(token));
// Submit the form:
$submit.prop('disabled', false);
$submit.click();
$submit.prop('disabled', true);
$form.get(0).submit();
$form.append($('<p>').text("Processing your payment. Please do not refresh."));
}
};
</script>
{% endblock %}
{% block body %}
<h2>Credit card payment for invoice #{{ invoice.id}}</h2>
<p>You have ${{ invoice.balance_due }} remaining to pay on this invoice.</p>
@@ -76,15 +74,15 @@
<h3>Card details</h3>
<form id="payment-form" method="post">
<div class="alert alert-danger" id="payment-errors-outer" style="display: none;">
<a class="close" data-dismiss="alert">×</a>
<span id="payment-errors"></span>
</div>
{% csrf_token %}
{{form|bootstrap}}
<input id="submit" class="btn btn-primary" type="submit" value="Pay {{ invoice.balance_due }}" />
<input id="pay" class="btn btn-primary" type="submit" value="Pay {{ invoice.balance_due }}" />
</form>