[interchange-cvs] interchange - jon modified lib/Vend/Payment/BoA.pm
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Thu Mar 28 10:54:00 2002
User: jon
Date: 2002-03-28 15:53:49 GMT
Modified: lib/Vend/Payment Tag: STABLE_4_8-branch BoA.pm
Log:
Commit updated Bank of America module from Mark Johnson.
Revision Changes Path
No revision
No revision
1.3.2.3 +9 -10 interchange/lib/Vend/Payment/BoA.pm
rev 1.3.2.3, prev_rev 1.3.2.2
Index: BoA.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Payment/BoA.pm,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -u -r1.3.2.2 -r1.3.2.3
--- BoA.pm 24 Jan 2002 05:07:03 -0000 1.3.2.2
+++ BoA.pm 28 Mar 2002 15:53:49 -0000 1.3.2.3
@@ -1,6 +1,6 @@
# Vend::Payment::BoA - Interchange BoA support
#
-# $Id: BoA.pm,v 1.3.2.2 2002/01/24 05:07:03 jon Exp $
+# $Id: BoA.pm,v 1.3.2.3 2002/03/28 15:53:49 jon Exp $
#
# Copyright (C) 1999-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -33,7 +33,7 @@
=head1 Interchange BoA Support
-Vend::Payment::BoA $Revision: 1.3.2.2 $
+Vend::Payment::BoA $Revision: 1.3.2.3 $
=head1 SYNOPSIS
@@ -440,6 +440,7 @@
}
#::logDebug("BoA query: " . ::uneval(\%query));
+
$opt->{extra_headers} = { Referer => $referer };
my $call_gateway = sub {
@@ -447,18 +448,15 @@
my $thing = post_data($opt, $query);
my $page = $thing->{result_page};
my $response = $thing->{status_line};
+
#::logDebug("BoA post_data response: " . ::uneval($thing) );
my %result;
- if ($opt->{script} =~ /payment/) {
- $page =~ s/^.*?A HREF=\?m=$user&//si;
- $page =~ s/>.*$//s;
-
- } else {
- $page =~ s/\cM{2}.*$//s;
- }
+ my $sep = "<BR>";
+
+ $page =~ s/\r*<html>.*$//is;
- foreach ( split( /\cM|&/, $page) ) {
+ foreach ( split( /$sep/i, $page) ) {
my ($key, $value) = split (/=/, $_, 2);
$value =~ tr/+/ /;
$value =~ s/%([0-9a-fA-F]{2})/chr( hex( $1 ) )/ge;
@@ -466,12 +464,13 @@
$result{"\L$key"} = $value;
}
+
#::logDebug("BoA result hash: " . ::uneval(\%result) );
return %result;
};
- my %result = $call_gateway->($opt,\%query,'auth');
+ my %result = $call_gateway->($opt,\%query);
if ($transtype =~ /^(?:auth|sale)/) {
# Interchange names are on the left, BoA on the right
@@ -490,7 +489,7 @@
if defined $result{$result_map{$_}};
}
-#::logDebug(qq{BoA %result after result_map loop:\n} . ::uneval(\%result) );
+#::logDebug(qq{BoA %result after result_map loop:\n} . ::uneval(\%result));
if (exists $boa_accept_map{ $result{ioc_response_code} } ) {
$result{MStatus} = 'success';