private static function initInternalItem(
        $product_reference,
        $name,
        $quantity,
        $unit_price,
        $tax_rate,
        $discount,
        $total_amount,
        $type,
        $discount_description = null
    ) {
        $cartItem = new Item();
        $cartItem->setProductReference($product_reference)
            ->setName($name)
            ->setType($type)
            ->setQuantity($quantity)
            ->setUnitPrice($unit_price)
            ->setTaxRate($tax_rate)
            ->setDiscount($discount)
            ->setTotalAmount($total_amount);

        if ($type == TypeItems::DISCOUNT) {
            $cartItem->setDiscountDescription($discount_description);
        }

        return $cartItem;
    }
private static function initInternalItem(
        $product_reference,
        $name,
        $quantity,
        $unit_price,
        $tax_rate,
        $discount,
        $total_amount,
        $type,
        $discount_description = null
    ) {
        $cartItem = new Item();
        $cartItem->setProductReference($product_reference)
            ->setName($name)
            ->setType($type)
            ->setQuantity($quantity)
            ->setUnitPrice($unit_price)
            ->setTaxRate($tax_rate)
            ->setDiscount($discount)
            ->setTotalAmount($total_amount);

        if ($type == TypeItems::DISCOUNT) {
            $cartItem->setDiscountDescription($discount_description);
        }

        return $cartItem;
    }
private static function initInternalItem ( $ product_reference , $ name , $ quantity , $ unit_price , $ tax_rate , $ discount , $ total_amount , $ type , $ discount_description = null ) { $ cartItem = new Item ( ) ; $ cartItem -> setProductReference ( $ product_reference ) -> setName ( $ name ) -> setType ( $ type ) -> setQuantity ( $ quantity ) -> setUnitPrice ( $ unit_price ) -> setTaxRate ( $ tax_rate ) -> setDiscount ( $ discount ) -> setTotalAmount ( $ total_amount ) ; if ( $ type == TypeItems :: DISCOUNT ) { $ cartItem -> setDiscountDescription ( $ discount_description ) ; } return $ cartItem ; }
Hydrate generic item

@param string $product_reference
@param string $name
@param int $quantity
@param float $unit_price
@param float $tax_rate
@param float $discount
@param float $total_amount
@param string $discount_description
@param string $type
@return \HiPay\Fullservice\Gateway\Model\Cart\Item
Hydrate generic item