change route in other payment
This commit is contained in:
@@ -230,14 +230,14 @@ function setCommPorts(comPortLists) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** pay with CB bank **/
|
/** pay with CB bank **/
|
||||||
function pay_withBank(cmd_type, payment_type, bnk_bill_amount,sale_id,receipt_no) {
|
function pay_withBank(cmd_type, payment_type, bnk_bill_amount,sale_id,receipt_no,cashier_type) {
|
||||||
$("#loading_wrapper").show();
|
$("#loading_wrapper").show();
|
||||||
var com_port = $("#com_port_name").val();
|
var com_port = $("#com_port_name").val();
|
||||||
reqCardSaleTrans(cmd_type, payment_type, bnk_bill_amount, sale_id, receipt_no, com_port);
|
reqCardSaleTrans(cmd_type, payment_type, bnk_bill_amount, sale_id, receipt_no, com_port,cashier_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
//add req data to card_sale_trans table
|
//add req data to card_sale_trans table
|
||||||
function reqCardSaleTrans(cmd_type, payment_type, bnk_bill_amount, sale_id, receipt_no, com_port) {
|
function reqCardSaleTrans(cmd_type, payment_type, bnk_bill_amount, sale_id, receipt_no, com_port,cashier_type) {
|
||||||
var jobj = {"cmd_type" : cmd_type, "payment_type" : "CARD", "amt" : bnk_bill_amount, "sale_id" : sale_id, "inv_no" : receipt_no, "com_port" : com_port};
|
var jobj = {"cmd_type" : cmd_type, "payment_type" : "CARD", "amt" : bnk_bill_amount, "sale_id" : sale_id, "inv_no" : receipt_no, "com_port" : com_port};
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@@ -247,14 +247,14 @@ function reqCardSaleTrans(cmd_type, payment_type, bnk_bill_amount, sale_id, rece
|
|||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data.status == "success"){
|
if (data.status == "success"){
|
||||||
card_sale_trans_id = data.card_sale_trans_id;
|
card_sale_trans_id = data.card_sale_trans_id;
|
||||||
resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amount, sale_id, receipt_no,com_port);
|
resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amount, sale_id, receipt_no,com_port,cashier_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//add res data to card_sale_trans table
|
//add res data to card_sale_trans table
|
||||||
function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amount, sale_id, receipt_no,com_port) {
|
function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amount, sale_id, receipt_no,com_port,cashier_type) {
|
||||||
|
|
||||||
var resMsg = "";
|
var resMsg = "";
|
||||||
var card_payment_type="";
|
var card_payment_type="";
|
||||||
@@ -281,7 +281,7 @@ function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amo
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if(data.status == "success"){
|
if(data.status == "success"){
|
||||||
resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amount,sale_id,receipt_no,com_port);
|
resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amount,sale_id,receipt_no,com_port,cashier_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -292,7 +292,7 @@ function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amount,sale_id,receipt_no,com_port) {
|
function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amount,sale_id,receipt_no,com_port,cashier_type) {
|
||||||
$("#loading_wrapper").hide();
|
$("#loading_wrapper").hide();
|
||||||
var jobj = $.parseJSON(resMsg);
|
var jobj = $.parseJSON(resMsg);
|
||||||
if(jobj.STATUS == "Approved"){
|
if(jobj.STATUS == "Approved"){
|
||||||
@@ -309,7 +309,7 @@ function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amoun
|
|||||||
closeOnCancel: false,
|
closeOnCancel: false,
|
||||||
allowOutsideClick: false
|
allowOutsideClick: false
|
||||||
}, function () {
|
}, function () {
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+"/payment";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -327,7 +327,7 @@ function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amoun
|
|||||||
closeOnCancel: false,
|
closeOnCancel: false,
|
||||||
allowOutsideClick: false
|
allowOutsideClick: false
|
||||||
}, function () {
|
}, function () {
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment/"+payment_type;
|
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/"+payment_type;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ $('#jcb_pay').on('click',function(){
|
|||||||
// }
|
// }
|
||||||
//end member discount
|
//end member discount
|
||||||
if(bank_integration == '1'){
|
if(bank_integration == '1'){
|
||||||
pay_withBank("SALE", "jcb", amount, sale_id, receipt_no);
|
pay_withBank("SALE", "jcb", amount, sale_id, receipt_no,cashier_type);
|
||||||
}else{
|
}else{
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
url: "<%= origami_payment_jcb_path %>",
|
url: "<%= origami_payment_jcb_path %>",
|
||||||
|
|||||||
@@ -212,7 +212,7 @@
|
|||||||
// }
|
// }
|
||||||
//end member discount
|
//end member discount
|
||||||
if(bank_integration == '1'){
|
if(bank_integration == '1'){
|
||||||
pay_withBank("SALE", "master", amount, sale_id, receipt_no);
|
pay_withBank("SALE", "master", amount, sale_id, receipt_no,cashier_type);
|
||||||
}else{
|
}else{
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
url: "<%= origami_payment_master_path %>",
|
url: "<%= origami_payment_master_path %>",
|
||||||
|
|||||||
@@ -122,10 +122,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
var cashier_type = "<%= @cashier_type %>";
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var sale_id = "<%= @sale_id %>";
|
var sale_id = "<%= @sale_id %>";
|
||||||
var bank_integration = "<%= @bank_integration %>";
|
var bank_integration = "<%= @bank_integration %>";
|
||||||
var cashier_type = "<%= @cashier_type %>";
|
|
||||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){}
|
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){}
|
||||||
else {
|
else {
|
||||||
$('#validamount').attr("value",parseFloat("<%= @can_mpu %>") - parseFloat(localStorage.getItem("cash")));
|
$('#validamount').attr("value",parseFloat("<%= @can_mpu %>") - parseFloat(localStorage.getItem("cash")));
|
||||||
@@ -217,7 +218,7 @@
|
|||||||
// }
|
// }
|
||||||
//end member discount
|
//end member discount
|
||||||
if(bank_integration == '1'){
|
if(bank_integration == '1'){
|
||||||
pay_withBank("SALE", "mpu", amount, sale_id, receipt_no);
|
pay_withBank("SALE", "mpu", amount, sale_id, receipt_no,cashier_type);
|
||||||
}else{
|
}else{
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
url: "<%= origami_payment_mpu_path %>",
|
url: "<%= origami_payment_mpu_path %>",
|
||||||
|
|||||||
@@ -216,7 +216,7 @@
|
|||||||
//end member discount
|
//end member discount
|
||||||
var bank_integration = "<%= @bank_integration %>";
|
var bank_integration = "<%= @bank_integration %>";
|
||||||
if(bank_integration == '1'){
|
if(bank_integration == '1'){
|
||||||
pay_withBank("SALE", "unionpay", amount, sale_id, receipt_no);
|
pay_withBank("SALE", "unionpay", amount, sale_id, receipt_no, cashier_type);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
|
|||||||
@@ -217,7 +217,7 @@
|
|||||||
//end member discount
|
//end member discount
|
||||||
var bank_integration = "<%= @bank_integration %>";
|
var bank_integration = "<%= @bank_integration %>";
|
||||||
if(bank_integration == '1'){
|
if(bank_integration == '1'){
|
||||||
pay_withBank("SALE", "visa", amount, sale_id, receipt_no);
|
pay_withBank("SALE", "visa", amount, sale_id, receipt_no,cashier_type);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
|
|||||||
Reference in New Issue
Block a user