I would prefer to get LWP->browser->post to just stop url encoding the data values since I already have a working system to communicate with PayPal. The code is basic enough you don't really need another API on top of it like the PayPal library. If its a simple header or configuration function parameter I can set in the code setting up the post call would solve all my problems and would be the easiest solution.
Here is what is happening:
My code is passing in the the cancel and return urls unencoded, and when PayPal gets them they are encoded like below which then generates invalid url errors:
TRXTYPE=S&TENDER=P&ACTION=S&PWD=2XXXXX1&USER=ilxxxer&VENDOR=ilxxxer&PARTNER=Verisign
&CANCELURL=http%3A%2F%2Fwww.proposalkit.com
&RETURNURL=http%3A%2F%2Fwww.proposalkit.com&AMT=42.00
The code to send the data to PayPal is:
$host = 'https://pilot-payflowpro.paypal.com';
@parm_list = ('TRXTYPE' => 'S',
'TENDER' => 'P',
'ACTION' => 'S',
'PWD' => $verisign_pwd,
'USER' => $verisign_usr,
'VENDOR' => $verisign_usr,
'PARTNER' => $verisign_prt,
'CANCELURL' => 'http://www.proposalkit.com',
'RETURNURL' => 'http://www.proposalkit.com',
'AMT' => '42.00');
@pf_headers = ('Content-Type' => 'text/namevalue');
my $browser = LWP::UserAgent->new();
if ($browser ne null) {
$browser->timeout(90);
$browser->agent('Cyber Sea Server');
my $response = $browser->post($host, [ @parm_list ], @pf_headers);
}
So I'm trying to find out if there is another setting I can put in the @pf_headers array or another $browser function that will make the post function not alter the data values in the @parm_list array.
|