summaryrefslogtreecommitdiff
path: root/fs_selfservice/FS-SelfService
diff options
context:
space:
mode:
Diffstat (limited to 'fs_selfservice/FS-SelfService')
-rw-r--r--fs_selfservice/FS-SelfService/SelfService.pm51
-rwxr-xr-xfs_selfservice/FS-SelfService/cgi/selfservice.cgi4
-rwxr-xr-xfs_selfservice/FS-SelfService/cgi/signup.cgi2
-rwxr-xr-xfs_selfservice/FS-SelfService/cgi/signup.html12
-rw-r--r--fs_selfservice/FS-SelfService/cgi/view_usage.html112
-rw-r--r--fs_selfservice/FS-SelfService/iZoomOnlineProvisionService.pm75
6 files changed, 110 insertions, 146 deletions
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
index 4023aa87d..3be4ebd8b 100644
--- a/fs_selfservice/FS-SelfService/SelfService.pm
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -50,6 +50,7 @@ $socket .= '.'.$tag if defined $tag && length($tag);
'list_invoices' => 'MyAccount/list_invoices', #?
'list_payby' => 'MyAccount/list_payby',
'insert_payby' => 'MyAccount/insert_payby',
+ 'update_payby' => 'MyAccount/update_payby',
'delete_payby' => 'MyAccount/delete_payby',
'cancel' => 'MyAccount/cancel', #add to ss cgi!
'payment_info' => 'MyAccount/payment_info',
@@ -112,6 +113,7 @@ $socket .= '.'.$tag if defined $tag && length($tag);
'new_customer' => 'Signup/new_customer',
'new_customer_minimal' => 'Signup/new_customer_minimal',
'capture_payment' => 'Signup/capture_payment',
+ 'new_prospect' => 'Signup/new_prospect',
#N/A 'clear_signup_cache' => 'Signup/clear_cache',
'new_agent' => 'Agent/new_agent',
'agent_login' => 'Agent/agent_login',
@@ -138,6 +140,8 @@ $socket .= '.'.$tag if defined $tag && length($tag);
'quotation_remove_pkg' => 'MyAccount/quotation/quotation_remove_pkg',
'quotation_order' => 'MyAccount/quotation/quotation_order',
+ 'freesideinc_service' => 'Freeside/freesideinc_service',
+
);
@EXPORT_OK = (
keys(%autoload),
@@ -679,6 +683,16 @@ Optional IP address from which payment was submitted
If there is an error, returns a hash reference with a single key, B<error>,
otherwise returns a hash reference with a single key, B<custpaybynum>.
+=item update_payby HASHREF
+
+Updates stored payment information. Takes a hash reference with the same
+keys as insert_payby, as well as B<custpaybynum> to specify which record
+to update. All keys except B<session_id> and B<custpaybynum> are optional;
+if omitted, the previous values in the record will be preserved.
+
+If there is an error, returns a hash reference with a single key, B<error>,
+otherwise returns a hash reference with a single key, B<custpaybynum>.
+
=item delete_payby HASHREF
Removes stored payment information. Takes a hash reference with two keys,
@@ -1069,6 +1083,10 @@ Number of total bytes gained by recharge
Orders a package for this customer.
+If signup_server-realtime is set, bills the new package, attemps to collect
+payment and (for auto-payment customers) cancels the package if the payment is
+declined.
+
Takes a hash reference as parameter with the following keys:
=over 4
@@ -1085,6 +1103,11 @@ Package to order (see L<FS::part_pkg>).
Quantity for this package order (default 1).
+=item run_bill_events
+
+If true, runs billing events for the customer after ordering and billing the
+package (signup_server-realtime must be set).
+
=item locationnum
Optional locationnum for this package order, for existing locations.
@@ -1092,13 +1115,22 @@ 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)
+(None of this is required at all if you are just ordering a package
+at the customer's existing default service location.)
+
=item address1
-=item address 2
+=item address2
=item city
-=item
+=item county
+
+=item state
+
+=item zip
+
+=item country
=item svcpart
@@ -1258,7 +1290,7 @@ following keys:
=item bill_date
(Future) Bill date. Indicates a future date for which billing could be run.
-Specified as a integer UNIX timestamp. Pass this value to the B<order_renew>
+Specified as an integer UNIX timestamp. Pass this value to the B<order_renew>
function.
=item bill_date_pretty
@@ -1274,7 +1306,7 @@ Base amount which will be charged if renewed early as of this date.
Renewal date; i.e. even-futher future date at which the customer will be paid
through if the early renewal is completed with the given B<bill-date>.
-Specified as a integer UNIX timestamp.
+Specified as an integer UNIX timestamp.
=item renew_date_pretty
@@ -1335,6 +1367,11 @@ Session identifier
pkgpart of package to cancel
+=item date
+
+Optional date, for future cancellation (expiration) instead of immediate
+cancellation. Specified as an integer UNIX timestamp ("epoch time").
+
=back
Returns a hash reference with a single key, B<error>, empty on success, or an
@@ -1501,7 +1538,7 @@ message, or empty on success, and B<contacts>, a list of contacts.
B<contacts> is an array reference of hash references (i.e. an array of structs,
in XML-RPC). Each hash reference (struct) has the following keys:
-=over4
+=over 4
=item contactnum
@@ -1610,6 +1647,8 @@ Takes a hash reference as parameter with the following keys:
Returns a hash reference with a single parameter, B<error>, which contains an
error message, or empty on success.
+=back
+
=head2 "MY ACCOUNT" QUOTATION FUNCTIONS
All of these functions require the user to be logged in, and the 'session_id'
@@ -1753,8 +1792,6 @@ Removes a package from a quotation. Takes the following arguments:
Returns 'error' => a string, which will be empty on success.
-=back
-
=item quotation_order HASHREF
Converts the packages in a quotation into real packages. Takes the following
diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
index 1054e6a00..4a309c91d 100755
--- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
+++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
@@ -606,7 +606,7 @@ sub make_payment {
sub payment_results {
- use Business::CreditCard 0.30;
+ use Business::CreditCard 0.35;
#we should only do basic checking here for DoS attacks and things
#that couldn't be constructed by the web form... let process_payment() do
@@ -998,7 +998,7 @@ sub delete_svc {
sub view_usage {
my $res = list_svcs(
'session_id' => $session_id,
- 'svcdb' => [ 'svc_acct', 'svc_phone', 'svc_port', 'svc_pbx' ],
+ 'svcdb' => [ 'svc_acct', 'svc_broadband', 'svc_phone', 'svc_port', 'svc_pbx' ],
'ncancelled' => 1,
);
if ($res->{hide_usage}) {
diff --git a/fs_selfservice/FS-SelfService/cgi/signup.cgi b/fs_selfservice/FS-SelfService/cgi/signup.cgi
index 817fdd310..c696276a7 100755
--- a/fs_selfservice/FS-SelfService/cgi/signup.cgi
+++ b/fs_selfservice/FS-SelfService/cgi/signup.cgi
@@ -19,7 +19,7 @@ use CGI;
#use CGI::Carp qw(fatalsToBrowser);
use Tie::IxHash;
use Text::Template;
-use Business::CreditCard;
+use Business::CreditCard 0.35;
use HTTP::BrowserDetect;
use HTML::Widgets::SelectLayers;
use FS::SelfService qw( signup_info new_customer );
diff --git a/fs_selfservice/FS-SelfService/cgi/signup.html b/fs_selfservice/FS-SelfService/cgi/signup.html
index def52991e..6edb644d2 100755
--- a/fs_selfservice/FS-SelfService/cgi/signup.html
+++ b/fs_selfservice/FS-SelfService/cgi/signup.html
@@ -412,18 +412,6 @@ SECPHRASE
$OUT .= '<INPUT TYPE="hidden" NAME="sec_phrase" VALUE="">';
}
- if ( $nomadix ) {
-
- warn $mac_addr;
- $mac_addr ||= $MA;
- warn $mac_addr;
-
- $OUT .= <<NOMADIX;
- <INPUT TYPE="hidden" NAME="mac_addr" VALUE="$mac_addr">
-NOMADIX
-
- }
-
}
if ( @svc_acct_pop ) {
diff --git a/fs_selfservice/FS-SelfService/cgi/view_usage.html b/fs_selfservice/FS-SelfService/cgi/view_usage.html
index 4099a57f5..2b9eb8bc2 100644
--- a/fs_selfservice/FS-SelfService/cgi/view_usage.html
+++ b/fs_selfservice/FS-SelfService/cgi/view_usage.html
@@ -1,21 +1,27 @@
<%= $url = "$selfurl?action=";
%by_pkg_label = (); # not used yet, but I'm sure it will be...
- @svc_acct = ();
@svc_phone = ();
@svc_port = ();
@svc_pbx = ();
-
- foreach (@svcs) {
- $by_pkg_label{ $_->{pkg_label} } ||= [];
- push @{ $by_pkg_label{ $_->{pkg_label} } }, $_;
- if ( $_->{svcdb} eq 'svc_acct' ) {
- push @svc_acct, $_;
- } elsif ( $_->{svcdb} eq 'svc_phone' ) {
- push @svc_phone, $_;
- } elsif ( $_->{svcdb} eq 'svc_port' ) {
- push @svc_port, $_;
- } elsif ( $_->{svcdb} eq 'svc_pbx' ) {
- push @svc_pbx, $_;
+ @bytes_svcs = (); # contains svc_acct and svc_broadband
+ @bytes_cols = qw(seconds_used seconds upbytes_used upbytes downbytes_used downbytes totalbytes_used totalbytes);
+ %bytes_show = map { $_ => 0 } @bytes_cols;
+
+ foreach my $svc (@svcs) {
+ $by_pkg_label{ $svc->{pkg_label} } ||= [];
+ push @{ $by_pkg_label{ $svc->{pkg_label} } }, $svc;
+
+ if (( $svc->{svcdb} eq 'svc_acct' ) || ( $svc->{svcdb} eq 'svc_broadband' )) {
+ foreach my $field (@bytes_cols) {
+ $bytes_show{$field} = 1 if length($svc->{$field}) or (($field !~ /_used$/) && $svc->{'recharge_'.$field});
+ }
+ push @bytes_svcs, $svc;
+ } elsif ( $svc->{svcdb} eq 'svc_phone' ) {
+ push @svc_phone, $svc;
+ } elsif ( $svc->{svcdb} eq 'svc_port' ) {
+ push @svc_port, $svc;
+ } elsif ( $svc->{svcdb} eq 'svc_pbx' ) {
+ push @svc_pbx, $svc;
}
}
'';
@@ -26,56 +32,64 @@
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">$error</FONT><BR><BR>!;
} ''; %>
-<%= if ( @svc_acct ) {
- $OUT.= '<TABLE BGCOLOR="#cccccc">
- <TR>
- <TH ALIGN="left">Account</TH>
- <TH ALIGN="right">Time remaining</TH>
- <TH ALIGN="right">Upload remaining</TH>
- <TH ALIGN="right">Download remaining</TH>
- <TH ALIGN="right">Total remaining</TH>
- </TR>';
- } else {
- $OUT .= '';
+<%= if ( @bytes_svcs ) {
+ $OUT .= '<TABLE BGCOLOR="#cccccc"><TR>';
+ $OUT .= '<TH ALIGN="left">Account</TH>';
+ $OUT .= '<TH ALIGN="right">Time used</TH>' if $bytes_show{'seconds_used'};
+ $OUT .= '<TH ALIGN="right">Time remaining</TH>' if $bytes_show{'seconds'};
+ $OUT .= '<TH ALIGN="right">Upload used</TH>' if $bytes_show{'upbytes_used'};
+ $OUT .= '<TH ALIGN="right">Upload remaining</TH>' if $bytes_show{'upbytes'};
+ $OUT .= '<TH ALIGN="right">Download used</TH>' if $bytes_show{'downbytes_used'};
+ $OUT .= '<TH ALIGN="right">Download remaining</TH>' if $bytes_show{'downbytes'};
+ $OUT .= '<TH ALIGN="right">Total used</TH>' if $bytes_show{'totalbytes_used'};
+ $OUT .= '<TH ALIGN="right">Total remaining</TH>' if $bytes_show{'totalbytes'};
+ $OUT .= '</TR>';
}
%>
-<%= foreach my $svc ( @svc_acct ) {
- my $link = "${url}view_usage_details;".
- "svcnum=$svc->{'svcnum'};beginning=0;ending=0";
+<%= foreach my $svc ( @bytes_svcs ) {
+ my $link = "${url}view_usage_details;".
+ "svcnum=$svc->{'svcnum'};beginning=0;ending=0";
my $username = $svc->{'value'};
$username =~ s/@.*?$//g if $view_usage_nodomain;
- $OUT .= '<TR><TD>';
- $OUT .= qq!<A HREF="$link">!. $svc->{'label'}. ': '. $username .'</A>';
- $OUT .= '</TD><TD ALIGN="right">';
- $OUT .= $svc->{'seconds'};
- $OUT .= '</TD><TD ALIGN="right">';
- $OUT .= $svc->{'upbytes'};
- $OUT .= '</TD><TD ALIGN="right">';
- $OUT .= $svc->{'downbytes'};
- $OUT .= '</TD><TD ALIGN="right">';
- $OUT .= $svc->{'totalbytes'};
- $OUT .= '</TD></TR>';
+ $OUT .= '<TR>';
+ $OUT .= '<TD>' . qq!<A HREF="$link">!. $svc->{'label'}. ': '. $username .'</A></TD>';
+ foreach my $field (@bytes_cols) {
+ $OUT .= '<TD ALIGN="right">' . $svc->{$field} . '</TD>' if $bytes_show{$field};
+ }
if ( $svc->{'recharge_amount'} ) {
my $link = "${url}process_order_recharge;".
"svcnum=$svc->{'svcnum'}";
- $OUT .= '<TR><TD ALIGN="right">';
+ $OUT .= '<TR><TD ALIGN="right">';
$OUT .= qq!<A HREF="$link">!.'Recharge for $';
$OUT .= $svc->{'recharge_amount'} . '</A> with';
- $OUT .= '</TD><TD ALIGN="right">';
- $OUT .= $svc->{'recharge_seconds'} if $svc->{'recharge_seconds'};
- $OUT .= '</TD><TD ALIGN="right">';
- $OUT .= $svc->{'recharge_upbytes'} if $svc->{'recharge_upbytes'};
- $OUT .= '</TD><TD ALIGN="right">';
- $OUT .= $svc->{'recharge_downbytes'} if $svc->{'recharge_downbytes'};
- $OUT .= '</TD><TD ALIGN="right">';
- $OUT .= $svc->{'recharge_totalbytes'} if $svc->{'recharge_totalbytes'};
- $OUT .= '</TD></TR>';
+ $OUT .= '</TD>';
+ foreach my $field ( qw(seconds upbytes downbytes totalbytes) ) {
+ $OUT .= '<TD></TD>' if $bytes_show{$field.'_used'};
+ if ($bytes_show{$field}) {
+ $OUT .= '<TD ALIGN="right">';
+ $OUT .= $svc->{'recharge_'.$field} if $svc->{'recharge_'.$field};
+ $OUT .= '</TD>';
+ }
+ }
+ $OUT .= '</TR>';
}
}
+ if ((@bytes_svcs > 1) and (grep { $bytes_show{$_.'_used'} } qw(seconds upbytes downbytes totalbytes) )) {
+ $OUT .= '<TR>';
+ $OUT .= '<TH align="left">Total Used</TH>';
+ foreach my $field (@bytes_cols) {
+ if ($bytes_show{$field}) {
+ $OUT .= '<TD ALIGN="right">';
+ $OUT .= $bytes_used_total{$field} || '0' if $field =~ /_used$/;
+ $OUT .= '</TD>';
+ }
+ }
+ $OUT .= '</TR>';
+ }
%>
-<%= scalar(@svc_acct) ? '</TABLE><BR><BR>' : '' %>
+<%= scalar(@bytes_svcs) ? '</TABLE><BR><BR>' : '' %>
<%= if ( @svc_phone or @svc_pbx ) {
%any = ();
diff --git a/fs_selfservice/FS-SelfService/iZoomOnlineProvisionService.pm b/fs_selfservice/FS-SelfService/iZoomOnlineProvisionService.pm
deleted file mode 100644
index f4c586969..000000000
--- a/fs_selfservice/FS-SelfService/iZoomOnlineProvisionService.pm
+++ /dev/null
@@ -1,75 +0,0 @@
-package iZoomOnlineProvisionService;
-
-use strict;
-
-#BEGIN { push @INC, '/usr/lib/perl/5.8.8/' };
-use FS::SelfService qw( bulk_processrow check_username agent_login );
-
-=begin WSDL
-
-_IN agent_username $string agent username
-_IN agent_password $string agent password
-_IN agent_custid $string customer id in agent system
-_IN username $string customer service username
-_IN password $string customer service password
-_IN daytime $string phone number
-_IN first $string first name
-_IN last $string last name
-_IN address1 $string address line 1
-_IN address2 $string address line 2
-_IN city $string city
-_IN state $string state
-_IN zip $string zip
-_IN pkg $string package name
-_IN action $string one of (R|P|D|S)(reconcile, provision, provision with disk, send disk)
-_IN adjourn $string day to terminate service
-_IN mobile $string mobile phone
-_IN sms $string (T|F) acceptable to send SMS messages to mobile?
-_IN ship_addr1 $string shipping address line 1
-_IN ship_addr2 $string shipping address line 2
-_IN ship_city $string shipping address city
-_IN ship_state $string shipping address state
-_IN ship_zip $string shipping address zip
-_RETURN @string array [status, message]. status is one of OK, ERR
-
-=cut
-
-my $DEBUG = 0;
-
-sub Provision {
- my $class = shift;
-
- my $session = agent_login( map { $_ => shift @_ } qw( username password ) );
- return [ 'ERR', $session->{error} ] if $session->{error};
-
- my $result =
- bulk_processrow( session_id => $session->{session_id}, row => [ @_ ] );
-
- return $result->{error} ? [ 'ERR', $result->{error} ]
- : [ 'OK', $result->{message} ];
-}
-
-=begin WSDL
-
-_IN agent_username $string agent username
-_IN agent_password $string agent password
-_IN username $string customer service username
-_IN domain $string user domain name
-_RETURN @string [OK|ERR]
-
-=cut
-sub CheckUserName {
- my $class = shift;
-
- my $session = agent_login( map { $_ => shift @_ } qw( username password ) );
- return [ 'ERR', $session->{error} ] if $session->{error};
-
- my $result = check_username( session_id => $session->{session_id},
- map { $_ => shift @_ } qw( user domain )
- );
-
- return $result->{error} ? [ 'ERR', $result->{error} ]
- : [ 'OK', $result->{message} ];
-}
-
-1;