Skip to content

Commit f2f6f99

Browse files
committed
fixed get all categories method
1 parent d192896 commit f2f6f99

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

demo/getAllCategories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let ebay = new Ebay({
55
});
66

77
ebay.getAllCategories().then((data) => {
8-
console.log(data);
8+
console.log(data); //data.CategoryArray
99
}, (error) => {
1010
console.log(error);
1111
})

src/buildURL.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ const buildURL = {
3333
*/
3434
buildShoppingUrl(options) {
3535
let base_url = "http://open.api.ebay.com/Shopping?";
36-
base_url += "SECURITY-APPNAME=" + options.clientID;
37-
base_url += "&OPERATION-NAME=" + options.operationName;
38-
base_url += "&SERVICE-VERSION=1.0.0&RESPONSE-DATA-FORMAT=JSON&REST-PAYLOAD&";
39-
base_url += options.param + "=" + options.name;
40-
base_url += "&paginationInput.entriesPerPage=" + options.limit;
36+
base_url += "appid=" + options.clientID;
37+
base_url += "&callname=" + options.operationName;
38+
base_url += "&version=967&siteid=0&responseencoding=JSON&";
39+
base_url += options.param + "=" + options.name + "&IncludeSelector=ChildCategories";
4140
//base_url += "&GLOBAL-ID=" + oglobalID;
4241
return base_url;
4342
},

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Ebay.prototype = {
5050
getAllCategories: function (categoryID) {
5151
//console.log(url);
5252
this.options.name = categoryID ? categoryID : -1;
53-
this.options.operationName = "findItemsByKeywords";
53+
this.options.operationName = "GetCategoryInfo";
5454
this.options.param = "CategoryID";
5555
let url = urlObject.buildShoppingUrl(this.options);
5656
console.log(url);

0 commit comments

Comments
 (0)