[ic] lib/Vend/Payment.pm patch

Randy Moore interchange-users@interchange.redhat.com
Fri Mar 29 01:28:01 2002


Hi,

This is a small patch for lib/Vend/Payment.pm (in v 4.8.3) that sets the
$Vend::Session->{errors}{mv_credit_card_valid} hash when a payment module 
returns a failure.

This is needed so that the [error std_label="Credit Card Information" 
name=mv_credit_card_valid] tag on the checkout page can show an appropriate 
error message when the credit card payments fail for some reason.  Without 
this patch, when a payment fails, the checkout page will show the standard 
message:
         There were errors in your last submission.
         They are shown in RED below

But, the credit card field does NOT show up in red and the error message 
doesn't appear anywhere on the page.

There may be good reasons why these messages should NOT show up on the 
checkout page, but I can't think of any.  There also could be better ways 
to fix this, but this patch should fix it for all payment modules.

--- Payment.pm.orig     Fri Mar 29 01:06:30 2002
+++ Payment.pm  Fri Mar 29 00:55:54 2002
@@ -437,6 +437,7 @@

         if($result{$svar} !~ /^success/) {
                 $Vend::Session->{payment_error} = $result{$evar};
+               $Vend::Session->{errors}{mv_credit_card_valid} = 
$result{$evar};
                 $result{'invalid-order-id'} = delete $result{'order-id'}
                         if $result{'order-id'};
         }
Randy Moore
Axion Information Technologies, Inc.

email     ramoore@axion-it.net
phone   301-408-1200
fax        301-445-3947