Skip to content

Commit

Permalink
Merge pull request #151 from CPIGroup/master
Browse files Browse the repository at this point in the history
Version 1.4.1
  • Loading branch information
Peardian authored Jan 19, 2018
2 parents 7ab8701 + 674e265 commit 317b266
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions includes/classes/AmazonProductFeeEstimate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
20 changes: 10 additions & 10 deletions test-cases/includes/classes/AmazonProductFeeEstimateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit 317b266

Please sign in to comment.