protected function addShipping(array $params, array $options)
    {
        if ($address = Arr::get($options, 'shipping_address')) {
            $params['application_context']['shipping_preference'] = 'SET_PROVIDED_ADDRESS';
            $params['transactions'][0]['amount']['details']['shipping'] = $this->gateway
                ->amount(Arr::get($address, 'price', 0));

            $params['transactions'][0]['item_list']['shipping_address'] = [
                'recipient_name' => trim(Arr::get($options, 'name')),
                'line1'          => Arr::get($address, 'address1', ''),
                'line2'          => Arr::get($address, 'address2', ''),
                'city'           => Arr::get($address, 'city', ''),
                'country_code'   => Arr::get($address, 'country', ''),
                'postal_code'    => Arr::get($address, 'zip', ''),
                'state'          => Arr::get($address, 'state', ''),
                'phone'          => Arr::get($options, 'phone', ''),
            ];
        } else {
            $params['application_context']['shipping_preference'] = 'NO_SHIPPING';
        }

        return $params;
    }
protected function addShipping(array $params, array $options)
    {
        if ($address = Arr::get($options, 'shipping_address')) {
            $params['application_context']['shipping_preference'] = 'SET_PROVIDED_ADDRESS';
            $params['transactions'][0]['amount']['details']['shipping'] = $this->gateway
                ->amount(Arr::get($address, 'price', 0));

            $params['transactions'][0]['item_list']['shipping_address'] = [
                'recipient_name' => trim(Arr::get($options, 'name')),
                'line1'          => Arr::get($address, 'address1', ''),
                'line2'          => Arr::get($address, 'address2', ''),
                'city'           => Arr::get($address, 'city', ''),
                'country_code'   => Arr::get($address, 'country', ''),
                'postal_code'    => Arr::get($address, 'zip', ''),
                'state'          => Arr::get($address, 'state', ''),
                'phone'          => Arr::get($options, 'phone', ''),
            ];
        } else {
            $params['application_context']['shipping_preference'] = 'NO_SHIPPING';
        }

        return $params;
    }
protected function addShipping ( array $ params , array $ options ) { if ( $ address = Arr :: get ( $ options , 'shipping_address' ) ) { $ params [ 'application_context' ] [ 'shipping_preference' ] = 'SET_PROVIDED_ADDRESS' ; $ params [ 'transactions' ] [ 0 ] [ 'amount' ] [ 'details' ] [ 'shipping' ] = $ this -> gateway -> amount ( Arr :: get ( $ address , 'price' , 0 ) ) ; $ params [ 'transactions' ] [ 0 ] [ 'item_list' ] [ 'shipping_address' ] = [ 'recipient_name' => trim ( Arr :: get ( $ options , 'name' ) ) , 'line1' => Arr :: get ( $ address , 'address1' , '' ) , 'line2' => Arr :: get ( $ address , 'address2' , '' ) , 'city' => Arr :: get ( $ address , 'city' , '' ) , 'country_code' => Arr :: get ( $ address , 'country' , '' ) , 'postal_code' => Arr :: get ( $ address , 'zip' , '' ) , 'state' => Arr :: get ( $ address , 'state' , '' ) , 'phone' => Arr :: get ( $ options , 'phone' , '' ) , ] ; } else { $ params [ 'application_context' ] [ 'shipping_preference' ] = 'NO_SHIPPING' ; } return $ params ; }
Add shipping params.

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

@return array
Add shipping params .