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

Stefan Hornburg <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit 5c6a0418fc94841d2efa9aec9db25a3874fe774c
Author: Stefan Hornburg (Racke) <[email protected]>
Date:   Thu Apr 14 19:10:27 2011 +0200

    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.

 lib/Vend/Payment.pm |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/lib/Vend/Payment.pm b/lib/Vend/Payment.pm
index d0a6238..8175da2 100644
--- a/lib/Vend/Payment.pm
+++ b/lib/Vend/Payment.pm
@@ -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'};
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.