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
paypal-express-0.4.3 lib/paypal/ipn.rb
paypal-express-0.4.2 lib/paypal/ipn.rb
paypal-express-0.4.1 lib/paypal/ipn.rb
paypal-express-0.4.0 lib/paypal/ipn.rb
paypal-express-0.4.0.alpha lib/paypal/ipn.rb
paypal-express-0.3.1 lib/paypal/ipn.rb
paypal-express-0.3.0 lib/paypal/ipn.rb
paypal-express-0.2.10 lib/paypal/ipn.rb
paypal-express-0.2.9 lib/paypal/ipn.rb
paypal-express-0.2.8 lib/paypal/ipn.rb
paypal-express-0.2.7 lib/paypal/ipn.rb
paypal-express-0.2.6 lib/paypal/ipn.rb
paypal-express-0.2.5 lib/paypal/ipn.rb
paypal-express-0.2.4 lib/paypal/ipn.rb
paypal-express-0.2.3 lib/paypal/ipn.rb
paypal-express-0.2.2 lib/paypal/ipn.rb
paypal-express-0.2.1 lib/paypal/ipn.rb
paypal-express-0.2.0 lib/paypal/ipn.rb