{
'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' ],
},
{
- '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',
},
{
- '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.',
);
}
+=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;
( $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,
'referer' => 'http://cleanwhisker.420.am/',
'email' => $email,
'phone' => $cust_main->daytime || $cust_main->night,
+ %content, #after
);
$transaction->submit();
my %method2payby = (
'CC' => 'CARD',
'ECHECK' => 'CHEK',
+ 'LEC' => 'LECB',
);
my $cust_pay = new FS::cust_pay ( {
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',
# );
#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;
=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
=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>)
$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
}
}
}
- $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;
} 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');
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})?)$/
|| $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];
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 {
$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
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
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
or die "can't open $prefix/named.conf: $!";
open(CONF_HEADER,"<$prefix/named.conf.HEADER")
- or die "can't open $prefix/named.conf.HEADER: $!"
+ or die "can't open $prefix/named.conf.HEADER: $!";
while (<CONF_HEADER>) { print NAMED_CONF $_; }
close CONF_HEADER;
or die "can't open $prefix/named.conf: $!";
open(CONF_HEADER,"<$prefix/named.conf.HEADER")
- or die "can't open $prefix/named.conf.HEADER: $!"
+ or die "can't open $prefix/named.conf.HEADER: $!";
while (<CONF_HEADER>) { print NAMED_CONF $_; }
close CONF_HEADER;
#!/usr/bin/perl -Tw
#
-# $Id: fs-setup,v 1.96.4.4 2002-12-14 11:16:04 steve Exp $
+# $Id: fs-setup,v 1.96.4.5 2002-12-14 12:19:19 steve Exp $
#to delay loading dbdef until we're ready
BEGIN { $FS::Record::setup_hack = 1; }
'_date', @date_type,
'payby', 'char', '', 4, # CARD/BILL/COMP, should be index into
# payment type table.
- 'payinfo', 'varchar', 'NULL', 16, #see cust_main above
+ 'payinfo', 'varchar', 'NULL', $char_d, #see cust_main above
'paybatch', 'varchar', 'NULL', $char_d, #for auditing purposes.
'closed', 'char', 'NULL', 1,
],
'reason', 'varchar', '', $char_d,
'payby', 'char', '', 4, # CARD/BILL/COMP, should be index
# into payment type table.
- 'payinfo', 'varchar', 'NULL', 16, #see cust_main above
+ 'payinfo', 'varchar', 'NULL', $char_d, #see cust_main above
'paybatch', 'varchar', 'NULL', $char_d,
'closed', 'char', 'NULL', 1,
],
'columns' => [
'recnum', 'int', '', '',
'svcnum', 'int', '', '',
- 'reczone', 'varchar', '', $char_d,
+ #'reczone', 'varchar', '', $char_d,
+ 'reczone', 'varchar', '', 255,
'recaf', 'char', '', 2,
'rectype', 'char', '', 5,
- 'recdata', 'varchar', '', $char_d,
+ #'recdata', 'varchar', '', $char_d,
+ 'recdata', 'varchar', '', 255,
],
'primary_key' => 'recnum',
'unique' => [],
'login' => 'MyAccount/login',
'customer_info' => 'MyAccount/customer_info',
'invoice' => 'MyAccount/invoice',
- 'start' => 'MyAccount/start',
- 'update' => 'MyAccount/update',
- 'collect' => 'MyAccount/collect',
- 'cancel' => 'MyAccount/cancel',
- 'uncancel' => 'MyAccount/uncancel',
- 'getinfo' => 'MyAccount/getinfo',
- 'charge' => 'MyAccount/charge',
- 'new_customer' => 'MyAccount/new_customer',
);
-
@EXPORT_OK = keys %autoload;
$ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin';
use FS::UID qw(adminsuidsetup forksuidsetup);
use FS::ClientAPI;
-$ENV{SELFSERVICE_SERVER} = 'TRUE';
$Debug = 2; # >= 2 will log packet contents, including potentially compromising
# information
use vars qw( $opt $Debug );
-$ENV{SIGNUP_SERVER} = 'TRUE';
$Debug = 2;
my $user = shift or die &usage;
'msgcat' => { map { $_=>gettext($_) } qw(
passwords_dont_match invalid_card unknown_card_type not_a
- ) }
+ ) },
+
+ 'statedefault' => $conf->config('statedefault') || 'CA',
+
+ 'countrydefault' => $conf->config('countrydefault') || 'US',
};
map { $_ => $signup_data->{$_} } qw(
last first ss company address1 address2 city county state zip country
- daytime night fax payby payinfo paydate payname referral_custnum comments
+ daytime night fax payby payinfo paydate payname referral_custnum
),
} );
$error ||= "Illegal payment type"
unless grep { $_ eq $signup_data->{'payby'} } @payby;
+ $cust_main->payinfo($cust_main->daytime)
+ if $cust_main->payby eq 'LECB' && ! $cust_main->payinfo;
+
my @invoicing_list = split( /\s*\,\s*/, $signup_data->{'invoicing_list'} );
$signup_data->{'pkgpart'} =~ /^(\d+)$/ or '' =~ /^()$/;