in reply to Question about LWP::UserAgent

Though I have not worked directly with Paypal, here is a chunk of code I use in working with one of the bigger gateways, FWIW:

use HTTP::Request::Common; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = POST 'http://www.somegateway.com/cgi-bin/somedir', [ somevariable1 => 'foo', somevariable2 => 'bar', ]; my $reply; my $response = $ua->request($req); if ($response->is_success) { $reply = $response->content; } else { print STDERR $response->status_line, "\n"; } ...do something with $reply...

Usually there are parameters that I send (like credit card info) and then I get a reponse code that I parse (such as 'approved', 'declined').


—Brad
"Don't ever take a fence down until you know the reason it was put up." G. K. Chesterton