Sha256: 5dcad298da0c34addba4cc7be27df3afa551ed5e800a117874bed697f9410392

Contents?: true

Size: 454 Bytes

Versions: 1

Compression:

Stored size: 454 Bytes

Contents

module WirecardGiropay
  class NotificationResponse

    def initialize(xml)
      @xml = xml
    end

    def self.from_xml(xml)
      new xml
    end

    def success?
      status_code == 'O10'
    end

    def failed?
      status_code == 'O30'
    end

    private

    def status_code
      @status_code ||= xml_doc.xpath('//Notification/ReferenceStatusCode').text
    end

    def xml_doc
      @xml_doc ||= Nokogiri::XML @xml
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wirecard_giropay-1.0.2 lib/wirecard_giropay/notification_response.rb