Class: GoogleCheckout::SendBuyerMessage
- Inherits:
-
OrderCommand
- Object
- Command
- OrderCommand
- GoogleCheckout::SendBuyerMessage
- Defined in:
- lib/google-checkout/command.rb
Overview
Send a message to the buyer associated with an order.
Google will actually send the message to their email address.
Constant Summary
Constants inherited from Command
Command::PRODUCTION_REQUEST_URL, Command::SANDBOX_REQUEST_URL
Instance Attribute Summary
Attributes inherited from OrderCommand
Attributes inherited from Command
#currency, #merchant_id, #merchant_key
Instance Method Summary collapse
-
#initialize(merchant_id, merchant_key, google_order_number, message) ⇒ SendBuyerMessage
constructor
Make a new message to send.
-
#to_xml ⇒ Object
:nodoc:.
Methods inherited from Command
Constructor Details
#initialize(merchant_id, merchant_key, google_order_number, message) ⇒ SendBuyerMessage
Make a new message to send.
The last argument is the actual message.
Call post
on the resulting object to submit it to Google for sending.
242 243 244 245 246 247 |
# File 'lib/google-checkout/command.rb', line 242 def initialize(merchant_id, merchant_key, google_order_number, ) # TODO Raise meaninful error if message is longer than 255 characters raise "Google won't send anything longer than 255 characters! Sorry!" if .length > 255 @message = super(merchant_id, merchant_key, google_order_number) end |
Instance Method Details
#to_xml ⇒ Object
:nodoc:
249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/google-checkout/command.rb', line 249 def to_xml # :nodoc: xml = Builder::XmlMarkup.new xml.instruct! @xml = xml.tag!('send-buyer-message', { :xmlns => "http://checkout.google.com/schema/2", "google-order-number" => @google_order_number }) do xml.tag!("message", @message) xml.tag!("send-email", true) end @xml end |