diff options
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r-- | FS/FS/ClientAPI/MyAccount.pm | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index b734424..73d27b5 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -209,12 +209,14 @@ sub access_info { $info->{hide_payment_fields} = [ - map { return 0 unless FS::payby->realtime($_); - my $pg = $cust_main->agent->payment_gateway( - 'method' => FS::payby->payby2bop($_), - 'nofatal' => 1, - ) or return 0; - $pg->gateway_namespace eq 'Business::OnlineThirdPartyPayment'; + map { my $pg = ''; + if ( FS::payby->realtime($_) ) { + $pg = $cust_main->agent->payment_gateway( + 'method' => FS::payby->payby2bop($_), + 'nofatal' => 1, + ); + } + $pg && $pg->gateway_namespace eq 'Business::OnlineThirdPartyPayment'; } @{ $info->{cust_paybys} } ]; @@ -469,12 +471,14 @@ sub payment_info { $return{hide_payment_fields} = [ - map { return 0 unless FS::payby->realtime($_); - my $pg = $cust_main->agent->payment_gateway( - 'method' => FS::payby->payby2bop($_), - 'nofatal' => 1, - ) or return 0; - $pg->gateway_namespace eq 'Business::OnlineThirdPartyPayment'; + map { my $pg = ''; + if ( FS::payby->realtime($_) ) { + $pg = $cust_main->agent->payment_gateway( + 'method' => FS::payby->payby2bop($_), + 'nofatal' => 1, + ); + } + $pg && $pg->gateway_namespace eq 'Business::OnlineThirdPartyPayment'; } @{ $return{cust_paybys} } ]; |