def remap_oscar_billing_address(address):
    """Remaps Oscar billing address dictionary to Helcim dictionary.

        Parameters:
            address (dict): A dictionary of the billing address details
                provided by Django Oscar.

        Returns:
            dict: Billing address details formatted for
                django-helcim.
    """
    if address.get('first_name') and address.get('last_name'):
        contact_name = '{} {}'.format(address.get('first_name'), address.
            get('last_name'))
    elif address.get('first_name'):
        contact_name = address.get('first_name')
    elif address.get('last_name'):
        contact_name = address.get('last_name')
    else:
        contact_name = None
    return {'billing_contact_name': contact_name, 'billing_street_1':
        address.get('line1'), 'billing_street_2': address.get('line2'),
        'billing_city': address.get('line4'), 'billing_province': address.
        get('state'), 'billing_postal_code': address.get('postcode'),
        'billing_country': address.get('country'), 'billing_phone': address
        .get('phone_number')}
