• Welcome to KonaKart Community Forum. Please login or sign up.
 

no mail from gateway callback

Started by lrkwz, December 07, 2009, 05:58:06 pm

Previous topic - Next topic

lrkwz

Hello,
    I've realized a payment gateway for Banca sella (Gestpay) starting from the WorldPay sources ... everything works fine but I canno send emails.

The sendOrderConfirmationMail(kkAppEng, orderId, /* success */false) function call does not receive any exception bue the local sendmail isn't called at all.

Other mail (Welcome, changepassword etc) have no prblems.

Any hint? How ca I diagnose the problem?

Thank you.

julie

Try adding   kkAppEng.setSessionId(sessionId); after getting the session id in the action class as shown below:           

// We log into the engine to get a session.
sessionId = kkAppEng.getEng().login(username, password);
kkAppEng.setSessionId(sessionId);

Maybe you would be so kind as to contribute the payment gateway to the community ?

lrkwz

Unfortunately I've already setted the instance ... no success :-(

Of course I'll contribute the gateway as soon all problems are resolved.

heidi

Have you checked the configuration settings are as you need in the KonaKart Admin App?

You can enable/disable the sending of order confirmation emails for example.

Another thing you can try is to enable the debug of email sessions.. Maybe that might give you some clues?

lrkwz

Debug Email Sessions = true
but  .. nothing in catalina.out where should I look for it?

I've also added

log4j.logger.com.konakart.bl.Emailer = DEBUG

with no output at all :-( :-(

lrkwz

I've realized that the OrderConfPaymentSuccess/Failure mail is sent only if you send the OrderConfirmation.

I wish to dsable the OrderConfirmation and send only the OrderConfPaymentSuccess/Failure ... is it possible?

julie


lrkwz

I I set in the admin send OrderConfirmation = false no mail is sent, if I set it true OrderConfirmation mail is sent and OrderConfPaymenrSuccess is also sent.

My code is:

public class GestpayAction extends BaseGatewayAction {
...
   public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
...
         // See if we need to send an email, by looking at the configuration
         String sendEmailsConfig = kkAppEng.getConfig(ConfigConstants.SEND_EMAILS);
         boolean sendEmail = false;
         if (sendEmailsConfig != null && sendEmailsConfig.equalsIgnoreCase("true")) {
            log.debug("will send email");
            sendEmail = true;
         }

...
            if (GestpayConstants.SUCCESSFUL_TRANSACTION_VALUE.equalsIgnoreCase(gestpayCrypt.getTransactionResult())) {
               comment = GestpayConstants.ORDER_HISTORY_COMMENT_OK + gestpayCrypt.getAuthorizationCode();
               kkAppEng.getEng().changeOrderStatus(sessionId, orderId, com.konakart.bl.OrderMgr.PAYMENT_RECEIVED_STATUS,
                     sendEmail, comment);

               // If the order payment was approved we update the inventory
               kkAppEng.getEng().updateInventory(sessionId, orderId);
               // If we expect no more communication from GestPay for this order we can
               // delete the SecretKey
               kkAppEng.getEng().deleteOrderIdForSecretKey(secretKey);
               if (sendEmail) {
                  log.debug("Sending payment received mail for order id " + orderId);
                  sendOrderConfirmationMail(kkAppEng, orderId, /* success */true);
               }
            } else {
               comment = GestpayConstants.ORDER_HISTORY_COMMENT_KO + gestpayCrypt.getTransactionResult();
               kkAppEng.getEng().changeOrderStatus(sessionId, orderId, com.konakart.bl.OrderMgr.PAYMENT_DECLINED_STATUS,
                     sendEmail, comment);
               if (sendEmail) {
                  log.debug("Sending payment declined mail for order id " + orderId);
                  sendOrderConfirmationMail(kkAppEng, orderId, /* success */false);
               }
            }

            ipnHistory.setKonakartResultDescription(GestpayConstants.RET0_DESC + " Auth code:"
                  + gestpayCrypt.getAuthorizationCode() + " Bank trans id:" + gestpayCrypt.getBankTransactionID());
            ipnHistory.setKonakartResultId(GestpayConstants.RET0);
            kkAppEng.getEng().saveIpnHistory(sessionId, ipnHistory);
         }

         return null;

      } catch (Exception e) {
...
    }
}


julie

In CheckoutConfirmationSubmitAction wheresaveOrder() is called, set sendEmail to false.

lrkwz