@@ -13,11 +13,11 @@ module MultiTenancy
|
||||
end
|
||||
|
||||
def find_tenant_by_subdomain_or_name
|
||||
# if request.subdomains.first && request.subdomains.first != "www"
|
||||
# set_current_tenant(Shop.find_by(subdomain: request.subdomains.first))
|
||||
# elsif Shop.count == 1
|
||||
set_current_tenant(Shop.last)
|
||||
# end
|
||||
if request.subdomains.first && request.subdomains.first != "www"
|
||||
set_current_tenant(Shop.find_by(subdomain: request.subdomains.first))
|
||||
elsif Shop.count == 1
|
||||
set_current_tenant(Shop.first)
|
||||
end
|
||||
end
|
||||
|
||||
def not_found
|
||||
|
||||
@@ -87,7 +87,6 @@ class Foodcourt::AddordersController < BaseFoodcourtController
|
||||
end
|
||||
|
||||
def create
|
||||
byebug
|
||||
if params[:booking_id].present?
|
||||
booking = Booking.find(params[:booking_id])
|
||||
end
|
||||
|
||||
@@ -230,8 +230,6 @@ class Foodcourt::QrpayController < BaseFoodcourtController
|
||||
|
||||
def create
|
||||
sale_id = params[:sale_id]
|
||||
response_body = params[:response_body]
|
||||
receipt_no = Sale.find_by(sale_id: sale_id).receipt_no
|
||||
|
||||
unless current_login_employee
|
||||
render json: { status: false, message: "User not authenticated or employee context missing." }, status: :unauthorized
|
||||
@@ -241,17 +239,6 @@ class Foodcourt::QrpayController < BaseFoodcourtController
|
||||
qrpayment_service = QrPaymentService.new(sale_id, current_login_employee)
|
||||
result = qrpayment_service.process
|
||||
|
||||
PaymentGatewayAuditJob.perform_later({
|
||||
receipt_no: receipt_no,
|
||||
gateway_name: "MMQR",
|
||||
endpoint_url: nil,
|
||||
event_type: "kbz.payment.success",
|
||||
request_body: nil,
|
||||
response_body: response_body.to_json,
|
||||
request_method: "POST",
|
||||
shop_code: Shop.current_shop.shop_code
|
||||
})
|
||||
|
||||
if result[:status]
|
||||
render json: result, status: :ok
|
||||
else
|
||||
@@ -286,7 +273,7 @@ class Foodcourt::QrpayController < BaseFoodcourtController
|
||||
if response[:data]['code'] == '0'
|
||||
case response[:data]['trade_status']
|
||||
when 'PAY_SUCCESS'
|
||||
render json: { status: response[:data][:trade_status], data: response[:data] }
|
||||
render json: { status: 'PAY_SUCCESS' }
|
||||
else
|
||||
render json: { status: response[:data]['trade_status'] || 'PENDING' }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user