Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Aung Myo
2017-06-13 12:05:11 +06:30
3 changed files with 37 additions and 33 deletions

View File

@@ -18,6 +18,7 @@
<hr>
</div>
</div>
<p class="">You can rebate upto <span style="color:red;" id="food_prices"><%= @food_prices %></span></p>
</div>
</div>
@@ -119,22 +120,26 @@ $("#redeem").click(function(){
redeem_amount = parseInt($("#used_amount").text());
if(redeem_amount<=0 ){
alert("Please type valid amount");
}else if(valid_amount< redeem_amount){
alert(" Insufficient Amount!")
}else{
$.ajax({
type: "POST",
url: "<%=origami_payment_paypar_path%>",
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
success: function(result){
if(result.status == true){
window.location.href = '/origami/sale/'+ sale_id + "/payment"
}else{
alert(result.message);
if(redeem_amount <= "<%= @food_prices %>"){
$.ajax({
type: "POST",
url: "<%=origami_payment_paypar_path%>",
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
success: function(result){
if(result.status == true){
window.location.href = '/origami/sale/'+ sale_id + "/payment"
}else{
alert(result.message);
}
}
}
})
})
}else {
alert("Redeem Amount is over!");
}
}
});
</script>