Sha256: 92dc8583347c02de7f9c018b6e0120564216e21c18844f8cf85d168cb3ed9b63

Contents?: true

Size: 394 Bytes

Versions: 1

Compression:

Stored size: 394 Bytes

Contents

module Alipay
  module Sign
    module Wap
      SORTED_VERIFY_PARAMS = %w( service v sec_id notify_data )

      def self.verify?(params)
        params = Utils.stringify_keys(params)

        query = SORTED_VERIFY_PARAMS.map do |key|
          "#{key}=#{params[key]}"
        end.join('&')

        params['sign'] == Digest::MD5.hexdigest("#{query}#{Alipay.key}")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alipay-0.6.0.beta1 lib/alipay/sign/wap.rb