class Sepa::NordeaResponse
Handles Nordea specific response logic. Mainly certificate specific stuff.
Public Instance Methods
certificate_is_trusted?()
click to toggle source
Checks whether the certificate embedded in the response soap has been signed with Nordea's root certificate.
@return [true] if certificate is trusted @return [false] if certificate fails to verify @see DanskeResponse#certificate_is_trusted?
# File lib/sepa/banks/nordea/nordea_response.rb, line 42 def certificate_is_trusted? verify_certificate_against_root_certificate(certificate, NORDEA_ROOT_CERTIFICATE) end
own_signing_certificate()
click to toggle source
Extracts own signing certificate from the response.
@return [String] own signing certificate as string it it is found @return [nil] if the certificate cannot be found
# File lib/sepa/banks/nordea/nordea_response.rb, line 10 def own_signing_certificate application_response = extract_application_response(NORDEA_PKI) at = 'xmlns|Certificate > xmlns|Certificate' node = Nokogiri::XML(application_response).at(at, xmlns: NORDEA_XML_DATA) return unless node cert_value = process_cert_value node.content cert = x509_certificate cert_value cert.to_s end
response_code()
click to toggle source
Calls superclass method
# File lib/sepa/banks/nordea/nordea_response.rb, line 23 def response_code return super unless [:get_certificate, :renew_certificate].include? command super(namespace: NORDEA_PKI) end
response_text()
click to toggle source
Calls superclass method
# File lib/sepa/banks/nordea/nordea_response.rb, line 30 def response_text return super unless [:get_certificate, :renew_certificate].include? command super(namespace: NORDEA_PKI) end