From 9f0bef732eb530afa2a3912a1f14b6947fb4b1db Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Tue, 13 Mar 2018 14:23:23 +0630 Subject: [PATCH] update change version v3 for api paymal --- app/controllers/crm/customers_controller.rb | 6 +++--- app/controllers/origami/discounts_controller.rb | 2 +- app/controllers/origami/payments_controller.rb | 6 +++--- app/controllers/origami/voucher_controller.rb | 2 +- app/models/customer.rb | 12 ++++++------ app/models/sale_payment.rb | 11 ++++++----- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 83a437a2..55eed487 100755 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -143,7 +143,7 @@ class Crm::CustomersController < BaseCrmController :body => member_params, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10 ) @@ -269,7 +269,7 @@ end :body => member_params, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10 ) @@ -328,7 +328,7 @@ end :body => member_params, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10 ) diff --git a/app/controllers/origami/discounts_controller.rb b/app/controllers/origami/discounts_controller.rb index 24b2c83f..0c2fbef5 100755 --- a/app/controllers/origami/discounts_controller.rb +++ b/app/controllers/origami/discounts_controller.rb @@ -273,7 +273,7 @@ class Origami::DiscountsController < BaseOrigamiController auth_token:auth_token}.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10) rescue HTTParty::Error response = {"status": false, "message": "Can't open membership server " } diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 563decfe..a5a96e43 100755 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -63,9 +63,9 @@ class Origami::PaymentsController < BaseOrigamiController # get member information rebate = MembershipSetting.find_by_rebate(1) if customer.membership_id != nil && rebate - member_info = Customer.get_member_account(customer) - current_balance = SaleAudit.paymal_search(sale_id) - # current_balance = 0 + # member_info = Customer.get_member_account(customer) + # current_balance = SaleAudit.paymal_search(sale_id) + current_balance = 0 end # get printer info print_settings=PrintSetting.find_by_unique_code(unique_code) diff --git a/app/controllers/origami/voucher_controller.rb b/app/controllers/origami/voucher_controller.rb index 750189df..c0a9e96d 100755 --- a/app/controllers/origami/voucher_controller.rb +++ b/app/controllers/origami/voucher_controller.rb @@ -54,7 +54,7 @@ class Origami::VoucherController < BaseOrigamiController }.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10 ) rescue Net::OpenTimeout diff --git a/app/models/customer.rb b/app/models/customer.rb index fcdd7f31..59ab8841 100755 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -31,7 +31,7 @@ class Customer < ApplicationRecord }.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10) rescue HTTParty::Error @@ -68,7 +68,7 @@ class Customer < ApplicationRecord }.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10 ) @@ -121,7 +121,7 @@ class Customer < ApplicationRecord :body => member_params, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }) rescue Net::OpenTimeout response = { status: false, message: "Server Time out" } @@ -198,7 +198,7 @@ class Customer < ApplicationRecord }.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10) rescue Net::OpenTimeout response = { "status": false , "message": "Connect To" } @@ -274,7 +274,7 @@ class Customer < ApplicationRecord }.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10) rescue Net::OpenTimeout response = { "status": false , "message": "Connect To" } @@ -309,7 +309,7 @@ class Customer < ApplicationRecord }.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10 ) diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 1866a630..5809dc0f 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -85,7 +85,7 @@ class SalePayment < ApplicationRecord }.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10 ) rescue Net::OpenTimeout @@ -133,7 +133,7 @@ class SalePayment < ApplicationRecord auth_token:auth_token}.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10 ) @@ -455,7 +455,7 @@ class SalePayment < ApplicationRecord }.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10) rescue Net::OpenTimeout response = { "status": false , "message": " Connection timeout" } @@ -500,7 +500,8 @@ class SalePayment < ApplicationRecord end rebate_arr.push(data) end - + Rails.logger.debug "Rebage Response" + Rails.logger.debug rebate_arr.to_json total_amount = rebate_prices - payparcost - overall_dis if credit == 1 @@ -531,7 +532,7 @@ class SalePayment < ApplicationRecord }.to_json, :headers => { 'Content-Type' => 'application/json', - 'Accept' => 'application/json; version=2' + 'Accept' => 'application/json; version=3' }, :timeout => 10) rescue Net::OpenTimeout response = { "status": false , "message": "Connect To" }