diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 79c8f8faa..b394c5873 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -37,6 +37,8 @@ - WebGUI::Text no longer spits out a billion warnings - fix: workaround for IE not handling ' in SyndicatedContent was not catching everything - fix: WebGUI::Operation::ProductManager added a tab with wrong name. + - fix: WebGUI::Operation::Commerce www_selectPaymentGateway no longer forces + user to choose gateway if they are only authorized to use one 7.1.3 - fix: SQLReport now returns error if can't find DatabaseLink diff --git a/lib/WebGUI/Operation/Commerce.pm b/lib/WebGUI/Operation/Commerce.pm index 600ee6e36..e5d97e64a 100644 --- a/lib/WebGUI/Operation/Commerce.pm +++ b/lib/WebGUI/Operation/Commerce.pm @@ -1011,7 +1011,7 @@ sub www_selectPaymentGateway { $i18n = WebGUI::International->new($session, 'Commerce'); $plugins = WebGUI::Commerce::Payment->getEnabledPlugins($session); - if (scalar(@$plugins) > 1) { + if (scalar(@$plugins)) { foreach (@$plugins) { push(@pluginLoop, { name => $_->name, @@ -1019,8 +1019,10 @@ sub www_selectPaymentGateway { formElement => WebGUI::Form::radio($session,{name=>'paymentGateway', value=>$_->namespace}) }) if ($session->user->isInGroup($_->get('whoCanUse'))); } - } elsif (scalar(@$plugins) == 1) { - my $paymentGateway = $plugins->[0]->namespace; + } + # If user is only authorized for one payment gateway, skip this step + if (scalar(@pluginLoop) == 1) { + my $paymentGateway = $pluginLoop[0]->{namespace}; return WebGUI::Operation::Commerce::www_selectPaymentGatewaySave($session, $paymentGateway); }