X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=fs_selfservice%2FFS-SelfService%2FSelfService.pm;h=c3026fa13f7af6e0cc72d2b81824f940c7d9239d;hb=97316d268e5751a1d08a0a37e5a0456f2ce4815c;hp=6e3ca3b5a445ee04b92ad29b267f63ecb52b7066;hpb=f7fd2a3e34da751cbc02bbf215e99c6dc89adc15;p=freeside.git diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm index 6e3ca3b5a..c3026fa13 100644 --- a/fs_selfservice/FS-SelfService/SelfService.pm +++ b/fs_selfservice/FS-SelfService/SelfService.pm @@ -1,7 +1,7 @@ package FS::SelfService; use strict; -use vars qw($VERSION @ISA @EXPORT_OK $socket %autoload $tag); +use vars qw($VERSION @ISA @EXPORT_OK $dir $socket %autoload $tag); use Exporter; use Socket; use FileHandle; @@ -13,7 +13,8 @@ $VERSION = '0.03'; @ISA = qw( Exporter ); -$socket = "/usr/local/freeside/selfservice_socket"; +$dir = "/usr/local/freeside"; +$socket = "$dir/selfservice_socket"; $socket .= '.'.$tag if defined $tag && length($tag); #maybe should ask ClientAPI for this list @@ -26,11 +27,14 @@ $socket .= '.'.$tag if defined $tag && length($tag); 'customer_info' => 'MyAccount/customer_info', 'edit_info' => 'MyAccount/edit_info', #add to ss cgi! 'invoice' => 'MyAccount/invoice', + 'invoice_logo' => 'MyAccount/invoice_logo', 'list_invoices' => 'MyAccount/list_invoices', #? 'cancel' => 'MyAccount/cancel', #add to ss cgi! 'payment_info' => 'MyAccount/payment_info', 'process_payment' => 'MyAccount/process_payment', - 'list_pkgs' => 'MyAccount/list_pkgs', #add to ss cgi! + 'process_prepay' => 'MyAccount/process_prepay', + 'list_pkgs' => 'MyAccount/list_pkgs', #add to ss cgi (added?) + 'list_svcs' => 'MyAccount/list_svcs', #add to ss cgi (added?) 'order_pkg' => 'MyAccount/order_pkg', #add to ss cgi! 'cancel_pkg' => 'MyAccount/cancel_pkg', #add to ss cgi! 'charge' => 'MyAccount/charge', #? @@ -38,6 +42,7 @@ $socket .= '.'.$tag if defined $tag && length($tag); 'provision_acct' => 'MyAccount/provision_acct', 'provision_external' => 'MyAccount/provision_external', 'unprovision_svc' => 'MyAccount/unprovision_svc', + 'myaccount_passwd' => 'MyAccount/myaccount_passwd', 'signup_info' => 'Signup/signup_info', 'new_customer' => 'Signup/new_customer', 'agent_login' => 'Agent/agent_login', @@ -57,6 +62,11 @@ $ENV{'BASH_ENV'} = ''; my $freeside_uid = scalar(getpwnam('freeside')); die "not running as the freeside user\n" if $> != $freeside_uid; +-e $dir or die "FATAL: $dir doesn't exist!"; +-d $dir or die "FATAL: $dir isn't a directory!"; +-r $dir or die "FATAL: Can't read $dir as freeside user!"; +-x $dir or die "FATAL: $dir not searchable (executable) as freeside user!"; + foreach my $autoload ( keys %autoload ) { my $eval = @@ -65,6 +75,7 @@ foreach my $autoload ( keys %autoload ) { if ( ref($_[0]) ) { $param = shift; } else { + #warn scalar(@_). ": ". join(" / ", @_); $param = { @_ }; } @@ -81,7 +92,7 @@ foreach my $autoload ( keys %autoload ) { sub simple_packet { my $packet = shift; socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!"; - connect(SOCK, sockaddr_un($socket)) or die "connect: $!"; + connect(SOCK, sockaddr_un($socket)) or die "connect to $socket: $!"; nstore_fd($packet, \*SOCK) or die "can't send packet: $!"; SOCK->flush; @@ -156,6 +167,10 @@ FS::SelfService - Freeside self-service API 'payby' => $payby, 'payinfo' => $payinfo, 'paycvv' => $paycvv, + 'paystart_month' => $paystart_month + 'paystart_year' => $paystart_year, + 'payissue' => $payissue, + 'payip' => $payip 'paydate' => $paydate, 'payname' => $payname, 'invoicing_list' => $invoicing_list, @@ -1059,7 +1074,7 @@ END Note: Resellers can also use the B and B functions with their active session, and the B and B functions -with their active session and an additonal I parameter. +with their active session and an additional I parameter. =over 4