Block/Form.php
public function getBillingAddress($needJsonEncode = true)
    {
        $quote = $this->getQuoteData();
        /** @var \Magento\Quote\Model\Quote\Address $billingAddress */
        $billingAddress = $quote->getBillingAddress();

        $streetAddressLines = [];
        $streetAddressLines[] = $billingAddress->getStreetLine(1);
        if ($billingAddress->getStreetLine(2)) {
            $streetAddressLines[] = $billingAddress->getStreetLine(2);
        }

        $result = [
            'customerAddressId' => $billingAddress->getId(),
            'countryId'         => $billingAddress->getCountryId(),
            'regionId'          => $billingAddress->getRegionId(),
            'regionCode'        => $billingAddress->getRegionCode(),
            'region'            => $billingAddress->getRegion(),
            'customerId'        => $billingAddress->getCustomerId(),
            'street'            => $streetAddressLines,
            'telephone'         => $billingAddress->getTelephone(),
            'postcode'          => $billingAddress->getPostcode(),
            'city'              => $billingAddress->getCity(),
            'firstname'         => $billingAddress->getFirstname(),
            'lastname'          => $billingAddress->getLastname(),
            'extensionAttributes'   => ['checkoutFields' => []],
            'saveInAddressBook'     => $billingAddress->getSaveInAddressBook()
        ];

        return ($needJsonEncode) ? json_encode($result) : $result;
    }
public function getBillingAddress($needJsonEncode = true)
    {
        $quote = $this->getQuoteData();
        /** @var \Magento\Quote\Model\Quote\Address $billingAddress */
        $billingAddress = $quote->getBillingAddress();

        $streetAddressLines = [];
        $streetAddressLines[] = $billingAddress->getStreetLine(1);
        if ($billingAddress->getStreetLine(2)) {
            $streetAddressLines[] = $billingAddress->getStreetLine(2);
        }

        $result = [
            'customerAddressId' => $billingAddress->getId(),
            'countryId'         => $billingAddress->getCountryId(),
            'regionId'          => $billingAddress->getRegionId(),
            'regionCode'        => $billingAddress->getRegionCode(),
            'region'            => $billingAddress->getRegion(),
            'customerId'        => $billingAddress->getCustomerId(),
            'street'            => $streetAddressLines,
            'telephone'         => $billingAddress->getTelephone(),
            'postcode'          => $billingAddress->getPostcode(),
            'city'              => $billingAddress->getCity(),
            'firstname'         => $billingAddress->getFirstname(),
            'lastname'          => $billingAddress->getLastname(),
            'extensionAttributes'   => ['checkoutFields' => []],
            'saveInAddressBook'     => $billingAddress->getSaveInAddressBook()
        ];

        return ($needJsonEncode) ? json_encode($result) : $result;
    }
public function getBillingAddress ( $ needJsonEncode = true ) { $ quote = $ this -> getQuoteData ( ) ; /** @var \Magento\Quote\Model\Quote\Address $billingAddress */ $ billingAddress = $ quote -> getBillingAddress ( ) ; $ streetAddressLines = [ ] ; $ streetAddressLines [ ] = $ billingAddress -> getStreetLine ( 1 ) ; if ( $ billingAddress -> getStreetLine ( 2 ) ) { $ streetAddressLines [ ] = $ billingAddress -> getStreetLine ( 2 ) ; } $ result = [ 'customerAddressId' => $ billingAddress -> getId ( ) , 'countryId' => $ billingAddress -> getCountryId ( ) , 'regionId' => $ billingAddress -> getRegionId ( ) , 'regionCode' => $ billingAddress -> getRegionCode ( ) , 'region' => $ billingAddress -> getRegion ( ) , 'customerId' => $ billingAddress -> getCustomerId ( ) , 'street' => $ streetAddressLines , 'telephone' => $ billingAddress -> getTelephone ( ) , 'postcode' => $ billingAddress -> getPostcode ( ) , 'city' => $ billingAddress -> getCity ( ) , 'firstname' => $ billingAddress -> getFirstname ( ) , 'lastname' => $ billingAddress -> getLastname ( ) , 'extensionAttributes' => [ 'checkoutFields' => [ ] ] , 'saveInAddressBook' => $ billingAddress -> getSaveInAddressBook ( ) ] ; return ( $ needJsonEncode ) ? json_encode ( $ result ) : $ result ; }
Return billing address information formatted to be used for magento order creation.

Example return value:
{"customerAddressId":"404","countryId":"US","regionId":"12","regionCode":"CA","region":"California",
"customerId":"202","street":["adasdasd 1234"],"telephone":"314-123-4125","postcode":"90014",
"city":"Los Angeles","firstname":"YevhenTest","lastname":"BoltDev",
"extensionAttributes":{"checkoutFields":{}},"saveInAddressBook":null}

@param bool $needJsonEncode

@return string
Return billing address information formatted to be used for magento order creation .