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.
829 830 831 |
# File 'lib/google4r/checkout/xml_generation.rb', line 829 def initialize(notification_acknowledgement) @notification_acknowledgement = notification_acknowledgement end |
Instance Method Details
#generate ⇒ Object
833 834 835 836 837 838 839 |
# File 'lib/google4r/checkout/xml_generation.rb', line 833 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
841 842 843 844 845 846 847 |
# File 'lib/google4r/checkout/xml_generation.rb', line 841 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 |