From 19d4cd9069d2c92de036800229ba224f9e375c4c Mon Sep 17 00:00:00 2001 From: Andrew Christensen Date: Tue, 21 Feb 2023 13:32:34 -0700 Subject: [PATCH 01/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9db8155..65b8166 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ PHP 7.1 or greater. ## Install Install the package using composer. ```php -composer require rhysnhall/etsy-php-sdk +composer require erankco/etsy-php-sdk ``` Include the OAuth client and Etsy class. From bb8e904a7bd9a4ab62982a1001a06419c76ca985 Mon Sep 17 00:00:00 2001 From: emergingdzns Date: Tue, 21 Feb 2023 16:24:51 -0700 Subject: [PATCH 02/12] Updated some and added new methods --- .gitignore | 1 + README.md | 2 +- src/Etsy.php | 63 +++++++++++++- src/Resources/BuyerTaxonomy.php | 28 ++++++ src/Resources/BuyerTaxonomyProperty.php | 13 +++ src/Resources/Listing.php | 111 ++++++++++++++++++++++-- src/Resources/ListingVideo.php | 25 ++++++ src/Resources/ProductionPartner.php | 13 +++ src/Resources/ReturnPolicy.php | 58 +++++++++++++ src/Resources/Shop.php | 79 +++++++++++++++++ 10 files changed, 383 insertions(+), 10 deletions(-) create mode 100644 src/Resources/BuyerTaxonomy.php create mode 100644 src/Resources/BuyerTaxonomyProperty.php create mode 100644 src/Resources/ListingVideo.php create mode 100644 src/Resources/ProductionPartner.php create mode 100644 src/Resources/ReturnPolicy.php diff --git a/.gitignore b/.gitignore index 8b7ef35..e22ebed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /vendor composer.lock +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index 65b8166..9db8155 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ PHP 7.1 or greater. ## Install Install the package using composer. ```php -composer require erankco/etsy-php-sdk +composer require rhysnhall/etsy-php-sdk ``` Include the OAuth client and Etsy class. diff --git a/src/Etsy.php b/src/Etsy.php index d97bbbd..453df44 100644 --- a/src/Etsy.php +++ b/src/Etsy.php @@ -118,16 +118,38 @@ public function ping() { } /** - * Only supports getting the user for who the current API KEY is associated with. + * Gets the user id and shop id for the logged in user. + * + * @return array + */ + public function getMe() { + $response = static::$client->get("/application/users/me"); + return $response ?? []; + } + + /** + * Gets the scopes for the current token + * + * @return array + */ + public function tokenScopes() { + $response = static::$client->get("/application/scopes"); + return $response ?? []; + } + + /** + * Get the user for the current tokened user or for a specified user. * + * @params int|null $user_id * @return Etsy\Resources\User */ - public function getUser() { - $user_id = explode(".", $this->api_key)[0]; + public function getUser($user_id = null) { + $user_id ?? explode(".", $this->api_key)[0]; $response = static::$client->get("/application/users/{$user_id}"); return static::getResource($response, "User"); } + /** * Gets an Etsy shop. If no shop_id is specified the current user will be queried for an associated shop. * @@ -166,6 +188,7 @@ public function getShops($keyword, $params = []) { /** * Retrieves the full hierarchy tree of seller taxonomy nodes. * + * @link https://developers.etsy.com/documentation/reference#tag/getSellerTaxonomyNodes * @return Etsy\Collection[Etsy\Resources\Taxonomy] */ public function getSellerTaxonomy() { @@ -175,6 +198,19 @@ public function getSellerTaxonomy() { return static::getResource($response, "Taxonomy"); } + /** + * Retrieves the full hierarchy tree of buyer taxonomy nodes. + * + * @link https://developers.etsy.com/documentation/reference#operation/getBuyerTaxonomyNodes + * @return Etsy\Collection[Etsy\Resources\BuyerTaxonomy] + */ + public function getBuyerTaxonomy() { + $response = static::$client->get( + "/application/buyer-taxonomy/nodes" + ); + return static::getResource($response, "BuyerTaxonomy"); + } + /** * Retrieves a list of available shipping carriers and the mail classes associated with them for a given country * @@ -253,4 +289,25 @@ public function getListings( return static::getResource($response, "Listing"); } + /** + * Find shops based on a shop name + * + * @param string $shop_name + * @param int|null $limit + * @param int|null $offset + * @return Etsy\Collection[Etsy\Resources\Shop] + */ + public function findShops(string $shop_name, ?int $limit, ?int $offset) { + $params = [ + "shop_name" => $shop_name + ]; + if ($limit) $params['limit'] = $limit; + if ($offset) $params['offset'] = $offset; + $response = static::$client->get( + "/application/shops", + $params + ); + return static::getResource($response, "Shop"); + } + } diff --git a/src/Resources/BuyerTaxonomy.php b/src/Resources/BuyerTaxonomy.php new file mode 100644 index 0000000..8591aff --- /dev/null +++ b/src/Resources/BuyerTaxonomy.php @@ -0,0 +1,28 @@ +request( + 'GET', + "/application/buyer-taxonomy/nodes/{$this->id}/properties", + "BuyerTaxonomyProperty" + ); + } + +} diff --git a/src/Resources/BuyerTaxonomyProperty.php b/src/Resources/BuyerTaxonomyProperty.php new file mode 100644 index 0000000..1b82369 --- /dev/null +++ b/src/Resources/BuyerTaxonomyProperty.php @@ -0,0 +1,13 @@ + "Shop", "User" => "User", - "Images" => "Image" + "Images" => "Image", + "Translations" => "Translation", + "Inventory" => "Inventory", + "Videos" => "Video", + "Shipping" => "Shipping" ]; /** @@ -32,7 +36,8 @@ class Listing extends Resource { public function update(array $data) { return $this->updateRequest( "/application/shops/{$this->shop_id}/listings/{$this->listing_id}", - $data + $data, + 'PATCH' ); } @@ -44,7 +49,7 @@ public function update(array $data) { */ public function delete() { return $this->deleteRequest( - "/application/shops/{$this->shop_id}/listings/{$this->listing_id}" + "/application/listings/{$this->listing_id}" ); } @@ -153,7 +158,7 @@ public function uploadFile(array $data) { public function getImages() { return $this->request( "GET", - "/application/shops/{$this->shop_id}/listings/{$this->listing_id}/images", + "/application/listings/{$this->listing_id}/images", "ListingImage" ) ->append(["shop_id" => $this->shop_id]); @@ -169,7 +174,7 @@ public function getImages() { public function getImage($listing_image_id) { $listing_image = $this->request( "GET", - "/application/shops/{$this->shop_id}/listings/{$this->listing_id}/images/{$listing_image_id}", + "/application/listings/{$this->listing_id}/images/{$listing_image_id}", "ListingImage" ); if($listing_image) { @@ -177,7 +182,7 @@ public function getImage($listing_image_id) { } return $listing_image; } - + /** * Upload a listing image. * @@ -201,6 +206,63 @@ public function uploadImage(array $data) { return $listing_image; } + /** + * Get the Listing Videos for the listing. + * + * @link https://developers.etsy.com/documentation/reference#operation/getListingVideos + * @return Etsy\Collection[Etsy\Resources\ListingVideo] + */ + public function getVideos() { + return $this->request( + "GET", + "/application/listings/{$this->listing_id}/videos", + "ListingVideo" + ) + ->append(["shop_id" => $this->shop_id]); + } + + /** + * Get a specific listing video. + * + * @link https://developers.etsy.com/documentation/reference#operation/getListingVideo + * @param integer|string $listing_video_id + * @return Etsy\Resources\ListingVideo + */ + public function getVideo($listing_video_id) { + $listing_video = $this->request( + "GET", + "/application/listings/{$this->listing_id}/videos/{$listing_video_id}", + "ListingVideo" + ); + if($listing_video) { + $listing_video->shop_id = $this->shop_id; + } + return $listing_video; + } + + /** + * Upload a listing video. + * + * @link https://developers.etsy.com/documentation/reference#operation/uploadListingVideo + * @param array $data + * @return Etsy\Resources\ListingVideo + */ + public function uploadVideo(array $data) { + if(!isset($data['video']) && !isset($data['video_id'])) { + throw new ApiException("Request requires either 'video_id' or 'video' paramater."); + } + $listing_video = $this->request( + "POST", + "/application/shops/{$this->shop_id}/listings/{$this->listing_id}/videos", + "ListingVideo", + $data + ); + if($listing_video) { + $listing_video->shop_id = $this->shop_id; + } + return $listing_video; + } + /** * Get the inventory for the listing. * @@ -247,6 +309,27 @@ public function updateInventory(array $data) { return $inventory; } + /** + * Get an offering for a listing. Use this method to bypass going through the ListingInventory resource. + * + * @link https://developers.etsy.com/documentation/reference#tag/ShopListing-Offering + * @param integer|string $product_id + * @param integer|string $product_offering_id + * @return Etsy\Resources\ListingOffering + */ + public function getOffering($product_id, $product_offering_id) { + $offering = $this->request( + "GET", + "/application/listings/{$this->listing_id}/inventory/products/{$product_id}/offerings/{$product_offering_id}", + "ListingOffering" + ); + if($offering) { + $offering->listing_id = $this->listing_id; + $offering->product_id = $product_id; + } + return $offering; + } + /** * Get a specific product for a listing. Use this method to bypass going through the ListingInventory resource. * @@ -341,4 +424,20 @@ public function updateVariationImages(array $data) { ); } + /** + * Get all reviews for the listing. + * + * @param array $params + * @return Etsy\Collection[Etsy\Resources\Review] + */ + public function getReviews(array $params = []) { + return $this->request( + "GET", + "/application/listings/{$this->listing_id}/reviews", + "Review", + $params + ); + } + + } diff --git a/src/Resources/ListingVideo.php b/src/Resources/ListingVideo.php new file mode 100644 index 0000000..423c98b --- /dev/null +++ b/src/Resources/ListingVideo.php @@ -0,0 +1,25 @@ +deleteRequest( + "/application/shops/{$this->shop_id}/listings/{$this->listing_id}/videos/{$this->listing_video_id}" + ); + } +} diff --git a/src/Resources/ProductionPartner.php b/src/Resources/ProductionPartner.php new file mode 100644 index 0000000..77be23b --- /dev/null +++ b/src/Resources/ProductionPartner.php @@ -0,0 +1,13 @@ +updateRequest( + "/application/shops/{$this->shop_id}/policies/return/{$this->return_policy_id}", + $data, + 'PUT' + ); + } + + /** + * Delete the return policy. + * + * @link https://developers.etsy.com/documentation/reference#operation/deleteShopReturnPolicy + * @return boolean + */ + public function delete() { + return $this->deleteRequest( + "/application/shops/{$this->shop_id}/policies/return/{$this->return_policy_id}" + ); + } + + + /** + * Get all listings associated with the shop return policy. + * + * @link https://developers.etsy.com/documentation/reference#operation/getListingsByShopReturnPolicy + * @param array $params + * @return Etsy\Collection[Etsy\Resources\Listing] + */ + public function getListings() { + return $this->request( + "GET", + "/application/shops/{$this->shop_id}/policies/return/{$this->return_policy_id}/listings", + "Listing" + ); + } + +} diff --git a/src/Resources/Shop.php b/src/Resources/Shop.php index 3428969..d4aad4d 100644 --- a/src/Resources/Shop.php +++ b/src/Resources/Shop.php @@ -78,6 +78,21 @@ public function createSection(string $title) { ); } + /** + * Get all production partners for the shop. + * + * @param array $params + * @return \Etsy\Collection + */ + public function getProductionPartners() { + return $this->request( + "GET", + "/application/shops/{$this->shop_id}/production-partners", + "ProductionPartner" + ) + ->append(['shop_id' => $this->shop_id]); + } + /** * Get all reviews for the shop. * @@ -151,6 +166,70 @@ public function createShippingProfile(array $data) { return $profile; } + /** + * Get all return policies for the shop. + * + * @return Etsy\Collection[Etsy\Resources\ReturnPolicy] + */ + public function getReturnPolicies() { + $policies = $this->request( + "GET", + "/application/shops/{$this->shop_id}/policies/return", + "ReturnPolicy" + )->append(['shop_id' => $this->shop_id]); + return $profiles; + } + + /** + * Gets a single shipping profile for the shop. + * + * @param integer $policy_id + * @return Etsy\Resources\ReturnPolicy + */ + public function getReturnPolicy($policy_id) { + $policy = $this->request( + "GET", + "/application/shops/{$this->shop_id}/shipping-profiles/{$policy_id}", + "ReturnPolicy" + ); + return $policy; + } + + /** + * Consolidate two shop return policies. + * + * @param integer $source_policy_id + * @param integer $destination_policy_id + * @return Etsy\Resources\ReturnPolicy + */ + public function consolidateReturnPolicies(int $source_policy_id, int $destination_policy_id) { + $data = [ + 'source_policy_id' => $source_policy_id, + 'destination_policy_id' => $destination_policy_id + ]; + return $this->updateRequest( + "/application/shops/{$this->shop_id}/policies/return/consolidate", + $data, + 'POST' + ); + } + /** + * Creates a new return policy for the shop. + * + * @link https://developers.etsy.com/documentation/reference#operation/createShopReturnPolicy + * @param array $data + * @return Etsy\Resources\ReturnPolicy + */ + public function createReturnPolicy(array $data) { + $policy = $this->request( + "POST", + "/application/shops/{$this->shop_id}/policies/return", + "ReturnPolicy", + $data + ); + return $policy; + } + /** * Assigns the shop ID to a shipping profile. * From b1bd01e1eae4090d0305aae9337700a37fe2e455 Mon Sep 17 00:00:00 2001 From: emergingdzns Date: Tue, 21 Feb 2023 19:41:24 -0700 Subject: [PATCH 03/12] Fixed a couple small bugs --- src/Resources/Shop.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Resources/Shop.php b/src/Resources/Shop.php index d4aad4d..acc018e 100644 --- a/src/Resources/Shop.php +++ b/src/Resources/Shop.php @@ -134,7 +134,7 @@ public function getShippingProfiles() { * Gets a single shipping profile for the shop. * * @param integer|string $shipping_profile_id - * @return Etsy\Resources\ShippingProfile + * @return Etsy\Collection[Etsy\Resources\ShippingProfile] */ public function getShippingProfile($shipping_profile_id) { $profile = $this->request( @@ -152,7 +152,7 @@ public function getShippingProfile($shipping_profile_id) { * * @link https://developers.etsy.com/documentation/reference/#operation/createShopShippingProfile * @param array $data - * @return Etsy\Resources\ShippingProfile + * @return Etsy\Collection[Etsy\Resources\ShippingProfile] */ public function createShippingProfile(array $data) { $profile = $this->request( @@ -177,7 +177,7 @@ public function getReturnPolicies() { "/application/shops/{$this->shop_id}/policies/return", "ReturnPolicy" )->append(['shop_id' => $this->shop_id]); - return $profiles; + return $policies; } /** From 6a368b12742f0aa8665394e95920e40bca273b4c Mon Sep 17 00:00:00 2001 From: emergingdzns Date: Tue, 21 Feb 2023 20:39:44 -0700 Subject: [PATCH 04/12] had to update to be able to pull into repo --- composer.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2964881..ef19d17 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "rhysnhall/etsy-php-sdk", - "version": "0.3.4", + "name": "erankco/etsy-php-sdk", + "version": "0.4", "description": "PHP SDK for Etsy API v3.", "type": "library", "keywords": [ @@ -15,6 +15,11 @@ "name": "Rhys Hall", "email": "hello@rhyshall.com", "homepage": "https://github.com/rhysnhall" + }, + { + "name": "Andrew Christensen", + "email": "andrew@critical-code.com", + "homepage": "https://github.com/erankco" } ], "require": { From 460f3b9cd32462fd07527c9012e46d283e181546 Mon Sep 17 00:00:00 2001 From: emergingdzns Date: Fri, 19 May 2023 14:14:57 -0700 Subject: [PATCH 05/12] Added ability to get transactions for listing --- src/Etsy.php | 4 ++-- src/Resources/Listing.php | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Etsy.php b/src/Etsy.php index 453df44..66362a0 100644 --- a/src/Etsy.php +++ b/src/Etsy.php @@ -145,7 +145,7 @@ public function tokenScopes() { */ public function getUser($user_id = null) { $user_id ?? explode(".", $this->api_key)[0]; - $response = static::$client->get("/application/users/{$user_id}"); + $response = static::$client->get("/application/users/{$user_id}", []); return static::getResource($response, "User"); } @@ -162,7 +162,7 @@ public function getShop( if(!$shop_id) { return $this->getUser()->getShop(); } - $response = static::$client->get("/application/shops/{$shop_id}"); + $response = static::$client->get("/application/shops/{$shop_id}", []); return static::getResource($response, "Shop"); } diff --git a/src/Resources/Listing.php b/src/Resources/Listing.php index ffc5272..59782cc 100644 --- a/src/Resources/Listing.php +++ b/src/Resources/Listing.php @@ -439,5 +439,19 @@ public function getReviews(array $params = []) { ); } - + /** + * Get all transactions for the listing. + * + * @link https://developers.etsy.com/documentation/reference#operation/getShopReceiptTransactionsByListing + * @param array $params + * @return Etsy\Collection[Etsy\Resources\Transaction] + */ + public function getTransactions(array $params = []) { + return $this->request( + "GET", + "/application/shops/{$this->shop_id}/listing/{$this->listing_id}/transactions", + "Transaction", + $params + ); + } } From fb390bc770029f22a1c80fa3dac8589e84219a7d Mon Sep 17 00:00:00 2001 From: emergingdzns Date: Wed, 24 May 2023 13:51:10 -0700 Subject: [PATCH 06/12] Adding expires --- src/OAuth/Client.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OAuth/Client.php b/src/OAuth/Client.php index a6cd261..b1711bf 100644 --- a/src/OAuth/Client.php +++ b/src/OAuth/Client.php @@ -190,7 +190,8 @@ public function requestAccessToken( $response = json_decode($response->getBody(), false); return [ 'access_token' => $response->access_token, - 'refresh_token' => $response->refresh_token + 'refresh_token' => $response->refresh_token, + 'expires_at' => (time() + $response->expires_in) ]; } catch(\Exception $e) { From d77daef7d83313d27db363db18a7219ac6910583 Mon Sep 17 00:00:00 2001 From: emergingdzns Date: Wed, 24 May 2023 13:59:12 -0700 Subject: [PATCH 07/12] Added expiration to multiple methods --- src/OAuth/Client.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/OAuth/Client.php b/src/OAuth/Client.php index b1711bf..1ce676d 100644 --- a/src/OAuth/Client.php +++ b/src/OAuth/Client.php @@ -220,7 +220,8 @@ public function refreshAccessToken( $response = json_decode($response->getBody(), false); return [ 'access_token' => $response->access_token, - 'refresh_token' => $response->refresh_token + 'refresh_token' => $response->refresh_token, + 'expires_at' => (time() + $response->expires_in) ]; } catch(\Exception $e) { @@ -249,7 +250,8 @@ public function exchangeLegacyToken( $response = json_decode($response->getBody(), false); return [ 'access_token' => $response->access_token, - 'refresh_token' => $response->refresh_token + 'refresh_token' => $response->refresh_token, + 'expires_at' => (time() + $response->expires_in) ]; } catch(\Exception $e) { From ae07118b5d11153d75a615650eed81194ebda55c Mon Sep 17 00:00:00 2001 From: emergingdzns Date: Mon, 19 Jun 2023 15:04:04 -0700 Subject: [PATCH 08/12] Fixed issue --- src/OAuth/Client.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/OAuth/Client.php b/src/OAuth/Client.php index 1ce676d..be2b4d1 100644 --- a/src/OAuth/Client.php +++ b/src/OAuth/Client.php @@ -39,6 +39,11 @@ class Client { */ protected $config = []; + /** + * @var array + */ + public $headers = []; + /** * Create a new instance of Client. * From 7157d713da6f649155e2fc79fa9ef94fce51e582 Mon Sep 17 00:00:00 2001 From: emergingdzns Date: Tue, 20 Jun 2023 11:22:46 -0700 Subject: [PATCH 09/12] making api key optional --- src/OAuth/Client.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/OAuth/Client.php b/src/OAuth/Client.php index be2b4d1..e213c6b 100644 --- a/src/OAuth/Client.php +++ b/src/OAuth/Client.php @@ -84,11 +84,14 @@ public function setConfig($config) { * @param string $api_key * @return void */ - public function setApiKey($api_key) { - $this->headers = [ - 'x-api-key' => $this->client_id, - 'Authorization' => "Bearer {$api_key}" + public function setApiKey($api_key = null) { + $headers = [ + 'x-api-key' => $this->client_id ]; + if ($api_key) { + $headers['Authorization'] = "Bearer {$api_key}"; + } + $this->headers = $headers; } public function __call($method, $args) { From f5f109f557cf5efbeebbb41871c9060ddc97424b Mon Sep 17 00:00:00 2001 From: emergingdzns Date: Tue, 20 Jun 2023 11:48:53 -0700 Subject: [PATCH 10/12] another adjustment to allow null api key --- src/Etsy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Etsy.php b/src/Etsy.php index 66362a0..e9e2f3a 100644 --- a/src/Etsy.php +++ b/src/Etsy.php @@ -29,7 +29,7 @@ class Etsy { public function __construct( string $client_id, - string $api_key, + string $api_key = null, array $config = [] ) { $this->client_id = $client_id; From 43e93ab67425b92856d930a2eb3aa402cd6c6cb0 Mon Sep 17 00:00:00 2001 From: Rhys Hall Date: Thu, 29 Jun 2023 13:57:47 +1000 Subject: [PATCH 11/12] Bug fixes - Fixed bug with null coalescing operator in Etsy::getUser not assigning correctly. - Update Etsy::tokenScopes to a POST request as per Etsy docs. - Replace Etsy::findShops params with a single param array. Add check for shop_name GET param. --- src/Etsy.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Etsy.php b/src/Etsy.php index e9e2f3a..b34228d 100644 --- a/src/Etsy.php +++ b/src/Etsy.php @@ -133,7 +133,7 @@ public function getMe() { * @return array */ public function tokenScopes() { - $response = static::$client->get("/application/scopes"); + $response = static::$client->post("/application/scopes"); return $response ?? []; } @@ -144,7 +144,7 @@ public function tokenScopes() { * @return Etsy\Resources\User */ public function getUser($user_id = null) { - $user_id ?? explode(".", $this->api_key)[0]; + $user_id = $user_id ?? explode(".", $this->api_key)[0]; $response = static::$client->get("/application/users/{$user_id}", []); return static::getResource($response, "User"); } @@ -162,7 +162,7 @@ public function getShop( if(!$shop_id) { return $this->getUser()->getShop(); } - $response = static::$client->get("/application/shops/{$shop_id}", []); + $response = static::$client->get("/application/shops/{$shop_id}"); return static::getResource($response, "Shop"); } @@ -292,17 +292,15 @@ public function getListings( /** * Find shops based on a shop name * - * @param string $shop_name - * @param int|null $limit - * @param int|null $offset + * @param array $params * @return Etsy\Collection[Etsy\Resources\Shop] */ - public function findShops(string $shop_name, ?int $limit, ?int $offset) { - $params = [ - "shop_name" => $shop_name - ]; - if ($limit) $params['limit'] = $limit; - if ($offset) $params['offset'] = $offset; + public function findShops( + array $params + ) { + if(!isset($params['shop_name'])) { + throw new ApiException("Etsy findShops operation expects a `shop_name` param."); + } $response = static::$client->get( "/application/shops", $params From 94180ccf65d208fadaf0e99054df57ea1e4b469e Mon Sep 17 00:00:00 2001 From: Rhys Hall Date: Thu, 29 Jun 2023 14:03:51 +1000 Subject: [PATCH 12/12] Update changelog for 0.4.0 --- CHANGELOG.md | 19 +++++++++++++++++++ composer.json | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 727cb1b..4138996 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## v0.4.0 +* Make api key optional when initializing client. +* Etsy::getUser now supports an optional user ID. +* Add expiry value to access tokens. +* Change Listing update request to use new PATCH method. +* Add new associations to Listing resource. +* Update endpoints for various Listing associated resources. + +### New +* Added Etsy::getMe() method: [User getMe method](https://developers.etsy.com/documentation/reference#operation/getMe) +* Added Etsy::tokenScopes method: [tokenScopes](https://developers.etsy.com/documentation/reference#operation/tokenScopes) +* Added new [BuyerTaxonomy](https://developers.etsy.com/documentation/reference#tag/BuyerTaxonomy) and BuyerTaxonomyProperty resource and supporting methods. +* Added Etsy::findShops() method: [findShops](https://developers.etsy.com/documentation/reference#operation/findShops) +* Add new [ListingVideo](https://developers.etsy.com/documentation/reference#tag/ShopListing-Video) resource and supporting methods. +* Add new [ProductionPartner](https://developers.etsy.com/documentation/reference#tag/Shop-ProductionPartner) resource and supporting methods. +* Add new [ReturnPolicy](https://developers.etsy.com/documentation/reference#tag/Shop-Return-Policy) resource and supporting methods. + +--- + ## v0.3.4 ### Fixed issues * Add pagination support for the Receipt resource. [Issue #15](https://github.com/rhysnhall/etsy-php-sdk/issues/15) diff --git a/composer.json b/composer.json index ef19d17..eed1a65 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "erankco/etsy-php-sdk", - "version": "0.4", + "name": "rhysnhall/etsy-php-sdk", + "version": "0.4.0", "description": "PHP SDK for Etsy API v3.", "type": "library", "keywords": [