Click to See Complete Forum and Search --> : Using PERL CGI with Paypal


bnlitin
06-29-2003, 05:16 PM
I am new at writing perl CGI scripts and I have a problem trying to send my processed information to Paypal, for processing.

I believe the Paypal site accepts GET requests.

Here is my current PERL code which doesn't work.
If anyone has any ideas on what I am doing wrong, let tme know.

Thanks
Boris
bnlitin@yahoo.com



sub callPaypal {
my $self = shift;
my ($key,$value,$url);

use URI;
use HTTP::Request::Common qw (GET POST);
use LWP::UserAgent;

my $ua = LWP::UserAgent->new();
$url=URI->new( 'https://www.paypal.com/cgi-bin/webscr');
$url->query_form(
_cmd => '_cat',
add => '1',
display => '1',
business => 'bnlitin%40yahoo.com',
quantity => $PaypalObj{blk2q},
item_name=> $PaypalObj{blk3n},
amount => $PaypalObj{blk4a},
currency_code => 'USD',
on0 => 'Op:',
os0 => $PaypalObj{op1v},
on1 => 'Cust:'.
os1 => $PaypalObj{op2v},
image_url => 'www.dvdspark.com/_borders/DVD-Spark.gif',
return => 'www.dvdspark.com/payment_completed.htm',
cancel_return => 'www.dvdspark.com/payment_cancelled.htm'
);
#my $req = get($url);
my $content = $ua->request(GET, $url);

print "url=$url \n";
}