Limit paid amount for JCB, Visa and Master Card
This commit is contained in:
@@ -9,6 +9,22 @@
|
||||
</div>
|
||||
<div class="card" style="margin-top:10px;padding-top:20px;">
|
||||
<div class="rebate-form">
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">You can pay upto </label>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_jcb %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% if @jcbcount != 0 %>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Recent JCB paid amount </label>
|
||||
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@jcbcount %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
||||
@@ -75,7 +91,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block"> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -125,16 +141,19 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
$('#jcb_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_jcb_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
alert("Payment success")
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
});
|
||||
if(parseFloat(amount) <= "<%= @can_jcb %>"){
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_jcb_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
alert("Payment success")
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
alert("Paid Amount is over!");
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user