[freeside-commits] freeside/FS/FS cust_main.pm,1.506,1.507
Jeff Finucane,420,,
jeff at wavetail.420.am
Thu Jun 3 09:20:42 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv16117
Modified Files:
cust_main.pm
Log Message:
repair botched refactor start during BOTPP integration RT# 8600
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.506
retrieving revision 1.507
diff -u -w -d -r1.506 -r1.507
--- cust_main.pm 20 May 2010 01:33:07 -0000 1.506
+++ cust_main.pm 3 Jun 2010 16:20:39 -0000 1.507
@@ -4265,14 +4265,6 @@
my ($self, $options) = @_;
my %content = ();
- $content{address} = exists($options->{'address1'})
- ? $options->{'address1'}
- : $self->address1;
- my $address2 = exists($options->{'address2'})
- ? $options->{'address2'}
- : $self->address2;
- $content{address} .= ", ". $address2 if length($address2);
-
my $payip = exists($options->{'payip'}) ? $options->{'payip'} : $self->payip;
$content{customer_ip} = $payip if length($payip);
@@ -4283,14 +4275,30 @@
( $conf->exists('business-onlinepayment-email_customer')
|| $conf->exists('business-onlinepayment-email-override') );
- $content{payfirst} = $self->getfield('first');
- $content{paylast} = $self->getfield('last');
+ my ($payname, $payfirst, $paylast);
+ if ( $options->{payname} && $options->{method} ne 'ECHECK' ) {
+ ($payname = $options->{payname}) =~
+ /^\s*([\w \,\.\-\']*)?\s+([\w\,\.\-\']+)\s*$/
+ or return "Illegal payname $payname";
+ ($payfirst, $paylast) = ($1, $2);
+ } else {
+ $payfirst = $self->getfield('first');
+ $paylast = $self->getfield('last');
+ $payname = "$payfirst $paylast";
+ }
- $content{account_name} = "$content{payfirst} $content{paylast}"
- if $options->{method} eq 'ECHECK';
+ $content{last_name} = $paylast;
+ $content{first_name} = $payfirst;
- $content{name} = $options->{payname};
- $content{name} = $content{account_name} if exists($content{account_name});
+ $content{name} = $payname;
+
+ $content{address} = exists($options->{'address1'})
+ ? $options->{'address1'}
+ : $self->address1;
+ my $address2 = exists($options->{'address2'})
+ ? $options->{'address2'}
+ : $self->address2;
+ $content{address} .= ", ". $address2 if length($address2);
$content{city} = exists($options->{city})
? $options->{city}
@@ -4304,10 +4312,11 @@
$content{country} = exists($options->{country})
? $options->{country}
: $self->country;
+
$content{referer} = 'http://cleanwhisker.420.am/'; #XXX fix referer :/
$content{phone} = $self->daytime || $self->night;
- (%content);
+ \%content;
}
my %bop_method2payby = (
@@ -4383,13 +4392,8 @@
# massage data
###
- my (%bop_content) = $self->_bop_content(\%options);
-
- if ( $options{method} ne 'ECHECK' ) {
- $options{payname} =~ /^\s*([\w \,\.\-\']*)?\s+([\w\,\.\-\']+)\s*$/
- or return "Illegal payname $options{payname}";
- ($bop_content{payfirst}, $bop_content{paylast}) = ($1, $2);
- }
+ my $bop_content = $self->_bop_content(\%options);
+ return $bop_content unless ref($bop_content);
my @invoicing_list = $self->invoicing_list_emailonly;
if ( $conf->exists('emailinvoiceautoalways')
@@ -4455,6 +4459,9 @@
$content{account_type} = exists($options{'paytype'})
? uc($options{'paytype'}) || 'CHECKING'
: uc($self->getfield('paytype')) || 'CHECKING';
+ $content{account_name} = $self->getfield('first'). ' '.
+ $self->getfield('last');
+
$content{customer_org} = $self->company ? 'B' : 'I';
$content{state_id} = exists($options{'stateid'})
? $options{'stateid'}
@@ -4539,7 +4546,7 @@
'amount' => $options{amount},
#'invoice_number' => $options{'invnum'},
'customer_id' => $self->custnum,
- %bop_content,
+ %$bop_content,
'reference' => $cust_pay_pending->paypendingnum, #for now
'email' => $email,
%content, #after
More information about the freeside-commits
mailing list