lib/alipay/sign.rb in alipay-0.3.0 vs lib/alipay/sign.rb in alipay-0.3.1
- old
+ new
@@ -3,13 +3,10 @@
require 'base64'
module Alipay
module Sign
def self.generate(params)
- query = params.sort.map do |key, value|
- "#{key}=#{value}"
- end.join('&')
-
+ query = params.sort.map { |item| item.join('=') }.join('&')
Digest::MD5.hexdigest("#{query}#{Alipay.key}")
end
def self.verify?(params)
params = Utils.stringify_keys(params)