[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: AVS Code in [data session cybercash_error]
****** message to minivend-users from mikeh@minivend.com ******
Quoting Dan Goldman (dano@nodewarrior.net):
>
> 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]
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
Fast, reliable, cheap. 131 Willow Lane, Floor 2 | || _ \
Pick two and we'll talk. Oxford, OH 45056 | || |_) |
-- unknown <mikeh@minivend.com> |___| _ <
513.523.7621 FAX 7501 |_| \_\
-
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