From deda2dd0c7708d2580baad55008633cdd445c7ac Mon Sep 17 00:00:00 2001 From: phyusin Date: Fri, 8 Dec 2017 11:20:30 +0630 Subject: [PATCH] add double click event for all payment --- app/views/origami/credit_payments/index.html.erb | 7 ++++++- app/views/origami/jcb/index.html.erb | 5 +++++ app/views/origami/master/index.html.erb | 5 +++++ app/views/origami/mpu/index.html.erb | 5 +++++ app/views/origami/payments/show.html.erb | 4 ++-- app/views/origami/redeem_payments/index.html.erb | 5 +++++ app/views/origami/visa/index.html.erb | 5 +++++ 7 files changed, 33 insertions(+), 3 deletions(-) diff --git a/app/views/origami/credit_payments/index.html.erb b/app/views/origami/credit_payments/index.html.erb index 712284da..82e66d7e 100755 --- a/app/views/origami/credit_payments/index.html.erb +++ b/app/views/origami/credit_payments/index.html.erb @@ -169,6 +169,7 @@ var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ + $(this).off("click"); $.ajax({type: "POST", url: "<%= origami_payment_credit_path %>", data: "amount="+ amount + "&sale_id="+ sale_id, @@ -177,7 +178,11 @@ swal({ title: "Information!", text: "Payment Success", - type: "success" + type: "success", + html: true, + closeOnConfirm: false, + closeOnCancel: false, + allowOutsideClick: false }, function () { window.location.href = '/origami/sale/'+ sale_id + "/payment"; }); diff --git a/app/views/origami/jcb/index.html.erb b/app/views/origami/jcb/index.html.erb index 226accab..e33d4936 100755 --- a/app/views/origami/jcb/index.html.erb +++ b/app/views/origami/jcb/index.html.erb @@ -161,6 +161,7 @@ $('#jcb_pay').on('click',function(){ var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ + $(this).off("click"); //start member discount 5% by pay card var sub_total = $('#sub-total').text(); var member_id = $('#membership_id').text(); @@ -183,6 +184,10 @@ $('#jcb_pay').on('click',function(){ swal({ title: "Information!", text: "Payment Successfully", + html: true, + closeOnConfirm: false, + closeOnCancel: false, + allowOutsideClick: false },function () { window.location.href = '/origami/sale/'+ sale_id + "/payment"; }); diff --git a/app/views/origami/master/index.html.erb b/app/views/origami/master/index.html.erb index fb271154..7dfac224 100755 --- a/app/views/origami/master/index.html.erb +++ b/app/views/origami/master/index.html.erb @@ -158,6 +158,7 @@ var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ + $(this).off("click"); //start member discount 5% by pay card var sub_total = $('#sub-total').text(); var member_id = $('#membership_id').text(); @@ -180,6 +181,10 @@ swal({ title: "Information!", text: "Payment Successfully", + html: true, + closeOnConfirm: false, + closeOnCancel: false, + allowOutsideClick: false },function () { window.location.href = '/origami/sale/'+ sale_id + "/payment"; }); diff --git a/app/views/origami/mpu/index.html.erb b/app/views/origami/mpu/index.html.erb index 82ed09f2..85ebdc6c 100755 --- a/app/views/origami/mpu/index.html.erb +++ b/app/views/origami/mpu/index.html.erb @@ -161,6 +161,7 @@ var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ + $(this).off("click"); //start member discount 5% by pay card var sub_total = $('#sub-total').text(); var member_id = $('#membership_id').text(); @@ -184,6 +185,10 @@ swal({ title: "Information!", text: "Payment Successfully", + html: true, + closeOnConfirm: false, + closeOnCancel: false, + allowOutsideClick: false }, function () { window.location.href = '/origami/sale/'+ sale_id + "/payment"; }); diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index dff17d79..7fbc9c60 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -418,7 +418,7 @@ title: "Information!", text: 'Changed amount ' + $('#balance').text() * (-1), html: true, - closeOnConfirm: false, //It does close the popup when I click on close button + closeOnConfirm: false, closeOnCancel: false, allowOutsideClick: false }, function () { @@ -430,7 +430,7 @@ title: "Information!", text: 'Thank You !', html: true, - closeOnConfirm: false, //It does close the popup when I click on close button + closeOnConfirm: false, closeOnCancel: false, allowOutsideClick: false }, function () { diff --git a/app/views/origami/redeem_payments/index.html.erb b/app/views/origami/redeem_payments/index.html.erb index 20ebdd88..6daacbb2 100755 --- a/app/views/origami/redeem_payments/index.html.erb +++ b/app/views/origami/redeem_payments/index.html.erb @@ -169,6 +169,7 @@ swal ( "Oops" , "Insufficient Amount!" , "warning" ); }else{ if(redeem_amount <= "<%= @redeem_prices %>"){ + $(this).off("click"); $.ajax({ type: "POST", url: "<%=origami_payment_paypar_path%>", @@ -179,6 +180,10 @@ swal({ title: "Information!", text: result.message, + html: true, + closeOnConfirm: false, + closeOnCancel: false, + allowOutsideClick: false }, function () { window.location.href = '/origami/sale/'+ sale_id + "/payment" }); diff --git a/app/views/origami/visa/index.html.erb b/app/views/origami/visa/index.html.erb index 04dad682..d239e231 100755 --- a/app/views/origami/visa/index.html.erb +++ b/app/views/origami/visa/index.html.erb @@ -160,6 +160,7 @@ console.log(amount); console.log($("#validamount").attr("value")); if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ + $(this).off("click"); //start member discount 5% by pay card var sub_total = $('#sub-total').text(); var member_id = $('#membership_id').text(); @@ -182,6 +183,10 @@ swal({ title: "Information!", text: "Payment Successfully", + html: true, + closeOnConfirm: false, + closeOnCancel: false, + allowOutsideClick: false }, function () { window.location.href = '/origami/sale/'+ sale_id + "/payment"; });