From ce67c42c272389ded001756fe40817db920c03f0 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Wed, 19 Jun 2019 10:03:07 +0800 Subject: [PATCH] remove wechat pay test --- app/controllers/trainings_controller.rb | 25 +--------------------- app/views/trainings/pay.html.erb | 22 ++++++------------- app/views/trainings/trainingsInfo.html.erb | 8 +------ 3 files changed, 8 insertions(+), 47 deletions(-) diff --git a/app/controllers/trainings_controller.rb b/app/controllers/trainings_controller.rb index ad3248c9..8650a5a7 100644 --- a/app/controllers/trainings_controller.rb +++ b/app/controllers/trainings_controller.rb @@ -15,20 +15,6 @@ class TrainingsController < ApplicationController layout 'base_trainings' - # TODO: 测试完成后删除 - ALLOW_OPENID_LIST = [ - 'oSrqE59d6uMBkANfXnJcGuUwuGds', - 'oSrqE5-j3rT3f9nt4iFhSICPF1Vo', - 'oSrqE5w6dtsRyjFkFBahQ1jeurTk', - 'oSrqE52fgGMooW3B1K4mZ0Le5G9I', - 'o5fSc0607iR3rp4-h_VnuBTp8CiM' - ] - before_filter :check_openid, only: [:update_payinfo] - def check_openid - return if ALLOW_OPENID_LIST.include?(session[:wechat_open_id]) - render plain: '暂未开放' - end - def show @training = current_training @@ -37,9 +23,6 @@ class TrainingsController < ApplicationController return end - # TODO: 测试完成后删除 - @test_wxpay = ALLOW_OPENID_LIST.include?(session[:wechat_open_id]) - render 'trainingsInfo' end @@ -67,8 +50,6 @@ class TrainingsController < ApplicationController @training.training_payinfo.fee = @training.registration_fee @training.training_payinfo.pay_type = params[:pay_type].presence || 3 end - # TODO: 测试完成后删除 - @test_wxpay = ALLOW_OPENID_LIST.include?(session[:wechat_open_id]) end def pay_callback @@ -174,12 +155,8 @@ class TrainingsController < ApplicationController training_info.save! - # TODO: 测试完成后删除 - @test_wxpay = ALLOW_OPENID_LIST.include?(session[:wechat_open_id]) - if params[:js] == 'true' && training_info.not_payed? - # TODO: 测试完成后删除 - _pay_js(@test_wxpay ? 0.01 : training_info.fee) + _pay_js(training_info.fee) else redirect_to result_training_path(id: friendly_id) end diff --git a/app/views/trainings/pay.html.erb b/app/views/trainings/pay.html.erb index f1b16f6e..7426cfa3 100644 --- a/app/views/trainings/pay.html.erb +++ b/app/views/trainings/pay.html.erb @@ -2,20 +2,10 @@
<%= hidden_field_tag(:friendly_id, @friendly_id) %> - <% if @test_wxpay %> -
- <% else %> -
- <% end %> - +
>

- <% if @test_wxpay %> - <%= @training.training_payinfo.pay_type.to_i == 3 ? "线下支付" : "微信支付" %> - <% else %> - 线下支付 - <% end %> - + <%= @training.training_payinfo.pay_type.to_i == 3 ? "线下支付" : "微信支付" %>

mt5" id="payInfos"> @@ -192,10 +182,10 @@ // $(this).addClass("active"); // billTypeShowFun(parseInt($(this).index()), userInfo); // }) - // //关闭弹窗 - // $(".billClose").on("click", function () { - // hideNav($(".downNav")); - // }); + //关闭弹窗 + $(".billClose").on("click", function () { + hideNav($(".downNav")); + }); //延迟支付,直接提交 $('#delayPayBtn').on('click', function () { diff --git a/app/views/trainings/trainingsInfo.html.erb b/app/views/trainings/trainingsInfo.html.erb index d9c74d6f..964455bc 100644 --- a/app/views/trainings/trainingsInfo.html.erb +++ b/app/views/trainings/trainingsInfo.html.erb @@ -41,13 +41,7 @@ <% if @training.training_payinfo.blank? || @training.training_payinfo.not_payed? %>
<%= link_to '转账支付', pay_training_path(id: @friendly_id, pay_type: 3), class: 'leftbtn' %> - <%#= link_to '微信支付', pay_training_path(id: @friendly_id, pay_type: 1), class: 'rightbtn' %> - - <% if @test_wxpay %> - <%= link_to '微信支付', pay_training_path(id: @friendly_id, pay_type: 1), class: 'rightbtn' %> - <% else %> - 微信支付 - <% end %> + <%= link_to '微信支付', pay_training_path(id: @friendly_id, pay_type: 1), class: 'rightbtn' %>
<% else %>