/** * Tnransfer data from a tax record model to a tax payload. * * @param EbayEnterprise_Tax_Model_Records * @param ITax * @return ITax */ public function taxRecordToTaxPayload(EbayEnterprise_Tax_Model_Record $taxRecord, ITax $taxPayload) { return $taxPayload->setType($taxRecord->getType())->setTaxability($taxRecord->getTaxability())->setSitus($taxRecord->getSitus())->setJurisdiction($taxRecord->getJurisdiction())->setJurisdictionLevel($taxRecord->getJurisdictionLevel())->setJurisdictionId($taxRecord->getJurisdictionId())->setImposition($taxRecord->getImposition())->setImpositionType($taxRecord->getImpositionType())->setEffectiveRate($taxRecord->getEffectiveRate())->setTaxableAmount($taxRecord->getTaxableAmount())->setCalculatedTax($taxRecord->getCalculatedTax())->setSellerRegistrationId($taxRecord->getSellerRegistrationId()); }
/** * Scenario: Test that the effective rate setter method will not round the value it stores * Given a float value of any precision * When setting the effective rate in the Tax payload * Then, the value will maintain the exact value without rounding it. * * @param float * @dataProvider providerEffectiveRateValueDoNotGetRounded */ public function testEffectiveRateValueDoNotGetRounded($effectiveRate) { $this->assertSame($this->payload, $this->payload->setEffectiveRate($effectiveRate)); $this->assertSame($effectiveRate, $this->payload->getEffectiveRate()); }