[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 Dan Goldman <dano@nodewarrior.net> ******
At 12:01 PM 3/23/99 -0500, you wrote:
>****** 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]
>
>--
Thats great you implemented this for CyberCash 3 since I'm currently
upgrading to CyberCash 3 in the next week or so.
I understand the ordiginal intent of cybercash_error, but I had to do what
I had to do with my limited knowledge of perl and current tags available at
the time.
Thank you Mike, This will help a bunch!!
Regards,
Dan Goldman
-
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