Module Simplepay::Helpers::NotificationHelper
In: lib/simplepay/helpers/notification_helper.rb
RuntimeError Error Service Standard Marketplace Donation Subscription MarketplacePolicy Interval SubscriptionPeriod BillingFrequency Comparable Field Service Epoch Currency Amount Boolean ResponseStatusCode Services Authentication FormHelper NotificationHelper RailsHelper Helpers Interval Currency Support Boolean Simplepay dot/f_2.png

Adds a +valid_simplepay_request?+ method to your ActionControllers.

In order to use this, you should just directly hand your params into the method:

    class FooController < ApplicationController

      def receive_ipn
        if valid_simplepay_request?(params)
          ... record something useful ...
        else
          ... maybe log a bad request? ...
        end
      end

    end

Methods

Protected Instance methods

Authenticates the incoming request by validating the signature provided.

    (from within your controller)
    def receive_ipn
      if valid_simplepay_request?(params)
        ...
      end
    end

[Source]

# File lib/simplepay/helpers/notification_helper.rb, line 40
      def valid_simplepay_request?(request_hash)
        hash      = request_hash.symbolize_keys
        signature = hash.delete(:signature) || ''
        Simplepay::Authentication.authentic?(hash, signature)
      end

[Validate]