'Call to mark this order as purchased.  Iterates through its OrderItems and calls
their purchased_callback
`first` - first name of person billed (e.g. John)
`last` - last name of person billed (e.g. Smith)
`street1` - first line of a street address of the billing address (e.g. 11 Cambridge Center)
`street2` - second line of a street address of the billing address (e.g. Suite 101)
`city` - city of the billing address (e.g. Cambridge)
`state` - code of the state, province, or territory of the billing address (e.g. MA)
`postalcode` - postal code of the billing address (e.g. 02142)
`country` - country code of the billing address (e.g. US)
`ccnum` - last 4 digits of the credit card number of the credit card billed (e.g. 1111)
`cardtype` - 3-digit code representing the card type used (e.g. 001)
`processor_reply_dump` - all the parameters returned by the processor'

def purchase(self, first='', last='', street1='', street2='', city='', state='', postalcode='', country='', ccnum='', cardtype='', processor_reply_dump=''):

    if (self.status == 'purchased'):
        log.error(u'`purchase`    method    called    on    order    {},    but    order    is    already    purchased.'.format(self.id))
        return
    self.status = 'purchased'
    self.purchase_time = datetime.now(pytz.utc)
    self.bill_to_first = first
    self.bill_to_last = last
    self.bill_to_city = city
    self.bill_to_state = state
    self.bill_to_country = country
    self.bill_to_postalcode = postalcode
    if settings.FEATURES['STORE_BILLING_INFO']:
        self.bill_to_street1 = street1
        self.bill_to_street2 = street2
        self.bill_to_ccnum = ccnum
        self.bill_to_cardtype = cardtype
        self.processor_reply_dump = processor_reply_dump
    self.save()
    orderitems = OrderItem.objects.filter(order=self).select_subclasses()
    site_name = configuration_helpers.get_value('SITE_NAME', settings.SITE_NAME)
    if (self.order_type == OrderTypes.BUSINESS):
        self.update_order_type()
    for item in orderitems:
        item.purchase_item()
    csv_file = None
    course_names = []
    if (self.order_type == OrderTypes.BUSINESS):
        (csv_file, course_names) = self.generate_registration_codes_csv(orderitems, site_name)
    try:
        pdf_file = self.generate_pdf_receipt(orderitems)
    except Exception:
        log.exception('Exception    at    creating    pdf    file.')
        pdf_file = None
    try:
        self.send_confirmation_emails(orderitems, (self.order_type == OrderTypes.BUSINESS), csv_file, pdf_file, site_name, course_names)
    except Exception:
        log.exception('Error    occurred    while    sending    payment    confirmation    email')
    self._emit_order_event('Completed    Order', orderitems)
