diff --git a/app/controllers/api/invoices_controller.rb b/app/controllers/api/invoices_controller.rb index 7d6e2cb7..aedfc9f7 100644 --- a/app/controllers/api/invoices_controller.rb +++ b/app/controllers/api/invoices_controller.rb @@ -1,6 +1,6 @@ class Api::InvoicesController < ActionController::API - before :authenticate_token - before :set_sale_params, only:[:show, :update, :destroy] + # before :authenticate_token + # before :set_sale_params, only:[:show, :update, :destroy] #List open invoices for today. def index diff --git a/app/controllers/api/memberships_controller.rb b/app/controllers/api/memberships_controller.rb index 210a4ca0..ea5b5279 100644 --- a/app/controllers/api/memberships_controller.rb +++ b/app/controllers/api/memberships_controller.rb @@ -1,7 +1,7 @@ class Api::MembershipsController < ActionController::API - before :authenticate_token + #before :authenticate_token + - #Add Membership to invoice def create diff --git a/app/controllers/api/payments_controller.rb b/app/controllers/api/payments_controller.rb index 2c2d219b..39219c6b 100644 --- a/app/controllers/api/payments_controller.rb +++ b/app/controllers/api/payments_controller.rb @@ -29,56 +29,56 @@ class Api::PaymentsController < ActionController::API #:received_amount, :card_payment_reference, :vochure_no, :giftcard_no, #:customer_id, :external_payment_status - switch (payment_method) - case "cash" + case payment_method + when "cash" sale_payment.payment_method = "cash" sale_payment.received_amount = params[:amount] @status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name) - case "creditnote" + when "creditnote" sale_payment.payment_method = "creditnote" sale_payment.received_amount = params[:amount] sale_payment.customer_id = params[:customer_id] @status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name) - case "visa" + when "visa" sale_payment.payment_method = "visa" sale_payment.received_amount = params[:amount] sale_payment.payment_reference = params[:payment_reference] @status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name) - case "master" + when "master" sale_payment.payment_method = "master" sale_payment.received_amount = params[:amount] sale_payment.payment_reference = params[:payment_reference] @status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name) - case "jcb" + when "jcb" sale_payment.payment_method = "jcb" sale_payment.received_amount = params[:amount] sale_payment.payment_reference = params[:payment_reference] @status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name) - case "mpu" + when "mpu" sale_payment.payment_method = "mpu" sale_payment.received_amount = params[:amount] sale_payment.payment_reference = params[:payment_reference] @status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name) - case "unionpay" + when "unionpay" sale_payment.payment_method = "unionpay" sale_payment.received_amount = params[:amount] sale_payment.payment_reference = params[:payment_reference] @status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name) - case "vochure" + when "vochure" sale_payment.payment_method = "vochure" sale_payment.received_amount = params[:amount] sale_payment.customer_id = params[:customer_id] sale_payment.payment_reference = params[:vochure_no] @status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name) - case "giftcard" + when "giftcard" sale_payment.payment_method = "giftcard" sale_payment.received_amount = params[:amount] sale_payment.customer_id = params[:customer_id] sale_payment.payment_reference = params[:giftcard_no] @status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name) - case "paypar" + when "paypar" sale_payment.payment_method = "paypar" sale_payment.received_amount = params[:amount] sale_payment.payment_reference = params[:payment_reference]