@@ -42,6 +42,14 @@ $(document).ready(function() { | |||||
}) | }) | ||||
}); | }); | ||||
}); | }); | ||||
instance.on('paymentMethodRequestable', function (event) { | |||||
button.removeAttribute('disabled'); | |||||
}); | |||||
instance.on('noPaymentMethodRequestable', function () { | |||||
button.setAttribute('disabled', true); | |||||
}); | |||||
}); | }); | ||||
}) | }) |
@@ -26,7 +26,7 @@ | |||||
</div> | </div> | ||||
</section> | </section> | ||||
<button class="btn btn-primary" type="submit" id="submit-button"><span>{{ _("Pay") }} {{ amount }} {{ currency }}</span></button> | |||||
<button class="btn btn-primary" type="submit" id="submit-button" disabled><span>{{ _("Pay") }} {{ amount }} {{ currency }}</span></button> | |||||
</form> | </form> | ||||
</div> | </div> | ||||
@@ -15,4 +15,13 @@ | |||||
<style> | <style> | ||||
{% include "templates/styles/card_style.css" %} | {% include "templates/styles/card_style.css" %} | ||||
</style> | </style> | ||||
<script> | |||||
frappe.ready(function() { | |||||
if('{{ frappe.form_dict.redirect_to or "" }}'){ | |||||
setTimeout(function(){ | |||||
window.location.href = '{{ frappe.form_dict.redirect_to }}'; | |||||
}, 6000); | |||||
} | |||||
}) | |||||
</script> | |||||
{% endblock %} | {% endblock %} |