/** * Call the fees endpoint of the Research API and return the response. * * @param string $asin * @param float $price * * @return FeesResponse */ public function getFees($asin, $price) { Arguments::contain(Boa::string(), Boa::float())->check($asin, $price); return (new FeesResponseFactory())->makeFromResponse($this->client->get(vsprintf('/v1/fees/%s', [$asin]), ['query' => ['price' => $price]])); }
/** * Check if a value is between two other values. * * @param int|float $min * @param int|float $max * @param int|float $value * * @throws LackOfCoffeeException * @return bool */ public static function within($min, $max, $value) { Arguments::define(Boa::either(Boa::integer(), Boa::float()), Boa::either(Boa::integer(), Boa::float()), Boa::either(Boa::integer(), Boa::float()))->check($min, $max, $value); if ($min > $max) { throw new LackOfCoffeeException('Max value is less than the min value.'); } return $min <= $value && $max >= $value; }