class OffsitePayments::Integrations::CheckoutFinland::Notification

Public Instance Methods

acknowledge(authcode = nil) click to toggle source

Verify authenticity of returned data

# File lib/offsite_payments/integrations/checkout_finland.rb, line 150
def acknowledge(authcode = nil)
  return_authcode = [params["VERSION"], params["STAMP"], params["REFERENCE"], params["PAYMENT"], params["STATUS"], params["ALGORITHM"]].join("&")
  OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), authcode, return_authcode).upcase == params["MAC"]
end
activation?() click to toggle source

Payment requires manual activation (fraud check etc)

# File lib/offsite_payments/integrations/checkout_finland.rb, line 121
def activation?
  params['STATUS'] == "7"
end
cancelled?() click to toggle source

Did the customer cancel the payment

# File lib/offsite_payments/integrations/checkout_finland.rb, line 116
def cancelled?
  params['STATUS'] == "-1"
end
complete?() click to toggle source

Payment can be market complete with the following status codes

# File lib/offsite_payments/integrations/checkout_finland.rb, line 106
def complete?
  ["2", "5", "6", "8", "9", "10"].include? params["STATUS"]
end
delayed?() click to toggle source

Did the customer choose delayed payment method

# File lib/offsite_payments/integrations/checkout_finland.rb, line 111
def delayed?
  params['STATUS'] == "3"
end
mac() click to toggle source

Returned Message Authentication Code

# File lib/offsite_payments/integrations/checkout_finland.rb, line 141
def mac
  params['MAC']
end
reference() click to toggle source

Reference specified by the client when sending payment

# File lib/offsite_payments/integrations/checkout_finland.rb, line 126
def reference
  params['REFERENCE']
end
stamp() click to toggle source

Unique ID assigned by customer

# File lib/offsite_payments/integrations/checkout_finland.rb, line 136
def stamp
  params['STAMP']
end
status() click to toggle source
# File lib/offsite_payments/integrations/checkout_finland.rb, line 145
def status
  params['STATUS']
end
transaction_id() click to toggle source

Unique ID assigned by Checkout

# File lib/offsite_payments/integrations/checkout_finland.rb, line 131
def transaction_id
  params['PAYMENT']
end

Private Instance Methods

parse(post) click to toggle source

Take the posted data and move the data into params

# File lib/offsite_payments/integrations/checkout_finland.rb, line 158
def parse(post)
  post.each do |key, value|
    params[key] = value
  end
end