X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=fs_signup%2FFS-SignupClient%2FSignupClient.pm;h=0a6cbfba25b1d6cbab2a25b2ae32e62822042069;hp=3933703ae7e2c3a8870df22641d85b6f5e113cd8;hb=3ef62a0570055da710328937e7f65dbb2c027c62;hpb=8fc4118f1f055195d280b3250b39a3b5fcdf13dc diff --git a/fs_signup/FS-SignupClient/SignupClient.pm b/fs_signup/FS-SignupClient/SignupClient.pm index 3933703ae..0a6cbfba2 100644 --- a/fs_signup/FS-SignupClient/SignupClient.pm +++ b/fs_signup/FS-SignupClient/SignupClient.pm @@ -8,7 +8,7 @@ use FileHandle; use IO::Handle; use Storable qw(nstore_fd fd_retrieve); -$VERSION = '0.02'; +$VERSION = '0.03'; @ISA = qw( Exporter ); @EXPORT_OK = qw( signup_info new_customer ); @@ -61,6 +61,7 @@ FS::SignupClient - Freeside signup client API '_password' => $password, 'sec_phrase' => $sec_phrase, 'popnum' => $popnum, + 'agentnum' => $agentnum, #optional } ); =head1 DESCRIPTION @@ -98,6 +99,8 @@ Each hash reference has the following keys: ac exch +(Future expansion: fourth argument is the $init_data hash reference) + =cut sub signup_info { @@ -141,6 +144,7 @@ a paramater with the following keys: pkgpart username _password + sec_phrase popnum Returns a scalar error message, or the empty string for success. @@ -150,12 +154,6 @@ Returns a scalar error message, or the empty string for success. sub new_customer { my $hashref = shift; - #things that aren't necessary in base class, but are for signup server -# return "Passwords don't match" -# if $hashref->{'_password'} ne $hashref->{'_password2'} - return "Empty password" unless $hashref->{'_password'}; - return "No POP selected" unless $hashref->{'popnum'}; - socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!"; connect(SOCK, sockaddr_un($fs_signupd_socket)) or die "connect: $!"; print SOCK "new_customer\n"; @@ -163,10 +161,11 @@ sub new_customer { my $signup_data = { map { $_ => $hashref->{$_} } qw( first last ss company address1 address2 city county state zip country daytime night fax payby payinfo paydate payname invoicing_list - referral_custnum pkgpart username _password popnum + referral_custnum pkgpart username _password sec_phrase popnum ) }; - # + $signup_data->{agentnum} = $hashref->{agentnum} if $hashref->{agentnum}; + nstore_fd($signup_data, \*SOCK) or die "can't send customer signup: $!"; SOCK->flush;