From 88c5dc21443a041132fddf24f1aab320dab088e8 Mon Sep 17 00:00:00 2001 From: Zoey Date: Mon, 24 Jun 2019 14:22:44 +0630 Subject: [PATCH] kbzpay setting --- .../origami/payments_controller.rb | 11 ++++++---- config/initializers/action_controller.rb | 10 +++++----- config/puma.rb | 20 +++++++++---------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 4eba48a2..35610936 100755 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -105,12 +105,15 @@ class Origami::PaymentsController < BaseOrigamiController #TODO :: KBZPAY ( QR ) # On/Off setting ( show or not qr ) # qrCode = "00020101021202021110500346KBZ005ab0ed5c1ed09d1c4585ff1313170389160831435294600062000040732kp1e78f7efddca190042638341afb88d50200006KBZPay0106KBZPay5303MMK5802MM62170813PAY_BY_QRCODE64060002my6304FBBD" - kbz_pay_status = PaymentMethodSetting.where(:payment_method => 'KBZPay').last + kbz_pay_setting = PaymentMethodSetting.where(:payment_method => 'KBZPay').last status = false - if kbz_pay_status - - status, qr = KbzPay.pay(sale_data.grand_total, sale_data.receipt_no) + qr = nil + + if !kbz_pay_setting.nil? + if kbz_pay_setting.is_active == true + status, qr = KbzPay.pay(sale_data.grand_total, sale_data.receipt_no) + end end filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, status, qr, cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount,nil,nil,nil) diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index 205c330a..85f38ec5 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -21,11 +21,11 @@ class ActionController::Base end else # check for license file - if check_license - current_license(ENV["SX_PROVISION_URL"]) - else - redirect_to activate_path - end + # if check_license + # current_license(ENV["SX_PROVISION_URL"]) + # else + # redirect_to activate_path + # end end end diff --git a/config/puma.rb b/config/puma.rb index fd89392f..6a545bed 100755 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,10 +1,10 @@ -application_path="#{File.expand_path("../..", __FILE__)}" -directory application_path -#environment ENV.fetch("RAILS_ENV") { "production" } -environment "production" -pidfile "#{application_path}/tmp/puma/pid" -state_path "#{application_path}/tmp/puma/state" -stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" -port ENV.fetch("PORT") { 62158 } -workers 2 -preload_app! +# application_path="#{File.expand_path("../..", __FILE__)}" +# directory application_path +# #environment ENV.fetch("RAILS_ENV") { "production" } +# environment "production" +# pidfile "#{application_path}/tmp/puma/pid" +# state_path "#{application_path}/tmp/puma/state" +# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" +# port ENV.fetch("PORT") { 62158 } +# workers 2 +# preload_app!