Class: GoogleCheckout::RefundOrder
- Inherits:
-
OrderCommand
- Object
- Command
- OrderCommand
- GoogleCheckout::RefundOrder
- Defined in:
- lib/google-checkout/command.rb
Overview
Tells Google to refund the order.
Constant Summary
Constants inherited from Command
Command::PRODUCTION_REQUEST_URL, Command::SANDBOX_REQUEST_URL
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#reason ⇒ Object
Returns the value of attribute reason.
Attributes inherited from OrderCommand
Attributes inherited from Command
#currency, #merchant_id, #merchant_key
Instance Method Summary collapse
Methods inherited from OrderCommand
Methods inherited from Command
#initialize, #post, #url, x509_store
Constructor Details
This class inherits a constructor from GoogleCheckout::OrderCommand
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment.
160 161 162 |
# File 'lib/google-checkout/command.rb', line 160 def comment @comment end |
#reason ⇒ Object
Returns the value of attribute reason.
160 161 162 |
# File 'lib/google-checkout/command.rb', line 160 def reason @reason end |
Instance Method Details
#to_xml ⇒ Object
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/google-checkout/command.rb', line 162 def to_xml raise "Refund amount must be greater than 0!" unless @amount.to_f > 0.0 xml = Builder::XmlMarkup.new xml.instruct! @xml = xml.tag!('refund-order', { :xmlns => "http://checkout.google.com/schema/2", "google-order-number" => @google_order_number }) do xml.tag!("amount", @amount, {:currency => @currency}) xml.tag!("reason", @reason) xml.tag!("comment", @comment) end @xml end |