From e9b8939899e0634a37b7fb6418ec9f0ec6aaddef Mon Sep 17 00:00:00 2001 From: Phobetor Date: Tue, 28 Mar 2017 19:04:37 +0200 Subject: [PATCH 1/6] fixed typo --- docs/guide/migration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/migration.rst b/docs/guide/migration.rst index 04dac2426..16aea2892 100644 --- a/docs/guide/migration.rst +++ b/docs/guide/migration.rst @@ -193,7 +193,7 @@ The pre-version 1 SDK would throw a ``DTS\eBaySDK\Exceptions\UnknownConfiguratio 'non-existent' => true ]); -HttpClient paramter and method has been removed +HttpClient parameter and method have been removed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Version 1 introduced the new :ref:`httpHandler ` configuration option which replaced both the ``httpClient`` parameter and method. From 3d0b788f4aa3f0c87fab5adba0e4aac7e7c01540 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Tue, 23 May 2017 20:55:47 +0100 Subject: [PATCH 2/6] fix: renamed state to cancelState and status to cancelStatus close #87 --- CHANGELOG.md | 7 +++++++ src/PostOrder/Types/CancelSummary.php | 12 ++++++------ test/property_fixes/PropertyFixesTest.php | 24 +++++++++++++++++++++++ 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 test/property_fixes/PropertyFixesTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index ac70d3fe5..d5c5daf71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG +## Unreleased + +### Fixes + +* renamed state to cancelState and status to cancelStatus. + This matches the properties returned by the API. + ## 11.0.0 - 2017-03-20 ### Breaking changes diff --git a/src/PostOrder/Types/CancelSummary.php b/src/PostOrder/Types/CancelSummary.php index 8800601ee..d9e55c9c8 100644 --- a/src/PostOrder/Types/CancelSummary.php +++ b/src/PostOrder/Types/CancelSummary.php @@ -25,8 +25,8 @@ * @property \DTS\eBaySDK\PostOrder\Types\Amount $requestRefundAmount * @property \DTS\eBaySDK\PostOrder\Types\DateTime $sellerResponseDueDate * @property \DTS\eBaySDK\PostOrder\Types\DateTime $shipmentDate - * @property string $state - * @property string $status + * @property string $cancelState + * @property string $cancelStatus */ class CancelSummary extends \DTS\eBaySDK\Types\BaseType { @@ -112,17 +112,17 @@ class CancelSummary extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'shipmentDate' ], - 'state' => [ + 'cancelState' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'state' + 'elementName' => 'cancelState' ], - 'status' => [ + 'cancelStatus' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'status' + 'elementName' => 'cancelStatus' ] ]; diff --git a/test/property_fixes/PropertyFixesTest.php b/test/property_fixes/PropertyFixesTest.php new file mode 100644 index 000000000..bc67b62af --- /dev/null +++ b/test/property_fixes/PropertyFixesTest.php @@ -0,0 +1,24 @@ +assertEquals(null, $obj->cancelState); + $this->assertEquals(null, $obj->cancelStatus); + } +} From d165dc812ad206bef3efad0c323d1ec380adfda9 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Tue, 23 May 2017 21:10:53 +0100 Subject: [PATCH 3/6] fix: change type from integer to string Properties changed to string to match what is returned via the API. ItemEligibilityResult::itemId ItemEligibilityResult::transactionId close #88 --- CHANGELOG.md | 3 ++- src/PostOrder/Types/ItemEligibilityResult.php | 8 ++++---- test/property_fixes/PropertyFixesTest.php | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5c5daf71..1a049165c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ ### Fixes -* renamed state to cancelState and status to cancelStatus. +* Renamed state to cancelState and status to cancelStatus. This matches the properties returned by the API. +* Changed type from integer to string for ItemEligibilityResult::itemId and ItemEligibilityResult::transactionId ## 11.0.0 - 2017-03-20 diff --git a/src/PostOrder/Types/ItemEligibilityResult.php b/src/PostOrder/Types/ItemEligibilityResult.php index ffdf7fa5a..0d24281a4 100644 --- a/src/PostOrder/Types/ItemEligibilityResult.php +++ b/src/PostOrder/Types/ItemEligibilityResult.php @@ -14,8 +14,8 @@ * * @property boolean $eligible * @property \DTS\eBaySDK\PostOrder\Enums\EligibilityFailureReasonEnum[] $failureReason - * @property integer $itemId - * @property integer $transactionId + * @property string $itemId + * @property string $transactionId */ class ItemEligibilityResult extends \DTS\eBaySDK\Types\BaseType { @@ -36,13 +36,13 @@ class ItemEligibilityResult extends \DTS\eBaySDK\Types\BaseType 'elementName' => 'failureReason' ], 'itemId' => [ - 'type' => 'integer', + 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'itemId' ], 'transactionId' => [ - 'type' => 'integer', + 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'transactionId' diff --git a/test/property_fixes/PropertyFixesTest.php b/test/property_fixes/PropertyFixesTest.php index bc67b62af..7e199b28f 100644 --- a/test/property_fixes/PropertyFixesTest.php +++ b/test/property_fixes/PropertyFixesTest.php @@ -21,4 +21,19 @@ public function testCancelSummary() $this->assertEquals(null, $obj->cancelState); $this->assertEquals(null, $obj->cancelStatus); } + + /** + * Incorrect documentation https://developer.ebay.com/Devzone/post-order/types/ItemEligibilityResult.html + * Example of correct property names returned in the API https://developer.ebay.com/Devzone/post-order/post-order_v2_cancellation__post.html#Samples + */ + public function testItemEligibilityResult() + { + $obj = new Sdk\PostOrder\Types\ItemEligibilityResult(); + + $obj->itemId = '123'; + $this->assertInternalType('string', $obj->itemId); + + $obj->transactionId = '123'; + $this->assertInternalType('string', $obj->transactionId); + } } From 04adcae71c31bf90d4bd95a21fbef185f3d23597 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Tue, 23 May 2017 21:18:53 +0100 Subject: [PATCH 4/6] fix: add missing property to error Added subdomain to PostOrder\Error close #89 --- CHANGELOG.md | 1 + src/PostOrder/Types/Error.php | 7 +++++++ test/property_fixes/PropertyFixesTest.php | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a049165c..53ac7d4b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Renamed state to cancelState and status to cancelStatus. This matches the properties returned by the API. * Changed type from integer to string for ItemEligibilityResult::itemId and ItemEligibilityResult::transactionId +* Added missing subdomain property to PostOrder\Error. ## 11.0.0 - 2017-03-20 diff --git a/src/PostOrder/Types/Error.php b/src/PostOrder/Types/Error.php index 8e837c5e9..70d42e344 100644 --- a/src/PostOrder/Types/Error.php +++ b/src/PostOrder/Types/Error.php @@ -14,6 +14,7 @@ * * @property integer $errorId * @property string $domain + * @property string $subdomain * @property string $severity * @property string $category * @property string $message @@ -39,6 +40,12 @@ class Error extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'domain' ], + 'subdomain' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'subdomain' + ], 'severity' => [ 'type' => 'string', 'repeatable' => false, diff --git a/test/property_fixes/PropertyFixesTest.php b/test/property_fixes/PropertyFixesTest.php index 7e199b28f..e408aafed 100644 --- a/test/property_fixes/PropertyFixesTest.php +++ b/test/property_fixes/PropertyFixesTest.php @@ -36,4 +36,12 @@ public function testItemEligibilityResult() $obj->transactionId = '123'; $this->assertInternalType('string', $obj->transactionId); } + + public function testError() + { + $obj = new Sdk\PostOrder\Types\Error(); + + $obj->subdomain = '123'; + $this->assertInternalType('string', $obj->subdomain); + } } From 3ca3ea304f30a0c4594725bed66f9784ea14f8f3 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Tue, 23 May 2017 21:35:45 +0100 Subject: [PATCH 5/6] fix: add missing discountAmount Added missing property discountAmount to Fulfillment\DeliveryCost close #95 --- CHANGELOG.md | 1 + src/Fulfillment/Types/DeliveryCost.php | 9 ++++++++- test/property_fixes/PropertyFixesTest.php | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53ac7d4b7..126a8b7a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This matches the properties returned by the API. * Changed type from integer to string for ItemEligibilityResult::itemId and ItemEligibilityResult::transactionId * Added missing subdomain property to PostOrder\Error. +* Added missing discountAmount property to Fulfillment\DeliveryCost. ## 11.0.0 - 2017-03-20 diff --git a/src/Fulfillment/Types/DeliveryCost.php b/src/Fulfillment/Types/DeliveryCost.php index fd9043c75..88113b56b 100644 --- a/src/Fulfillment/Types/DeliveryCost.php +++ b/src/Fulfillment/Types/DeliveryCost.php @@ -15,6 +15,7 @@ * @property \DTS\eBaySDK\Fulfillment\Types\Amount $importCharges * @property \DTS\eBaySDK\Fulfillment\Types\Amount $shippingCost * @property \DTS\eBaySDK\Fulfillment\Types\Amount $shippingIntermediationFee + * @property \DTS\eBaySDK\Fulfillment\Types\Amount $discountAmount */ class DeliveryCost extends \DTS\eBaySDK\Types\BaseType { @@ -39,7 +40,13 @@ class DeliveryCost extends \DTS\eBaySDK\Types\BaseType 'repeatable' => false, 'attribute' => false, 'elementName' => 'shippingIntermediationFee' - ] + ], + 'discountAmount' => [ + 'type' => 'DTS\eBaySDK\Fulfillment\Types\Amount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'discountAmount' + ], ]; /** diff --git a/test/property_fixes/PropertyFixesTest.php b/test/property_fixes/PropertyFixesTest.php index e408aafed..b53a4709b 100644 --- a/test/property_fixes/PropertyFixesTest.php +++ b/test/property_fixes/PropertyFixesTest.php @@ -44,4 +44,12 @@ public function testError() $obj->subdomain = '123'; $this->assertInternalType('string', $obj->subdomain); } + + public function testDeliveryCost() + { + $obj = new Sdk\Fulfillment\Types\DeliveryCost(); + + $obj->discountAmount = new Sdk\Fulfillment\Types\Amount(); + $this->assertInstanceOf('\DTS\eBaySDK\Fulfillment\Types\Amount', $obj->discountAmount); + } } From 1e8677672fed6360629d66fa9ff3cfda09910eea Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Tue, 23 May 2017 21:41:56 +0100 Subject: [PATCH 6/6] update: bump version to 12.0.0 --- CHANGELOG.md | 2 +- src/Sdk.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 126a8b7a5..88872a2c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## Unreleased +## 12.0.0 - 2017-05-23 ### Fixes diff --git a/src/Sdk.php b/src/Sdk.php index 923f6ea6d..79d0e1d42 100644 --- a/src/Sdk.php +++ b/src/Sdk.php @@ -30,7 +30,7 @@ */ class Sdk { - const VERSION = '11.0.0'; + const VERSION = '12.0.0'; /** * @var bool Controls if the SDK should enforce strict types