add some debugging methods to get at raw responses
[Business-OnlinePayment-TransactionCentral.git] / lib / Business / OnlinePayment / TransactionCentral.pm
index 68a193d..78b84ec 100644 (file)
@@ -8,7 +8,7 @@ use Business::OnlinePayment::HTTPS 0.02;
 use vars qw($VERSION @ISA $DEBUG);
 
 @ISA = qw(Business::OnlinePayment::HTTPS);
-$VERSION = '0.01';
+$VERSION = '0.02';
 $DEBUG = 0;
 
 sub set_defaults {
@@ -18,7 +18,9 @@ sub set_defaults {
     $self->port('443');
     $self->path('/billing/TransactionCentral/');
 
-    $self->build_subs(qw( order_number avs_code cvv2_response ));
+    $self->build_subs(qw( order_number avs_code cvv2_response
+                          response_page response_code response_headers
+                     ));
 }
 
 sub submit {
@@ -107,10 +109,13 @@ sub submit {
     DESCRIPTION DESCDATE TRANSTYPE TRANSROUTE
   );
 
-  #my( $page, $response, %reply_headers ) =
-  my( $page, $response ) =
+  my( $page, $response, %reply_headers ) =
     $self->https_post( $self->get_fields( @fields ) );
 
+  $self->response_code( $response );
+  $self->response_page( $page );
+  $self->response_headers( \%reply_headers );
+
   warn "\n" if $DEBUG > 1;
   if ( $DEBUG > 2 ) {
     warn "response: $response\n";
@@ -177,7 +182,7 @@ Business::OnlinePayment::TransactionCentral - Transaction Central backend module
   # One step transaction, the simple case.
   ####
 
-  my $tx = new Business::OnlinePayment("Capstone");
+  my $tx = new Business::OnlinePayment("TransactionCentral");
   $tx->content(
       type           => 'CC',
       login          => '10011', #MerchantID