Examples of CheckoutException


Examples of com.google.checkout.CheckoutException

          .getMerchantId(), notification.getGoogleOrderNo());
      order.addIncomingMessage(notification.getTimestamp(), notification
          .getRootNodeName(), notification.getXmlPretty(), ack);
      return ack;
    } catch (Exception e) {
      throw new CheckoutException(e);
    }
  }
View Full Code Here

Examples of com.google.checkout.CheckoutException

          .getMerchantId(), notification.getGoogleOrderNo());
      order.addIncomingMessage(notification.getTimestamp(), notification
          .getRootNodeName(), notification.getXmlPretty(), ack);
      return ack;
    } catch (Exception e) {
      throw new CheckoutException(e);
    }
  }
View Full Code Here

Examples of com.google.checkout.CheckoutException

          .toString());
      order.addIncomingMessage(notification.getTimestamp(), notification
          .getRootNodeName(), notification.getXmlPretty(), ack);
      return ack;
    } catch (Exception e) {
      throw new CheckoutException(e);
    }
  }
View Full Code Here

Examples of com.google.checkout.CheckoutException

          .getMerchantId(), notification.getGoogleOrderNo());
      order.addIncomingMessage(notification.getTimestamp(), notification
          .getRootNodeName(), notification.getXmlPretty(), ack);
      return ack;
    } catch (Exception e) {
      throw new CheckoutException(e);
    }
  }
View Full Code Here

Examples of com.google.checkout.CheckoutException

      order.setOrderAmount("" + notification.getOrderTotal());
      order.addIncomingMessage(notification.getTimestamp(), notification
          .getRootNodeName(), notification.getXmlPretty(), ack);
      return ack;
    } catch (Exception e) {
      throw new CheckoutException(e);
    }
  }
View Full Code Here

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

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

            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

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

   */
  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

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

    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

Examples of org.broadleafcommerce.core.checkout.service.exception.CheckoutException

    @Override
    public CheckoutResponse performCheckout(Order order) throws CheckoutException {
        //Immediately fail if another thread is currently attempting to check out the order
        Object lockObject = putLock(order.getId());
        if (lockObject != null) {
            throw new CheckoutException("This order is already in the process of being submitted, unable to checkout order -- id: " + order.getId(), new CheckoutSeed(order, new HashMap<String, Object>()));
        }

        // Immediately fail if this order has already been checked out previously
        if (hasOrderBeenCompleted(order)) {
            throw new CheckoutException("This order has already been submitted, unable to checkout order -- id: " + order.getId(), new CheckoutSeed(order, new HashMap<String, Object>()));
        }
       
        CheckoutSeed seed = null;
        try {
            // Do a final save of the order before going through with the checkout workflow
            order = orderService.save(order, false);
            seed = new CheckoutSeed(order, new HashMap<String, Object>());

            ProcessContext<CheckoutSeed> context = (ProcessContext<CheckoutSeed>) checkoutWorkflow.doActivities(seed);

            // We need to pull the order off the seed and save it here in case any activity modified the order.
            order = orderService.save(seed.getOrder(), false);
            order.getOrderMessages().addAll(((ActivityMessages) context).getActivityMessages());
            seed.setOrder(order);

            return seed;
        } catch (PricingException e) {
            throw new CheckoutException("Unable to checkout order -- id: " + order.getId(), e, seed);
        } catch (WorkflowException e) {
            throw new CheckoutException("Unable to checkout order -- id: " + order.getId(), e.getRootCause(), seed);
        } catch (RequiredAttributeNotProvidedException e) {
            throw new CheckoutException("Unable to checkout order -- id: " + order.getId(), e.getCause(), seed);
        } finally {
            // The order has completed processing, remove the order from the processing map
            removeLock(order.getId());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.