Examples of OrderStateChangeNotification


Examples of com.google.checkout.OrderStateChangeNotification

      output.output(_message, writer);
      String xml = writer.toString();
      if (LOG.isDebugEnabled()) {
        LOG.debug("Order State Change Notification received: [" + xml + "]");
      }
      OrderStateChangeNotification notification = (OrderStateChangeNotification) Unmarshaller.unmarshal(OrderStateChangeNotification.class, new StringReader(writer.toString()));
      handleNotification(notification);
    } catch (MarshalException e) {
      throw new HandlerException("Error marshalling XML: " + e.getLocalizedMessage(), e);
    } catch (ValidationException e) {
      throw new HandlerException("Error validating XML: " + e.getLocalizedMessage(), e);
View Full Code Here

Examples of com.google.checkout.notification.OrderStateChangeNotification

    AbstractNotificationProcessor implements MessageHandler {
 
  public String process(MerchantConstants mc, String notificationMsg)
  throws CheckoutException {
    try {
      OrderStateChangeNotification notification =
          new OrderStateChangeNotification(notificationMsg);
      String ack = getAckString();
      GoogleOrder order = GoogleOrder.findOrCreate(mc.getMerchantId(),
          notification.getGoogleOrderNo());
      order.setLastFulStatus(notification.getNewFulfillmentOrderState()
      .toString());
      order.setLastFinStatus(notification.getNewFinancialOrderState()
      .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.notification.OrderStateChangeNotification

      return processor.process(notification);
    }
    if (notificationString.indexOf("order-state-change-notification") > -1) {
      OrderStateChangeNotificationProcessor processor = new OrderStateChangeNotificationProcessorImpl(
          mc);
      OrderStateChangeNotification notification = new OrderStateChangeNotification(
          notificationString);
      return processor.process(notification);
    }
    if (notificationString.indexOf("charge-amount-notification") > -1) {
      ChargeAmountNotificationProcessor processor = new ChargeAmountNotificationProcessorImpl(
View Full Code Here

Examples of com.google.checkout.notification.OrderStateChangeNotification

      return processor.process(notification);
    }
    if (notificationString.indexOf("order-state-change-notification") > -1) {
      OrderStateChangeNotificationProcessor processor = new OrderStateChangeNotificationProcessorImpl(
          mc);
      OrderStateChangeNotification notification = new OrderStateChangeNotification(
          notificationString);
      return processor.process(notification);
    }
    if (notificationString.indexOf("charge-amount-notification") > -1) {
      ChargeAmountNotificationProcessor processor = new ChargeAmountNotificationProcessorImpl(
View Full Code Here

Examples of com.google.checkout.notification.OrderStateChangeNotification

                    Debug.logError(e, module);
                    sendResponse(response, serialNumber, e);
                    return null;
                }
            } else if ("order-state-change-notification".equals(nodeValue)) {
                OrderStateChangeNotification info = new OrderStateChangeNotification(document);
                String serialNumber = info.getSerialNumber();
                try {
                    helper.processStateChange(info);
                    sendResponse(response, serialNumber, null);
                } catch (GeneralException e) {
                    Debug.logError(e, module);
                    sendResponse(response, serialNumber, e);
                    return null;
                }
            } else if ("risk-information-notification".equals(nodeValue)) {
                RiskInformationNotification info = new RiskInformationNotification(document);
                String serialNumber = info.getSerialNumber();
                try {
                    helper.processRiskNotification(info);
                    sendResponse(response, serialNumber, null);
                } catch (GeneralException e) {
                    Debug.logError(e, module);
                    sendResponse(response, serialNumber, e);
                    return null;
                }
            } else if ("authorization-amount-notification".equals(nodeValue)) {
                AuthorizationAmountNotification info = new AuthorizationAmountNotification(document);
                String serialNumber = info.getSerialNumber();
                try {
                    helper.processAuthNotification(info);
                    sendResponse(response, serialNumber, null);
                } catch (GeneralException e) {
                    Debug.logError(e, module);
                    sendResponse(response, serialNumber, e);
                    return null;
                }
            } else if ("charge-amount-notification".equals(nodeValue)) {
                ChargeAmountNotification info = new ChargeAmountNotification(document);
                String serialNumber = info.getSerialNumber();
                try {
                    helper.processChargeNotification(info);
                    sendResponse(response, serialNumber, null);
                } catch (GeneralException e) {
                    Debug.logError(e, module);
                    sendResponse(response, serialNumber, e);
                    return null;
                }
            } else if ("chargeback-amount-notification".equals(nodeValue)) {
                ChargebackAmountNotification info = new ChargebackAmountNotification(document);
                String serialNumber = info.getSerialNumber();
                try {
                    helper.processChargeBackNotification(info);
                    sendResponse(response, serialNumber, null);
                } catch (GeneralException e) {
                    Debug.logError(e, module);
                    sendResponse(response, serialNumber, e);
                    return null;
                }
            } else if ("refund-amount-notification".equals(nodeValue)) {
                RefundAmountNotification info = new RefundAmountNotification(document);
                String serialNumber = info.getSerialNumber();
                try {
                    helper.processRefundNotification(info);
                    sendResponse(response, serialNumber, null);
                } catch (GeneralException e) {
                    Debug.logError(e, module);
View Full Code Here

Examples of com.google.checkout.schema._2.OrderStateChangeNotification

  private class OrderStatusEventHandler extends CallBackEventHandler
      implements OrderStateChangeNotificationListener {
    public void handleEvent(CallBackEvent event) {
      OrderStateChangeNotificationEvent statusEvent = (OrderStateChangeNotificationEvent) event;
      OrderStateChangeNotification stateChange
        = statusEvent.getOrderStateChangeNote();
      assertSame(OrderStateChangeNotification.class, stateChange.getClass());
    }
View Full Code Here

Examples of com.google.checkout.schema._2.OrderStateChangeNotification

  private class OrderStatusEventHandler extends CallBackEventHandler
      implements OrderStateChangeNotificationListener {
    public void handleEvent(CallBackEvent event) {
      OrderStateChangeNotificationEvent statusEvent = (OrderStateChangeNotificationEvent) event;
      OrderStateChangeNotification stateChange
        = statusEvent.getOrderStateChangeNote();
      assertNotNull(stateChange.getClass());
    }
View Full Code Here

Examples of com.google.checkout.sdk.domain.OrderStateChangeNotification

    ByteArrayInputStream error = new ByteArrayInputStream("".getBytes());
    Object object = new TestingApiContext(environment, input, output, error)
        .reportsRequester()
        // the specific number is mocked and doesn't matter, but the parsing _does_...
        .requestNotification("c821426e-7caa-4d51-9b2e-48ef7ecd6423");
    OrderStateChangeNotification oscn = (OrderStateChangeNotification)object;

    assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
        + "<notification-history-request xmlns=\"http://checkout.google.com/schema/2\">\n"
        + "    <serial-number>c821426e-7caa-4d51-9b2e-48ef7ecd6423</serial-number>\n"
        + "</notification-history-request>\n", output.toString("utf-8"));


    // textually identical to the XML EXAMPLE_NOTIFICATION string.
    assertEquals("841171949013218", oscn.getGoogleOrderNumber());
    assertEquals(FinancialOrderState.CHARGING, oscn.getNewFinancialOrderState());
    assertEquals(FinancialOrderState.CHARGEABLE, oscn.getPreviousFinancialOrderState());
    assertEquals(FulfillmentOrderState.NEW, oscn.getNewFulfillmentOrderState());
    assertEquals(FulfillmentOrderState.NEW, oscn.getPreviousFulfillmentOrderState());
    assertEquals(DATE_STRING, oscn.getTimestamp().toXMLFormat());
  }
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.