Module: ActiveMerchant::Billing::Integrations::SwedbankEst
- Defined in:
- lib/active_merchant/billing/integrations/swedbank_est.rb,
lib/active_merchant/billing/integrations/swedbank_est/helper.rb,
lib/active_merchant/billing/integrations/swedbank_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/swedbank_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.
69 70 71 72 73 74 75 76 |
# File 'lib/active_merchant/billing/integrations/swedbank_est.rb', line 69 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
92 93 94 |
# File 'lib/active_merchant/billing/integrations/swedbank_est.rb', line 92 def self.notification(post) Notification.new(post) end |
.service_url ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/active_merchant/billing/integrations/swedbank_est.rb', line 80 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 |