X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=fs_signup%2FFS-SignupClient%2FSignupClient.pm;h=d656d7528410e3ab5a165c086f2946759dd9316b;hp=5769c18fcf27f6828097654481e18178076e26f8;hb=5e99168da38e7616fc726242ce7d85e140f22c6f;hpb=aa7b51c0794f6a61e522fbba978f6c64446d8696 diff --git a/fs_signup/FS-SignupClient/SignupClient.pm b/fs_signup/FS-SignupClient/SignupClient.pm index 5769c18fc..d656d7528 100644 --- a/fs_signup/FS-SignupClient/SignupClient.pm +++ b/fs_signup/FS-SignupClient/SignupClient.pm @@ -7,7 +7,7 @@ use Socket; use FileHandle; use IO::Handle; -$VERSION = '0.01'; +$VERSION = '0.02'; @ISA = qw( Exporter ); @EXPORT_OK = qw( signup_info new_customer ); @@ -35,29 +35,30 @@ FS::SignupClient - Freeside signup client API ( $locales, $packages, $pops ) = signup_info; $error = new_customer ( { - 'first' => $first, - 'last' => $last, - 'ss' => $ss, - 'comapny' => $company, - 'address1' => $address1, - 'address2' => $address2, - 'city' => $city, - 'county' => $county, - 'state' => $state, - 'zip' => $zip, - 'country' => $country, - 'daytime' => $daytime, - 'night' => $night, - 'fax' => $fax, - 'payby' => $payby, - 'payinfo' => $payinfo, - 'paydate' => $paydate, - 'payname' => $payname, - 'invoicing_list' => $invoicing_list, - 'pkgpart' => $pkgpart, - 'username' => $username, - '_password' => $password, - 'popnum' => $popnum, + 'first' => $first, + 'last' => $last, + 'ss' => $ss, + 'comapny' => $company, + 'address1' => $address1, + 'address2' => $address2, + 'city' => $city, + 'county' => $county, + 'state' => $state, + 'zip' => $zip, + 'country' => $country, + 'daytime' => $daytime, + 'night' => $night, + 'fax' => $fax, + 'payby' => $payby, + 'payinfo' => $payinfo, + 'paydate' => $paydate, + 'payname' => $payname, + 'invoicing_list' => $invoicing_list, + 'referral_custnum' => $referral_custnum, + 'pkgpart' => $pkgpart, + 'username' => $username, + '_password' => $password, + 'popnum' => $popnum, } ); =head1 DESCRIPTION @@ -173,6 +174,7 @@ a paramater with the following keys: paydate payname invoicing_list + referral_custnum pkgpart username _password @@ -185,6 +187,10 @@ 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 "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"; @@ -192,7 +198,7 @@ sub new_customer { print SOCK join("\n", map { $hashref->{$_} } qw( first last ss company address1 address2 city county state zip country daytime night fax payby payinfo paydate payname invoicing_list - pkgpart username _password popnum + referral_custnum pkgpart username _password popnum ) ), "\n"; SOCK->flush; @@ -202,10 +208,6 @@ sub new_customer { =back -=head1 VERSION - -$Id: SignupClient.pm,v 1.3 2000-02-02 07:44:00 ivan Exp $ - =head1 BUGS =head1 SEE ALSO