Sha256: 79f26a8a1f81760356333d6b92e2a555b834590b7b907d43eb733a0efbadf234

Contents?: true

Size: 455 Bytes

Versions: 58

Compression:

Stored size: 455 Bytes

Contents

module Paypal
  module IPN
    def self.endpoint
      _endpoint_ = URI.parse Paypal.endpoint
      _endpoint_.query = {
        :cmd => '_notify-validate'
      }.to_query
      _endpoint_.to_s
    end

    def self.verify!(raw_post)
      response = RestClient.post(
        endpoint, raw_post
      )
      case response.body
      when 'VERIFIED'
        true
      else
        raise Exception::APIError.new(response.body)
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 4 rubygems

Version Path
creative-paypal-express-0.8.2.2 lib/paypal/ipn.rb
creative-paypal-express-0.8.2.1 lib/paypal/ipn.rb
creative-paypal-express-0.8.2 lib/paypal/ipn.rb
creative-paypal-express-0.8.1 lib/paypal/ipn.rb
paypal-express-0.8.1 lib/paypal/ipn.rb
paypal-express-0.8.0 lib/paypal/ipn.rb
paypal-express-0.7.1 lib/paypal/ipn.rb
paypal-express-0.7.0 lib/paypal/ipn.rb
paypal-express-0.6.0 lib/paypal/ipn.rb
paypal-express-0.5.5 lib/paypal/ipn.rb
paypal-express-0.5.4 lib/paypal/ipn.rb
paypal-express-0.5.3 lib/paypal/ipn.rb
paypal-express-0.5.2 lib/paypal/ipn.rb
paypal-express-0.5.1 lib/paypal/ipn.rb
paypal-express-0.5.0 lib/paypal/ipn.rb
paypal-express-0.4.7 lib/paypal/ipn.rb
paypal-express-0.5.0.alpha lib/paypal/ipn.rb
paypal-express-0.4.6 lib/paypal/ipn.rb
paypal-express-0.4.5 lib/paypal/ipn.rb
paypal-express-0.4.4 lib/paypal/ipn.rb