def verify_notify?(post_params)
      post_sign = post_params[:sign]
      verifing_sign = Digest::MD5.hexdigest(post_params.reject { |p| [:sign, :sign_type].include?(p) }
                                                .inject([]) { |memo, (key, v)| memo << "#{key}=#{v}"; memo }
                                                .sort! { |m, n| m.to_s <=> n.to_s }.join('&')+NewAlipay.key)

      puts "#{verifing_sign}:#{post_sign}"
      unless verifing_sign == post_sign
        return false
      end

      begin
        conn = Faraday.new(:url => 'https://mapi.alipay.com') do |faraday|
          faraday.request :url_encoded # form-encode POST params
          faraday.response :logger # log requests to STDOUT
          faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
        end
        response = conn.get '/gateway.do', {:service => 'notify_verify', partner: NewAlipay.partner, notify_id: post_params[:notify_id]}
        response.body.to_s == 'true'
      rescue Exception => e
        false
      end
    end
def verify_notify?(post_params)
      post_sign = post_params[:sign]
      verifing_sign = Digest::MD5.hexdigest(post_params.reject { |p| [:sign, :sign_type].include?(p) }
                                                .inject([]) { |memo, (key, v)| memo << "#{key}=#{v}"; memo }
                                                .sort! { |m, n| m.to_s <=> n.to_s }.join('&')+NewAlipay.key)

      puts "#{verifing_sign}:#{post_sign}"
      unless verifing_sign == post_sign
        return false
      end

      begin
        conn = Faraday.new(:url => 'https://mapi.alipay.com') do |faraday|
          faraday.request :url_encoded # form-encode POST params
          faraday.response :logger # log requests to STDOUT
          faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
        end
        response = conn.get '/gateway.do', {:service => 'notify_verify', partner: NewAlipay.partner, notify_id: post_params[:notify_id]}
        response.body.to_s == 'true'
      rescue Exception => e
        false
      end
    end
params.except(*request.env.keys.push(:route_info))
 @param post_params 除去系统变量的参数