class Eghl_hash_beta

% cat lib/hola.rb

Public Class Methods

hash() click to toggle source
# File lib/eghl_hash_beta.rb, line 6
def self.hash

      @random = rand(1000..9999999)

      @password = "sit12345"
      @serviceid = "SIT"
      @paymentid = "RoR" + "SIT" + "-" + (@random).to_s
      @merchantreturnurl = "http://arifall.my/eGHL/success_page.php"
      @merchantcallbackurl = "http://arifall.my/eGHL/mp_callback.php"
      @amount = "1.00"
      @currencycode = "MYR"

      @concat = @password+@serviceid+@paymentid+@merchantreturnurl+@merchantcallbackurl+@amount+@currencycode
      @hashvalue = Digest::SHA256.hexdigest @concat 

  puts "hash value is : "+@hashvalue
end