#!/usr/bin/perl use HTTP::Request::Common; use LWP::UserAgent; sub process_transaction { ($clientid, $siteid, $priceid,$password, $firstname, $lastname, $address, $city, $state, $zip, $country, $phone, $email, $amount, $cardnumber, $expmonth, $expyear, $transtype, $cvv2, $clientip, $gateid) = @_; $ua = LWP::UserAgent->new; ################################ # Assemble transaction data # ################################ $server_response = $ua->request(POST 'https://stats.slimcd.com/software/web_terminal_v2.asp', [ transtype => $transtype, clientid => $clientid, siteid => $siteid, priceid => $priceid, password => $password, first_name => $firstname, last_name => $lastname, address => $address, city => $city, state => $state, zip => $zip, country => $country, phone => $phone, email => $email, cardnumber => $cardnumber, expmonth => $expmonth, expyear => $expyear, amount => $amount, clientip => $clientip ] ) ; if($server_response->is_success) { # return transaction string from server. return $server_response->content; } else { # analyze error and return appropriate info. print $server_response->error_as_HTML; return "ERROR-SEE_DEBUG_OUTPUT"; } } # # Heres an example transaction. (Amounts are taken in US dollars.) $ar = process_transaction(1,562519011,2, "testmaster", "Testfirst", "Testlast", "123 Some addr", "Testtown", "FL", "33071", "US", "800-555-1212", "test@testing.com", "25.00", "4747474747474747", "03", "2003", "SALE", "NA", "127.0.0.1",""); print $ar;