Skip to content

Commit 317b266

Browse files
authored
Merge pull request #151 from CPIGroup/master
Version 1.4.1
2 parents 7ab8701 + 674e265 commit 317b266

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## 1.4.1 - 2018-01-19
6+
### Changed
7+
- Fixed parameter names for Product Fees Estimates
8+
59
## 1.4.0 - 2017-11-17
610
### Added
711
- Travis support for PHP 7.1 and 7.2

includes/classes/AmazonProductFeeEstimate.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ public function setRequests($a){
9595
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.MarketplaceId'] = $x['MarketplaceId'];
9696
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IdType'] = $x['IdType'];
9797
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IdValue'] = $x['IdValue'];
98-
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.ListingPrice.CurrencyCode'] = $x['ListingPrice']['CurrencyCode'];
99-
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.ListingPrice.Value'] = $x['ListingPrice']['Value'];
98+
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.ListingPrice.CurrencyCode'] = $x['ListingPrice']['CurrencyCode'];
99+
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.ListingPrice.Amount'] = $x['ListingPrice']['Value'];
100100
if (isset($x['Shipping']) && is_array($x['Shipping'])){
101-
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Shipping.CurrencyCode'] = $x['Shipping']['CurrencyCode'];
102-
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Shipping.Value'] = $x['Shipping']['Value'];
101+
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Shipping.CurrencyCode'] = $x['Shipping']['CurrencyCode'];
102+
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Shipping.Amount'] = $x['Shipping']['Value'];
103103
}
104104
if (array_key_exists('Points', $x)){
105-
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Points.PointsNumber'] = $x['Points'];
105+
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Points.PointsNumber'] = $x['Points'];
106106
}
107107
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Identifier'] = $x['Identifier'];
108108
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IsAmazonFulfilled'] = $x['IsAmazonFulfilled'];

test-cases/includes/classes/AmazonProductFeeEstimateTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,22 @@ public function testSetRequest() {
6262
$this->assertEquals('ASIN', $o[$pre.'1.IdType']);
6363
$this->assertArrayHasKey($pre.'1.IdValue', $o);
6464
$this->assertEquals('B00123ASIN', $o[$pre.'1.IdValue']);
65-
$this->assertArrayHasKey($pre.'1.ListingPrice.CurrencyCode', $o);
66-
$this->assertEquals('USD', $o[$pre.'1.ListingPrice.CurrencyCode']);
67-
$this->assertArrayHasKey($pre.'1.ListingPrice.Value', $o);
68-
$this->assertEquals('123', $o[$pre.'1.ListingPrice.Value']);
65+
$this->assertArrayHasKey($pre.'1.PriceToEstimateFees.ListingPrice.CurrencyCode', $o);
66+
$this->assertEquals('USD', $o[$pre.'1.PriceToEstimateFees.ListingPrice.CurrencyCode']);
67+
$this->assertArrayHasKey($pre.'1.PriceToEstimateFees.ListingPrice.Amount', $o);
68+
$this->assertEquals('123', $o[$pre.'1.PriceToEstimateFees.ListingPrice.Amount']);
6969
$this->assertArrayHasKey($pre.'1.Identifier', $o);
7070
$this->assertEquals('TEST123', $o[$pre.'1.Identifier']);
7171
$this->assertArrayHasKey($pre.'1.IsAmazonFulfilled', $o);
7272
$this->assertEquals('false', $o[$pre.'1.IsAmazonFulfilled']);
7373
$this->assertArrayHasKey($pre.'2.MarketplaceId', $o);
7474
$this->assertEquals('Mark II', $o[$pre.'2.MarketplaceId']);
75-
$this->assertArrayHasKey($pre.'2.Shipping.CurrencyCode', $o);
76-
$this->assertEquals('USD', $o[$pre.'2.Shipping.CurrencyCode']);
77-
$this->assertArrayHasKey($pre.'2.Shipping.Value', $o);
78-
$this->assertEquals('1.23', $o[$pre.'2.Shipping.Value']);
79-
$this->assertArrayHasKey($pre.'2.Points.PointsNumber', $o);
80-
$this->assertEquals('3', $o[$pre.'2.Points.PointsNumber']);
75+
$this->assertArrayHasKey($pre.'2.PriceToEstimateFees.Shipping.CurrencyCode', $o);
76+
$this->assertEquals('USD', $o[$pre.'2.PriceToEstimateFees.Shipping.CurrencyCode']);
77+
$this->assertArrayHasKey($pre.'2.PriceToEstimateFees.Shipping.Amount', $o);
78+
$this->assertEquals('1.23', $o[$pre.'2.PriceToEstimateFees.Shipping.Amount']);
79+
$this->assertArrayHasKey($pre.'2.PriceToEstimateFees.Points.PointsNumber', $o);
80+
$this->assertEquals('3', $o[$pre.'2.PriceToEstimateFees.Points.PointsNumber']);
8181

8282
//setting again should reset
8383
$this->assertNull($this->object->setRequests(array($op)));

0 commit comments

Comments
 (0)