X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=OnlinePayment%2FHTTPS.pm;h=cb5190534ae762873a9151cfe244ab2906472521;hb=3a9c1a2ca18dba7df35f29b1404d43c2b6c6e18a;hp=1f840697ec7d03350fe56bddfa3f0ab799d3d17b;hpb=442ce3915cfcdb6586dddab405711004e82d663c;p=Business-OnlinePayment.git diff --git a/OnlinePayment/HTTPS.pm b/OnlinePayment/HTTPS.pm index 1f84069..cb51905 100644 --- a/OnlinePayment/HTTPS.pm +++ b/OnlinePayment/HTTPS.pm @@ -6,7 +6,7 @@ use URI::Escape; use Tie::IxHash; use base qw(Business::OnlinePayment); -$VERSION = '0.07'; +$VERSION = '0.09'; $DEBUG = 0; BEGIN { @@ -85,8 +85,8 @@ In the latter case, ordering is preserved (see L to do so when passing a hashref). Returns a list consisting of the page content as a string, the HTTP -response code, and a list of key/value pairs representing the HTTP -response headers. +response code and message (i.e. "200 OK" or "404 Not Found"), and a list of +key/value pairs representing the HTTP response headers. The options hashref supports setting headers and Content-Type: @@ -155,6 +155,8 @@ sub https_get { $opts->{"Content-Type"}, ); + $res_code =~ /^(HTTP\S+ )?(.*)/ and $res_code = $2; + $self->response_page( $res_page ); $self->response_code( $res_code ); $self->response_headers( { @res_headers } ); @@ -180,10 +182,10 @@ sub https_get { $res->header_field_names; $self->response_page( $res->content ); - $self->response_code( $res->code ); + $self->response_code( $res->code. ' '. $res->message ); $self->response_headers( { @res_headers } ); - ( $res->content, $res->code, @res_headers ); + ( $res->content, $res->code. ' '. $res->message, @res_headers ); } else { die "unknown SSL module $ssl_module"; @@ -200,8 +202,8 @@ passing a hashref). Also accepts instead a simple scalar containing the raw content. Returns a list consisting of the page content as a string, the HTTP -response code, and a list of key/value pairs representing the HTTP -response headers. +response code and message (i.e. "200 OK" or "404 Not Found"), and a list of +key/value pairs representing the HTTP response headers. The options hashref supports setting headers and Content-Type: @@ -276,6 +278,8 @@ sub https_post { $opts->{"Content-Type"}, ); + $res_code =~ /^(HTTP\S+ )?(.*)/ and $res_code = $2; + $self->response_page( $res_page ); $self->response_code( $res_code ); $self->response_headers( { @res_headers } ); @@ -315,10 +319,10 @@ sub https_post { $res->header_field_names; $self->response_page( $res->content ); - $self->response_code( $res->code ); + $self->response_code( $res->code. ' '. $res->message ); $self->response_headers( { @res_headers } ); - ( $res->content, $res->code, @res_headers ); + ( $res->content, $res->code. ' '. $res->message, @res_headers ); } else { die "unknown SSL module $ssl_module";