protected function addBillingAddress(array $params, array $options)
    {
        if ($address = Arr::get($options, 'billing_address') && $taxId = Arr::get($address, 'tax_id') && $companyName = Arr::get($address, 'company_name')) {
            $addressFiltered = Arr::filters([
                'street1'         => Arr::get($address, 'address1'),
                'street2'         => Arr::get($address, 'address2'),
                'street3'         => Arr::get($address, 'address3'),
                'external_number' => Arr::get($address, 'external_number'),
                'city'            => Arr::get($address, 'city'),
                'country'         => Arr::get($address, 'country'),
                'state'           => Arr::get($address, 'state'),
                'postal_code'     => Arr::get($address, 'zip'),
            ]);

            if (!empty($addressFiltered)) {
                $params['fiscal_entity']['address'] = $addressFiltered;
            }

            $params['fiscal_entity']['phone'] = Arr::get($address, 'phone', Arr::get($options, 'phone', 'none'));
            $params['fiscal_entity']['email'] = Arr::get($address, 'email', Arr::get($options, 'email', 'none'));
            $params['fiscal_entity']['tax_id'] = $taxId;
            $params['fiscal_entity']['company_name'] = $companyName;
        }

        return $params;
    }
protected function addBillingAddress(array $params, array $options)
    {
        if ($address = Arr::get($options, 'billing_address') && $taxId = Arr::get($address, 'tax_id') && $companyName = Arr::get($address, 'company_name')) {
            $addressFiltered = Arr::filters([
                'street1'         => Arr::get($address, 'address1'),
                'street2'         => Arr::get($address, 'address2'),
                'street3'         => Arr::get($address, 'address3'),
                'external_number' => Arr::get($address, 'external_number'),
                'city'            => Arr::get($address, 'city'),
                'country'         => Arr::get($address, 'country'),
                'state'           => Arr::get($address, 'state'),
                'postal_code'     => Arr::get($address, 'zip'),
            ]);

            if (!empty($addressFiltered)) {
                $params['fiscal_entity']['address'] = $addressFiltered;
            }

            $params['fiscal_entity']['phone'] = Arr::get($address, 'phone', Arr::get($options, 'phone', 'none'));
            $params['fiscal_entity']['email'] = Arr::get($address, 'email', Arr::get($options, 'email', 'none'));
            $params['fiscal_entity']['tax_id'] = $taxId;
            $params['fiscal_entity']['company_name'] = $companyName;
        }

        return $params;
    }
protected function addBillingAddress ( array $ params , array $ options ) { if ( $ address = Arr :: get ( $ options , 'billing_address' ) && $ taxId = Arr :: get ( $ address , 'tax_id' ) && $ companyName = Arr :: get ( $ address , 'company_name' ) ) { $ addressFiltered = Arr :: filters ( [ 'street1' => Arr :: get ( $ address , 'address1' ) , 'street2' => Arr :: get ( $ address , 'address2' ) , 'street3' => Arr :: get ( $ address , 'address3' ) , 'external_number' => Arr :: get ( $ address , 'external_number' ) , 'city' => Arr :: get ( $ address , 'city' ) , 'country' => Arr :: get ( $ address , 'country' ) , 'state' => Arr :: get ( $ address , 'state' ) , 'postal_code' => Arr :: get ( $ address , 'zip' ) , ] ) ; if ( ! empty ( $ addressFiltered ) ) { $ params [ 'fiscal_entity' ] [ 'address' ] = $ addressFiltered ; } $ params [ 'fiscal_entity' ] [ 'phone' ] = Arr :: get ( $ address , 'phone' , Arr :: get ( $ options , 'phone' , 'none' ) ) ; $ params [ 'fiscal_entity' ] [ 'email' ] = Arr :: get ( $ address , 'email' , Arr :: get ( $ options , 'email' , 'none' ) ) ; $ params [ 'fiscal_entity' ] [ 'tax_id' ] = $ taxId ; $ params [ 'fiscal_entity' ] [ 'company_name' ] = $ companyName ; } return $ params ; }
Add Billing address to request.

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

@return array
Add Billing address to request .