public static Map<String,Object> testProcessorWithCapture(DispatchContext dctx,Map<String,? extends Object> context){
  Locale locale=(Locale)context.get("locale");
  Map<String,Object> result=FastMap.newInstance();
  BigDecimal processAmount=(BigDecimal)context.get("processAmount");
  if (processAmount != null && processAmount.compareTo(new BigDecimal("100.00")) >= 0)   result.put("authResult",Boolean.TRUE);
  result.put("captureResult",Boolean.TRUE);
  if (processAmount != null && processAmount.compareTo(new BigDecimal("100.00")) < 0)   result.put("authResult",Boolean.FALSE);
  result.put("captureResult",Boolean.FALSE);
  result.put("customerRespMsgs",UtilMisc.toList(UtilProperties.getMessage(resource,"AccountingPaymentTestProcessorMinimumPurchase",locale)));
  if (processAmount == null)   result.put("authResult",null);
  String refNum=UtilDateTime.nowAsString();
  result.put("processAmount",context.get("processAmount"));
  result.put("authRefNum",refNum);
  result.put("authAltRefNum",refNum);
  result.put("captureRefNum",refNum);
  result.put("captureAltRefNum",refNum);
  result.put("authCode","100");
  result.put("captureCode","200");
  result.put("authFlag","X");
  result.put("authMessage",UtilMisc.toList(UtilProperties.getMessage(resource,"AccountingPaymentTestCapture",locale)));
  result.put("internalRespMsgs",UtilMisc.toList(UtilProperties.getMessage(resource,"AccountingPaymentTestCapture",locale)));
  return result;
}

public static Map < String , Object > testProcessorWithCapture ( DispatchContext dctx , Map < String , ? extends Object > context ) { Locale locale = ( Locale ) context . get ( "locale" ) ; Map < String , Object > result = FastMap . newInstance ( ) ; BigDecimal processAmount = ( BigDecimal ) context . get ( "processAmount" ) ; if ( processAmount != null && processAmount . compareTo ( new BigDecimal ( "100.00" ) ) >= 0 ) result . put ( "authResult" , Boolean . TRUE ) ; result . put ( "captureResult" , Boolean . TRUE ) ; if ( processAmount != null && processAmount . compareTo ( new BigDecimal ( "100.00" ) ) < 0 ) result . put ( "authResult" , Boolean . FALSE ) ; result . put ( "captureResult" , Boolean . FALSE ) ; result . put ( "customerRespMsgs" , UtilMisc . toList ( UtilProperties . getMessage ( resource , "AccountingPaymentTestProcessorMinimumPurchase" , locale ) ) ) ; if ( processAmount == null ) result . put ( "authResult" , null ) ; String refNum = UtilDateTime . nowAsString ( ) ; result . put ( "processAmount" , context . get ( "processAmount" ) ) ; result . put ( "authRefNum" , refNum ) ; result . put ( "authAltRefNum" , refNum ) ; result . put ( "captureRefNum" , refNum ) ; result . put ( "captureAltRefNum" , refNum ) ; result . put ( "authCode" , "100" ) ; result . put ( "captureCode" , "200" ) ; result . put ( "authFlag" , "X" ) ; result . put ( "authMessage" , UtilMisc . toList ( UtilProperties . getMessage ( resource , "AccountingPaymentTestCapture" , locale ) ) ) ; result . put ( "internalRespMsgs" , UtilMisc . toList ( UtilProperties . getMessage ( resource , "AccountingPaymentTestCapture" , locale ) ) ) ; return result ; }
simple test processor ; declines all orders < 100 . 00 ; approves all orders > 100 . 00
