[interchange-cvs] interchange - heins modified
lib/Vend/Payment/Linkpoint.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Fri May 19 10:06:28 EDT 2006
User: heins
Date: 2006-05-19 14:06:28 GMT
Modified: lib/Vend/Payment Tag: STABLE_5_4-branch Linkpoint.pm
Log:
* Change variables sent in POST_AUTH transaction so that partial
captures can be done, and so that AVS will not be attempted.
Changes supplied by Josh Lavin.
* Add documentation adapted by Josh Lavin.
Revision Changes Path
No revision
No revision
1.5.2.2 +43 -2 interchange/lib/Vend/Payment/Linkpoint.pm
rev 1.5.2.2, prev_rev 1.5.2.1
Index: Linkpoint.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Payment/Linkpoint.pm,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -r1.5.2.1 -r1.5.2.2
--- Linkpoint.pm 15 May 2006 16:47:48 -0000 1.5.2.1
+++ Linkpoint.pm 19 May 2006 14:06:28 -0000 1.5.2.2
@@ -1,6 +1,6 @@
# Vend::Payment::Linkpoint - Interchange Linkpoint support
#
-# $Id: Linkpoint.pm,v 1.5.2.1 2006/05/15 16:47:48 mheins Exp $
+# $Id: Linkpoint.pm,v 1.5.2.2 2006/05/19 14:06:28 mheins Exp $
#
# Copyright (C) 2002-2005 Interchange Development Group
# Copyright (C) 2002 Stefan Hornburg (Racke) <racke at linuxia.de>
@@ -108,6 +108,46 @@
Default is C<sale>.
+=item check_sub
+
+Name of a Sub or GlobalSub to be called after the result hash has been
+received from LinkPoint. A reference to the modifiable result hash is
+passed into the subroutine, and it should return true (in the Perl truth
+sense) if its checks were successful, or false if not.
+
+This can come in handy since LinkPoint has no option to decline a charge
+when AVS data come back negative.
+
+If you want to fail based on a bad AVS check, make sure you're only
+doing an auth -- B<not a sale>, or your customers would get charged on
+orders that fail the AVS check and never get logged in your system!
+
+Add the parameters like this:
+
+ Route signio check_sub avs_check
+
+This is a matching sample subroutine you could put in interchange.cfg:
+
+ GlobalSub <<EOR
+ sub link_avs_check {
+ my ($result) = @_;
+ my $avs = $result->{r_avs};
+ my ($addr, $zip) = split //, $avs;
+ return 1 if $addr eq 'Y' or $zip eq 'Y';
+ return 1 if $addr eq 'X' and $zip eq 'X';
+ $result->{MStatus} = 'failure';
+ $result->{r_error} = $result->{MErrMsg} = "The billing address you entered does not match the cardholder's billing address";
+ return 0;
+ }
+ EOR
+
+That would work equally well as a Sub in catalog.cfg. It will succeed if
+either the address or zip is 'Y', or if both are unknown. If it fails,
+it sets the error message in the result hash.
+
+Of course you can use this sub to do any other post-processing you
+want as well.
+
=back
=head2 Troubleshooting
@@ -301,13 +341,14 @@
POSTAUTH => [
qw(
shipping
- chargetotal
subtotal
tax
vattax
cardnumber
cardexpmonth
cardexpyear
+ addrnum
+ company
)
],
);
More information about the interchange-cvs
mailing list