'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',
'reset_passwd' => 'MyAccount/reset_passwd',
'check_reset_passwd' => 'MyAccount/check_reset_passwd',
'process_reset_passwd' => 'MyAccount/process_reset_passwd',
+ 'list_tickets' => 'MyAccount/list_tickets',
'create_ticket' => 'MyAccount/create_ticket',
'get_ticket' => 'MyAccount/get_ticket',
'adjust_ticket_priority' => 'MyAccount/adjust_ticket_priority',
'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',
'call_time' => 'PrepaidPhone/call_time',
'call_time_nanpa' => 'PrepaidPhone/call_time_nanpa',
'phonenum_balance' => 'PrepaidPhone/phonenum_balance',
+
+ 'start_thirdparty' => 'MyAccount/start_thirdparty',
+ 'finish_thirdparty' => 'MyAccount/finish_thirdparty',
);
@EXPORT_OK = (
keys(%autoload),
# "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 {
'<INPUT TYPE="hidden" NAME="domsvc" VALUE="'. $key. '"></TD></TR>'
}
- my $text .= qq!<TR><TD ALIGN="right">Domain</TD><TD><SELECT NAME="domsvc" SIZE=1 STYLE="width: 20em"><OPTION>(Choose Domain)!;
+ my $text .= qq!<TR><TD ALIGN="right">Domain</TD><TD><SELECT NAME="domsvc" SIZE=1 STYLE="width: 20em">!;
+ $text .= '<OPTION>(Choose Domain)' unless $domsvc;
foreach my $domain ( sort { $domains->{$a} cmp $domains->{$b} } keys %$domains ) {
$text .= qq!<OPTION VALUE="!. $domain. '"'.