request.setAttribute("_ERROR_MESSAGE_", "<li>Merchant Configuration Error, please contact customer service.");
return "error";
}
// create a purchase token
PurchaseToken token = null;
try {
token = new PurchaseToken(instIdInt, currencyAmount, orderId);
} catch (SelectException e) {
Debug.logError(e, "Cannot create purchase token", module);
} catch (ArgumentException e) {
Debug.logError(e, "Cannot create purchase token", module);
}
if (token == null) {
request.setAttribute("_ERROR_MESSAGE_", "<li>Problems creating a purchase token, please contact customer service.");
return "error";
}
// set the auth/test modes
try {
token.setAuthorisationMode(authMode);
} catch (SelectException e) {
Debug.logWarning(e, "Problems setting the authorization mode", module);
}
token.setTestMode(testModeInt);
// set the token to the purchase link
try {
linkParms.setValue(SelectDefs.SEL_purchase, token.produce());
} catch (SelectException e) {
Debug.logError(e, "Problems producing token", module);
request.setAttribute("_ERROR_MESSAGE_", "<li>Problems producing purchase token, please contact customer service.");
return "error";
}