3 Replies Latest reply: Jul 26, 2011 2:07 PM by 877450 RSS

    Not able to add a remaining order amount to a payment group

    877450
      Hello all,

      I've been writing a customized kind of PaymentFormHandler, which extends the PurchaseProcessFormHandler and implements the transaction pattern.

      I'm getting an exception which I am currently not able tosolve. The important code section follows, the exception caught as well.

      Does anyone have a tip on solving this problem? Any help is appreciated.

      (Do not consider the comment and log lines in Portuguese)

      // Adicionando o default
                                    String nomePaymentGroupDefault = getPaymentGroupMapContainer()
                                              .getDefaultPaymentGroupName();

                                    PaymentGroup paymentGroup = getPaymentGroupMapContainer()
                                              .getPaymentGroup(nomePaymentGroupDefault);

                                    logDebug("adicionando o restante do valor do order ao "
                                              + nomePaymentGroupDefault + ", id: "
                                              + paymentGroup.getId());
                                    try {
                                         getOrderManager()
                                                   .addRemainingOrderAmountToPaymentGroup(
                                                             getOrder(), paymentGroup.getId());
                                    } catch (CommerceException e) {
                                         tratarExcecoes(e);
                                    }



      CONTAINER:atg.commerce.order.InvalidParameterException: atg.commerce.order.OrderResources->InvalidPaymentGroupIdParameter
      : Invalid PaymentGroup id parameter.; SOURCE:atg.commerce.order.PaymentGroupNotFoundException: atg.commerce.order.OrderRes
      ources->PaymentGroupNotFound : PaymentGroup with id pg640003 is not in container.
      at atg.commerce.order.PaymentGroupManager.getPaymentGroupOrderRelationship(PaymentGroupManager.java:731)
      at atg.commerce.order.OrderManager.getPaymentGroupOrderRelationship(OrderManager.java:5021)
      at atg.commerce.order.OrderManager.addRemainingOrderAmountToPaymentGroup(OrderManager.java:2066)
      at passarela.web.pagamento.PagamentoFormHandler.handleEfetuarPagamento(PagamentoFormHandler.java:201)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at atg.droplet.EventSender.sendEvent(EventSender.java:582)
      at atg.droplet.FormTag.doSendEvents(FormTag.java:800)
      at atg.droplet.FormTag.sendEvents(FormTag.java:649)
      at atg.droplet.DropletEventServlet.sendEvents(DropletEventServlet.java:523)



      Thanks a lot.