#!/usr/bin/perl # 2Checkout to authpro.com passback support # !!! CONFIGURE VARIABLES HERE !!! # Your authpro account username: my $AP_ACCOUNT='test'; # set to 1 if your host does not allow outgoing connections my $redir='1'; # !!! END OF CONFIGURATION !!! # NO NEED TO CHANGE ANYTHING BELOW use strict; use CGI::Carp; use CGI qw(:standard escapeHTML); use LWP::UserAgent; $CGI::USE_PARAM_SEMICOLONS = 0; my $AP_URL='http://www.authpro.com/cgi-bin/pcs/2co.cgi'; if (query_string() eq '') { print "Content-type: text/html\n\n"; print "TEST CALL OK"; exit; } if ($redir) { print "Location: $AP_URL?ap_acc=$AP_ACCOUNT&".query_string()."\n\n"; exit; } my $ua = new LWP::UserAgent; # build the request my $req = new HTTP::Request("POST", $AP_URL); $req->content_type("application/x-www-form-urlencoded"); $req->content(query_string() . "&ap_acc=$AP_ACCOUNT"); # get the response my $resp = $ua->request($req); if ($resp->is_success) { print "Content-type: text/html\n\n"; print $resp->content; } else { print "Content-type: text/html\n\n"; print "ERROR"; } exit;