Hi
I have a smal webshop, which i use paypal to accept payments through. I can use a simple Form with post to send the customer and payment info to paypal. The problem is..
I need to be able to collect data from the customer through the form, then and process the data in a perl script, before forwarding it to paypal in the correct format they need,open a new window for the customer so they can get the respons from paypal and proceed with the payment...
So far I am able to send the data, but respons is only 'no_success'
Anyone who has any ideas or hints please?
regards
.runar
Here is the what I use..
..........
use HTTP::Request::Common qw(POST);
# Create a user agent object
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("AgentName/0.1" .$ua->agent);
# Create a request
my $request = POST (' Content_Type => 'form-data',
Content => [
business => 'xxxxxxxx',
item_name => 'item',
item_number => 'idnummer',
amount => '1',
no_note => '1',
currency_code => 'EUR',
]
);
# Pass request to the user agent and get a response back
my $res = $ua->request($request);
# check the outcome
if ($res->is_success){
print $res->content;
}else{
print "Bad luck this time<br>\n";
}
I have a smal webshop, which i use paypal to accept payments through. I can use a simple Form with post to send the customer and payment info to paypal. The problem is..
I need to be able to collect data from the customer through the form, then and process the data in a perl script, before forwarding it to paypal in the correct format they need,open a new window for the customer so they can get the respons from paypal and proceed with the payment...
So far I am able to send the data, but respons is only 'no_success'
Anyone who has any ideas or hints please?
regards
.runar
Here is the what I use..
..........
use HTTP::Request::Common qw(POST);
# Create a user agent object
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("AgentName/0.1" .$ua->agent);
# Create a request
my $request = POST (' Content_Type => 'form-data',
Content => [
business => 'xxxxxxxx',
item_name => 'item',
item_number => 'idnummer',
amount => '1',
no_note => '1',
currency_code => 'EUR',
]
);
# Pass request to the user agent and get a response back
my $res = $ua->request($request);
# check the outcome
if ($res->is_success){
print $res->content;
}else{
print "Bad luck this time<br>\n";
}