@@ -312,6 +312,13 @@ static String mapToString(Map src, boolean mask, int type) {
312312 return Utility .mapToString (src , mask , type );
313313 }
314314
315+ /**
316+ * Get Merchant Config object based on request and properties
317+ * @param request
318+ * @param props
319+ * @return MerchantConfig
320+ * @throws ConfigException
321+ */
315322 static private MerchantConfig getMerchantConfigObject (Map <String , String > request , Properties props ) throws ConfigException {
316323 MerchantConfig mc ;
317324 String merchantID = request .get (MERCHANT_ID );
@@ -328,6 +335,12 @@ static private MerchantConfig getMerchantConfigObject(Map<String, String> reques
328335 return mc ;
329336 }
330337
338+ /**
339+ * Get Merchant Id from request, If merchantId is null, get it from properties
340+ * @param request
341+ * @param props
342+ * @return String
343+ */
331344 private static String getMerchantId (Map <String , String > request , Properties props ) {
332345 String merchantID = request .get (MERCHANT_ID );
333346 if (merchantID == null ) {
@@ -338,6 +351,12 @@ private static String getMerchantId(Map<String, String> request, Properties prop
338351 return merchantID ;
339352 }
340353
354+ /**
355+ * get KeyAlias from property, If keyAlias is null, return merchant Id
356+ * @param request
357+ * @param props
358+ * @return String
359+ */
341360 private static String getKeyForInstanceMap (Map <String , String > request , Properties props ) {
342361 String keyAlias = props .getProperty (KEY_ALIAS );
343362 if (keyAlias != null ) {
@@ -347,6 +366,14 @@ private static String getKeyForInstanceMap(Map<String, String> request, Properti
347366 return getMerchantId (request , props );
348367 }
349368
369+ /**
370+ * Get Merchant config instance from concurrent hash map in memory cache .
371+ * If it is empty, it will create new merchant config object and put it in map for reuse.
372+ * @param request
373+ * @param props
374+ * @return MerchantConfig
375+ * @throws ConfigException
376+ */
350377 private static MerchantConfig getInstanceMap (Map <String , String > request , Properties props ) throws ConfigException {
351378 String midOrKeyAlias = getKeyForInstanceMap (request , props );
352379
0 commit comments