'Create a payment and customer profile in the Authorize.net backend.
Creates a customer profile for the partner/credit card combination and links
a corresponding payment profile to it. Note that a single partner in the Odoo
database can have multiple customer profiles in Authorize.net (i.e. a customer
profile is created for every res.partner/payment.token couple).
:param record partner: the res.partner record of the customer
:param str cardnumber: cardnumber in string format (numbers only, no separator)
:param str expiration_date: expiration date in \'YYYY-MM\' string format
:param str card_code: three- or four-digit verification number
:return: a dict containing the profile_id and payment_profile_id of the
newly created customer profile and payment profile
:rtype: dict'

def create_customer_profile(self, partner, cardnumber, expiration_date, card_code):

    root = self._base_tree('createCustomerProfileRequest')
    profile = etree.SubElement(root, 'profile')
    etree.SubElement(profile, 'merchantCustomerId').text = ('ODOO-%s-%s' % (partner.id, uuid4().hex[:8]))
    etree.SubElement(profile, 'email').text = partner.email
    payment_profile = etree.SubElement(profile, 'paymentProfiles')
    etree.SubElement(payment_profile, 'customerType').text = ('business' if partner.is_company else 'individual')
    billTo = etree.SubElement(payment_profile, 'billTo')
    etree.SubElement(billTo, 'address').text = ((partner.street or ('' + (partner.street2 if partner.street2 else ''))) or None)
    etree.SubElement(billTo, 'city').text = partner.city
    etree.SubElement(billTo, 'state').text = (partner.state_id.name or None)
    etree.SubElement(billTo, 'zip').text = partner.zip
    etree.SubElement(billTo, 'country').text = (partner.country_id.name or None)
    payment = etree.SubElement(payment_profile, 'payment')
    creditCard = etree.SubElement(payment, 'creditCard')
    etree.SubElement(creditCard, 'cardNumber').text = cardnumber
    etree.SubElement(creditCard, 'expirationDate').text = expiration_date
    etree.SubElement(creditCard, 'cardCode').text = card_code
    etree.SubElement(root, 'validationMode').text = 'liveMode'
    response = self._authorize_request(root)
    res = dict()
    res['profile_id'] = response.find('customerProfileId').text
    res['payment_profile_id'] = response.find('customerPaymentProfileIdList/numericString').text
    return res
