diff options
author | ivan <ivan> | 2002-04-06 22:32:43 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-04-06 22:32:43 +0000 |
commit | 99a8652052e5b036e7db08c32603c0feadc60e85 (patch) | |
tree | 7f756edc8e506018290107c4f0f3759302c8df94 /FS | |
parent | 4fa13bb706c06379b76b085c5f4acdea42902f4f (diff) |
add a config option to set the Business::OnlinePayment description field,
and make some useful data available for the config option.
closes: Bug#378
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Conf.pm | 7 | ||||
-rw-r--r-- | FS/FS/cust_bill.pm | 19 | ||||
-rw-r--r-- | FS/FS/cust_bill_pkg.pm | 13 | ||||
-rw-r--r-- | FS/FS/cust_main.pm | 11 |
4 files changed, 46 insertions, 4 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index bda19c0a2..74e28d8b1 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -269,6 +269,13 @@ httemplate/docs/config.html }, { + 'key' => 'business-onlinepayment-description', + 'section' => 'billing', + 'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>. Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages to which the invoiced being charged applies)', + 'type' => 'textarea', + }, + + { 'key' => 'bsdshellmachines', 'section' => 'shell', 'description' => 'Your BSD flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd\' and `/etc/master.passwd\'.', diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 0a8d4a4ae..2461e42f1 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -478,6 +478,19 @@ sub realtime_card { my $email = $invoicing_list[0]; my( $action1, $action2 ) = split(/\s*\,\s*/, $bop_action ); + + my $description = 'Internet Services'; + if ( $conf->exists('business-onlinepayment-description') ) { + my $dtempl = $conf->config('business-onlinepayment-description'); + + my $agent = $self->cust_main->agent->agent; + my $pkgs = join(', ', + map { $_->cust_pkg->part_pkg->pkg } + grep { $_->pkgnum } $self->cust_bill_pkg + ); + $description = eval qq("$dtempl"); + + } my $transaction = new Business::OnlinePayment( $bop_processor, @bop_options ); @@ -486,7 +499,7 @@ sub realtime_card { 'login' => $bop_login, 'password' => $bop_password, 'action' => $action1, - 'description' => 'Internet Services', + 'description' => $description, 'amount' => $amount, 'invoice_number' => $self->invnum, 'customer_id' => $self->custnum, @@ -520,7 +533,7 @@ sub realtime_card { order_number => $ordernum, amount => $amount, authorization => $auth, - description => 'Internet Services', + description => $description, ); $capture->submit(); @@ -887,7 +900,7 @@ sub print_text { =head1 VERSION -$Id: cust_bill.pm,v 1.24 2002-03-18 21:40:17 ivan Exp $ +$Id: cust_bill.pm,v 1.25 2002-04-06 22:32:43 ivan Exp $ =head1 BUGS diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index b3d3fcde2..72f9ce4a9 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -125,11 +125,22 @@ sub check { ''; #no error } +=item cust_pkg + +Returns the package (see L<FS::cust_pkg>) for this invoice line item. + +=cut + +sub cust_pkg { + my $self = shift; + qsearchs( 'cust_pkg', { 'pkgnum' => $self->pkgnum } ); +} + =back =head1 VERSION -$Id: cust_bill_pkg.pm,v 1.2 2001-02-11 17:34:44 ivan Exp $ +$Id: cust_bill_pkg.pm,v 1.3 2002-04-06 22:32:43 ivan Exp $ =head1 BUGS diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index b59b0d1ac..499d149a6 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -817,6 +817,17 @@ sub cancel { grep { $_->cancel } $self->ncancelled_pkgs; } +=item agent + +Returns the agent (see L<FS::agent>) for this customer. + +=cut + +sub agent { + my $self = shift; + qsearchs( 'agent', { 'agent' => $self->agentnum } ); +} + =item bill OPTIONS Generates invoices (see L<FS::cust_bill>) for this customer. Usually used in |