[ic] There were errors in your last submission. They are shown in thiscolor below.

Mike Heins mikeh@minivend.com
Thu, 18 Jan 2001 03:21:08 -0500

Quoting Ron Phipps (takedown@cdsnet.net):
> This happens because the authorizenet module that sits in between the binary
> and IC does not write the error back for the user to see.  This can easily
> be modified with a line like so:
>                 my $msg = errmsg("Verisign error: " . $result{RESULT} . " "
> . " " . $result{RESPMSG} . ". Please call in your order or try again.");
>                 $Vend::Session->{errors}{mv_credit_card_valid} = $msg;
> Put this in the authorizenet module after where the module sets the
> pop.status to 'failed'.  I'm doing this based off of the Signio module which
> may be different although I think they were built similiarly.  This will put
> the error message in RED right above the CC section.  I'm currently using
> this code on 3 production sites and it works like a charm.  Next to do is
> enable the DEBUG variable in interchange.cfg.  If the authorizenet module
> has logdebug statements it will spit out a bunch of information in
> /tmp/icdebug which is extremely helpful.  I used this log file to get Java
> Verisign on an Alpha working with IC (I'll be writing a how-to soon!).  Good
> luck!

Ron, your answer is on target as usual. And I appreciate your
contributions on this with your HOWTO. One of the many things I don't
seem to get to is collecting gems like that in one place. 8-\

I did something I shouldn't have done with the errmsg, by the way (if 
indeed I wrote that code; I know I wrote the original globalsub/signio
but can't remember what the genesis was). The reason the errmsg() routine
is used is to give access to the error locale, i.e. the call should be:

    my $msg = errmsg(
	"Signio error: %s %s. Please call in your order or try again.", 
	$result{RESULT} ,

That way, you can add this to your locale (either the global locale.error or
the catalog-based one, using either the locale DB or config file method):

Locale de_DE <<EOL
 "Signio error: %s %s. Please call in your order or try again." 
 "Fehler Signio: %s %s. benennen bitte in Ihrer Ordnung oder versuchen noch einmal."

Then, if the error occurs while the locale is de_DE, the German message
will be spit out with proper substitution of the variable error from the
result.  Of course that will still be in English unless Signio has locale
substitution. 8-)

Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>

Nature, to be commanded, must be obeyed. -- Francis Bacon