class Sepa::SamlinkResponse
Handles Samlink specific response logic. Mainly certificate specific stuff.
Public Instance Methods
application_response()
click to toggle source
Calls superclass method
# File lib/sepa/banks/samlink/samlink_response.rb, line 14 def application_response [:get_certificate, :renew_certificate].include?(command) ? super(namespace: SAMLINK_PKI) : super end
certificate_is_trusted?()
click to toggle source
# File lib/sepa/banks/samlink/samlink_response.rb, line 24 def certificate_is_trusted? case environment when :production # Samlink doesn't provide a CA certificate for production environment and that's why we check that the # certificate provided is equal to the known trusted certificate. certificate.to_s == SAMLINK_CERTIFICATE.to_s when :test verify_certificate_against_root_certificate(certificate, SAMLINK_ROOT_CERTIFICATE) end end
own_signing_certificate()
click to toggle source
# File lib/sepa/banks/samlink/samlink_response.rb, line 18 def own_signing_certificate (node = Nokogiri::XML(application_response).at('xmlns|Certificate > xmlns|Certificate', xmlns: OP_XML_DATA)) && (content = node.content) && x509_certificate(decode(content)).to_s end
response_code()
click to toggle source
Calls superclass method
# File lib/sepa/banks/samlink/samlink_response.rb, line 5 def response_code [:get_certificate, :renew_certificate].include?(command) ? super(namespace: SAMLINK_PKI) : super end
response_text()
click to toggle source
Calls superclass method
# File lib/sepa/banks/samlink/samlink_response.rb, line 10 def response_text [:get_certificate, :renew_certificate].include?(command) ? super(namespace: SAMLINK_PKI) : super end