handleError(new Exception(sprintf("Discount type '%s' not supported", $type))); } $this->type = $type; $this->value = floatval($value); $this->currencyCode = $context->getCurrencyCode(); } }