From 07560581aedba753147fcb3f6a5e7c30bdc2f77f Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 29 Aug 2009 18:51:41 +0000 Subject: [PATCH] hopefully fix self-service when not using real-time gateway --- FS/FS/ClientAPI/MyAccount.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index e1d4c9225..b73442421 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -209,12 +209,12 @@ sub access_info { $info->{hide_payment_fields} = [ - map { FS::payby->realtime($_) && - $cust_main - ->agent - ->payment_gateway( 'method' => FS::payby->payby2bop($_) ) - ->gateway_namespace - eq 'Business::OnlineThirdPartyPayment' + 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'; } @{ $info->{cust_paybys} } ]; @@ -469,12 +469,12 @@ sub payment_info { $return{hide_payment_fields} = [ - map { FS::payby->realtime($_) && - $cust_main - ->agent - ->payment_gateway( 'method' => FS::payby->payby2bop($_) ) - ->gateway_namespace - eq 'Business::OnlineThirdPartyPayment' + 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'; } @{ $return{cust_paybys} } ]; -- 2.11.0