check JunctionPay

This commit is contained in:
phyusin
2018-06-11 17:20:47 +06:30
parent 425e72afe7
commit e2fdf994d7
4 changed files with 76 additions and 23 deletions

View File

@@ -28,6 +28,13 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
delivery_type = "DIRECT DELIVERY"; delivery_type = "DIRECT DELIVERY";
} }
var payment_type = "";
if(value.payment_type=="cash_on_delivery"){
payment_type = "COD";
}else if(value.payment_type =="dinga"){
payment_type = "DINGA";
}
if(key==0){ if(key==0){
var order_id = value.order_reservation_id; var order_id = value.order_reservation_id;
var sr_no = rowCount; var sr_no = rowCount;
@@ -49,11 +56,13 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
+'</td>' +'</td>'
+'<td width ="20%" class="align-center">'+created_at +'<td width ="20%" class="align-center">'+created_at
+'</td>' +'</td>'
+'<td width ="20%" class="align-center">'+time +'<td width ="15%" class="align-center">'+time
+'</td>' +'</td>'
+'<td width ="20%" class="align-center">'+value.grand_total +'<td width ="20%" class="align-center">'+value.grand_total
+'</td>' +'</td>'
+'<td width ="30%" class="align-center">' +'<td width ="20%" class="align-center col-blue">'+payment_type
+'</td>'
+'<td width ="20%" class="align-center">'
+'<span class="font-10 col-blue">'+ delivery_type +'</span>' +'<span class="font-10 col-blue">'+ delivery_type +'</span>'
+'</td>' +'</td>'
+' </tr>'; +' </tr>';

View File

@@ -359,7 +359,12 @@ function show_order_detail(url,sr_no){
$('#address').text(address); $('#address').text(address);
$(".order_payment_type").show(); $(".order_payment_type").show();
$("#payment_type").text(data.payment_type); if(data.payment_type == "cash_on_delivery"){
$("#payment_type").text("COD");
}else if(data.payment_type == "dinga"){
$("#payment_type").text("DINGA");
}
$('#ref_no').text(data.transaction_ref); $('#ref_no').text(data.transaction_ref);
$('#callback_url').text(data.callback_url); $('#callback_url').text(data.callback_url);
$('#order_id').text(data.order_reservation_id); $('#order_id').text(data.order_reservation_id);

View File

@@ -206,6 +206,7 @@ $('#junction_pay').on('click',function(){
var is_rebate=false; var is_rebate=false;
//alert(cashier_id + amount + com_port); //alert(cashier_id + amount + com_port);
code2lab.reqJunctionPay(true, cashier_id, parseFloat(amount), receipt_no, com_port); code2lab.reqJunctionPay(true, cashier_id, parseFloat(amount), receipt_no, com_port);
resJunctionPayUpdate = function(totalBillAmount , finalBillAmt,giftCardAmount, voucherAmount,voucherNumber,receiptNumber){ resJunctionPayUpdate = function(totalBillAmount , finalBillAmt,giftCardAmount, voucherAmount,voucherNumber,receiptNumber){
$("#loading_wrapper").hide(); $("#loading_wrapper").hide();
@@ -244,7 +245,10 @@ $('#junction_pay').on('click',function(){
if(memberno != ''){ is_rebate = true; } if(memberno != ''){ is_rebate = true; }
}; };
resError = function(err_message){
$("#loading_wrapper").hide();
swal ( "Oops" , err_message , "error" );
};
// $("#loading_wrapper").hide(); // $("#loading_wrapper").hide();
// $.ajax({type: "POST", // $.ajax({type: "POST",
// url: "/origami/payment/"+payment_type, // url: "/origami/payment/"+payment_type,

View File

@@ -79,13 +79,20 @@
<td width ="20%" class="align-center"> <td width ="20%" class="align-center">
<%= order.created_at.utc.getlocal.strftime("%Y-%m-%d") %> <%= order.created_at.utc.getlocal.strftime("%Y-%m-%d") %>
</td> </td>
<td width ="20%" class="align-center"> <td width ="15%" class="align-center">
<%= order.created_at.utc.getlocal.strftime("%I:%M %p") %> <%= order.created_at.utc.getlocal.strftime("%I:%M %p") %>
</td> </td>
<td width ="20%" class="align-center"> <td width ="20%" class="align-center">
<%=order.grand_total%> <%=order.grand_total%>
</td> </td>
<td width ="30%" class="align-center"> <td width ="20%" class="align-center col-blue">
<% if order.payment_type == 'cash_on_delivery' %>
COD
<% elsif order.payment_type == 'dinga' %>
DINGA
<% end %>
</td>
<td width ="20%" class="align-center">
<span class="font-10 col-blue"> <span class="font-10 col-blue">
<% if order.delivery.delivery_type == 'service' %> <% if order.delivery.delivery_type == 'service' %>
DELIVERY DELIVERY
@@ -122,13 +129,20 @@
<td width ="20%" class="align-center"> <td width ="20%" class="align-center">
<%= order.created_at.utc.getlocal.strftime("%Y-%m-%d") %> <%= order.created_at.utc.getlocal.strftime("%Y-%m-%d") %>
</td> </td>
<td width ="20%" class="align-center"> <td width ="15%" class="align-center">
<%= order.created_at.utc.getlocal.strftime("%I:%M %p") %> <%= order.created_at.utc.getlocal.strftime("%I:%M %p") %>
</td> </td>
<td width ="20%" class="align-center"> <td width ="20%" class="align-center">
<%=order.grand_total%> <%=order.grand_total%>
</td> </td>
<td width ="30%" class="align-center"> <td width ="20%" class="align-center col-blue">
<% if order.payment_type == 'cash_on_delivery' %>
COD
<% elsif order.payment_type == 'dinga' %>
DINGA
<% end %>
</td>
<td width ="20%" class="align-center">
<span class="font-10 col-blue"> <span class="font-10 col-blue">
<% if order.delivery.delivery_type == 'service' %> <% if order.delivery.delivery_type == 'service' %>
DELIVERY DELIVERY
@@ -164,13 +178,20 @@
<td width ="20%" class="align-center"> <td width ="20%" class="align-center">
<%= order.created_at.utc.getlocal.strftime("%Y-%m-%d") %> <%= order.created_at.utc.getlocal.strftime("%Y-%m-%d") %>
</td> </td>
<td width ="20%" class="align-center"> <td width ="15%" class="align-center">
<%= order.created_at.utc.getlocal.strftime("%I:%M %p") %> <%= order.created_at.utc.getlocal.strftime("%I:%M %p") %>
</td> </td>
<td width ="20%" class="align-center"> <td width ="20%" class="align-center">
<%=order.grand_total%> <%=order.grand_total%>
</td> </td>
<td width ="30%" class="align-center"> <td width ="20%" class="align-center col-blue">
<% if order.payment_type == 'cash_on_delivery' %>
COD
<% elsif order.payment_type == 'dinga' %>
DINGA
<% end %>
</td>
<td width ="20%" class="align-center">
<span class="font-10 col-blue"> <span class="font-10 col-blue">
<% if order.delivery.delivery_type == 'service' %> <% if order.delivery.delivery_type == 'service' %>
DELIVERY DELIVERY
@@ -206,13 +227,20 @@
<td width ="20%" class="align-center"> <td width ="20%" class="align-center">
<%= order.created_at.utc.getlocal.strftime("%Y-%m-%d") %> <%= order.created_at.utc.getlocal.strftime("%Y-%m-%d") %>
</td> </td>
<td width ="20%" class="align-center"> <td width ="15%" class="align-center">
<%= order.created_at.utc.getlocal.strftime("%I:%M %p") %> <%= order.created_at.utc.getlocal.strftime("%I:%M %p") %>
</td> </td>
<td width ="20%" class="align-center"> <td width ="20%" class="align-center">
<%=order.grand_total%> <%=order.grand_total%>
</td> </td>
<td width ="30%" class="align-center"> <td width ="20%" class="align-center col-blue">
<% if order.payment_type == 'cash_on_delivery' %>
COD
<% elsif order.payment_type == 'dinga' %>
DINGA
<% end %>
</td>
<td width ="20%" class="align-center">
<span class="font-10 col-blue"> <span class="font-10 col-blue">
<% if order.delivery.delivery_type == 'service' %> <% if order.delivery.delivery_type == 'service' %>
DELIVERY DELIVERY
@@ -248,13 +276,20 @@
<td width ="20%" class="align-center"> <td width ="20%" class="align-center">
<%= order.created_at.utc.getlocal.strftime("%Y-%m-%d") %> <%= order.created_at.utc.getlocal.strftime("%Y-%m-%d") %>
</td> </td>
<td width ="20%" class="align-center"> <td width="15%" class="align-center">
<%= order.created_at.utc.getlocal.strftime("%I:%M %p") %> <%= order.created_at.utc.getlocal.strftime("%I:%M %p") %>
</td> </td>
<td width ="20%" class="align-center"> <td width ="20%" class="align-center">
<%=order.grand_total%> <%=order.grand_total%>
</td> </td>
<td width ="30%" class="align-center"> <td width ="10%" class="align-center col-blue">
<% if order.payment_type == 'cash_on_delivery' %>
COD
<% elsif order.payment_type == 'dinga' %>
DINGA
<% end %>
</td>
<td width ="20%" class="align-center">
<span class="font-10 col-blue"> <span class="font-10 col-blue">
<% if order.delivery.delivery_type == 'service' %> <% if order.delivery.delivery_type == 'service' %>
DELIVERY DELIVERY
@@ -402,7 +437,7 @@
<span class="font-13">REF.</span><br> <span class="font-13">REF.</span><br>
<b id="trans_ref"></b> <b id="trans_ref"></b>
</td> </td>
<td class="body-td align-left order_payment_type"> <td class="body-td align-right order_payment_type">
<span class="font-13">PAYMENT</span><br> <span class="font-13">PAYMENT</span><br>
<b id="payment_type"></b> <b id="payment_type"></b>
</td> </td>