protected function addLineItems(array $params, array $options)
    {
        $currency = Arr::get($options, 'currency', $this->gateway->getCurrency());

        $items = [];
        $itemsTotal = 0;
        foreach (Arr::get($options, 'line_items', []) as $item) {
            $items[] = [
                'name'        => $item['name'],
                'description' => Arr::get($item, 'description'),
                'quantity'    => $item['quantity'],
                'price'       => $this->gateway->amount($item['unit_price']),
                'sku'         => Arr::get($item, 'sku'),
                'currency'    => $currency,
            ];
            $itemsTotal += $item['unit_price'] * $item['quantity'];
        }

        if (!empty($items)) {
            $params['transactions'][0]['item_list']['items'] = $items;
            $params['transactions'][0]['amount']['details']['subtotal'] = $this->gateway->amount($itemsTotal);
        }

        return $params;
    }
protected function addLineItems(array $params, array $options)
    {
        $currency = Arr::get($options, 'currency', $this->gateway->getCurrency());

        $items = [];
        $itemsTotal = 0;
        foreach (Arr::get($options, 'line_items', []) as $item) {
            $items[] = [
                'name'        => $item['name'],
                'description' => Arr::get($item, 'description'),
                'quantity'    => $item['quantity'],
                'price'       => $this->gateway->amount($item['unit_price']),
                'sku'         => Arr::get($item, 'sku'),
                'currency'    => $currency,
            ];
            $itemsTotal += $item['unit_price'] * $item['quantity'];
        }

        if (!empty($items)) {
            $params['transactions'][0]['item_list']['items'] = $items;
            $params['transactions'][0]['amount']['details']['subtotal'] = $this->gateway->amount($itemsTotal);
        }

        return $params;
    }
protected function addLineItems ( array $ params , array $ options ) { $ currency = Arr :: get ( $ options , 'currency' , $ this -> gateway -> getCurrency ( ) ) ; $ items = [ ] ; $ itemsTotal = 0 ; foreach ( Arr :: get ( $ options , 'line_items' , [ ] ) as $ item ) { $ items [ ] = [ 'name' => $ item [ 'name' ] , 'description' => Arr :: get ( $ item , 'description' ) , 'quantity' => $ item [ 'quantity' ] , 'price' => $ this -> gateway -> amount ( $ item [ 'unit_price' ] ) , 'sku' => Arr :: get ( $ item , 'sku' ) , 'currency' => $ currency , ] ; $ itemsTotal += $ item [ 'unit_price' ] * $ item [ 'quantity' ] ; } if ( ! empty ( $ items ) ) { $ params [ 'transactions' ] [ 0 ] [ 'item_list' ] [ 'items' ] = $ items ; $ params [ 'transactions' ] [ 0 ] [ 'amount' ] [ 'details' ] [ 'subtotal' ] = $ this -> gateway -> amount ( $ itemsTotal ) ; } return $ params ; }
Add order line items params.

@param string[] $params
@param string[] $options

@return array
Add order line items params .