1 package FS::SignupClient;
4 use vars qw($VERSION @ISA @EXPORT_OK $init_data); # $fs_signupd_socket);
9 #use Storable qw(nstore_fd fd_retrieve);
10 use FS::SelfService; # qw( new_customer signup_info );
14 @ISA = qw( Exporter );
15 @EXPORT_OK = qw( signup_info new_customer regionselector expselect popselector);
19 FS::SignupClient - Freeside signup client API
23 use FS::SignupClient qw( signup_info new_customer );
25 #this is the backwards-compatibility bit
26 ( $locales, $packages, $pops, $real_signup_info ) = signup_info;
28 #this is compatible with FS::SelfService::new_customer
29 $error = new_customer ( {
33 'comapny' => $company,
34 'address1' => $address1,
35 'address2' => $address2,
40 'country' => $country,
41 'daytime' => $daytime,
45 'payinfo' => $payinfo,
47 'paydate' => $paydate,
48 'payname' => $payname,
49 'invoicing_list' => $invoicing_list,
50 'referral_custnum' => $referral_custnum,
51 'comments' => $comments,
52 'pkgpart' => $pkgpart,
53 'username' => $username,
54 '_password' => $password,
55 'sec_phrase' => $sec_phrase,
57 'agentnum' => $agentnum, #optional
62 This module provides an API for a remote signup server.
64 It needs to be run as the freeside user. Because of this, the program which
65 calls these subroutines should be written very carefully.
73 Returns three array references of hash references.
75 The first set of hash references is of allowable locales. Each hash reference
76 has the following keys:
82 The second set of hash references is of allowable packages. Each hash
83 reference has the following keys:
87 The third set of hash references is of allowable POPs (Points Of Presence).
88 Each hash reference has the following keys:
95 (Future expansion: fourth argument is the $init_data hash reference)
102 $init_data = FS::SelfService::signup_info();
104 (map { $init_data->{$_} } qw( cust_main_county part_pkg svc_acct_pop ) ),
109 =item new_customer HASHREF
111 Adds a customer to the remote Freeside system. Requires a hash reference as
112 a paramater with the following keys:
141 Returns a scalar error message, or the empty string for success.
147 my $hash = FS::SelfService::new_customer(@_);
151 =item regionselector SELECTED_COUNTY, SELECTED_STATE, SELECTED_COUNTRY, PREFIX, ONCHANGE
156 my ( $selected_county, $selected_state, $selected_country,
157 $prefix, $onchange ) = @_;
158 signup_info() unless $init_data;
159 FS::SelfService::regionselector({
160 selected_county => $selected_county,
161 selected_state => $selected_state,
162 selected_country => $selected_country,
164 onchange => $onchange,
165 default_country => $init_data->{countrydefault},
166 locales => $init_data->{cust_main_county},
168 #default_state => $init_data->{statedefault},
171 =item expselect PREFIX, DATE
176 FS::SelfService::expselect(@_);
185 signup_info() unless $init_data;
186 FS::SelfService::popselector({
188 pops => $init_data->{svc_acct_pop},
198 This is just a wrapper around FS::SelfService functions for backwards
199 compatibility and will probably be deprecated soon.
203 L<fs_signupd>, L<FS::cust_main>