diff --git a/Gemfile b/Gemfile old mode 100755 new mode 100644 index fe3610b0..41682d12 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -ruby '2.4.0' +ruby '2.4.1' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") "https://github.com/#{repo_name}.git" @@ -131,4 +131,4 @@ gem 'momentjs-rails' # for date-range selector # gem 'bootstrap-datepicker-rails' # date picker # gem 'jquery-datetimepicker-rails' # gem 'select2-rails' # for multi-select and auto-complete select box -gem "chartkick" #chart lib +gem "chartkick" #chart lib \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock old mode 100755 new mode 100644 diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index 42fca385..573f7c9e 100755 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -26,7 +26,7 @@ _MASTER_ = "/   MASTER PAYMENT"; _MPU_ = "/   MPU PAYMENT"; _ALIPAY_ = "/   Alipay"; _JUNCTIONPAY_ = "/   JunctionPay"; -_PAYMAL_ = "/   Paymal"; +_PAYMAL_ = "/   PAYMAL"; _OTHER_CHARGES_ = "/   CHARGES"; _OTHER_PAYMENTS_ = "/   OTHER PAYMENT"; _PAYMENTS_ = "/   PAYMENT"; diff --git a/app/controllers/origami/paymal_controller.rb b/app/controllers/origami/paymal_controller.rb index bdcee917..3db34a1c 100644 --- a/app/controllers/origami/paymal_controller.rb +++ b/app/controllers/origami/paymal_controller.rb @@ -27,46 +27,46 @@ class Origami::PaymalController < BaseOrigamiController @payment_prices = sale_data.grand_total - @payparcount -others - if sale_data - if sale_data.customer_id - customer_data= Customer.find_by_customer_id(sale_data.customer_id) - if customer_data - @membership_id = customer_data.membership_id - if !@membership_id.nil? - membership_setting = MembershipSetting.find_by_membership_type("paypar_url") - if membership_setting.gateway_url - member_actions =MembershipAction.find_by_membership_type("get_account_balance") - if member_actions.gateway_url - @campaign_type_id = nil - url = membership_setting.gateway_url.to_s + member_actions.gateway_url.to_s - merchant_uid= member_actions.merchant_account_id - auth_token = member_actions.auth_token.to_s - membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid,auth_token) - if membership_data["status"]==true - @membership_rebate_balance=membership_data["balance"] - @out = true, @membership_rebate_balance,@membership_id - end - else - @out =false,0 - end - else - @out = false,0 - end + if sale_data + if sale_data.customer_id + customer_data= Customer.find_by_customer_id(sale_data.customer_id) + if customer_data + @membership_id = customer_data.membership_id + if !@membership_id.nil? + membership_setting = MembershipSetting.find_by_membership_type("paypar_url") + if membership_setting.gateway_url + member_actions =MembershipAction.find_by_membership_type("get_account_balance") + if member_actions.gateway_url + @campaign_type_id = nil + url = membership_setting.gateway_url.to_s + member_actions.gateway_url.to_s + merchant_uid= member_actions.merchant_account_id + auth_token = member_actions.auth_token.to_s + membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid,auth_token) + if membership_data["status"]==true + @membership_rebate_balance=membership_data["balance"] + @out = true, @membership_rebate_balance,@membership_id + end + else + @out =false,0 + end + else + @out = false,0 + end - else - @out = false, 0 - end - else - @out = false, 0 - end - else - @out = false, 0 - end - else - @out = false, 0 - end - @out = false, 0 + else + @out = false, 0 + end + else + @out = false, 0 + end + else + @out = false, 0 + end + else + @out = false, 0 + end + @out = false, 0 end def create cash = params[:payment_amount] diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index d4b549bb..e43414b8 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -49,15 +49,12 @@ class SalePayment < ApplicationRecord payment_status = paypar_payment when "foc" payment_status = foc_payment -<<<<<<< HEAD when "paymal" payment_status = paymal_payment -======= when "JunctionPay" payment_status = junction_pay_payment when "alipay" payment_status = external_terminal_card_payment(:alipay) ->>>>>>> 996392a041cb5f92a3b2985cbd0379210132d829 else puts "it was something else" end @@ -360,7 +357,6 @@ class SalePayment < ApplicationRecord end -<<<<<<< HEAD def paymal_payment payment_status = false @@ -386,7 +382,10 @@ class SalePayment < ApplicationRecord else sale_update_payment_status(0) end -======= + + return payment_status + end + def junction_pay_payment payment_status = false @@ -398,10 +397,7 @@ class SalePayment < ApplicationRecord self.payment_status = "paid" payment_method = self.save! sale_update_payment_status(self.received_amount) - ->>>>>>> 996392a041cb5f92a3b2985cbd0379210132d829 return payment_status - end def sale_update_payment_status(paid_amount,check_foc = false) diff --git a/app/views/origami/paymal/index.html.erb b/app/views/origami/paymal/index.html.erb index 81684256..627f9085 100644 --- a/app/views/origami/paymal/index.html.erb +++ b/app/views/origami/paymal/index.html.erb @@ -9,7 +9,6 @@ --> -
PayMal Payment
@@ -110,11 +109,13 @@