Dear Monks,
I would the user to submit the form data to PayPal directly without presenting the html form. Here's what I have:use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = LWP::UserAgent->new(); my $req = POST 'https://www.paypal.com/cgi-bin/webscr', [ cmd => '_xclick', business => 'user@domain.com', item_name => 'Item name', amount => 20, ]; $content = $ua->request($req)->as_string; print "Content-type: text/html\n\n"; print $content;
This sort of works but but there's a lot of garbage at the top of the page, and the browser's address bar is still set to <http://mydomain/script.cgi> rather than the PayPal's domain - where the user should be just like if he or she made the submission via an html form.
What changes are needed to make the post work exactly as if the submission were made via an html form?
In reply to Post cart data to paypal by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |