summaryrefslogtreecommitdiff
path: root/FS/FS/ClientAPI
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2018-10-30 11:07:15 -0400
committerChristopher Burger <burgerc@freeside.biz>2018-10-30 11:07:15 -0400
commit3fc05ed5adb6cbfcd6aee27b2ae199cf95cd4224 (patch)
tree6e6b4f6b07dace617b68775c82ebce52107168ff /FS/FS/ClientAPI
parent723793ec73af5af8c7d077771851829cf8f82634 (diff)
RT# 79902 - fixed so change payment information link will still work when upgraded from V3 to V4 and restores functionality in V3
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 365a42b..bb3ca12 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -876,12 +876,18 @@ sub payment_info {
$return{$_} = $cust_main->bill_location->get($_)
for qw(address1 address2 city state zip);
+ $p->{'payment_payby'} = $payment_info->{paybys} if !$p->{'payment_payby'};
+
# look for stored cust_payby info
# only if we've been given a clear payment_payby (to avoid payname conflicts)
- if ($p->{'payment_payby'} =~ /^(CARD|CHEK)$/) {
- my @search_payby = ($p->{'payment_payby'} eq 'CARD') ? ('CARD','DCRD') : ('CHEK','DCHK');
+ if ($p->{'payment_payby'} =~ /^(CARD|CHEK)$/ || (ref($p->{'payment_payby'}))) {
+ my @search_payby = ();
+ if ($p->{'payment_payby'} eq 'CARD') { @search_payby = ('CARD','DCRD'); }
+ elsif ($p->{'payment_payby'} eq 'CHEK') { @search_payby = ('CHEK','DCHK'); }
+ elsif (ref($p->{'payment_payby'}) eq 'ARRAY') { @search_payby = @{$payment_info->{paybys}}; }
my ($cust_payby) = $cust_main->cust_payby(@search_payby);
if ($cust_payby) {
+ $return{payby} = $cust_payby->payby;
$return{payname} = $cust_payby->payname
|| ( $cust_main->first. ' '. $cust_main->get('last') );
$return{custpaybynum} = $cust_payby->custpaybynum;