Mailing List Archive

[interchange] Fix [charge] to not populate $Vend::Session->{errors}{mv_credit_card_valid}
commit 5c6a0418fc94841d2efa9aec9db25a3874fe774c
Author: Stefan Hornburg (Racke) <racke@linuxia.de>
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'};
}

_______________________________________________
interchange-cvs mailing list
interchange-cvs@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-cvs