From 4446946faef893c0d84567d8130432437b1320bb Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sat, 12 Jun 2021 22:48:01 +0100 Subject: [PATCH 1/5] Update README.md --- README.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a689f2a607..518e47af5f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This project enables PHP developers to use the [eBay API](https://go.developer.ebay.com/api-documentation) in their PHP code, and build software using services such as [Finding](http://developer.ebay.com/Devzone/finding/Concepts/FindingAPIGuide.html), [Trading](http://developer.ebay.com/DevZone/guides/ebayfeatures/index.html), [Shopping](http://developer.ebay.com/Devzone/shopping/docs/Concepts/ShoppingAPIGuide.html), etc. You can get started by [installing the SDK via Composer](http://devbay.net/sdk/guides/getting-started/installation.html) and by following the [Basic Usage Guide](http://devbay.net/sdk/guides/getting-started/basic-usage.html). -This is a personal project that has been developed by me, [David T. Sadler](http://twitter.com/davidtsadler). I decided to create this project to make up for the lack of an official SDK for PHP. It is in no way endorsed, sponsored or maintained by eBay. +This is a personal project that has been developed by me, [David T. Sadler](https://davidtsadler.com). I decided to create this project to make up for the lack of an official SDK for PHP. It is in no way endorsed, sponsored or maintained by eBay. ## Features @@ -14,11 +14,9 @@ This is a personal project that has been developed by me, [David T. Sadler](http ## Resources - - [User Guides](http://devbay.net/sdk/guides/) - Getting started guide and in-depth information. + - [User Guides](https://github.com/davidtsadler/ebay-sdk-php/wiki) - Getting started guide and in-depth information. - [Examples](https://github.com/davidtsadler/ebay-sdk-examples) - Several examples of using the SDK. - - [Google Group](https://groups.google.com/forum/#!forum/ebay-sdk-php) - Join for support with the SDK. - - [@devbaydotnet](https://twitter.com/devbaydotnet) - Follow on Twitter for announcements of releases, important changes and so on. - + ## Requirements - PHP 5.5 or greater with the following extensions: @@ -74,13 +72,6 @@ $response = $service->geteBayTime($request); printf("The official eBay time is: %s\n", $response->Timestamp->format('H:i (\G\M\T) \o\n l jS Y')); ``` -## Project Goals - - - Be well maintained. - - Be [well documented](http://devbay.net/sdk/guides/). - - Be [well tested](https://github.com/davidtsadler/ebay-sdk-php/tree/master/test). - - Be well supported with [working examples](https://github.com/davidtsadler/ebay-sdk-examples). - ## License Licensed under the [Apache Public License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). From 620a0812e3a7b64596fc83b16f7f9d5300583a89 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sat, 12 Jun 2021 22:48:50 +0100 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 518e47af5f..51ef8f5746 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **This repository is no longer actively maintained and has been archived.** -This project enables PHP developers to use the [eBay API](https://go.developer.ebay.com/api-documentation) in their PHP code, and build software using services such as [Finding](http://developer.ebay.com/Devzone/finding/Concepts/FindingAPIGuide.html), [Trading](http://developer.ebay.com/DevZone/guides/ebayfeatures/index.html), [Shopping](http://developer.ebay.com/Devzone/shopping/docs/Concepts/ShoppingAPIGuide.html), etc. You can get started by [installing the SDK via Composer](http://devbay.net/sdk/guides/getting-started/installation.html) and by following the [Basic Usage Guide](http://devbay.net/sdk/guides/getting-started/basic-usage.html). +This project enables PHP developers to use the [eBay API](https://go.developer.ebay.com/api-documentation) in their PHP code, and build software using services such as [Finding](http://developer.ebay.com/Devzone/finding/Concepts/FindingAPIGuide.html), [Trading](http://developer.ebay.com/DevZone/guides/ebayfeatures/index.html), [Shopping](http://developer.ebay.com/Devzone/shopping/docs/Concepts/ShoppingAPIGuide.html), etc. You can get started by [installing the SDK via Composer](https://github.com/davidtsadler/ebay-sdk-php/wiki/Installation) and by following the [Basic Usage Guide](http://devbay.net/sdk/guides/getting-started/basic-usage.html). This is a personal project that has been developed by me, [David T. Sadler](https://davidtsadler.com). I decided to create this project to make up for the lack of an official SDK for PHP. It is in no way endorsed, sponsored or maintained by eBay. From 744dc96f3a82b14a494ed5f8b05708c87bc297ea Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sat, 12 Jun 2021 22:49:38 +0100 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51ef8f5746..3bf57949a2 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This is a personal project that has been developed by me, [David T. Sadler](http ## Installation -The SDK can be installed with [Composer](http://getcomposer.org/). Please see the [Installation section of the User Guide](http://devbay.net/sdk/guides/getting-started/installation.html) to learn about installing through other means. +The SDK can be installed with [Composer](http://getcomposer.org/). Please see the [Installation section of the User Guide](https://github.com/davidtsadler/ebay-sdk-php/wiki/Installation) to learn about installing through other means. 1. Install Composer. From 9425ff585b02f4569e90c2072eecd7882a6ac82c Mon Sep 17 00:00:00 2001 From: Chris Lock Date: Mon, 2 Dec 2024 11:55:36 +0000 Subject: [PATCH 4/5] Content-Language is required in the InventoryAPI See https://developer.ebay.com/api-docs/sell/inventory/resources/inventory_item/methods/createOrReplaceInventoryItem --- src/Services/BaseRestService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Services/BaseRestService.php b/src/Services/BaseRestService.php index 8dbf3479ed..81c6a7886d 100644 --- a/src/Services/BaseRestService.php +++ b/src/Services/BaseRestService.php @@ -222,8 +222,9 @@ private function buildRequestHeaders($body) $headers['Accept'] = 'application/json'; $headers['Content-Type'] = 'application/json'; $headers['Content-Length'] = strlen($body); + // Default to en-US but allow user to change it + $headers[self::HDR_REQUEST_LANGUAGE] = 'en-US'; - // Add optional headers. if ($this->getConfig('requestLanguage')) { $headers[self::HDR_REQUEST_LANGUAGE] = $this->getConfig('requestLanguage'); } From 654e47d59391456dea1ebf38173a71b68635a035 Mon Sep 17 00:00:00 2001 From: Chris Lock Date: Mon, 2 Dec 2024 22:07:38 +0000 Subject: [PATCH 5/5] Limiting change to the relevant service Changed tests to ensure it's required --- src/Inventory/Services/InventoryBaseService.php | 4 +++- src/Services/BaseRestService.php | 3 +-- test/Inventory/Services/ServiceTest.php | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Inventory/Services/InventoryBaseService.php b/src/Inventory/Services/InventoryBaseService.php index 862121f7ff..8bbf452156 100644 --- a/src/Inventory/Services/InventoryBaseService.php +++ b/src/Inventory/Services/InventoryBaseService.php @@ -40,6 +40,8 @@ public function __construct(array $config) public static function getConfigDefinitions() { $definitions = parent::getConfigDefinitions(); + $definitions['requestLanguage']['default'] = 'en-US'; + $definitions['requestLanguage']['required'] = true; return $definitions + [ 'apiVersion' => [ @@ -53,7 +55,7 @@ public static function getConfigDefinitions() ], 'marketplaceId' => [ 'valid' => ['string'] - ] + ], ]; } diff --git a/src/Services/BaseRestService.php b/src/Services/BaseRestService.php index 81c6a7886d..8dbf3479ed 100644 --- a/src/Services/BaseRestService.php +++ b/src/Services/BaseRestService.php @@ -222,9 +222,8 @@ private function buildRequestHeaders($body) $headers['Accept'] = 'application/json'; $headers['Content-Type'] = 'application/json'; $headers['Content-Length'] = strlen($body); - // Default to en-US but allow user to change it - $headers[self::HDR_REQUEST_LANGUAGE] = 'en-US'; + // Add optional headers. if ($this->getConfig('requestLanguage')) { $headers[self::HDR_REQUEST_LANGUAGE] = $this->getConfig('requestLanguage'); } diff --git a/test/Inventory/Services/ServiceTest.php b/test/Inventory/Services/ServiceTest.php index 76ebd34585..f22cc2ad2d 100644 --- a/test/Inventory/Services/ServiceTest.php +++ b/test/Inventory/Services/ServiceTest.php @@ -29,6 +29,12 @@ public function testConfigDefinitions() $this->assertEquals([ 'valid' => ['string'] ], $d['marketplaceId']); + $this->assertArrayHasKey('requestLanguage', $d); + $this->assertEquals([ + 'valid' => ['string'], + 'default' => 'en-US', + 'required' => true + ], $d['requestLanguage']); } public function testRequiredEbayHeaders()