Sha256: cf5c3b0f9da3cd64c1ababecf56596dfe51ce44661f9dc25c6bb5cea3d3bbb7c
Contents?: true
Size: 734 Bytes
Versions: 4
Compression:
Stored size: 734 Bytes
Contents
require 'digest/md5' module Ipizza::Provider class Nordea::AuthenticationRequest < Ipizza::AuthenticationRequest attr_accessor :params attr_accessor :service_url def sign(key_path) key = File.read(key_path).strip params['MAC'] = Digest::MD5.hexdigest(mac_data_string(key)).upcase end def request_params params.inject(Hash.new) { |h, v| h["A01Y_#{v.first}"] = v.last; h } end private def mac_data_string(key) order = %w(ACTION_ID VERS RCVID LANGCODE STAMP IDTYPE RETLINK CANLINK REJLINK KEYVERS ALG) datastr = order.inject('') do |memo, param| memo << params[param].to_s << '&' end datastr << key << '&' end end end
Version data entries
4 entries across 4 versions & 1 rubygems