class OffsitePayments::Return

Attributes

notification[R]
params[RW]

Public Class Methods

new(query_string, options = {}) click to toggle source
# File lib/offsite_payments/return.rb, line 6
def initialize(query_string, options = {})
  @params  = parse(query_string)
  @options = options
end

Public Instance Methods

cancelled?() click to toggle source

Not cancelled by default. Overridden in the child class.

# File lib/offsite_payments/return.rb, line 17
def cancelled?
  false
end
message() click to toggle source
# File lib/offsite_payments/return.rb, line 21
def message
end
parse(query_string) click to toggle source
# File lib/offsite_payments/return.rb, line 24
def parse(query_string)
  return {} if query_string.blank?

  query_string.split('&').inject({}) do |memo, chunk|
    next if chunk.empty?
    key, value = chunk.split('=', 2)
    next if key.empty?
    value = value.nil? ? nil : CGI.unescape(value)
    memo[CGI.unescape(key)] = value
    memo
  end
end
success?() click to toggle source

Successful by default. Overridden in the child class

# File lib/offsite_payments/return.rb, line 12
def success?
  true
end