Module: ActiveMerchant::Billing::Integrations::SebEst

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

Overview

:nodoc:

Defined Under Namespace

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.



57
58
59
60
61
62
63
64
# File 'lib/active_merchant/billing/integrations/seb_est.rb', line 57

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.



70
71
72
73
74
75
76
77
# File 'lib/active_merchant/billing/integrations/seb_est.rb', line 70

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



93
94
95
# File 'lib/active_merchant/billing/integrations/seb_est.rb', line 93

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

.service_urlObject



81
82
83
84
85
86
87
88
89
90
91
# File 'lib/active_merchant/billing/integrations/seb_est.rb', line 81

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