src/Genesis/API/Request/Financial/Alternatives/Klarna/Item.php
public function setItemType($value)
    {
        $this->verifyRequiredField('item_type', $value);

        // check if it is valid type
        $item_types = array(
            self::ITEM_TYPE_PHYSICAL,
            self::ITEM_TYPE_DISCOUNT,
            self::ITEM_TYPE_SHIPPING_FEE,
            self::ITEM_TYPE_DIGITAL,
            self::ITEM_TYPE_GIFT_CARD,
            self::ITEM_TYPE_STORE_CREDIT,
            self::ITEM_TYPE_SURCHARGE
        );
        if (!in_array($value, $item_types)) {
            throw new \Genesis\Exceptions\ErrorParameter(
                sprintf(
                    'Required item parameter item_type is set to %s, but expected to be one of (%s)',
                    $value,
                    implode(
                        ', ',
                        CommonUtils::getSortedArrayByValue($item_types)
                    )
                )
            );
        }

        $this->item_type = $value;
        return $this;
    }
public function setItemType($value)
    {
        $this->verifyRequiredField('item_type', $value);

        // check if it is valid type
        $item_types = array(
            self::ITEM_TYPE_PHYSICAL,
            self::ITEM_TYPE_DISCOUNT,
            self::ITEM_TYPE_SHIPPING_FEE,
            self::ITEM_TYPE_DIGITAL,
            self::ITEM_TYPE_GIFT_CARD,
            self::ITEM_TYPE_STORE_CREDIT,
            self::ITEM_TYPE_SURCHARGE
        );
        if (!in_array($value, $item_types)) {
            throw new \Genesis\Exceptions\ErrorParameter(
                sprintf(
                    'Required item parameter item_type is set to %s, but expected to be one of (%s)',
                    $value,
                    implode(
                        ', ',
                        CommonUtils::getSortedArrayByValue($item_types)
                    )
                )
            );
        }

        $this->item_type = $value;
        return $this;
    }
public function setItemType ( $ value ) { $ this -> verifyRequiredField ( 'item_type' , $ value ) ; // check if it is valid type $ item_types = array ( self :: ITEM_TYPE_PHYSICAL , self :: ITEM_TYPE_DISCOUNT , self :: ITEM_TYPE_SHIPPING_FEE , self :: ITEM_TYPE_DIGITAL , self :: ITEM_TYPE_GIFT_CARD , self :: ITEM_TYPE_STORE_CREDIT , self :: ITEM_TYPE_SURCHARGE ) ; if ( ! in_array ( $ value , $ item_types ) ) { throw new \ Genesis \ Exceptions \ ErrorParameter ( sprintf ( 'Required item parameter item_type is set to %s, but expected to be one of (%s)' , $ value , implode ( ', ' , CommonUtils :: getSortedArrayByValue ( $ item_types ) ) ) ) ; } $ this -> item_type = $ value ; return $ this ; }
Set item type

@param $value
@return $this
@throws \Genesis\Exceptions\ErrorParameter
Set item type