def get_bill_to_address(user):
    """
    Create an address appropriate to pass to billTo on the CyberSource API

    Args:
        user (User): the user whose address to use

    Returns:
        dict:
            User's legal_address in the appropriate data structure
    """

    legal_address = user.legal_address

    # minimally require fields
    billing_address = {
        "firstName": legal_address.first_name,
        "lastName": legal_address.last_name,
        "email": user.email,
        "street1": legal_address.street_address_1,
        "street2": legal_address.street_address_2,
        "street3": legal_address.street_address_3,
        "street4": legal_address.street_address_4,
        "city": legal_address.city,
        "country": legal_address.country,
    }

    # these are required for certain countries, we presume here that data was validated before it was written
    if legal_address.state_or_territory:
        # State is in US-MA format and we want that send part
        billing_address["state"] = legal_address.state_or_territory.split("-")[1]

    if legal_address.postal_code:
        billing_address["postalCode"] = legal_address.postal_code

    return billing_address