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 );
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";
}
'expiration' => $exp,
'referer' => 'http://cleanwhisker.420.am/',
'email' => $email,
+ 'phone' => $cust_main->daytime || $cust_main->night,
);
$transaction->submit();
if ( $transaction->is_success() && $action2 ) {
my $auth = $transaction->authorization;
my $ordernum = $transaction->order_number;
+
#warn "********* $auth ***********\n";
#warn "********* $ordernum ***********\n";
my $capture =
$template->compile()
or return "($perror) can't compile template: $Text::Template::ERROR";
- my $error = $transaction->error_message;
+ my $templ_hash = { error => $transaction->error_message };
#false laziness w/FS::cust_pay::delete & fs_signup_server && ::send
$ENV{MAILADDRESS} = $invoice_from;
] );
my $message = new Mail::Internet (
'Header' => $header,
- 'Body' => [ $template->fill_in() ],
+ 'Body' => [ $template->fill_in(HASH => $templ_hash) ],
);
$!=0;
$message->smtpsend( Host => $smtpmachine )
'payname' => $cust_main->getfield('payname'),
'amount' => $self->owed,
} );
- $cust_pay_batch->insert;
+ my $error = $cust_pay_batch->insert;
+ die $error if $error;
+ '';
}
=item print_text [TIME];
=head1 VERSION
-$Id: cust_bill.pm,v 1.32 2002-04-16 22:56:58 ivan Exp $
+$Id: cust_bill.pm,v 1.37 2002-06-07 20:33:27 khoff Exp $
=head1 BUGS