MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

AVS Code in UserTag Doesn't Work?



******    message to minivend-users from mwatkins@lexmark.com     ******

Hi Mike and All,

I too was interested in posting the AVS Code in my report and thought
Mike H's solution would be sharp.  I put the code in minivend.cfg and
tried it out, but to no avail.  I am running mv3.12beta6.

To try and debut I returned $key to make sure I was getting what I
thought it should and it was returning a 1.

So I modified the code:
my $key = shift; -> my ($key) = shift;

Which caused, it to return the string avs-code.

I also had it return the $ret and is showed the HASH(...),
but when it put it all together, it wouldn't work.

Is there something obvious I am lacking?  It seemed like as long
as avs-code was part of the HASH from cybercash, it should of
worked.

Any information would be helpful.
Mark Watkins


SOME HISTORY.....
>
> Hi All,
>
> I thought I would share some exiting changes I've made to Order.pm so
that
> I can retrieve the AVS Code (Address Verification Code) on cybercash
> transactions via the [data session cybercash_error] tag.
>
> Some of you may not remember, but a while ago I posted a question
regarding
> how I can retrieve the CyberCash AVS Code and display it on my
report.html.
>  Well, I never got any responses, so I decided to tear my hair out
and find
> the answer on my own.  Well I found it!!
>
> I modified the following lines of code in Order.pm:
>
> OLD Code:
>         if($result{MStatus} !~ /^success/) {
>                 $Vend::Session->{cybercash_error} = $result{MErrMsg};
>                 return undef;
>         }
>         elsif($result{MStatus} =~ /success-duplicate/) {
>                 $Vend::Session->{cybercash_error} = $result{MErrMsg};
>         }
>         else {
>                 $Vend::Session->{cybercash_error} = '';
>
> NEW Code:
>         if($result{MStatus} !~ /^success/) {
>                 $Vend::Session->{cybercash_error} = $result{MErrMsg};
>                 return undef;
>         }
>         elsif($result{MStatus} =~ /success-duplicate/) {
>                 $Vend::Session->{cybercash_error} = $result{MErrMsg};
>         }
>         else {
>                 $Vend::Session->{cybercash_error} =
$result{'avs-code'};
>

Not a bad solution. I went for a more general one which saves the whole
response hash for CyberCash 3; it is in the beta 3.12, and
the release 3.12 will do it for CC 2 as well.

(I think this was a suggestion from August Detlefsen when he did the
 mods that made MV work with CyberCash 3.)

You do need to put a UserTag somewhere:

UserTag cybercash-response Order key
UserTag cybercash-response Routine <<EOR
sub {
        my $key = shift;
        my $ref = $Vend::Session->{cybercash_response} || {};
        return $ref->{$key} || '';
}
EOR

[cybercash-response avs-code] with now return that. Any of the other
normal response keys can be accessed as well.

The original intent for [data session cybercash_error] was to provide
for:

        [if session cybercash_error]
        There was an error processing the transaction.
        [/if]


-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: