Vend::Payment::Linkpoint
Interchange Linkpoint Support
- Provided by: interchange (Version: 5.7.7-2)
- Report a bug
Interchange Linkpoint Support
&charge=linkpoint
or
[charge mode=linkpoint param1=value1 param2=value2]
LPERL
The Vend::Payment::Linkpoint module implements the linkpoint() routine for use with Interchange. It is compatible on a call level with the other Interchange payment modules.
To enable this module, place this directive in "interchange.cfg":
Require module Vend::Payment::Linkpoint
This must be in interchange.cfg or a file included from it.
Make sure CreditCardAuto is off (default in Interchange demos).
The mode can be named anything, but the "gateway" parameter must be set to "linkpoint". To make it the default payment gateway for all credit card transactions in a specific catalog, you can set in "catalog.cfg":
Variable MV_PAYMENT_MODE linkpoint
It uses several of the standard settings from Interchange payment. Any time we speak of a setting, it is obtained either first from the tag/call options, then from an Interchange order Route named for the mode, then finally a default global payment variable, For example, the "id" parameter would be specified by:
[charge mode=linkpoint id=YourLinkpointID]
or
Route linkpoint id YourLinkpointID
or
Variable MV_PAYMENT_ID YourLinkpointID
Required settings are "id" and "keyfile".
The active settings are:
Interchange Linkpoint
---------------- -----------------
auth PREAUTH
sale SALE
settle_prior POSTAUTH
Default is "sale".
This can come in handy since LinkPoint has no option to decline a charge when AVS or CVV data come back negative.
If you want to fail based on a bad AVS/CVV check, make sure you're only doing an auth -- not a sale, or your customers would get charged on orders that fail the AVS/CVV check and never get logged in your system!
Add the parameters like this:
Route linkpoint check_sub link_check
This is a matching sample subroutine you could put in interchange.cfg:
GlobalSub <<EOR
sub link_check {
my ($result) = @_;
my $avs = $result->{r_avs};
my ($addr, $zip, $nothing, $cvv) = split m{}, $avs;
#::logDebug("avs=$avs, addr=$addr zip=$zip banks=$nothing cvv=$cvv");
return 1 if $addr eq 'Y' or $zip eq 'Y';
return 1 if $addr eq 'X' and $zip eq 'X';
return 1 if $cvv =~ /^[MPSUX]$/;
$result->{MStatus} = 'failure';
if ($cvv eq 'N' || '') {
$result->{r_error} = "The card security code you entered does not match. Additional failed attempts may hold your available funds.";
}
else {
$result->{r_error} = "The billing address you entered does not match the cardholder's billing address. Additional failed attempts may hold your available funds.";
}
}
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, or if the CVV matches or is 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.
If nothing works:
Require module Vend::Payment::Linkpoint
perl -Mlpperl -e 'print "It works.\n"'
If it "It works." and returns to the prompt you should be OK (presuming they are in working order otherwise).
<XMP>
[calc]
my $string = $Tag->uneval( { ref => $Session->{payment_result} });
$string =~ s/{/{\n/;
$string =~ s/,/,\n/g;
return $string;
[/calc]
</XMP>
That should show what happened.
There is actually nothing *in* Vend::Payment::Linkpoint. It changes packages to Vend::Payment and places things there.
Stefan Hornburg (Racke) <racke@linuxia.de> Ron Phipps <rphipps@reliant-solutions.com>