diff --git a/includes/classes/AmazonProductFeeEstimate.php b/includes/classes/AmazonProductFeeEstimate.php index 2f52b144..435e4d44 100644 --- a/includes/classes/AmazonProductFeeEstimate.php +++ b/includes/classes/AmazonProductFeeEstimate.php @@ -98,11 +98,11 @@ public function setRequests($a){ $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 09c9310f..3a6a4493 100644 --- a/test-cases/includes/classes/AmazonProductFeeEstimateTest.php +++ b/test-cases/includes/classes/AmazonProductFeeEstimateTest.php @@ -62,8 +62,8 @@ public function testSetRequest() { $this->assertEquals('ASIN', $o[$pre.'1.IdType']); $this->assertArrayHasKey($pre.'1.IdValue', $o); $this->assertEquals('B00123ASIN', $o[$pre.'1.IdValue']); - $this->assertEquals('USD', $o[$pre.'1.PriceToEstimateFees.ListingPrice.CurrencyCode']); $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); @@ -72,12 +72,12 @@ public function testSetRequest() { $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)));