diff options
author | Ivan Kohler <ivan@freeside.biz> | 2019-02-13 10:02:47 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2019-02-13 10:02:47 -0800 |
commit | 92e8ec0e2092fef7bfb126f8d87acac83bbca8eb (patch) | |
tree | f4ce041d62105d6d091a3a48ce3d0817cc88a550 /FS/FS/cust_main/Billing_Realtime.pm | |
parent | 9427fea032c131bc2c000515853d4f1462b7deff (diff) |
restore fallback to customer billing address for CC transactions, RT#77641, RT#71513
Diffstat (limited to 'FS/FS/cust_main/Billing_Realtime.pm')
-rw-r--r-- | FS/FS/cust_main/Billing_Realtime.pm | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm index b29408b0e..4ff2c0602 100644 --- a/FS/FS/cust_main/Billing_Realtime.pm +++ b/FS/FS/cust_main/Billing_Realtime.pm @@ -361,14 +361,23 @@ sub _bop_content { $content{name} = $payname if $payname; - $content{address} = $options->{'address1'}; - my $address2 = $options->{'address2'}; - $content{address} .= ", ". $address2 if length($address2); - - $content{city} = $options->{'city'}; - $content{state} = $options->{'state'}; - $content{zip} = $options->{'zip'}; - $content{country} = $options->{'country'}; + if ( exists($options->{'address1'}) ) { + + $content{address} = $options->{'address1'}; + my $address2 = $options->{'address2'}; + $content{address} .= ", ". $address2 if length($address2); + + $content{$_} = $options->{$_} foreach qw( city state zip country ); + + } elsif ( ref($self) ) { + + $content{address} = $self->address1; + my $address2 = $self->address2; + $content{address} .= ", ". $address2 if length($address2); + + $content{$_} = $self->$_() foreach qw( city state zip country ); + + } # can't set phone if called as class method $content{phone} = $self->daytime || $self->night |