diff --git a/CHANGELOG.md b/CHANGELOG.md index becd5e3b..0c11d32e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 1.4.1 - 2018-01-19 +### Changed + - Fixed parameter names for Product Fees Estimates + ## 1.4.0 - 2017-11-17 ### Added - Travis support for PHP 7.1 and 7.2 diff --git a/includes/classes/AmazonProductFeeEstimate.php b/includes/classes/AmazonProductFeeEstimate.php index 5cfa711b..435e4d44 100644 --- a/includes/classes/AmazonProductFeeEstimate.php +++ b/includes/classes/AmazonProductFeeEstimate.php @@ -95,14 +95,14 @@ public function setRequests($a){ $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.MarketplaceId'] = $x['MarketplaceId']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IdType'] = $x['IdType']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IdValue'] = $x['IdValue']; - $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.ListingPrice.CurrencyCode'] = $x['ListingPrice']['CurrencyCode']; - $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.ListingPrice.Value'] = $x['ListingPrice']['Value']; + $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.ListingPrice.CurrencyCode'] = $x['ListingPrice']['CurrencyCode']; + $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.ListingPrice.Amount'] = $x['ListingPrice']['Value']; if (isset($x['Shipping']) && is_array($x['Shipping'])){ - $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Shipping.CurrencyCode'] = $x['Shipping']['CurrencyCode']; - $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Shipping.Value'] = $x['Shipping']['Value']; + $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Shipping.CurrencyCode'] = $x['Shipping']['CurrencyCode']; + $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Shipping.Amount'] = $x['Shipping']['Value']; } if (array_key_exists('Points', $x)){ - $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Points.PointsNumber'] = $x['Points']; + $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Points.PointsNumber'] = $x['Points']; } $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Identifier'] = $x['Identifier']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IsAmazonFulfilled'] = $x['IsAmazonFulfilled']; diff --git a/test-cases/includes/classes/AmazonProductFeeEstimateTest.php b/test-cases/includes/classes/AmazonProductFeeEstimateTest.php index 3c40a593..3a6a4493 100644 --- a/test-cases/includes/classes/AmazonProductFeeEstimateTest.php +++ b/test-cases/includes/classes/AmazonProductFeeEstimateTest.php @@ -62,22 +62,22 @@ public function testSetRequest() { $this->assertEquals('ASIN', $o[$pre.'1.IdType']); $this->assertArrayHasKey($pre.'1.IdValue', $o); $this->assertEquals('B00123ASIN', $o[$pre.'1.IdValue']); - $this->assertArrayHasKey($pre.'1.ListingPrice.CurrencyCode', $o); - $this->assertEquals('USD', $o[$pre.'1.ListingPrice.CurrencyCode']); - $this->assertArrayHasKey($pre.'1.ListingPrice.Value', $o); - $this->assertEquals('123', $o[$pre.'1.ListingPrice.Value']); + $this->assertArrayHasKey($pre.'1.PriceToEstimateFees.ListingPrice.CurrencyCode', $o); + $this->assertEquals('USD', $o[$pre.'1.PriceToEstimateFees.ListingPrice.CurrencyCode']); + $this->assertArrayHasKey($pre.'1.PriceToEstimateFees.ListingPrice.Amount', $o); + $this->assertEquals('123', $o[$pre.'1.PriceToEstimateFees.ListingPrice.Amount']); $this->assertArrayHasKey($pre.'1.Identifier', $o); $this->assertEquals('TEST123', $o[$pre.'1.Identifier']); $this->assertArrayHasKey($pre.'1.IsAmazonFulfilled', $o); $this->assertEquals('false', $o[$pre.'1.IsAmazonFulfilled']); $this->assertArrayHasKey($pre.'2.MarketplaceId', $o); $this->assertEquals('Mark II', $o[$pre.'2.MarketplaceId']); - $this->assertArrayHasKey($pre.'2.Shipping.CurrencyCode', $o); - $this->assertEquals('USD', $o[$pre.'2.Shipping.CurrencyCode']); - $this->assertArrayHasKey($pre.'2.Shipping.Value', $o); - $this->assertEquals('1.23', $o[$pre.'2.Shipping.Value']); - $this->assertArrayHasKey($pre.'2.Points.PointsNumber', $o); - $this->assertEquals('3', $o[$pre.'2.Points.PointsNumber']); + $this->assertArrayHasKey($pre.'2.PriceToEstimateFees.Shipping.CurrencyCode', $o); + $this->assertEquals('USD', $o[$pre.'2.PriceToEstimateFees.Shipping.CurrencyCode']); + $this->assertArrayHasKey($pre.'2.PriceToEstimateFees.Shipping.Amount', $o); + $this->assertEquals('1.23', $o[$pre.'2.PriceToEstimateFees.Shipping.Amount']); + $this->assertArrayHasKey($pre.'2.PriceToEstimateFees.Points.PointsNumber', $o); + $this->assertEquals('3', $o[$pre.'2.PriceToEstimateFees.Points.PointsNumber']); //setting again should reset $this->assertNull($this->object->setRequests(array($op)));