Here is the test code I m using .
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);
Please suggest if it needs any change. Thanks, SHAM...

In reply to Re^2: What can be the reasons for bad request ?? by Sham
in thread What can be the reasons for bad request ?? by Sham

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.