Skip to content

Commit f2dcfa7

Browse files
luigelPeardian
authored andcommitted
Update AmazonProductFeeEstimate.php (CPIGroup#147)
* Update AmazonProductFeeEstimate.php Edited the option key for the listing prices so the amazon can get the data. Refer to the scratchpad product api labels. * Update AmazonProductFeeEstimateTest.php
1 parent b3e6b0c commit f2dcfa7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

includes/classes/AmazonProductFeeEstimate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ 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'])){
101101
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Shipping.CurrencyCode'] = $x['Shipping']['CurrencyCode'];
102102
$this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Shipping.Value'] = $x['Shipping']['Value'];

test-cases/includes/classes/AmazonProductFeeEstimateTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ 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->assertEquals('USD', $o[$pre.'1.PriceToEstimateFees.ListingPrice.CurrencyCode']);
66+
$this->assertArrayHasKey($pre.'1.PriceToEstimateFees.ListingPrice.CurrencyCode', $o);
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);

0 commit comments

Comments
 (0)