Permalink
Browse files

Fix [charge] to not populate $Vend::Session->{errors}{mv_credit_card_…

…valid}

when payment module returned an empty error message.

This happens with PayPaypalExpress when using setrequest request and
results in [if errors]...[/if] being true but [error all=1 show_error=1]
displaying nothing.
  • Loading branch information...
1 parent 60a4731 commit 5c6a0418fc94841d2efa9aec9db25a3874fe774c @racke racke committed Apr 14, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Vend/Payment.pm
View
@@ -508,7 +508,9 @@ sub charge {
if($result{$svar} !~ /^success/) {
$Vend::Session->{payment_error} = $result{$evar};
- $Vend::Session->{errors}{mv_credit_card_valid} = $result{$evar};
+ if ($result{$evar} =~ /\S/) {
+ $Vend::Session->{errors}{mv_credit_card_valid} = $result{$evar};
+ }
$result{'invalid-order-id'} = delete $result{'order-id'}
if $result{'order-id'};
}

0 comments on commit 5c6a041

Please sign in to comment.