Module: ActiveMerchant::Billing::Integrations::SampoEst
- Defined in:
- lib/active_merchant/billing/integrations/sampo_est.rb,
lib/active_merchant/billing/integrations/sampo_est/helper.rb,
lib/active_merchant/billing/integrations/sampo_est/notification.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Helper, Notification
Class Method Summary collapse
-
.get_bank_public_key ⇒ Object
RSA public key of the bank, taken from the X509 certificate of the bank.
-
.get_private_key ⇒ Object
Our RSA private key.
- .notification(post) ⇒ Object
- .service_url ⇒ Object
Class Method Details
.get_bank_public_key ⇒ Object
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/sampo_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_key ⇒ Object
Our RSA private key. OpenSSL container.
70 71 72 73 74 75 76 77 |
# File 'lib/active_merchant/billing/integrations/sampo_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
94 95 96 |
# File 'lib/active_merchant/billing/integrations/sampo_est.rb', line 94 def self.notification(post) Notification.new(post) end |
.service_url ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/active_merchant/billing/integrations/sampo_est.rb', line 82 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 |