try {
ApiContext apiContext = EbayStoreHelper.getApiContext(productStoreId, locale, delegator);
VerifyAddItemRequestType req = new VerifyAddItemRequestType();
VerifyAddItemResponseType resp = null;
VerifyAddItemCall verifyCall = new VerifyAddItemCall(apiContext);
Map<String,Object> addItemObject = getAddItemListingObject(request, apiContext);
List<Map<String,Object>> listAddItem = null;
if (UtilValidate.isNotEmpty(addItemObject.get("itemListing"))) {
listAddItem = (List<Map<String,Object>>) addItemObject.get("itemListing");
} else {
listAddItem = FastList.newInstance();
}
double feesummary = 0.0;
for (Map<String,Object> itemObj : listAddItem) {
AddItemCall addItemCall = (AddItemCall) itemObj.get("addItemCall");
ItemType item = addItemCall.getItem();
String SKU = item.getSKU();
if (UtilValidate.isNotEmpty(requestParams.get("productId"))) {
String productId = requestParams.get("productId").toString();
if (productId.equals(SKU)) {
req.setItem(item);
resp = (VerifyAddItemResponseType) verifyCall.execute(req);
if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
itemObj.put("isVerify", "Y");
FeesType feest = (FeesType) resp.getFees();
FeeType[] fees = feest.getFee();
for (FeeType fee : fees) {