'login' => 'MyAccount/login',
'logout' => 'MyAccount/logout',
'switch_acct' => 'MyAccount/switch_acct',
+ 'switch_cust' => 'MyAccount/switch_cust',
'customer_info' => 'MyAccount/customer_info',
'customer_info_short' => 'MyAccount/customer_info_short',
'billing_history' => 'MyAccount/billing_history',
'access_info' => 'MyAccount/access_info',
'domain_select_hash' => 'Signup/domain_select_hash', # expose?
'new_customer' => 'Signup/new_customer',
+ 'new_customer_minimal' => 'Signup/new_customer_minimal',
'capture_payment' => 'Signup/capture_payment',
#N/A 'clear_signup_cache' => 'Signup/clear_cache',
'new_agent' => 'Agent/new_agent',
# "my account" functionality
use FS::SelfService qw( login customer_info invoice cancel payment_info process_payment );
+ #new-style login with an email address and password
+ # can also be used for svc_acct login, set $emailaddress to username@domain
+ my $rv = login ( { 'email' => $emailaddress,
+ 'password' => $password,
+ },
+ );
+ if ( $rv->{'error'} ) {
+ #handle login error...
+ } else {
+ #successful login
+ $session_id = $rv->{'session_id'};
+ }
+
+ #classic svc_acct-based login with separate username and password
my $rv = login( { 'username' => $username,
'domain' => $domain,
'password' => $password,
}
);
+ if ( $rv->{'error'} ) {
+ #handle login error...
+ } else {
+ #successful login
+ $session_id = $rv->{'session_id'};
+ }
+ #svc_phone login with phone number and PIN
+ my $rv = login( { 'username' => $phone_number,
+ 'domain' => 'svc_phone',
+ 'password' => $pin,
+ }
+ );
if ( $rv->{'error'} ) {
#handle login error...
} else {
#successful login
- my $session_id = $rv->{'session_id'};
+ $session_id = $rv->{'session_id'};
}
my $customer_info = customer_info( { 'session_id' => $session_id } );
=over 4
+=item email
+
+Email address (username@domain), instead of username and domain. Required for
+contact-based self-service login, can also be used for svc_acct-based login.
+
=item username
Username
Package to order (see L<FS::part_pkg>).
+=item quantity
+
+Quantity for this package order (default 1).
+
+=item locationnum
+
+Optional locationnum for this package order, for existing locations.
+
+Or, for new locations, pass the following fields: address1*, address2, city*,
+county, state*, zip*, country. (* = required in this case)
+
+=item address1
+
+=item address 2
+
+=item city
+
+=item
+
=item svcpart
Service to order (see L<FS::part_svc>).
foreach my $state ( sort keys %{ $cust_main_county{$param->{'selected_country'}} } ) {
my $text = $state || '(n/a)';
my $selected = $state eq $param->{'selected_state'} ? 'SELECTED' : '';
- $state_html .= "\n<OPTION $selected VALUE=$state>$text</OPTION>"
+ $state_html .= "\n<OPTION $selected VALUE=\"$state\">$text</OPTION>"
}
$state_html .= '</SELECT>';
my $selected = $country eq $param->{'selected_country'}
? ' SELECTED'
: '';
- $country_html .= "\n<OPTION$selected>$country</OPTION>"
+ $country_html .= "\n<OPTION $selected>$country</OPTION>"
}
$country_html .= '</SELECT>';
} else {