From 76bdcd1f41ae97517496a456ea2bb5c6bcecb502 Mon Sep 17 00:00:00 2001 From: Ashish Vijaywargiya Date: Thu, 10 Sep 2009 13:58:33 +0000 Subject: [PATCH] Initial pass on new call "GetOrders" (More to come in a day or so) - http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetOrders.html. OOTB we have "GetSellersTransactions" call implemented but we have observed something strange in its functionality. Here are few reason for this implementation: -- In "GetSellersTransactions" itemId(ProductId in ebay) is provided in the OrderHeader.externalId field which doesn't seems correct. -- Suppose we have Single Order created in eBay if some one wins the auction and in that order we have 3 order items. Then "GetSellersTransaction" call creates three orders in OFBiz for all those three items that are associated with Single Ebay order. In short "GetSellersTransaction" request treat three item as three transactions. -- "GetOrders" call will return the list of orders on the basis of search criteria and then we will create(Import) the Order in OFBiz from the resultant list of orders. -- Current implementation for "GetSellersTransactions" will remain as it is in trunk - as we don't know if someone might be using it in their custom projects. Also did miscellaneous cleanup. Thanks Jacopo for providing your notes for this implementation & also discussing issues in b/w development - as always your notes were awesome. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@813444 13f79535-47bb-0310-9956-ffa450edef68 --- ebay/config/EbayUiLabels.xml | 9 ++ ebay/servicedef/services.xml | 11 ++ ebay/src/org/ofbiz/ebay/EbayHelper.java | 91 +++++++++++++- .../src/org/ofbiz/ebay/EbayOrderServices.java | 113 ++++++++++++++++++ .../org/ofbiz/ebay/ImportOrdersFromEbay.java | 104 ++-------------- ebay/webapp/ebay/WEB-INF/controller.xml | 23 ++++ ebay/widget/EbayForms.xml | 27 +++++ ebay/widget/EbayMenus.xml | 1 + ebay/widget/EbayScreens.xml | 34 ++++++ 9 files changed, 319 insertions(+), 94 deletions(-) create mode 100644 ebay/src/org/ofbiz/ebay/EbayOrderServices.java diff --git a/ebay/config/EbayUiLabels.xml b/ebay/config/EbayUiLabels.xml index b9aac9b6a..f5741d146 100644 --- a/ebay/config/EbayUiLabels.xml +++ b/ebay/config/EbayUiLabels.xml @@ -32,6 +32,9 @@ OFBiz OFBiz + + eBay Orders + zu eBay exportieren Export To eBay @@ -324,6 +327,12 @@ ส่งออกสินค้าถึงอีเบย์ 把产品导出到eBay + + Unable to find eBay configurations. + + + Exception in getting orders from Ebay. + Cannot convert from date, from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format Ne peut convertir la date de début, depuis le format yyyy-MM-dd HH:mm:ss.SSS vers yyyy-MM-dd'T'HH:mm:ss.SSS'Z' diff --git a/ebay/servicedef/services.xml b/ebay/servicedef/services.xml index 4582a4c4f..40cc81a7b 100644 --- a/ebay/servicedef/services.xml +++ b/ebay/servicedef/services.xml @@ -108,4 +108,15 @@ under the License. + + + + Get Orders from eBay + + + + + + \ No newline at end of file diff --git a/ebay/src/org/ofbiz/ebay/EbayHelper.java b/ebay/src/org/ofbiz/ebay/EbayHelper.java index ea7674853..2f5dd0869 100644 --- a/ebay/src/org/ofbiz/ebay/EbayHelper.java +++ b/ebay/src/org/ofbiz/ebay/EbayHelper.java @@ -19,6 +19,17 @@ package org.ofbiz.ebay; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.text.ParsePosition; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; import java.util.Map; import javolution.util.FastMap; @@ -27,24 +38,30 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; +import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.service.ServiceUtil; +import org.w3c.dom.Document; +import org.w3c.dom.Element; public class EbayHelper { private static final String configFileName = "ebayExport.properties"; private static final String module = EbayHelper.class.getName(); + public static final String resource = "EbayUiLabels"; public static Map buildEbayConfig(Map context, GenericDelegator delegator) { Map buildEbayConfigContext = FastMap.newInstance(); + Locale locale = (Locale) context.get("locale"); String productStoreId = (String) context.get("productStoreId"); if (UtilValidate.isNotEmpty(productStoreId)) { GenericValue eBayConfig = null; try { eBayConfig = delegator.findOne("EbayConfig", false, UtilMisc.toMap("productStoreId", productStoreId)); } catch (GenericEntityException e) { - Debug.logError("Unable to find value for EbayConfig", module); - e.printStackTrace(); + String errMsg = UtilProperties.getMessage(resource, "buildEbayConfig.unableToFindEbayConfig" + e.getMessage(), locale); + return ServiceUtil.returnError(errMsg); } if (UtilValidate.isNotEmpty(eBayConfig)) { buildEbayConfigContext.put("devID", eBayConfig.getString("devId")); @@ -66,4 +83,74 @@ public class EbayHelper { } return buildEbayConfigContext; } + + public static void appendRequesterCredentials(Element elem, Document doc, String token) { + Element requesterCredentialsElem = UtilXml.addChildElement(elem, "RequesterCredentials", doc); + UtilXml.addChildElementValue(requesterCredentialsElem, "eBayAuthToken", token, doc); + } + + public static String convertDate(String dateIn, String fromDateFormat, String toDateFormat) { + String dateOut; + try { + SimpleDateFormat formatIn = new SimpleDateFormat(fromDateFormat); + SimpleDateFormat formatOut= new SimpleDateFormat(toDateFormat); + Date data = formatIn.parse(dateIn, new ParsePosition(0)); + dateOut = formatOut.format(data); + } catch (Exception e) { + dateOut = null; + } + return dateOut; + } + + public static String toString(InputStream inputStream) throws IOException { + String string; + StringBuilder outputBuilder = new StringBuilder(); + if (inputStream != null) { + BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); + while (null != (string = reader.readLine())) { + outputBuilder.append(string).append('\n'); + } + } + return outputBuilder.toString(); + } + + public static Map postItem(String postItemsUrl, StringBuffer generatedXmlData, String devID, String appID, String certID, + String callName, String compatibilityLevel, String siteID) throws IOException { + if (Debug.verboseOn()) { + Debug.logVerbose("Request of " + callName + " To eBay:\n" + generatedXmlData.toString(), module); + } + HttpURLConnection connection = (HttpURLConnection) (new URL(postItemsUrl)).openConnection(); + connection.setDoInput(true); + connection.setDoOutput(true); + connection.setRequestMethod("POST"); + connection.setRequestProperty("X-EBAY-API-COMPATIBILITY-LEVEL", compatibilityLevel); + connection.setRequestProperty("X-EBAY-API-DEV-NAME", devID); + connection.setRequestProperty("X-EBAY-API-APP-NAME", appID); + connection.setRequestProperty("X-EBAY-API-CERT-NAME", certID); + connection.setRequestProperty("X-EBAY-API-CALL-NAME", callName); + connection.setRequestProperty("X-EBAY-API-SITEID", siteID); + connection.setRequestProperty("Content-Type", "text/xml"); + + OutputStream outputStream = connection.getOutputStream(); + outputStream.write(generatedXmlData.toString().getBytes()); + outputStream.close(); + + int responseCode = connection.getResponseCode(); + InputStream inputStream = null; + Map result = FastMap.newInstance(); + String response = null; + + if (responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_OK) { + inputStream = connection.getInputStream(); + response = EbayHelper.toString(inputStream); + result = ServiceUtil.returnSuccess(response); + } else { + inputStream = connection.getErrorStream(); + result = ServiceUtil.returnFailure(EbayHelper.toString(inputStream)); + } + if (Debug.verboseOn()) { + Debug.logVerbose("Response of " + callName + " From eBay:\n" + response, module); + } + return result; + } } \ No newline at end of file diff --git a/ebay/src/org/ofbiz/ebay/EbayOrderServices.java b/ebay/src/org/ofbiz/ebay/EbayOrderServices.java new file mode 100644 index 000000000..a6f63f7f4 --- /dev/null +++ b/ebay/src/org/ofbiz/ebay/EbayOrderServices.java @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ofbiz.ebay; + +import java.util.Locale; +import java.util.Map; + +import javolution.util.FastMap; + +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.base.util.UtilXml; +import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.service.DispatchContext; +import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ModelService; +import org.ofbiz.service.ServiceUtil; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +public class EbayOrderServices { + + private static final String resource = "EbayUiLabels"; + private static final String module = EbayOrderServices.class.getName(); + + public static Map getEbayOrders(DispatchContext dctx, Map context) { + GenericDelegator delegator = dctx.getDelegator(); + LocalDispatcher dispatcher = dctx.getDispatcher(); + Locale locale = (Locale) context.get("locale"); + Map result = FastMap.newInstance(); + try { + Map eBayConfigResult = EbayHelper.buildEbayConfig(context, delegator); + StringBuffer getOrdersXml = new StringBuffer(); + + if (!ServiceUtil.isFailure(buildGetOrdersRequest(context, getOrdersXml, eBayConfigResult.get("token").toString()))) { + result = EbayHelper.postItem(eBayConfigResult.get("xmlGatewayUri").toString(), getOrdersXml, eBayConfigResult.get("devID").toString(), eBayConfigResult.get("appID").toString(), eBayConfigResult.get("certID").toString(), "GetOrders", eBayConfigResult.get("compatibilityLevel").toString(), eBayConfigResult.get("siteID").toString()); + String success = (String) result.get(ModelService.SUCCESS_MESSAGE); + if (success != null) { + result = checkOrders(delegator, dispatcher, locale, context, success); + } + } + } catch (Exception e) { + String errMsg = UtilProperties.getMessage(resource, "buildEbayConfig.exceptionInGetOrdersFromEbay" + e.getMessage(), locale); + return ServiceUtil.returnError(errMsg); + } + return result; + } + + private static Map buildGetOrdersRequest(Map context, StringBuffer dataItemsXml, String token) { + Locale locale = (Locale) context.get("locale"); + String fromDate = (String) context.get("fromDate"); + String thruDate = (String) context.get("thruDate"); + try { + Document transDoc = UtilXml.makeEmptyXmlDocument("GetOrdersRequest"); + Element transElem = transDoc.getDocumentElement(); + transElem.setAttribute("xmlns", "urn:ebay:apis:eBLBaseComponents"); + + EbayHelper.appendRequesterCredentials(transElem, transDoc, token); + UtilXml.addChildElementValue(transElem, "DetailLevel", "ReturnAll", transDoc); + UtilXml.addChildElementValue(transElem, "OrderRole", "Seller", transDoc); + UtilXml.addChildElementValue(transElem, "OrderStatus", "Completed", transDoc); + + String fromDateOut = EbayHelper.convertDate(fromDate, "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + if (fromDateOut != null) { + UtilXml.addChildElementValue(transElem, "CreateTimeFrom", fromDateOut, transDoc); + } else { + Debug.logError("Cannot convert from date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.cannotConvertFromDate", locale)); + } + fromDateOut = EbayHelper.convertDate(thruDate, "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + if (fromDateOut != null) { + UtilXml.addChildElementValue(transElem, "CreateTimeTo", fromDateOut, transDoc); + } else { + Debug.logError("Cannot convert thru date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.cannotConvertThruDate", locale)); + } + //Debug.logInfo("The value of generated string is ======= " + UtilXml.writeXmlDocument(transDoc), module); + dataItemsXml.append(UtilXml.writeXmlDocument(transDoc)); + } catch (Exception e) { + Debug.logError("Exception during building get seller transactions request", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionDuringBuildingGetSellerTransactionRequest", locale)); + } + return ServiceUtil.returnSuccess(); + } + + private static Map checkOrders(GenericDelegator delegator, LocalDispatcher dispatcher, Locale locale, Map context, String response) { + Document docResponse; + try { + docResponse = UtilXml.readXmlDocument(response, true); + //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), module); + } catch (Exception e) { + Debug.logError("Exception during read response from Ebay", module); + } + return ServiceUtil.returnSuccess(); + } +} diff --git a/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java b/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java index 1ee2394e1..f1b01ede3 100755 --- a/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java +++ b/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java @@ -18,24 +18,16 @@ *******************************************************************************/ package org.ofbiz.ebay; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; import java.math.BigDecimal; -import java.net.HttpURLConnection; -import java.net.URL; import java.sql.Timestamp; -import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Collection; import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.Collection; import javolution.util.FastMap; @@ -52,12 +44,12 @@ import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.order.order.OrderChangeHelper; import org.ofbiz.order.shoppingcart.CheckOutHelper; import org.ofbiz.order.shoppingcart.ShoppingCart; +import org.ofbiz.party.contact.ContactHelper; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ModelService; import org.ofbiz.service.ServiceUtil; -import org.ofbiz.party.contact.ContactHelper; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -76,7 +68,7 @@ public class ImportOrdersFromEbay { StringBuffer sellerTransactionsItemsXml = new StringBuffer(); if (!ServiceUtil.isFailure(buildGetSellerTransactionsRequest(context, sellerTransactionsItemsXml, eBayConfigResult.get("token").toString()))) { - result = postItem(eBayConfigResult.get("xmlGatewayUri").toString(), sellerTransactionsItemsXml, eBayConfigResult.get("devID").toString(), eBayConfigResult.get("appID").toString(), eBayConfigResult.get("certID").toString(), "GetSellerTransactions", eBayConfigResult.get("compatibilityLevel").toString(), eBayConfigResult.get("siteID").toString()); + result = EbayHelper.postItem(eBayConfigResult.get("xmlGatewayUri").toString(), sellerTransactionsItemsXml, eBayConfigResult.get("devID").toString(), eBayConfigResult.get("appID").toString(), eBayConfigResult.get("certID").toString(), "GetSellerTransactions", eBayConfigResult.get("compatibilityLevel").toString(), eBayConfigResult.get("siteID").toString()); String success = (String)result.get(ModelService.SUCCESS_MESSAGE); if (success != null) { result = checkOrders(delegator, dispatcher, locale, context, success); @@ -171,7 +163,7 @@ public class ImportOrdersFromEbay { StringBuffer completeSaleXml = new StringBuffer(); if (!ServiceUtil.isFailure(buildCompleteSaleRequest(delegator, locale, externalId, transactionId, context, completeSaleXml, eBayConfigResult.get("token").toString()))) { - result = postItem(eBayConfigResult.get("xmlGatewayUri").toString(), completeSaleXml, eBayConfigResult.get("devID").toString(), eBayConfigResult.get("appID").toString(), eBayConfigResult.get("certID").toString(), "CompleteSale", eBayConfigResult.get("compatibilityLevel").toString(), eBayConfigResult.get("siteID").toString()); + result = EbayHelper.postItem(eBayConfigResult.get("xmlGatewayUri").toString(), completeSaleXml, eBayConfigResult.get("devID").toString(), eBayConfigResult.get("appID").toString(), eBayConfigResult.get("certID").toString(), "CompleteSale", eBayConfigResult.get("compatibilityLevel").toString(), eBayConfigResult.get("siteID").toString()); String successMessage = (String)result.get("successMessage"); if (successMessage != null) { return readCompleteSaleResponse(successMessage, locale); @@ -186,62 +178,6 @@ public class ImportOrdersFromEbay { return ServiceUtil.returnSuccess(); } - private static String toString(InputStream inputStream) throws IOException { - String string; - StringBuilder outputBuilder = new StringBuilder(); - if (inputStream != null) { - BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); - while (null != (string = reader.readLine())) { - outputBuilder.append(string).append('\n'); - } - } - return outputBuilder.toString(); - } - - private static Map postItem(String postItemsUrl, StringBuffer dataItems, String devID, String appID, String certID, - String callName, String compatibilityLevel, String siteID) throws IOException { - if (Debug.verboseOn()) { - Debug.logVerbose("Request of " + callName + " To eBay:\n" + dataItems.toString(), module); - } - - HttpURLConnection connection = (HttpURLConnection)(new URL(postItemsUrl)).openConnection(); - connection.setDoInput(true); - connection.setDoOutput(true); - connection.setRequestMethod("POST"); - connection.setRequestProperty("X-EBAY-API-COMPATIBILITY-LEVEL", compatibilityLevel); - connection.setRequestProperty("X-EBAY-API-DEV-NAME", devID); - connection.setRequestProperty("X-EBAY-API-APP-NAME", appID); - connection.setRequestProperty("X-EBAY-API-CERT-NAME", certID); - connection.setRequestProperty("X-EBAY-API-CALL-NAME", callName); - connection.setRequestProperty("X-EBAY-API-SITEID", siteID); - connection.setRequestProperty("Content-Type", "text/xml"); - - OutputStream outputStream = connection.getOutputStream(); - outputStream.write(dataItems.toString().getBytes()); - outputStream.close(); - - int responseCode = connection.getResponseCode(); - InputStream inputStream = null; - Map result = FastMap.newInstance(); - String response = null; - - if (responseCode == HttpURLConnection.HTTP_CREATED || - responseCode == HttpURLConnection.HTTP_OK) { - inputStream = connection.getInputStream(); - response = toString(inputStream); - result = ServiceUtil.returnSuccess(response); - } else { - inputStream = connection.getErrorStream(); - result = ServiceUtil.returnFailure(toString(inputStream)); - } - - if (Debug.verboseOn()) { - Debug.logVerbose("Response of " + callName + " From eBay:\n" + response, module); - } - - return result; - } - private static Map checkOrders(GenericDelegator delegator, LocalDispatcher dispatcher, Locale locale, Map context, String response) { StringBuffer errorMessage = new StringBuffer(); List orders = readResponseFromEbay(response, locale, (String)context.get("productStoreId"), delegator, errorMessage); @@ -281,10 +217,11 @@ public class ImportOrdersFromEbay { Element transElem = transDoc.getDocumentElement(); transElem.setAttribute("xmlns", "urn:ebay:apis:eBLBaseComponents"); - appendRequesterCredentials(transElem, transDoc, token); + EbayHelper.appendRequesterCredentials(transElem, transDoc, token); UtilXml.addChildElementValue(transElem, "DetailLevel", "ReturnAll", transDoc); + UtilXml.addChildElementValue(transElem, "IncludeContainingOrder", "true", transDoc); - String fromDateOut = convertDate(fromDate, "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + String fromDateOut = EbayHelper.convertDate(fromDate, "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); if (fromDateOut != null) { UtilXml.addChildElementValue(transElem, "ModTimeFrom", fromDateOut, transDoc); } else { @@ -293,14 +230,14 @@ public class ImportOrdersFromEbay { } - fromDateOut = convertDate(thruDate, "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + fromDateOut = EbayHelper.convertDate(thruDate, "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); if (fromDateOut != null) { UtilXml.addChildElementValue(transElem, "ModTimeTo", fromDateOut, transDoc); } else { Debug.logError("Cannot convert thru date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", module); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.cannotConvertThruDate", locale)); } - + //Debug.logInfo("The value of generated string is ======= " + UtilXml.writeXmlDocument(transDoc), module); dataItemsXml.append(UtilXml.writeXmlDocument(transDoc)); } catch (Exception e) { Debug.logError("Exception during building get seller transactions request", module); @@ -316,7 +253,7 @@ public class ImportOrdersFromEbay { Element transElem = transDoc.getDocumentElement(); transElem.setAttribute("xmlns", "urn:ebay:apis:eBLBaseComponents"); - appendRequesterCredentials(transElem, transDoc, token); + EbayHelper.appendRequesterCredentials(transElem, transDoc, token); UtilXml.addChildElementValue(transElem, "DetailName", "ShippingServiceDetails", transDoc); UtilXml.addChildElementValue(transElem, "DetailName", "TaxJurisdiction", transDoc); dataItemsXml.append(UtilXml.writeXmlDocument(transDoc)); @@ -341,7 +278,7 @@ public class ImportOrdersFromEbay { Element transElem = transDoc.getDocumentElement(); transElem.setAttribute("xmlns", "urn:ebay:apis:eBLBaseComponents"); - appendRequesterCredentials(transElem, transDoc, token); + EbayHelper.appendRequesterCredentials(transElem, transDoc, token); UtilXml.addChildElementValue(transElem, "ItemID", itemId, transDoc); @@ -380,11 +317,6 @@ public class ImportOrdersFromEbay { return ServiceUtil.returnSuccess(); } - private static void appendRequesterCredentials(Element elem, Document doc, String token) { - Element requesterCredentialsElem = UtilXml.addChildElement(elem, "RequesterCredentials", doc); - UtilXml.addChildElementValue(requesterCredentialsElem, "eBayAuthToken", token, doc); - } - private static Map readCompleteSaleResponse(String msg, Locale locale) { try { Document docResponse = UtilXml.readXmlDocument(msg, true); @@ -410,6 +342,7 @@ public class ImportOrdersFromEbay { List orders = null; try { Document docResponse = UtilXml.readXmlDocument(msg, true); +// Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), module); Element elemResponse = docResponse.getDocumentElement(); String ack = UtilXml.childElementValue(elemResponse, "Ack", "Failure"); List paginationList = UtilXml.childElementList(elemResponse, "PaginationResult"); @@ -1177,19 +1110,6 @@ public class ImportOrdersFromEbay { return orderHeader; } - private static String convertDate(String dateIn, String fromDateFormat, String toDateFormat) { - String dateOut; - try { - SimpleDateFormat formatIn = new SimpleDateFormat(fromDateFormat); - SimpleDateFormat formatOut= new SimpleDateFormat(toDateFormat); - Date data = formatIn.parse(dateIn, new ParsePosition(0)); - dateOut = formatOut.format(data); - } catch (Exception e) { - dateOut = null; - } - return dateOut; - } - private static void setShipmentMethodType(ShoppingCart cart, String shippingService) { String partyId = "_NA_"; String shipmentMethodTypeId = "NO_SHIPPING"; diff --git a/ebay/webapp/ebay/WEB-INF/controller.xml b/ebay/webapp/ebay/WEB-INF/controller.xml index 973f28d91..4ba3bed91 100644 --- a/ebay/webapp/ebay/WEB-INF/controller.xml +++ b/ebay/webapp/ebay/WEB-INF/controller.xml @@ -68,6 +68,28 @@ under the License. + + + + + + + + + + + + + + + + + + + + + + @@ -76,5 +98,6 @@ under the License. + diff --git a/ebay/widget/EbayForms.xml b/ebay/widget/EbayForms.xml index 4310750e4..2476d0304 100644 --- a/ebay/widget/EbayForms.xml +++ b/ebay/widget/EbayForms.xml @@ -87,4 +87,31 @@ under the License. + +
+ + + + + + + + + + +
+ +
+ + + + + + + + + +
\ No newline at end of file diff --git a/ebay/widget/EbayMenus.xml b/ebay/widget/EbayMenus.xml index b1d0fa2df..c776f830e 100644 --- a/ebay/widget/EbayMenus.xml +++ b/ebay/widget/EbayMenus.xml @@ -21,5 +21,6 @@ under the License. + diff --git a/ebay/widget/EbayScreens.xml b/ebay/widget/EbayScreens.xml index 1501af0dc..f5e40775f 100644 --- a/ebay/widget/EbayScreens.xml +++ b/ebay/widget/EbayScreens.xml @@ -195,4 +195,38 @@ under the License. + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
+
+
+
\ No newline at end of file