#-*-Perl-*- #register-eprocess-tclink.txt #install with "update-sysStrings register-eprocess-# < register-eprocess-tclink.txt" #where # is the credit card tender number. make sure to set eauth in the tender table/program ############################################################################################# #this code finalizes the purchase w/tclink #this sample version uses the GPL client from #http://www.trustcommerce.com/ #you need to install their TCLink perl client #this doesn't use avs or cvv ######################################################################### #If other processors/gateways have open source or public domain clients,# #I'm willing to write wrappers like this for them, as well. # # jburrell(at)users.sf.net # ######################################################################### &main::infoPrint("Please wait, finalizing the credit card transaction..."); my %dta; my $str = SysString->new; if(!$str->open('ccauth-tclink-custid')) { print STDERR "register-process-5 couldn't load the ccauth-tclink-custid from the database\n"; return 0; } $dta{'custid'} = $str->{'data'}; if(!$str->open('ccauth-tclink-password')) { print STDERR "register-eauth-5 couldn't load the ccauth-tclink-password from the database\n"; return 0; } $dta{'password'} = $str->{'data'}; $dta{'transid'} = $ccAuth; $dta{'action'} = 'postauth'; my %result = Net::TCLink::send(%dta); if($result{'status'} ne 'accepted') { #tell the clerk what the problem is &main::infoPrint("Finalization Failed.\n\nReason: $result{'error'}"); my($key, $value); print STDERR "%result\n"; while(($key, $value) = each %result) { print STDERR "\t$key=$value\n"; } return 0; } &main::infoPrint(""); #print an extra ticket for the person to sign #$main::reg->reprintProcess($tend->{'id'}, sprintf("%-40.40s\n%-40.40s\n%-40.40s\n", "Card Number: $main::reg->reprintProcess(5, sprintf("%-40.40s\n%-40.40s\n%-40.40s\n", "Card Number: $ccNum","Type: $ccType", "Authorization: $ccAuth")); my($key, $value); print STDERR "%result\n"; while(($key, $value) = each %result) { print STDERR "\t$key=$value\n"; } return 1;