X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=e2705fd83667a7d14b20f5ffa6ca69d1e92037c4;hp=cb2aa46293f515c1092238eb357ebe372f8bb24b;hb=a1e5529209c50a7b281e19c57f903f311e2adeef;hpb=17ddcceb66e4c5c45abe890403d2ca98b128d375 diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index cb2aa4629..e2705fd83 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -8,7 +8,7 @@ use vars qw( $xaction $E_NoErr ); use vars qw( $bop_processor $bop_login $bop_password $bop_action @bop_options ); use vars qw( $invoice_lines @buf ); #yuck use Date::Format; -use Mail::Internet; +use Mail::Internet 1.44; use Mail::Header; use Text::Template; use FS::Record qw( qsearch qsearchs ); @@ -458,7 +458,7 @@ sub realtime_card { 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"; @@ -466,7 +466,7 @@ sub realtime_card { ($payfirst, $paylast) = ($1, $2); } else { $payfirst = $cust_main->getfield('first'); - $paylast = $cust_main->getfield('first'); + $paylast = $cust_main->getfield('last'); $payname = "$payfirst $paylast"; } @@ -483,7 +483,10 @@ sub realtime_card { 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 @@ -515,6 +518,7 @@ sub realtime_card { 'expiration' => $exp, 'referer' => 'http://cleanwhisker.420.am/', 'email' => $email, + 'phone' => $cust_main->daytime || $cust_main->night, ); $transaction->submit(); @@ -582,9 +586,9 @@ sub realtime_card { 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; @@ -605,7 +609,7 @@ sub realtime_card { $!=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: $!"; @@ -944,7 +948,7 @@ sub print_text { =head1 VERSION -$Id: cust_bill.pm,v 1.28 2002-04-16 09:38:19 ivan Exp $ +$Id: cust_bill.pm,v 1.35 2002-05-18 09:51:30 ivan Exp $ =head1 BUGS