Module: ActiveMerchant::Billing::Integrations::DnbNordLtu

Defined in:
lib/active_merchant/billing/integrations/dnb_nord_ltu/common.rb,
lib/active_merchant/billing/integrations/dnb_nord_ltu.rb,
lib/active_merchant/billing/integrations/dnb_nord_ltu/helper.rb,
lib/active_merchant/billing/integrations/dnb_nord_ltu/notification.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Common Classes: Helper, Notification

Class Method Summary collapse

Class Method Details

.get_bank_public_keyObject

RSA public key of the bank, taken from the X509 certificate of the bank. OpenSSL container.



15
16
17
18
19
20
21
22
# File 'lib/active_merchant/billing/integrations/dnb_nord_ltu.rb', line 15

def self.get_bank_public_key
  if ActiveMerchant::Billing::Base.integration_mode == :production
    cert = self.bank_certificate
  else
    cert = self.test_bank_certificate
  end
  OpenSSL::X509::Certificate.new(cert.gsub(/  /, '')).public_key
end

.get_private_keyObject

Our RSA private key. OpenSSL container.



27
28
29
30
31
32
33
34
# File 'lib/active_merchant/billing/integrations/dnb_nord_ltu.rb', line 27

def self.get_private_key
  if ActiveMerchant::Billing::Base.integration_mode == :production
    private_key = self.private_key
  else
    private_key = self.test_private_key
  end
  OpenSSL::PKey::RSA.new(private_key.gsub(/  /, ''))
end

.notification(post) ⇒ Object



50
51
52
# File 'lib/active_merchant/billing/integrations/dnb_nord_ltu.rb', line 50

def self.notification(post)
  Notification.new(post)
end

.service_urlObject



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/active_merchant/billing/integrations/dnb_nord_ltu.rb', line 38

def self.service_url
  mode = ActiveMerchant::Billing::Base.integration_mode
  case mode
  when :production
    self.production_url
  when :test
    self.test_url
  else
    raise StandardError, "Integration mode set to an invalid value: #{mode}"
  end
end