fix: WebGUI::Operation::Commerce now picks payment gateway for the user if only one authorized

This commit is contained in:
Doug Bell 2006-11-06 23:54:56 +00:00
parent aa2327141d
commit a072558478
2 changed files with 7 additions and 3 deletions

View file

@ -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

View file

@ -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);
}