Package com.google.checkout.sdk.commands

Examples of com.google.checkout.sdk.commands.CheckoutException


    }
  }

  protected void dispatchUnknownNotification(Notification notification, OrderSummary orderSummary,
      BaseNotificationDispatcher dispatcher) throws Exception {
    throw new CheckoutException("Unrecognized notification type " + notification);
  }
View Full Code Here


            HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Internal Error in Server");
      } catch (Exception secondaryException) {
        logger.log(Level.WARNING, "Secondary Exception caught while rolling back transaction.",
            secondaryException);
      }
      throw new CheckoutException("Rolled back transaction due to exception.", e);
    }

    try {
      sendNotificationAcknowledgment(
          serialNumber, dispatcher.response, notification, dispatcher.request);
View Full Code Here

   */
  public Notification getNotificationFromRequest(HttpServletRequest request) throws CheckoutException {
    if (Utils.isSerialNumberRequest(request)) {
      String serialNumber = request.getParameter(SERIAL_NUMBER_PARAMETER);
      if (serialNumber == null) {
        throw new CheckoutException("Couldn't find serial number in parameters");
      }
      return apiContext.reportsRequester().requestNotification(serialNumber);
    } else {
      String auth = request.getHeader("Authorization");
      if (!apiContext.isValidAuth(auth)) {
        throw new CheckoutException("Invalid auth found");
      }
      try {
        return (Notification)Utils.fromXML(request.getInputStream()).getValue();
      } catch (Exception e) {
        throw new CheckoutException("Could not retrieve notification", e);
      }
    }
  }
View Full Code Here

    protected HttpURLConnection openHttpConnection(String toUrl) throws CheckoutException {
      try {
        return new FakeHttpConnection(
            new URL(toUrl), input, output, error);
      } catch (MalformedURLException e) {
        throw new CheckoutException(e);
      }
    }
View Full Code Here

TOP

Related Classes of com.google.checkout.sdk.commands.CheckoutException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.