summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorsteve <steve>2002-12-14 12:19:28 +0000
committersteve <steve>2002-12-14 12:19:28 +0000
commit5d235092e3d3e31d404b6e1db2ff8ec30098c2af (patch)
tree37b4d4b0c2c93fcbde1987541ec280d4ae850d93 /FS
parent9d722730eba9b3d03b6a68615e99d5de9b830111 (diff)
botched commit
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm37
-rw-r--r--FS/FS/cust_bill.pm39
-rw-r--r--FS/FS/cust_main.pm46
-rw-r--r--FS/FS/cust_pkg.pm45
-rw-r--r--FS/MANIFEST2
5 files changed, 60 insertions, 109 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index be5d4ec7d..e805c8ee7 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -815,7 +815,7 @@ httemplate/docs/config.html
{
'key' => 'username_policy',
- 'section' => '',
+ 'section' => 'deprecated',
'description' => 'This file controls the mechanism for preventing duplicate usernames in passwd/radius files exported from svc_accts. This should be one of \'prepend domsvc\' \'append domsvc\' \'append domain\' or \'append @domain\'',
'type' => 'select',
'select_enum' => [ 'prepend domsvc', 'append domsvc', 'append domain', 'append @domain' ],
@@ -894,20 +894,6 @@ httemplate/docs/config.html
},
{
- 'key' => 'selfservice_server-quiet',
- 'section' => '',
- 'description' => 'Disable decline and cancel emails generated by transactions initiated by the selfservice server. Not recommended, unless the customer will get instant feedback from a customer service UI, and receiving an email would be confusing/overkill.',
- 'type' => 'checkbox',
- },
-
- {
- 'key' => 'signup_server-quiet',
- 'section' => '',
- 'description' => 'Disable decline and cancel emails generated by transactions initiated by the signup server. Not recommended, unless the customer will get instant feedback from a customer service UI, and receiving an email would be confusing/overkill. Does not disable welcome emails.',
- 'type' => 'checkbox',
- },
-
- {
'key' => 'signup_server-payby',
'section' => '',
'description' => 'Acceptable payment types for the signup server',
@@ -952,27 +938,6 @@ httemplate/docs/config.html
},
{
- 'key' => 'cancelmessage',
- 'section' => 'billing',
- 'description' => 'Template file for cancellation emails.',
- 'type' => 'textarea',
- },
-
- {
- 'key' => 'cancelsubject',
- 'section' => 'billing',
- 'description' => 'Subject line for cancellation emails.',
- 'type' => 'text',
- },
-
- {
- 'key' => 'emailcancel',
- 'section' => 'billing',
- 'description' => 'Enable emailing of cancellation notices.',
- 'type' => 'checkbox',
- },
-
- {
'key' => 'require_cardname',
'section' => 'billing',
'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 01d0f1790..6856e5fe8 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -656,6 +656,28 @@ sub realtime_ach {
);
}
+=item realtime_lec
+
+Attempts to pay this invoice with phone bill (LEC) payment via a
+Business::OnlinePayment realtime gateway. See
+http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment
+for supported processors.
+
+=cut
+
+sub realtime_lec {
+ my $self = shift;
+ $self->realtime_bop(
+ 'LEC',
+ $bop_processor,
+ $bop_login,
+ $bop_password,
+ $bop_action,
+ \@bop_options,
+ @_
+ );
+}
+
sub realtime_bop {
my( $self, $method, $processor, $login, $password, $action, $options ) = @_;
my $cust_main = $self->cust_main;
@@ -714,12 +736,13 @@ sub realtime_bop {
( $content{account_number}, $content{routing_code} ) =
split('@', $cust_main->payinfo);
$content{bank_name} = $cust_main->payname;
+ } elsif ( $method eq 'LEC' ) {
+ $content{phone} = $cust_main->payinfo;
}
my $transaction =
new Business::OnlinePayment( $processor, @$options );
$transaction->content(
- %content,
'type' => $method,
'login' => $login,
'password' => $password,
@@ -739,6 +762,7 @@ sub realtime_bop {
'referer' => 'http://cleanwhisker.420.am/',
'email' => $email,
'phone' => $cust_main->daytime || $cust_main->night,
+ %content, #after
);
$transaction->submit();
@@ -790,6 +814,7 @@ sub realtime_bop {
my %method2payby = (
'CC' => 'CARD',
'ECHECK' => 'CHEK',
+ 'LEC' => 'LECB',
);
my $cust_pay = new FS::cust_pay ( {
@@ -817,11 +842,9 @@ sub realtime_bop {
my $perror = "$processor error, invnum #". $self->invnum. ': '.
$transaction->result_code. ": ". $transaction->error_message;
- if ( !($ENV{SIGNUP_SERVER} && $conf->exists('signup_server-quiet'))
- && !($ENV{SELFSERVICE_SERVER} && $conf->exists('selfservice_server-quiet'))
- && $conf->exists('emaildecline')
+ if ( $conf->exists('emaildecline')
&& grep { $_ ne 'POST' } $cust_main->invoicing_list
- ) {
+ ) {
my @templ = $conf->config('declinetemplate');
my $template = new Text::Template (
TYPE => 'ARRAY',
@@ -1161,16 +1184,14 @@ sub print_text {
# );
#and subroutine for the template
-
sub FS::cust_bill::_template::invoice_lines {
- my $lines = shift or return @buf;
+ my $lines = shift || scalar(@buf);
map {
scalar(@buf) ? shift @buf : [ '', '' ];
}
( 1 .. $lines );
}
-
#and fill it in
$FS::cust_bill::_template::page = 1;
my $lines;
@@ -1190,7 +1211,7 @@ sub print_text {
=head1 VERSION
-$Id: cust_bill.pm,v 1.41.2.14 2002-12-14 11:13:53 steve Exp $
+$Id: cust_bill.pm,v 1.41.2.15 2002-12-14 12:19:16 steve Exp $
=head1 BUGS
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 9ee243789..fdb06200a 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -158,7 +158,7 @@ FS::Record. The following fields are currently supported:
=item ship_fax - phone (optional)
-=item payby - `CARD' (credit cards), `CHEK' (electronic check), `BILL' (billing), `COMP' (free), or `PREPAY' (special billing type: applies a credit - see L<FS::prepay_credit> and sets billing type to BILL)
+=item payby - `CARD' (credit cards), `CHEK' (electronic check), `LECB' (Phone bill billing), `BILL' (billing), `COMP' (free), or `PREPAY' (special billing type: applies a credit - see L<FS::prepay_credit> and sets billing type to BILL)
=item payinfo - card number, P.O., comp issuer (4-8 lowercase alphanumerics; think username) or prepayment identifier (see L<FS::prepay_credit>)
@@ -482,14 +482,15 @@ sub replace {
$self->invoicing_list( $invoicing_list );
}
- if ( $self->payby =~ /^(CARD|CHEK)$/ &&
+ if ( $self->payby =~ /^(CARD|CHEK|LECB)$/ &&
grep { $self->get($_) ne $old->get($_) } qw(payinfo paydate payname) ) {
# card info has changed, want to retry realtime_card invoice events
#false laziness w/collect
foreach my $cust_bill_event (
grep {
#$_->part_bill_event->plan eq 'realtime-card'
- $_->part_bill_event->eventcode eq '$cust_bill->realtime_card();'
+ $_->part_bill_event->eventcode =~
+ /^\$cust_bill\->realtime_(card|ach|lec)\(\);$/
&& $_->status eq 'done'
&& $_->statustext
}
@@ -664,14 +665,14 @@ sub check {
}
}
- $self->payby =~ /^(CARD|CHEK|BILL|COMP|PREPAY)$/
+ $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREPAY)$/
or return "Illegal payby: ". $self->payby;
$self->payby($1);
if ( $self->payby eq 'CARD' ) {
my $payinfo = $self->payinfo;
- $payinfo =~ s/[^\d\@]//g;
+ $payinfo =~ s/\D//g;
$payinfo =~ /^(\d{13,16})$/
or return gettext('invalid_card'); # . ": ". $self->payinfo;
$payinfo = $1;
@@ -684,11 +685,19 @@ sub check {
} elsif ( $self->payby eq 'CHEK' ) {
my $payinfo = $self->payinfo;
- #$payinfo =~ s/[\D\@]//g;
+ $payinfo =~ s/[^\d\@]//g;
$payinfo =~ /^(\d+)\@(\d{9})$/ or return 'invalid echeck account@aba';
$payinfo = "$1\@$2";
$self->payinfo($payinfo);
+ } elsif ( $self->payby eq 'LECB' ) {
+
+ my $payinfo = $self->payinfo;
+ $payinfo =~ s/\D//g;
+ $payinfo =~ /^1?(\d{10})$/ or return 'invalid btn billing telephone number';
+ $payinfo = $1;
+ $self->payinfo($payinfo);
+
} elsif ( $self->payby eq 'BILL' ) {
$error = $self->ut_textn('payinfo');
@@ -713,7 +722,7 @@ sub check {
if ( $self->paydate eq '' || $self->paydate eq '-' ) {
return "Expriation date required"
- unless $self->payby =~ /^(BILL|PREPAY|CHEK)$/;
+ unless $self->payby =~ /^(BILL|PREPAY|CHEK|LECB)$/;
$self->paydate('');
} else {
$self->paydate =~ /^(\d{1,2})[\/\-](\d{2}(\d{2})?)$/
@@ -1045,26 +1054,25 @@ sub bill {
|| $self->payby eq 'COMP'
|| $taxable_charged == 0 ) {
- my $cust_main_county =
- qsearchs('cust_main_county',{
+ my $cust_main_county = qsearchs('cust_main_county',{
'state' => $self->state,
'county' => $self->county,
'country' => $self->country,
'taxclass' => $part_pkg->taxclass,
- } )
- or qsearchs('cust_main_county',{
+ } );
+ $cust_main_county ||= qsearchs('cust_main_county',{
'state' => $self->state,
'county' => $self->county,
'country' => $self->country,
'taxclass' => '',
- } )
- or do {
- $dbh->rollback if $oldAutoCommit;
- return
- "fatal: can't find tax rate for state/county/country/taxclass ".
- join('/', ( map $self->$_(), qw(state county country) ),
- $part_pkg->taxclass ). "\n";
- };
+ } );
+ unless ( $cust_main_county ) {
+ $dbh->rollback if $oldAutoCommit;
+ return
+ "fatal: can't find tax rate for state/county/country/taxclass ".
+ join('/', ( map $self->$_(), qw(state county country) ),
+ $part_pkg->taxclass ). "\n";
+ }
if ( $cust_main_county->exempt_amount ) {
my ($mon,$year) = (localtime($sdate) )[4,5];
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 7a248256a..24b96c6e3 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -20,13 +20,6 @@ use FS::svc_domain;
use FS::svc_www;
use FS::svc_forward;
-# need all this for sending cancel emails in sub cancel
-
-use FS::Conf;
-use Date::Format;
-use Mail::Internet 1.44;
-use Mail::Header;
-
@ISA = qw( FS::Record );
sub _cache {
@@ -298,45 +291,7 @@ sub cancel {
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
- my $conf = new FS::Conf;
-
- if ( !($ENV{SIGNUP_SERVER} && $conf->exists('signup_server-quiet'))
- && !($ENV{SELFSERVICE_SERVER} && $conf->exists('selfservice_server-quiet'))
- && $conf->exists('emailcancel')
- && grep { $_ ne 'POST' } $self->cust_main->invoicing_list) {
-
- my @invoicing_list = $self->cust_main->invoicing_list;
-
- my $invoice_from = $conf->config('invoice_from');
- my @print_text = map "$_\n", $conf->config('cancelmessage');
- my $subject = $conf->config('cancelsubject');
- my $smtpmachine = $conf->config('smtpmachine');
-
- if ( grep { $_ ne 'POST' } @invoicing_list ) { #email invoice
- #false laziness w/FS::cust_pay::delete & fs_signup_server && ::realtime_card
- #$ENV{SMTPHOSTS} = $smtpmachine;
- $ENV{MAILADDRESS} = $invoice_from;
- my $header = new Mail::Header ( [
- "From: $invoice_from",
- "To: ". join(', ', grep { $_ ne 'POST' } @invoicing_list ),
- "Sender: $invoice_from",
- "Reply-To: $invoice_from",
- "Date: ". time2str("%a, %d %b %Y %X %z", time),
- "Subject: $subject",
- ] );
- my $message = new Mail::Internet (
- 'Header' => $header,
- 'Body' => [ @print_text ],
- );
- $!=0;
- $message->smtpsend( Host => $smtpmachine )
- or $message->smtpsend( Host => $smtpmachine, Debug => 1 );
- #should this return an error?
- }
- }
-
''; #no errors
-
}
=item suspend
diff --git a/FS/MANIFEST b/FS/MANIFEST
index 1489cd0e9..578120d57 100644
--- a/FS/MANIFEST
+++ b/FS/MANIFEST
@@ -68,6 +68,7 @@ FS/part_export/cyrus.pm
FS/part_export/domain_shellcommands.pm
FS/part_export/http.pm
FS/part_export/infostreet.pm
+FS/part_export/ldap.pm
FS/part_export/null.pm
FS/part_export/shellcommands.pm
FS/part_export/shellcommands_withdomain.pm
@@ -142,6 +143,7 @@ t/part_export-cyrus.t
t/part_export-domain_shellcommands.t
t/part_export-http.t
t/part_export-infostreet.t
+t/part_export-ldap.t
t/part_export-null.t
t/part_export-shellcommands.t
t/part_export-shellcommands_withdomain.t