Package com.ebay.sdk.call

Examples of com.ebay.sdk.call.LeaveFeedbackCall


        String ratingComm = (String) context.get("ratingComm");
        String ratingShip = (String) context.get("ratingShip");
        String ratingShipHand = (String) context.get("ratingShipHand");
        try {
            if (commentType != null) {
                LeaveFeedbackCall leaveFeedbackCall = new LeaveFeedbackCall();
                leaveFeedbackCall.setApiContext(apiContext);
                leaveFeedbackCall.setTargetUser(targetUser);
                leaveFeedbackCall.setTransactionID(transactionId);

                if (role.equals("seller")) {
                    ItemRatingDetailArrayType sellerItemRatingDetailArray = new ItemRatingDetailArrayType();

                    //The item description
                    ItemRatingDetailsType itemRatingDetailsType1 = new ItemRatingDetailsType();
                    int ratingItemValue = 0;
                    if (UtilValidate.isInteger(ratingItem)) {
                        ratingItemValue = Integer.parseInt(ratingItem);
                    }
                    if (ratingItemValue < 3) {
                        /*
                        String AqItemAsDescribed = null;
                        int AqItemAsDescribedId = Integer.parseInt((String) context.get("AqItemAsDescribedId"));
                        switch (AqItemAsDescribedId) {
                        case 5:
                            AqItemAsDescribed = "ItemNotReceived";
                            break;
                        case 6:
                            AqItemAsDescribed = "ItemBadQuality";
                            break;
                        case 2:
                            AqItemAsDescribed = "ItemDamaged";
                            break;
                        case 1:
                            AqItemAsDescribed = "ItemIneligible";
                            break;
                        case 3:
                            AqItemAsDescribed = "ItemLost";
                            break;
                        default:
                            AqItemAsDescribed = "Other";
                            break;
                        }
                        */
                    }
                    itemRatingDetailsType1.setRating(ratingItemValue);
                    itemRatingDetailsType1.setRatingDetail(FeedbackRatingDetailCodeType.ITEM_AS_DESCRIBED);

                    //The seller's communication
                    ItemRatingDetailsType itemRatingDetailsType2 = new ItemRatingDetailsType();
                    int ratingCommValue = 0;
                    if (UtilValidate.isInteger(ratingComm)) {
                        ratingCommValue = Integer.parseInt(ratingComm);
                    }
                    itemRatingDetailsType2.setRating(ratingCommValue);
                    itemRatingDetailsType2.setRatingDetail(FeedbackRatingDetailCodeType.COMMUNICATION);

                    //the seller ship the item
                    ItemRatingDetailsType itemRatingDetailsType3 = new ItemRatingDetailsType();
                    int ratingShipValue = 0;
                    if (UtilValidate.isInteger(ratingShip)) {
                        ratingShipValue = Integer.parseInt(ratingShip);
                    }
                    itemRatingDetailsType3.setRating(ratingShipValue);
                    itemRatingDetailsType3.setRatingDetail(FeedbackRatingDetailCodeType.SHIPPING_TIME);

                    //the shipping and handling charges
                    ItemRatingDetailsType itemRatingDetailsType4 = new ItemRatingDetailsType();
                    int ratingShipHandValue = 0;
                    if (UtilValidate.isInteger(ratingShipHand)) {
                        ratingShipHandValue = Integer.parseInt(ratingShipHand);
                    }
                    itemRatingDetailsType4.setRating(ratingShipHandValue);
                    itemRatingDetailsType4.setRatingDetail(FeedbackRatingDetailCodeType.SHIPPING_AND_HANDLING_CHARGES);

                    //Rating Summary
                    ItemRatingDetailsType[] itemRatingDetailsType = {itemRatingDetailsType1, itemRatingDetailsType2, itemRatingDetailsType3, itemRatingDetailsType4};
                    sellerItemRatingDetailArray.setItemRatingDetails(itemRatingDetailsType);

                    leaveFeedbackCall.setSellerItemRatingDetailArray(sellerItemRatingDetailArray);
                }
                FeedbackDetailType feedbackDetail = new FeedbackDetailType();
                feedbackDetail.setItemID(itemId);
                feedbackDetail.setCommentingUser(commentingUser);
                feedbackDetail.setCommentText(commentText);
                feedbackDetail.setCommentTime(Calendar.getInstance());
                if (commentType.equals("positive")) {
                    feedbackDetail.setCommentType(CommentTypeCodeType.POSITIVE);
                } else if (commentType.equals("neutral")) {
                    feedbackDetail.setCommentType(CommentTypeCodeType.NEUTRAL);
                } else if (commentType.equals("negative")) {
                    feedbackDetail.setCommentType(CommentTypeCodeType.NEGATIVE);
                }
                leaveFeedbackCall.setFeedbackDetail(feedbackDetail);
                leaveFeedbackCall.leaveFeedback();
            }
        } catch (ApiException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (SdkException e) {
View Full Code Here


                        for (SellingManagerSoldOrderType item : items) {
                            // start leave feedbacks
                            SellingManagerSoldTransactionType[] soldTrans = item.getSellingManagerSoldTransaction();
                            if (UtilValidate.isNotEmpty(soldTrans)) {
                                for (SellingManagerSoldTransactionType soldTran : soldTrans) {
                                    LeaveFeedbackCall leaveFeedbackCall = new LeaveFeedbackCall(apiContext);
                                    FeedbackDetailType detail = new FeedbackDetailType();
                                    // ramdom comments
                                    if (list.size() > 0) {
                                        Collections.shuffle(list, new Random());
                                        comment = list.get(0);
                                    }
                                    detail.setCommentText(comment);
                                    detail.setCommentingUser(commentingUser);
                                    //detail.setCommentingUserScore(value);
                                    detail.setCommentType(CommentTypeCodeType.POSITIVE);
                                    detail.setItemID(soldTran.getItemID());
                                    detail.setItemPrice(soldTran.getItemPrice());
                                    detail.setItemTitle(soldTran.getItemTitle());
                                    leaveFeedbackCall.setFeedbackDetail(detail);
                                    leaveFeedbackCall.setTargetUser(item.getBuyerID());
                                    leaveFeedbackCall.setTransactionID(String.valueOf(soldTran.getTransactionID()));
                                    leaveFeedbackCall.leaveFeedback();
                                    Debug.logInfo("Auto leave feedback with site ".concat(apiContext.getSite().value()).concat("itemId ".concat(soldTran.getItemID())).concat(" comment is ".concat(comment)), module);
                                }
                            }
                        }
                    }
View Full Code Here

                        for (SellingManagerSoldOrderType item : items) {
                            // start leave feedbacks
                            SellingManagerSoldTransactionType[] soldTrans = item.getSellingManagerSoldTransaction();
                            if (UtilValidate.isNotEmpty(soldTrans)) {
                                for (SellingManagerSoldTransactionType soldTran : soldTrans) {
                                    LeaveFeedbackCall leaveFeedbackCall = new LeaveFeedbackCall(apiContext);
                                    FeedbackDetailType detail = new FeedbackDetailType();
                                    // ramdom comments
                                    if (list.size() > 0) {
                                        Collections.shuffle(list, new Random());
                                        comment = list.get(0);
                                    }
                                    detail.setCommentText(comment);
                                    detail.setCommentingUser(commentingUser);
                                    //detail.setCommentingUserScore(value);
                                    detail.setCommentType(CommentTypeCodeType.POSITIVE);
                                    detail.setItemID(soldTran.getItemID());
                                    detail.setItemPrice(soldTran.getItemPrice());
                                    detail.setItemTitle(soldTran.getItemTitle());
                                    leaveFeedbackCall.setFeedbackDetail(detail);
                                    leaveFeedbackCall.setTargetUser(item.getBuyerID());
                                    leaveFeedbackCall.setTransactionID(String.valueOf(soldTran.getTransactionID()));
                                    leaveFeedbackCall.leaveFeedback();
                                    Debug.logInfo("Auto leave feedback with site ".concat(apiContext.getSite().value()).concat("itemId ".concat(soldTran.getItemID())).concat(" comment is ".concat(comment)), module);
                                }
                            }
                        }
                    }
View Full Code Here

                        for (SellingManagerSoldOrderType item : items) {
                            // start leave feedbacks
                            SellingManagerSoldTransactionType[] soldTrans = item.getSellingManagerSoldTransaction();
                            if (UtilValidate.isNotEmpty(soldTrans)) {
                                for (SellingManagerSoldTransactionType soldTran : soldTrans) {
                                    LeaveFeedbackCall leaveFeedbackCall = new LeaveFeedbackCall(apiContext);
                                    FeedbackDetailType detail = new FeedbackDetailType();
                                    // ramdom comments
                                    if (list.size() > 0) {
                                        Collections.shuffle(list, new Random());
                                        comment = list.get(0);
                                    }
                                    detail.setCommentText(comment);
                                    detail.setCommentingUser(commentingUser);
                                    //detail.setCommentingUserScore(value);
                                    detail.setCommentType(CommentTypeCodeType.POSITIVE);
                                    detail.setItemID(soldTran.getItemID());
                                    detail.setItemPrice(soldTran.getItemPrice());
                                    detail.setItemTitle(soldTran.getItemTitle());
                                    leaveFeedbackCall.setFeedbackDetail(detail);
                                    leaveFeedbackCall.setTargetUser(item.getBuyerID());
                                    leaveFeedbackCall.setTransactionID(String.valueOf(soldTran.getTransactionID()));
                                    leaveFeedbackCall.leaveFeedback();
                                    Debug.logInfo("Auto leave feedback with site ".concat(apiContext.getSite().value()).concat("itemId ".concat(soldTran.getItemID())).concat(" comment is ".concat(comment)), module);
                                }
                            }
                        }
                    }
View Full Code Here

                        for (SellingManagerSoldOrderType item : items) {
                            // start leave feedbacks
                            SellingManagerSoldTransactionType[] soldTrans = item.getSellingManagerSoldTransaction();
                            if (UtilValidate.isNotEmpty(soldTrans)) {
                                for (SellingManagerSoldTransactionType soldTran : soldTrans) {
                                    LeaveFeedbackCall leaveFeedbackCall = new LeaveFeedbackCall(apiContext);
                                    FeedbackDetailType detail = new FeedbackDetailType();
                                    // ramdom comments
                                    if (list.size() > 0) {
                                        Collections.shuffle(list, new Random());
                                        comment = list.get(0);
                                    }
                                    detail.setCommentText(comment);
                                    detail.setCommentingUser(commentingUser);
                                    //detail.setCommentingUserScore(value);
                                    detail.setCommentType(CommentTypeCodeType.POSITIVE);
                                    detail.setItemID(soldTran.getItemID());
                                    detail.setItemPrice(soldTran.getItemPrice());
                                    detail.setItemTitle(soldTran.getItemTitle());
                                    leaveFeedbackCall.setFeedbackDetail(detail);
                                    leaveFeedbackCall.setTargetUser(item.getBuyerID());
                                    leaveFeedbackCall.setTransactionID(String.valueOf(soldTran.getTransactionID()));
                                    leaveFeedbackCall.leaveFeedback();
                                    Debug.logInfo("Auto leave feedback with site ".concat(apiContext.getSite().value()).concat("itemId ".concat(soldTran.getItemID())).concat(" comment is ".concat(comment)), module);
                                }
                            }
                        }
                    }
View Full Code Here

        String ratingComm = (String) context.get("ratingComm");
        String ratingShip = (String) context.get("ratingShip");
        String ratingShipHand = (String) context.get("ratingShipHand");
        try {
            if (commentType != null) {
                LeaveFeedbackCall leaveFeedbackCall = new LeaveFeedbackCall();
                leaveFeedbackCall.setApiContext(apiContext);
                leaveFeedbackCall.setTargetUser(targetUser);
                leaveFeedbackCall.setTransactionID(transactionId);

                if (role.equals("seller")) {
                    ItemRatingDetailArrayType sellerItemRatingDetailArray = new ItemRatingDetailArrayType();

                    //The item description
                    ItemRatingDetailsType itemRatingDetailsType1 = new ItemRatingDetailsType();
                    int ratingItemValue = 0;
                    if (UtilValidate.isInteger(ratingItem)) {
                        ratingItemValue = Integer.parseInt(ratingItem);
                    }
                    if (ratingItemValue < 3) {
                        int AqItemAsDescribedId = Integer.parseInt((String) context.get("AqItemAsDescribedId"));
                        switch (AqItemAsDescribedId) {
                        case 5:
                            AqItemAsDescribed = "ItemNotReceived";
                            break;
                        case 6:
                            AqItemAsDescribed = "ItemBadQuality";
                            break;
                        case 2:
                            AqItemAsDescribed = "ItemDamaged";
                            break;
                        case 1:
                            AqItemAsDescribed = "ItemIneligible";
                            break;
                        case 3:
                            AqItemAsDescribed = "ItemLost";
                            break;
                        default:
                            AqItemAsDescribed = "Other";
                            break;
                        }
                    }
                    itemRatingDetailsType1.setRating(ratingItemValue);
                    itemRatingDetailsType1.setRatingDetail(FeedbackRatingDetailCodeType.ITEM_AS_DESCRIBED);

                    //The seller's communication
                    ItemRatingDetailsType itemRatingDetailsType2 = new ItemRatingDetailsType();
                    int ratingCommValue = 0;
                    if (UtilValidate.isInteger(ratingComm)) {
                        ratingCommValue = Integer.parseInt(ratingComm);
                    }
                    itemRatingDetailsType2.setRating(ratingCommValue);
                    itemRatingDetailsType2.setRatingDetail(FeedbackRatingDetailCodeType.COMMUNICATION);

                    //the seller ship the item
                    ItemRatingDetailsType itemRatingDetailsType3 = new ItemRatingDetailsType();
                    int ratingShipValue = 0;
                    if (UtilValidate.isInteger(ratingShip)) {
                        ratingShipValue = Integer.parseInt(ratingShip);
                    }
                    itemRatingDetailsType3.setRating(ratingShipValue);
                    itemRatingDetailsType3.setRatingDetail(FeedbackRatingDetailCodeType.SHIPPING_TIME);

                    //the shipping and handling charges
                    ItemRatingDetailsType itemRatingDetailsType4 = new ItemRatingDetailsType();
                    int ratingShipHandValue = 0;
                    if (UtilValidate.isInteger(ratingShipHand)) {
                        ratingShipHandValue = Integer.parseInt(ratingShipHand);
                    }
                    itemRatingDetailsType4.setRating(ratingShipHandValue);
                    itemRatingDetailsType4.setRatingDetail(FeedbackRatingDetailCodeType.SHIPPING_AND_HANDLING_CHARGES);

                    //Rating Summary
                    ItemRatingDetailsType[] itemRatingDetailsType = {itemRatingDetailsType1, itemRatingDetailsType2, itemRatingDetailsType3, itemRatingDetailsType4};
                    sellerItemRatingDetailArray.setItemRatingDetails(itemRatingDetailsType);

                    leaveFeedbackCall.setSellerItemRatingDetailArray(sellerItemRatingDetailArray);
                }
                FeedbackDetailType feedbackDetail = new FeedbackDetailType();
                feedbackDetail.setItemID(itemId);
                feedbackDetail.setCommentingUser(commentingUser);
                feedbackDetail.setCommentText(commentText);
                feedbackDetail.setCommentTime(Calendar.getInstance());
                if (commentType.equals("positive")) {
                    feedbackDetail.setCommentType(CommentTypeCodeType.POSITIVE);
                } else if (commentType.equals("neutral")) {
                    feedbackDetail.setCommentType(CommentTypeCodeType.NEUTRAL);
                } else if (commentType.equals("negative")) {
                    feedbackDetail.setCommentType(CommentTypeCodeType.NEGATIVE);
                }
                leaveFeedbackCall.setFeedbackDetail(feedbackDetail);
                leaveFeedbackCall.leaveFeedback();
            }
        } catch (ApiException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (SdkException e) {
View Full Code Here

TOP

Related Classes of com.ebay.sdk.call.LeaveFeedbackCall

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.