def post
      # Create HTTP(S) POST command and set up Basic Authentication.
      uri = URI.parse(url)

      request = Net::HTTP::Post.new(uri.path)
      request.basic_auth(@merchant_id, @merchant_key)

      # Set up the HTTP connection object and the SSL layer.
      https = Net::HTTP.new(uri.host, uri.port)
      https.use_ssl = true
      https.cert_store = self.class.x509_store
      https.verify_mode = OpenSSL::SSL::VERIFY_PEER
      https.verify_depth = 5

      # Send the request to Google.
      response = https.request(request, self.to_xml)

      # NOTE Because Notification.parse() is used, the content of objects
      #      will be correctly parsed no matter what the HTTP response code
      #      is from the server.
      case response
      when Net::HTTPSuccess, Net::HTTPClientError
        notification = Notification.parse(response.body)
        if notification.error?
          raise APIError, "#{notification.message} [in #{GoogleCheckout.production? ? 'production' : 'sandbox' }]"
        end
        return notification
      when Net::HTTPRedirection, Net::HTTPServerError, Net::HTTPInformation
        raise "Unexpected response code (#{response.class}): #{response.code} - #{response.message}"
      else
        raise "Unknown response code: #{response.code} - #{response.message}"
      end
    end
def post
      # Create HTTP(S) POST command and set up Basic Authentication.
      uri = URI.parse(url)

      request = Net::HTTP::Post.new(uri.path)
      request.basic_auth(@merchant_id, @merchant_key)

      # Set up the HTTP connection object and the SSL layer.
      https = Net::HTTP.new(uri.host, uri.port)
      https.use_ssl = true
      https.cert_store = self.class.x509_store
      https.verify_mode = OpenSSL::SSL::VERIFY_PEER
      https.verify_depth = 5

      # Send the request to Google.
      response = https.request(request, self.to_xml)

      # NOTE Because Notification.parse() is used, the content of objects
      #      will be correctly parsed no matter what the HTTP response code
      #      is from the server.
      case response
      when Net::HTTPSuccess, Net::HTTPClientError
        notification = Notification.parse(response.body)
        if notification.error?
          raise APIError, "#{notification.message} [in #{GoogleCheckout.production? ? 'production' : 'sandbox' }]"
        end
        return notification
      when Net::HTTPRedirection, Net::HTTPServerError, Net::HTTPInformation
        raise "Unexpected response code (#{response.class}): #{response.code} - #{response.message}"
      else
        raise "Unknown response code: #{response.code} - #{response.message}"
      end
    end
Sends the Command's XML to GoogleCheckout via HTTPS with Basic Auth.

 Returns a GoogleCheckout::RequestReceived or a GoogleCheckout::Error object.