Class: Google4R::Checkout::NotificationAcknowledgementXmlGenerator
- Inherits:
-
XmlGenerator
- Object
- XmlGenerator
- Google4R::Checkout::NotificationAcknowledgementXmlGenerator
- Defined in:
- lib/google4r/checkout/xml_generation.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(notification_acknowledgement) ⇒ NotificationAcknowledgementXmlGenerator
constructor
A new instance of NotificationAcknowledgementXmlGenerator.
- #process_notification_acknowledgement(notification_acknowledgement) ⇒ Object
Constructor Details
#initialize(notification_acknowledgement) ⇒ NotificationAcknowledgementXmlGenerator
Returns a new instance of NotificationAcknowledgementXmlGenerator.
901 902 903 |
# File 'lib/google4r/checkout/xml_generation.rb', line 901 def initialize(notification_acknowledgement) @notification_acknowledgement = notification_acknowledgement end |
Instance Method Details
#generate ⇒ Object
905 906 907 908 909 910 911 |
# File 'lib/google4r/checkout/xml_generation.rb', line 905 def generate super self.process_notification_acknowledgement(@notification_acknowledgement) io = StringIO.new @document.write(io, -1) return io.string end |
#process_notification_acknowledgement(notification_acknowledgement) ⇒ Object
913 914 915 916 917 918 919 |
# File 'lib/google4r/checkout/xml_generation.rb', line 913 def process_notification_acknowledgement(notification_acknowledgement) root = @document.add_element('notification-acknowledgment') root.add_attribute('xmlns', 'http://checkout.google.com/schema/2') if not notification_acknowledgement.serial_number.nil? root.add_attribute('serial-number', notification_acknowledgement.serial_number) end end |