in reply to Re: What can be the reasons for bad request ??
in thread What can be the reasons for bad request ??
Please suggest if it needs any change. Thanks, SHAM...use strict; use Data::Dumper; #use LWP::UserAgent; #use HTTP::Request; use Net::SSLeay qw(get_https post_https sslcat make_headers make_form) +; my $method = 'POST'; my $host = 'orbital1.paymentech.net'; #my $host = 'orbital2.paymentech.net'; my $uri = '/authorize'; ## This is the initial test xml-request for authorization my $xmlRequest = '<Request>'. '<NewOrder>'. '<IndustryType>EC/IndustryType>'. '<MessageType>A</MessageType>'. '<BIN>000002</BIN>'. + '<TerminalID>001</TerminalID>'. '<AccountNum>4111111111111111</AccountNum>'. '<Exp>102009</Exp>'. '<CurrencyCode>840</CurrencyCode>'. '<CurrencyExponent>2</CurrencyExponent>'. '<CardSecVal>213</CardSecVal>'. '<AVSzip>33408</AVSzip>'. '<AVSaddress1>test address</AVSaddress1>'. '<AVScity>miami</AVScity>'. '<AVSstate>Florida</AVSstate>'. '<AVSphoneNum>5618926384</AVSphoneNum>'. '<AVSname>Raj Malahotra</AVSname>'. '<AVScountryCode>US</AVScountryCode>'. '<AVSDestzip>33408</AVSDestzip>'. '<AVSDestaddress1>Dest addresss</AVSDestaddres +s1>'. '<AVSDestcity>testcity</AVSDestcity>'. '<AVSDeststate>Florida</AVSDeststate>'. '<AVSDestname>Raj Malahotra</AVSDestname>'. '<AVSDestcountryCode>US</AVSDestcountryCode>'. '<CustomerProfileFromOrderInd>A</CustomerProfi +leFromOrderInd>'. '<OrderID>091933208935</OrderID>'. '<Amount>15.00</Amount>'. '<BMLShippingCost>15.00</BMLShippingCost>'. + '<BMLTNCVersion>5</BMLTNCVersion>'. + '</NewOrder>'. '</Request>'; my ($page, $response, %reply_headers); ## As per the specifications given in the pdf of Paymentech my $MIME_Version = '1.0'; my $content_type = 'application/PTI41'; my $content_length = length $xmlRequest; my $content_transfer_encoding = 'text'; my $request_number = '1'; my $document_type = 'Request'; #my $CRLF = "\x0d\x0a"; #my $CRLF = "\r\n"; my $CRLF = $Net::SSLeay::CRLF; my $headers = make_headers( 'MIME-Version' => $MIME_Version +, 'Content-Type' => $content_type +, 'Content-length' => $content_length +, 'Content-transfer-encoding' => $content_tra +nsfer_encoding, 'Request-number' => $request_number +, 'Document-type' => $document_ty +pe, ); #$headers = "POST /AUTHORIZE HTTP/1.0" . $CRLF . $headers; $headers = "POST /AUTHORIZE HTTP/1.0\r\n" . 'Host: ' . $host . ': 443' . "\r\n" . "Accept: */*\r\n" . $headers; $Net::SSLeay::trace = 3; # 0=no debugging, 1=ciphers, 2=trace, 3=dump + data ($page, $response, %reply_headers) = post_https( $host, 443, $uri, $headers, $xmlRequest ); print STDERR "\n========= headers ======== \n" . Dumper($headers) +; print STDERR "\n========= request ======== \n" . Dumper($xmlReque +st); print STDERR "\n========= page ======== \n" . Dumper($page); print STDERR "\n========= response ======== \n" . Dumper($respons +e); print STDERR "\n========= reply_headers ======== \n" . Dumper(%re +ply_headers);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: What can be the reasons for bad request ??
by dorko (Prior) on Sep 08, 2007 at 14:02 UTC | |
by erroneousBollock (Curate) on Sep 09, 2007 at 06:02 UTC | |
by Sham (Novice) on Sep 10, 2007 at 12:26 UTC | |
|
Re^3: What can be the reasons for bad request ??
by derby (Abbot) on Sep 08, 2007 at 14:35 UTC | |
by Sham (Novice) on Sep 10, 2007 at 10:50 UTC | |
by Anonymous Monk on Sep 11, 2007 at 09:41 UTC | |
by Sham (Novice) on Sep 12, 2007 at 06:49 UTC | |
by Anonymous Monk on Sep 12, 2007 at 10:42 UTC | |
by Anonymous Monk on Jul 23, 2013 at 19:54 UTC |