Sha256: f001d659a675bc2aeb5b9e970d6fd2954bb87026472c6eb572f0ed524c8f807d

Contents?: true

Size: 398 Bytes

Versions: 1

Compression:

Stored size: 398 Bytes

Contents

module Alipay
  module Notify
    def self.verify?(params)
      params = Utils.stringify_keys(params)
      Sign.verify?(params) && verify_notify_id?(params['notify_id'])
    end

    def self.verify_notify_id?(notify_id)
      Net::HTTP.get(URI("https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}&notify_id=#{CGI.escape(notify_id.to_s)}")) == 'true'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alipay-0.6.0.beta1 lib/alipay/notify.rb