module PaynowStatus

throws error when hash from Paynow does not match locally generated hash

Public Class Methods

check_transaction_status(poll_url) click to toggle source
# File lib/paynow_sdk.rb, line 14
def self.check_transaction_status(poll_url)
  url = URI(poll_url)

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Post.new(url)
  request["content-type"] = "application/x-www-form-urlencoded"

  response = http.request(request)
  response.read_body

  response_object = URI.decode_www_form(response.read_body).to_h
end
paid() click to toggle source