my($payname, $payfirst, $paylast);
if ( $cust_main->payname ) {
$payname = $cust_main->payname;
- $payname =~ /^\s*([\w \,\.\-\']*)?\s+([\w\,\.\-\']+)$/
+ $payname =~ /^\s*([\w \,\.\-\']*)?\s+([\w\,\.\-\']+)\s*$/
or do {
#$dbh->rollback if $oldAutoCommit;
return "Illegal payname $payname";
($payfirst, $paylast) = ($1, $2);
} else {
$payfirst = $cust_main->getfield('first');
- $paylast = $cust_main->getfield('first');
+ $paylast = $cust_main->getfield('last');
$payname = "$payfirst $paylast";
}
if ( $conf->exists('business-onlinepayment-description') ) {
my $dtempl = $conf->config('business-onlinepayment-description');
- my $agent = $self->cust_main->agent->agent;
+ my $agent_obj = $cust_main->agent
+ or die "can't retreive agent for $cust_main (agentnum ".
+ $cust_main->agentnum. ")";
+ my $agent = $agent_obj->agent;
my $pkgs = join(', ',
map { $_->cust_pkg->part_pkg->pkg }
grep { $_->pkgnum } $self->cust_bill_pkg
'expiration' => $exp,
'referer' => 'http://cleanwhisker.420.am/',
'email' => $email,
+ 'phone' => $cust_main->daytime || $cust_main->night,
);
$transaction->submit();
my $template = new Text::Template (
TYPE => 'ARRAY',
SOURCE => [ map "$_\n", @templ ],
- ) or die "($perror) can't create template: $Text::Template::ERROR";
+ ) or return "($perror) can't create template: $Text::Template::ERROR";
$template->compile()
- or die "($perror) can't compile template: $Text::Template::ERROR";
+ or return "($perror) can't compile template: $Text::Template::ERROR";
my $error = $transaction->error_message;
$!=0;
$message->smtpsend( Host => $smtpmachine )
or $message->smtpsend( Host => $smtpmachine, Debug => 1 )
- or die "($perror) (customer # ". $self->custnum.
+ or return "($perror) (customer # ". $self->custnum.
") can't send card decline email to ".
join(', ', grep { $_ ne 'POST' } $cust_main->invoicing_list ).
" via server $smtpmachine with SMTP: $!";
=head1 VERSION
-$Id: cust_bill.pm,v 1.28 2002-04-16 09:38:19 ivan Exp $
+$Id: cust_bill.pm,v 1.34 2002-05-06 13:36:02 ivan Exp $
=head1 BUGS