Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
12.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
David T. Sadler committed May 23, 2017
2 parents 3f73014 + 1e86776 commit 6b8e12a
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 13 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG

## 12.0.0 - 2017-05-23

### Fixes

* 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.
* Added missing discountAmount property to Fulfillment\DeliveryCost.

## 11.0.0 - 2017-03-20

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <httpHandler>` configuration option which replaced both the ``httpClient`` parameter and method.
Expand Down
9 changes: 8 additions & 1 deletion src/Fulfillment/Types/DeliveryCost.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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'
],
];

/**
Expand Down
12 changes: 6 additions & 6 deletions src/PostOrder/Types/CancelSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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'
]
];

Expand Down
7 changes: 7 additions & 0 deletions src/PostOrder/Types/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*
* @property integer $errorId
* @property string $domain
* @property string $subdomain
* @property string $severity
* @property string $category
* @property string $message
Expand All @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/PostOrder/Types/ItemEligibilityResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/Sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
55 changes: 55 additions & 0 deletions test/property_fixes/PropertyFixesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
namespace DTS\eBaySDK\Types\Test;

use DTS\eBaySDK as Sdk;
/**
* These tests are to cover where we have corrected
* the property names of various classes.
* These names have been incorrectly named in the documentation.
* The names used for the properties are now taken from the actual response from the API.
*/
class PropertyFixesTest extends \PHPUnit_Framework_TestCase
{
/**
* Incorrect documentation https://developer.ebay.com/Devzone/post-order/types/CancelSummary.html
* Example of correct property names returned in the API https://developer.ebay.com/Devzone/post-order/post-order_v2_cancellation_search__get.html#Output
*/
public function testCancelSummary()
{
$obj = new Sdk\PostOrder\Types\CancelSummary();

$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);
}

public function testError()
{
$obj = new Sdk\PostOrder\Types\Error();

$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);
}
}

0 comments on commit 6b8e12a

Please sign in to comment.