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 = ''. ''. 'EC/IndustryType>'. 'A'. '000002'. '001'. '4111111111111111'. '102009'. '840'. '2'. '213'. '33408'. 'test address'. 'miami'. 'Florida'. '5618926384'. 'Raj Malahotra'. 'US'. '33408'. 'Dest addresss'. 'testcity'. 'Florida'. 'Raj Malahotra'. 'US'. 'A'. '091933208935'. '15.00'. '15.00'. '5'. ''. ''; 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_transfer_encoding, 'Request-number' => $request_number, 'Document-type' => $document_type, ); #$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($xmlRequest); print STDERR "\n========= page ======== \n" . Dumper($page); print STDERR "\n========= response ======== \n" . Dumper($response); print STDERR "\n========= reply_headers ======== \n" . Dumper(%reply_headers);