Class: GoogleCheckout::ChargeOrder
- Inherits:
-
OrderCommand
- Object
- Command
- OrderCommand
- GoogleCheckout::ChargeOrder
- Defined in:
- lib/google-checkout/command.rb
Overview
Create a new ChargeOrder object, set the amount
, then post
it.
Constant Summary
Constants inherited from Command
GoogleCheckout::Command::PRODUCTION_REQUEST_URL, GoogleCheckout::Command::SANDBOX_REQUEST_URL
Instance Attribute Summary
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 Method Details
#to_xml ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/google-checkout/command.rb', line 115 def to_xml raise "Charge amount must be greater than 0!" unless @amount.to_f > 0.0 xml = Builder::XmlMarkup.new xml.instruct! @xml = xml.tag!('charge-order', { :xmlns => "http://checkout.google.com/schema/2", "google-order-number" => @google_order_number }) do xml.tag!("amount", @amount, {:currency => @currency}) end @xml end |