From 03cc12bfbab60117c304decfa9329c667c5828a7 Mon Sep 17 00:00:00 2001 From: Nextor Date: Wed, 31 Aug 2016 14:42:21 -0700 Subject: [PATCH 01/14] Adding support for booleans when actually are strings --- src/Etsy/RequestValidator.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Etsy/RequestValidator.php b/src/Etsy/RequestValidator.php index 8846f23..224a1ff 100644 --- a/src/Etsy/RequestValidator.php +++ b/src/Etsy/RequestValidator.php @@ -52,7 +52,9 @@ public static function validateData($args, $methodInfo) $result['_invalid'][] = 'Method not found'; return $result; } + $methodsParams = $methodInfo['params']; + foreach ($args as $name => $arg) { if (isset($methodsParams[$name])) @@ -85,16 +87,26 @@ public static function validateData($args, $methodInfo) case 'double': $item_type = 'float'; break; - } + } $type = 'array('.$item_type.')'; } } break; } + if ($validType !== $type) { - if (substr($validType, 0, 4) === 'enum') + if( $validType === "boolean" && $type === "string" ) { + if( $arg === "false" || $arg === "true" ) + { + $result['_valid'][$name] = $arg; + } + else + { + $result['_invalid'][] = RequestValidator::invalidParam($name, $arg, gettype($arg)); + } + } elseif (substr($validType, 0, 4) === 'enum') { if ($arg === 'enum' || !preg_match("@".preg_quote($arg)."@", $validType)) { $result['_invalid'][] = 'Invalid enum data param "'.$name.'" value ('.$arg.'): valid values "'.$validType.'"'; @@ -128,4 +140,4 @@ public static function invalidParamType($name, $value, $type, $validType) { return 'Invalid data param type "'.$name.'" ('.(is_array($value) ? implode(', ', $value) : $value).': '.$type.'): required type "'.$validType.'"'; } -} \ No newline at end of file +} From b7189dc554310d15f481bb072ef40019dbca9383 Mon Sep 17 00:00:00 2001 From: Nextor Date: Thu, 1 Sep 2016 09:45:52 -0700 Subject: [PATCH 02/14] Updating when_made enum for year 2016 --- src/Etsy/methods.json | 6 +++--- tests/Etsy/EtsyApiBuildRequestTest.php | 2 +- tests/Etsy/RequestValidatorTest.php | 4 ++-- tests/Etsy/methods.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Etsy/methods.json b/src/Etsy/methods.json index 221a90e..644a957 100644 --- a/src/Etsy/methods.json +++ b/src/Etsy/methods.json @@ -367,7 +367,7 @@ "tags": "array(string)", "who_made": "enum(i_did, collective, someone_else)", "is_supply": "boolean", - "when_made": "enum(made_to_order, 2010_2015, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", + "when_made": "enum(made_to_order, 2010_2016, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", "recipient": "enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)", "occasion": "enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanza, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)", "style": "array(string)" @@ -425,7 +425,7 @@ "tags": "array(string)", "who_made": "enum(i_did, collective, someone_else)", "is_supply": "boolean", - "when_made": "enum(made_to_order, 2010_2015, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", + "when_made": "enum(made_to_order, 2010_2016, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", "recipient": "enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)", "occasion": "enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanza, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)", "style": "array(string)", @@ -3393,4 +3393,4 @@ "visibility": "public", "http_method": "GET" } -} \ No newline at end of file +} diff --git a/tests/Etsy/EtsyApiBuildRequestTest.php b/tests/Etsy/EtsyApiBuildRequestTest.php index c504159..97b5126 100644 --- a/tests/Etsy/EtsyApiBuildRequestTest.php +++ b/tests/Etsy/EtsyApiBuildRequestTest.php @@ -76,7 +76,7 @@ public function testValidData() "tags" => array('fashion, othertag'), "who_made" => "collective", "is_supply" => true, - "when_made" => "2010_2015", + "when_made" => "2010_2016", "recipient" => "men", "occasion" => "baptism", "style" => array('style1, style2') diff --git a/tests/Etsy/RequestValidatorTest.php b/tests/Etsy/RequestValidatorTest.php index 621c05a..fa3fdae 100644 --- a/tests/Etsy/RequestValidatorTest.php +++ b/tests/Etsy/RequestValidatorTest.php @@ -134,7 +134,7 @@ public function testDataEmpty() "tags": "array(string)", "who_made": "enum(i_did, collective, someone_else)", "is_supply": "boolean", - "when_made": "enum(made_to_order, 2010_2015, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", + "when_made": "enum(made_to_order, 2010_2016, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", "recipient": "enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)", "occasion": "enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanza, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)", "style": "array(string)" @@ -413,4 +413,4 @@ public function testDataInvalidImageFileType() $this->assertCount(1, $result['_invalid']); $this->assertRegExp($this->invalidTypeRegExp, $result['_invalid'][0]); } -} \ No newline at end of file +} diff --git a/tests/Etsy/methods.json b/tests/Etsy/methods.json index a643a49..e9b88f3 100644 --- a/tests/Etsy/methods.json +++ b/tests/Etsy/methods.json @@ -366,7 +366,7 @@ "tags": "array(string)", "who_made": "enum(i_did, collective, someone_else)", "is_supply": "boolean", - "when_made": "enum(made_to_order, 2010_2015, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", + "when_made": "enum(made_to_order, 2010_2016, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", "recipient": "enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)", "occasion": "enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanza, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)", "style": "array(string)" @@ -423,7 +423,7 @@ "tags": "array(string)", "who_made": "enum(i_did, collective, someone_else)", "is_supply": "boolean", - "when_made": "enum(made_to_order, 2010_2015, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", + "when_made": "enum(made_to_order, 2010_2016, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", "recipient": "enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)", "occasion": "enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanza, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)", "style": "array(string)", From 0b5edc9e98f7e6dea71e4137823434b953637e4d Mon Sep 17 00:00:00 2001 From: Tudor-Dan Ravoiu Date: Mon, 5 Sep 2016 12:29:25 +0200 Subject: [PATCH 03/14] Allow language parameter For some specific calls like e.g. finAllTopCategory etsy allows an extra "language" parameter to be sent. This change enables this extra parameter. --- src/Etsy/EtsyApi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Etsy/EtsyApi.php b/src/Etsy/EtsyApi.php index a498109..a185235 100644 --- a/src/Etsy/EtsyApi.php +++ b/src/Etsy/EtsyApi.php @@ -94,7 +94,7 @@ protected function validateResponse($request_args, $response) private function prepareParameters($params) { $query_pairs = array(); - $allowed = array("limit", "offset", "page", "sort_on", "sort_order", "include_private"); + $allowed = array("limit", "offset", "page", "sort_on", "sort_order", "include_private", "language"); if ($params) { foreach($params as $key=>$value) { From 051f5b0d402312e1f01d4a66da40e6079fca8c93 Mon Sep 17 00:00:00 2001 From: Nextor Date: Mon, 5 Sep 2016 11:52:26 -0700 Subject: [PATCH 04/14] Adding 0 and 1 for booleans --- src/Etsy/RequestValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Etsy/RequestValidator.php b/src/Etsy/RequestValidator.php index 224a1ff..c4b06fb 100644 --- a/src/Etsy/RequestValidator.php +++ b/src/Etsy/RequestValidator.php @@ -98,7 +98,7 @@ public static function validateData($args, $methodInfo) { if( $validType === "boolean" && $type === "string" ) { - if( $arg === "false" || $arg === "true" ) + if( $arg === "false" || $arg === "true" || $arg === "0" || $arg === "1") { $result['_valid'][$name] = $arg; } From cd56c9bb22a99266a1b263d620fb012890a2e50f Mon Sep 17 00:00:00 2001 From: Nextor Date: Mon, 5 Sep 2016 11:54:42 -0700 Subject: [PATCH 05/14] Fix the value type for price in updateListingVariation and createListingVariation --- src/Etsy/methods.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Etsy/methods.json b/src/Etsy/methods.json index 644a957..b793590 100644 --- a/src/Etsy/methods.json +++ b/src/Etsy/methods.json @@ -752,7 +752,7 @@ "property_id": "int", "value": "string", "is_available": "boolean", - "price": "int" + "price": "float" }, "defaults": { "is_available": true, @@ -771,7 +771,7 @@ "property_id": "int", "value": "string", "is_available": "boolean", - "price": "int" + "price": "float" }, "defaults": { "price": null From 870cdd34157c247e10682b7ddaab7fb43e688dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Abete?= Date: Mon, 5 Sep 2016 19:15:50 -0300 Subject: [PATCH 06/14] Bump version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cd5a63a..c925da9 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "inakiabt/etsy-php", - "version": "0.9.0", + "version": "0.9.1", "description": "Simple PHP wrapper for Etsy API", "license": "MIT", "authors": [ From b38b81854af4b2fbbd70f0e7bb983852b27a105b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Abete?= Date: Mon, 5 Sep 2016 19:19:43 -0300 Subject: [PATCH 07/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36dc9b7..86d2a6b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Add the following to your `composer.json` file: ```json { "require": { - "inakiabt/etsy-php": "dev-master" + "inakiabt/etsy-php": ">=0.9.0" } } ``` From 9f656a785cc523a682c8c70bf8d9c7971347604d Mon Sep 17 00:00:00 2001 From: gtlt Date: Wed, 7 Sep 2016 22:46:22 +0200 Subject: [PATCH 08/14] Update EtsyClient.php add getLastResponseHeaders to access Etsy X-Ratelimit-Limit and X-Ratelimit-Remaining --- src/Etsy/EtsyClient.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Etsy/EtsyClient.php b/src/Etsy/EtsyClient.php index cd99ea6..9495170 100644 --- a/src/Etsy/EtsyClient.php +++ b/src/Etsy/EtsyClient.php @@ -102,6 +102,10 @@ public function getConsumerSecret() return $this->consumer_secret; } + public function getLastResponseHeaders(){ + return $this->oauth->getLastResponseHeaders(); + } + public function setDebug($debug) { $this->debug = $debug; From 121438d31d795dc1f0f970034ba1f6054b5d44f1 Mon Sep 17 00:00:00 2001 From: Nextor Date: Thu, 8 Sep 2016 08:47:45 -0700 Subject: [PATCH 09/14] Adding strings 0 and 1 as valid booleans --- src/Etsy/RequestValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Etsy/RequestValidator.php b/src/Etsy/RequestValidator.php index 224a1ff..c4b06fb 100644 --- a/src/Etsy/RequestValidator.php +++ b/src/Etsy/RequestValidator.php @@ -98,7 +98,7 @@ public static function validateData($args, $methodInfo) { if( $validType === "boolean" && $type === "string" ) { - if( $arg === "false" || $arg === "true" ) + if( $arg === "false" || $arg === "true" || $arg === "0" || $arg === "1") { $result['_valid'][$name] = $arg; } From 22d464593e057ecf4b69c052cc3e8e18d73610fe Mon Sep 17 00:00:00 2001 From: Nextor Date: Thu, 8 Sep 2016 08:49:31 -0700 Subject: [PATCH 10/14] Change int to float for the price parameters --- src/Etsy/methods.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Etsy/methods.json b/src/Etsy/methods.json index 644a957..b793590 100644 --- a/src/Etsy/methods.json +++ b/src/Etsy/methods.json @@ -752,7 +752,7 @@ "property_id": "int", "value": "string", "is_available": "boolean", - "price": "int" + "price": "float" }, "defaults": { "is_available": true, @@ -771,7 +771,7 @@ "property_id": "int", "value": "string", "is_available": "boolean", - "price": "int" + "price": "float" }, "defaults": { "price": null From 126bdd509006af7414590d356809464c343421b8 Mon Sep 17 00:00:00 2001 From: Nextor Date: Wed, 31 Aug 2016 14:42:21 -0700 Subject: [PATCH 11/14] Adding support for booleans when actually are strings --- src/Etsy/RequestValidator.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Etsy/RequestValidator.php b/src/Etsy/RequestValidator.php index 8846f23..224a1ff 100644 --- a/src/Etsy/RequestValidator.php +++ b/src/Etsy/RequestValidator.php @@ -52,7 +52,9 @@ public static function validateData($args, $methodInfo) $result['_invalid'][] = 'Method not found'; return $result; } + $methodsParams = $methodInfo['params']; + foreach ($args as $name => $arg) { if (isset($methodsParams[$name])) @@ -85,16 +87,26 @@ public static function validateData($args, $methodInfo) case 'double': $item_type = 'float'; break; - } + } $type = 'array('.$item_type.')'; } } break; } + if ($validType !== $type) { - if (substr($validType, 0, 4) === 'enum') + if( $validType === "boolean" && $type === "string" ) { + if( $arg === "false" || $arg === "true" ) + { + $result['_valid'][$name] = $arg; + } + else + { + $result['_invalid'][] = RequestValidator::invalidParam($name, $arg, gettype($arg)); + } + } elseif (substr($validType, 0, 4) === 'enum') { if ($arg === 'enum' || !preg_match("@".preg_quote($arg)."@", $validType)) { $result['_invalid'][] = 'Invalid enum data param "'.$name.'" value ('.$arg.'): valid values "'.$validType.'"'; @@ -128,4 +140,4 @@ public static function invalidParamType($name, $value, $type, $validType) { return 'Invalid data param type "'.$name.'" ('.(is_array($value) ? implode(', ', $value) : $value).': '.$type.'): required type "'.$validType.'"'; } -} \ No newline at end of file +} From fbfcdb48d7ba99af32b05473b6b179643b76ed54 Mon Sep 17 00:00:00 2001 From: Nextor Date: Thu, 1 Sep 2016 09:45:52 -0700 Subject: [PATCH 12/14] Updating when_made enum for year 2016 --- src/Etsy/methods.json | 6 +++--- tests/Etsy/EtsyApiBuildRequestTest.php | 2 +- tests/Etsy/RequestValidatorTest.php | 4 ++-- tests/Etsy/methods.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Etsy/methods.json b/src/Etsy/methods.json index 221a90e..644a957 100644 --- a/src/Etsy/methods.json +++ b/src/Etsy/methods.json @@ -367,7 +367,7 @@ "tags": "array(string)", "who_made": "enum(i_did, collective, someone_else)", "is_supply": "boolean", - "when_made": "enum(made_to_order, 2010_2015, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", + "when_made": "enum(made_to_order, 2010_2016, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", "recipient": "enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)", "occasion": "enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanza, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)", "style": "array(string)" @@ -425,7 +425,7 @@ "tags": "array(string)", "who_made": "enum(i_did, collective, someone_else)", "is_supply": "boolean", - "when_made": "enum(made_to_order, 2010_2015, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", + "when_made": "enum(made_to_order, 2010_2016, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", "recipient": "enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)", "occasion": "enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanza, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)", "style": "array(string)", @@ -3393,4 +3393,4 @@ "visibility": "public", "http_method": "GET" } -} \ No newline at end of file +} diff --git a/tests/Etsy/EtsyApiBuildRequestTest.php b/tests/Etsy/EtsyApiBuildRequestTest.php index c504159..97b5126 100644 --- a/tests/Etsy/EtsyApiBuildRequestTest.php +++ b/tests/Etsy/EtsyApiBuildRequestTest.php @@ -76,7 +76,7 @@ public function testValidData() "tags" => array('fashion, othertag'), "who_made" => "collective", "is_supply" => true, - "when_made" => "2010_2015", + "when_made" => "2010_2016", "recipient" => "men", "occasion" => "baptism", "style" => array('style1, style2') diff --git a/tests/Etsy/RequestValidatorTest.php b/tests/Etsy/RequestValidatorTest.php index 621c05a..fa3fdae 100644 --- a/tests/Etsy/RequestValidatorTest.php +++ b/tests/Etsy/RequestValidatorTest.php @@ -134,7 +134,7 @@ public function testDataEmpty() "tags": "array(string)", "who_made": "enum(i_did, collective, someone_else)", "is_supply": "boolean", - "when_made": "enum(made_to_order, 2010_2015, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", + "when_made": "enum(made_to_order, 2010_2016, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", "recipient": "enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)", "occasion": "enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanza, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)", "style": "array(string)" @@ -413,4 +413,4 @@ public function testDataInvalidImageFileType() $this->assertCount(1, $result['_invalid']); $this->assertRegExp($this->invalidTypeRegExp, $result['_invalid'][0]); } -} \ No newline at end of file +} diff --git a/tests/Etsy/methods.json b/tests/Etsy/methods.json index a643a49..e9b88f3 100644 --- a/tests/Etsy/methods.json +++ b/tests/Etsy/methods.json @@ -366,7 +366,7 @@ "tags": "array(string)", "who_made": "enum(i_did, collective, someone_else)", "is_supply": "boolean", - "when_made": "enum(made_to_order, 2010_2015, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", + "when_made": "enum(made_to_order, 2010_2016, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", "recipient": "enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)", "occasion": "enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanza, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)", "style": "array(string)" @@ -423,7 +423,7 @@ "tags": "array(string)", "who_made": "enum(i_did, collective, someone_else)", "is_supply": "boolean", - "when_made": "enum(made_to_order, 2010_2015, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", + "when_made": "enum(made_to_order, 2010_2016, 2000_2009, 1994_1999, before_1994, 1990_1993, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)", "recipient": "enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)", "occasion": "enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanza, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)", "style": "array(string)", From 9e609c51d6d9ae849c952509ee4ed8af972b42b1 Mon Sep 17 00:00:00 2001 From: Nextor Date: Mon, 5 Sep 2016 11:52:26 -0700 Subject: [PATCH 13/14] Adding 0 and 1 for booleans --- src/Etsy/RequestValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Etsy/RequestValidator.php b/src/Etsy/RequestValidator.php index 224a1ff..c4b06fb 100644 --- a/src/Etsy/RequestValidator.php +++ b/src/Etsy/RequestValidator.php @@ -98,7 +98,7 @@ public static function validateData($args, $methodInfo) { if( $validType === "boolean" && $type === "string" ) { - if( $arg === "false" || $arg === "true" ) + if( $arg === "false" || $arg === "true" || $arg === "0" || $arg === "1") { $result['_valid'][$name] = $arg; } From 7459ca66d35a80e5ef2bdc405c79106fbe27c3bd Mon Sep 17 00:00:00 2001 From: Nextor Date: Mon, 5 Sep 2016 11:54:42 -0700 Subject: [PATCH 14/14] Fix the value type for price in updateListingVariation and createListingVariation --- src/Etsy/methods.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Etsy/methods.json b/src/Etsy/methods.json index 644a957..b793590 100644 --- a/src/Etsy/methods.json +++ b/src/Etsy/methods.json @@ -752,7 +752,7 @@ "property_id": "int", "value": "string", "is_available": "boolean", - "price": "int" + "price": "float" }, "defaults": { "is_available": true, @@ -771,7 +771,7 @@ "property_id": "int", "value": "string", "is_available": "boolean", - "price": "int" + "price": "float" }, "defaults": { "price": null