Sha256: f8cfc903f12ff1a15c63ed7acc8a6b4062895da62899f7a6635c119a82b6ffbc
Contents?: true
Size: 551 Bytes
Versions: 19
Compression:
Stored size: 551 Bytes
Contents
module Alipay module Notify def self.verify?(params, options = {}) params = Utils.stringify_keys(params) pid = options[:pid] || Alipay.pid Sign.verify?(params, options) && verify_notify_id?(pid, params['notify_id']) end def self.verify_notify_id?(pid, notify_id) uri = URI("https://mapi.alipay.com/gateway.do") uri.query = URI.encode_www_form( 'service' => 'notify_verify', 'partner' => pid, 'notify_id' => notify_id ) Net::HTTP.get(uri) == 'true' end end end
Version data entries
19 entries across 19 versions & 2 rubygems