mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Stripe Elements: Fix incorrect JavaScript and display loading indicator
This commit is contained in:
@@ -64,7 +64,7 @@ $(function () {
|
||||
|
||||
$(".checkout-button-row .btn-primary").click(
|
||||
function (e) {
|
||||
if (($("input[name=payment][value=stripe]").prop('checked') || $("input[type=checkbox][name=payment]").length === 0)
|
||||
if (($("input[name=payment][value=stripe]").prop('checked') || $("input[type=checkbox][name=radio]").length === 0)
|
||||
&& $("#stripe_token").val() == "") {
|
||||
pretixstripe.start();
|
||||
e.preventDefault();
|
||||
|
||||
@@ -28,6 +28,9 @@ var pretixstripe = {
|
||||
});
|
||||
},
|
||||
'load': function () {
|
||||
if (pretixstripe.stripe !== null) {
|
||||
return;
|
||||
}
|
||||
$('.stripe-container').closest("form").find(".btn-primary").prop("disabled", true);
|
||||
$.ajax(
|
||||
{
|
||||
@@ -66,6 +69,9 @@ var pretixstripe = {
|
||||
);
|
||||
},
|
||||
'load_checkout': function () {
|
||||
if (pretixstripe.checkout_handler !== null) {
|
||||
return;
|
||||
}
|
||||
$('.stripe-container').closest("form").find(".btn-primary").prop("disabled", true);
|
||||
$.ajax(
|
||||
{
|
||||
@@ -151,7 +157,7 @@ $(function () {
|
||||
|
||||
$('.stripe-container').closest("form").submit(
|
||||
function () {
|
||||
if (($("input[name=payment][value=stripe]").prop('checked') || $("input[name=payment][type=checkbox]").length === 0)
|
||||
if (($("input[name=payment][value=stripe]").prop('checked') || $("input[name=payment][type=radio]").length === 0)
|
||||
&& $("#stripe_token").val() == "") {
|
||||
if ($("#stripe-checkout").length) {
|
||||
pretixstripe.show_checkout();
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
{% endif %}
|
||||
|
||||
<div id="stripe-card" class="form-control">
|
||||
<span class="fa fa-spinner fa-spin"></span>
|
||||
<!-- a Stripe Element will be inserted here. -->
|
||||
</div>
|
||||
<p class="help-block">
|
||||
|
||||
Reference in New Issue
Block a user