|
|
|
@ -189,11 +189,11 @@ function noticeSlipPayAndFinish() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function submitNoticeSlip() {
|
|
|
|
|
app.preloader.show();
|
|
|
|
|
app.dialog.preloader("Sending...");
|
|
|
|
|
stripe.createPaymentMethod({type: 'card', card: card}).then(function (result) {
|
|
|
|
|
if (result.error) {
|
|
|
|
|
// Inform the customer that there was an error.
|
|
|
|
|
app.preloader.hide();
|
|
|
|
|
app.dialog.close();
|
|
|
|
|
var errorElement = document.getElementById('noticeslip-card-errors');
|
|
|
|
|
errorElement.textContent = result.error.message;
|
|
|
|
|
} else {
|
|
|
|
@ -211,7 +211,7 @@ function submitNoticeSlip() {
|
|
|
|
|
amount: $("#noticeslip-pay-amount").text(),
|
|
|
|
|
stripeid: result.paymentMethod.id
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
app.preloader.hide();
|
|
|
|
|
app.dialog.close();
|
|
|
|
|
if (resp.status == "OK") {
|
|
|
|
|
app.popup.close();
|
|
|
|
|
router.navigate("/noticeslip/success");
|
|
|
|
@ -221,7 +221,7 @@ function submitNoticeSlip() {
|
|
|
|
|
app.dialog.alert("There was a server problem. Try again later.", "Error");
|
|
|
|
|
}
|
|
|
|
|
}, function (xhr) {
|
|
|
|
|
app.preloader.hide();
|
|
|
|
|
app.dialog.close();
|
|
|
|
|
app.popup.close();
|
|
|
|
|
try {
|
|
|
|
|
var error = $.parseJSON(xhr.responseText);
|
|
|
|
|