I'm trying to implement a payment system using 2Checkout. (Yes, I tried the e-commerce mod and it didn't do what I needed.) Everything is working great except that I can't figure out how to set the default field values on the user registration screen. What I want to do is take the data from their transaction over on 2checkout's site and populate the fields on the drupal registration screen with email and name. 2Checkout passes all the field values to my server when the customer is finished.
I think I know how to use php to grab the values ($_POST['username_from_2checkout']). What I need to know is where to put that value in drupal to have it show up on the registration screen in the Username: field.
I thought it would be in user.module around line 1025-26:
$default = form_textfield(t('Username'), 'name', $edit['name'], 30, 64, t('Your full name or your preferred username; only letters, numbers and spaces are allowed.'), NULL, TRUE);
$default .= form_textfield(t('E-mail address'), 'mail', $edit['mail'], 30, 64, t('A password and instructions will be sent to this e-mail address, so make sure it is accurate.'), NULL, TRUE);
But it is not obvious to me where to put it. When I view source I see:
Clearly, there is a call on this somewhere else that formats the true html.