check and update qrcode payment
This commit is contained in:
@@ -50,10 +50,9 @@ class Origami::OrderReservationController < BaseOrigamiController
|
||||
status = params[:status]
|
||||
end
|
||||
|
||||
# response = OrderReservation.send_status_to_ordering(params[:url],params[:ref_no],status)
|
||||
response = OrderReservation.send_status_to_ordering(params[:url],params[:ref_no],status)
|
||||
|
||||
result = {:status=> true, :message => " accepted !" }
|
||||
render :json => result.to_json
|
||||
render :json => response
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -92,7 +92,7 @@ class OrderReservation < ApplicationRecord
|
||||
@status, @sale = Sale.request_bill(@order,current_user,current_user)
|
||||
|
||||
#order status send to doemal
|
||||
# callback_response = send_status_to_ordering(order.callback_url,order.transaction_ref,SEND_TO_KITCHEN)
|
||||
callback_response = send_status_to_ordering(order.callback_url,order.transaction_ref,SEND_TO_KITCHEN)
|
||||
#order reservation status updated
|
||||
update_order_reservation(order.id, @sale.sale_id, SEND_TO_KITCHEN)
|
||||
|
||||
@@ -123,7 +123,7 @@ class OrderReservation < ApplicationRecord
|
||||
sale_payment.process_payment(saleObj, current_user.name, saleObj.grand_total, "cash")
|
||||
|
||||
#order status send to doemal
|
||||
# callback_response = send_status_to_ordering(order.callback_url,order.transaction_ref,DELIVERED)
|
||||
callback_response = send_status_to_ordering(order.callback_url,order.transaction_ref,DELIVERED)
|
||||
#order reservation status updated
|
||||
update_order_reservation(order.id, saleObj.sale_id, DELIVERED)
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="paypar_account_no" id="paypar_account_no" value="1011002923682533" />
|
||||
<input type="hidden" name="paypar_account_no" id="paypar_account_no" />
|
||||
<input type="hidden" name="qr_code" id="qr_code" />
|
||||
<div class="row text-center m-t-20">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
@@ -325,9 +325,10 @@
|
||||
var customer_name = '';
|
||||
var membership_id = '';
|
||||
var membership_type = '';
|
||||
var receipt_no = $("#receipt_no").text() || 0;
|
||||
setTimeout(function(){
|
||||
code=getQRCode();
|
||||
if(sale_id != 0 && code != ""){
|
||||
code=getQRCode();
|
||||
if(sale_id != 0 && code != ""){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/"+sale_id+"/send_account" ,
|
||||
@@ -343,6 +344,7 @@
|
||||
url: "<%=origami_payment_paymal_path%>",
|
||||
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:code},
|
||||
success: function(result){
|
||||
|
||||
if(result.status == true){
|
||||
swal({
|
||||
title: "Information!",
|
||||
|
||||
@@ -328,6 +328,7 @@
|
||||
var payment_amount = parseFloat($("#used_amount").text());
|
||||
setTimeout(function(){
|
||||
code=getQRCode();
|
||||
alert(code)
|
||||
if(sale_id != 0 && code != ""){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -344,6 +345,7 @@
|
||||
url: "<%=origami_payment_paymal_path%>",
|
||||
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:code},
|
||||
success: function(result){
|
||||
alert(result)
|
||||
if(result.status == true){
|
||||
swal({
|
||||
title: "Information!",
|
||||
|
||||
Reference in New Issue
Block a user