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

Gateway confirmation mail i18n

Started by lrkwz, January 14, 2010, 04:18:21 pm

Previous topic - Next topic

lrkwz

I've noticed that email sent by the payment callback (com.konakart.actions.ipn.*) when payment is received/refused at in the store default locale.

I've ended up with this changes:

in BaseGateWayAction function sendOrderConfirmationMail() from:

  kkAppEng.getEng().sendOrderConfirmationEmail1(kkAppEng.getSessionId(), orderId, /* langIdForOrder */   -1, options);
to:
kkAppEng.getEng().sendOrderConfirmationEmail1(kkAppEng.getSessionId(), orderId, kkAppEng.getLangId(), options);


in CheckOutConfirmationAction() added:
  // Save Locale in order to reuse it in the email sent from the callback
  checkoutOrder.setCustom1("Navigation language id:" + kkAppEng.getLangId() + "," + kkAppEng.getLocale() );


before:
    return mapping.findForward("CheckoutConfirmation");

then in the gateway callback add

try {
   String navLang = localOrder.getCustom1();
   if (navLang != null && navLang.length() > 0) {
      // Custom1 should be something like: fixed_text:2,it_IT (see. src/appn/src/com/konakart/actions/CheckoutConfirmationAction.java)
      String[] t = navLang.substring(navLang.indexOf(":") + 1).split(",");
      kkAppEng.setLangId(new Integer(t[0]));
      String[] l = t[1].split("_");
      kkAppEng.setLocale(l[0], l[1]);
   }
} catch (Exception e) {
   log.error("Cannot initialize locale for order " + orderId + " " + e);
}