summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2003-04-21 20:53:57 +0000
committerivan <ivan>2003-04-21 20:53:57 +0000
commit030bef17868168b05a67d9f5866b55da1bb9439c (patch)
treeafb0ca6f648985fe710dc07b87ab5008a55c2a0b /FS
parent6eedae5614eee808d0e0c4b9d9b3fe7d1217b776 (diff)
on-demand vs. automatic cards & checks: added DCRD and DCHK payment types
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm4
-rw-r--r--FS/FS/cust_main.pm17
-rw-r--r--FS/FS/part_bill_event.pm4
-rwxr-xr-xFS/bin/freeside-daily2
-rwxr-xr-xFS/bin/freeside-expiration-alerter6
-rwxr-xr-xFS/bin/freeside-setup2
6 files changed, 20 insertions, 15 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index cb404ff03..5681dde38 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -905,7 +905,7 @@ httemplate/docs/config.html
'section' => '',
'description' => 'Acceptable payment types for the signup server',
'type' => 'selectmultiple',
- 'select_enum' => [ qw(CARD CHEK LECB PREPAY BILL COMP) ],
+ 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
},
{
@@ -1013,7 +1013,7 @@ httemplate/docs/config.html
'section' => 'UI',
'description' => 'Default payment type. HIDE disables display of billing information and sets customers to BILL.',
'type' => 'select',
- 'select_enum' => [ '', qw(CARD CHEK LECB BILL COMP HIDE) ],
+ 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL COMP HIDE) ],
},
{
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index cde370c68..cefc7648f 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -159,7 +159,7 @@ FS::Record. The following fields are currently supported:
=item ship_fax - phone (optional)
-=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 payby - I<CARD> (credit card - automatic), I<DCRD> (credit card - on-demand), I<CHEK> (electronic check - automatic), I<DCHK> (electronic check - on-demand), I<LECB> (Phone bill billing), I<BILL> (billing), I<COMP> (free), or I<PREPAY> (special billing type: applies a credit - see L<FS::prepay_credit> and sets billing type to I<BILL>)
=item payinfo - card number, P.O., comp issuer (4-8 lowercase alphanumerics; think username) or prepayment identifier (see L<FS::prepay_credit>)
@@ -700,11 +700,11 @@ sub check {
}
}
- $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREPAY)$/
+ $self->payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP|PREPAY)$/
or return "Illegal payby: ". $self->payby;
$self->payby($1);
- if ( $self->payby eq 'CARD' ) {
+ if ( $self->payby eq 'CARD' || $self->payby eq 'DCRD' ) {
my $payinfo = $self->payinfo;
$payinfo =~ s/\D//g;
@@ -717,7 +717,7 @@ sub check {
return gettext('unknown_card_type')
if cardtype($self->payinfo) eq "Unknown";
- } elsif ( $self->payby eq 'CHEK' ) {
+ } elsif ( $self->payby eq 'CHEK' || $self->payby eq 'DCHK' ) {
my $payinfo = $self->payinfo;
$payinfo =~ s/[^\d\@]//g;
@@ -770,7 +770,9 @@ sub check {
}
if ( $self->payname eq '' && $self->payby ne 'CHEK' &&
- ( ! $conf->exists('require_cardname') || $self->payby ne 'CARD' ) ) {
+ ( ! $conf->exists('require_cardname')
+ || $self->payby !~ /^(CARD|DCRD)$/ )
+ ) {
$self->payname( $self->first. " ". $self->getfield('last') );
} else {
$self->payname =~ /^([\w \,\.\-\']+)$/
@@ -1244,8 +1246,9 @@ sub bill {
(Attempt to) collect money for this customer's outstanding invoices (see
L<FS::cust_bill>). Usually used after the bill method.
-Depending on the value of `payby', this may print an invoice (`BILL'), charge
-a credit card (`CARD'), or just add any necessary (pseudo-)payment (`COMP').
+Depending on the value of `payby', this may print or email an invoice (I<BILL>,
+I<DCRD>, or I<DCHK>), charge a credit card (I<CARD>), charge via electronic
+check/ACH (I<CHEK>), or just add any necessary (pseudo-)payment (I<COMP>).
Most actions are now triggered by invoice events; see L<FS::part_bill_event>
and the invoice events web interface.
diff --git a/FS/FS/part_bill_event.pm b/FS/FS/part_bill_event.pm
index a75a011b0..e0e4f3f19 100644
--- a/FS/FS/part_bill_event.pm
+++ b/FS/FS/part_bill_event.pm
@@ -37,7 +37,7 @@ FS::Record. The following fields are currently supported:
=item eventpart - primary key
-=item payby - CARD, CHEK, LECB, BILL, or COMP
+=item payby - CARD, DCRD, CHEK, DCHK, LECB, BILL, or COMP
=item event - event name
@@ -140,7 +140,7 @@ sub check {
}
my $error = $self->ut_numbern('eventpart')
- || $self->ut_enum('payby', [qw( CARD CHEK LECB BILL COMP )] )
+ || $self->ut_enum('payby', [qw( CARD DCRD CHEK DCHK LECB BILL COMP )] )
|| $self->ut_text('event')
|| $self->ut_anything('eventcode')
|| $self->ut_number('seconds')
diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily
index 579d071ac..63e621b57 100755
--- a/FS/bin/freeside-daily
+++ b/FS/bin/freeside-daily
@@ -113,7 +113,7 @@ the bill and collect methods of a cust_main object. See L<FS::cust_main>.
-d: Pretend it's 'date'. Date is in any format Date::Parse is happy with,
but be careful.
- -p: Only process customers with the specified payby (CARD, CHEK, BILL, COMP, LECB)
+ -p: Only process customers with the specified payby (I<CARD>, I<DCRD>, I<CHEK>, I<DCHK>, I<BILL>, I<COMP>, I<LECB>)
-v: enable debugging
diff --git a/FS/bin/freeside-expiration-alerter b/FS/bin/freeside-expiration-alerter
index 5399f6d22..691fd3aa5 100755
--- a/FS/bin/freeside-expiration-alerter
+++ b/FS/bin/freeside-expiration-alerter
@@ -97,7 +97,7 @@ foreach my $customer (@customers)
my $expire_time = timelocal(0,0,0,$payday,--$paymonth,$payyear);
#credit cards expire at the end of the month/year of their exp date
- if ($payby eq 'CARD') {
+ if ($payby eq 'CARD' || $payby eq 'DCRD') {
($paymonth < 11) ? $paymonth++ : ($paymonth=0, $payyear++);
$expire_time = timelocal(0,0,0,$payday,$paymonth,$payyear);
$expire_time--;
@@ -127,7 +127,7 @@ foreach my $customer (@customers)
$FS::alerter::_template::first = $first;
$FS::alerter::_template::last = $last;
$FS::alerter::_template::company = $company;
- if ($payby eq 'CARD') {
+ if ($payby eq 'CARD' || $payby eq 'DCRD') {
$FS::alerter::_template::payby = "credit card (" .
substr($payinfo, 0, 2) . "xxxxxxxxxx" .
substr($payinfo, -4) . ")";
@@ -202,7 +202,7 @@ user: From the mapsecrets file - see config.html from the base documentation
=head1 VERSION
-$Id: freeside-expiration-alerter,v 1.4 2002-09-16 09:27:14 ivan Exp $
+$Id: freeside-expiration-alerter,v 1.5 2003-04-21 20:53:57 ivan Exp $
=head1 BUGS
diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup
index 010ec4c14..8ec014186 100755
--- a/FS/bin/freeside-setup
+++ b/FS/bin/freeside-setup
@@ -291,6 +291,8 @@ foreach my $aref (
[ 'COMP', 'Comp invoice', '$cust_bill->comp();', 30, 'comp' ],
[ 'CARD', 'Batch card', '$cust_bill->batch_card();', 40, 'batch-card' ],
[ 'BILL', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
+ [ 'DCRD', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
+ [ 'DCHK', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
) {
my $part_bill_event = new FS::part_bill_event({