add some debugging methods to get at raw responses
authorivan <ivan>
Wed, 21 Mar 2007 22:11:00 +0000 (22:11 +0000)
committerivan <ivan>
Wed, 21 Mar 2007 22:11:00 +0000 (22:11 +0000)
Changes
README
lib/Business/OnlinePayment/TransactionCentral.pm

diff --git a/Changes b/Changes
index 3cf390c..c1c2bd7 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for Perl extension Business::OnlinePayment::TransactionCentral.
 
+0.02  unreleased
+       - updated example in manpage s/Capstone/TransactionCentral/
+        - add debugging methods response_page, response_code, response_headers
+
 0.01  Wed Nov 23 05:14:43 2005
        - original version; created by h2xs 1.23 with options
                -X -b 5.5.0 -n Business::OnlinePayment::TransactionCentral -v 0.01
diff --git a/README b/README
index 2f711ec..6bfa275 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ Copyright (c) 2006 Ivan Kohler
 All rights reserved. This program is free software; you can redistribute it
 and/or modify it under the  same terms as Perl itself.
 
-This is Business::OnlinePayment::TransactionCentral, an Business::OnlinePayment
+This is Business::OnlinePayment::TransactionCentral, a Business::OnlinePayment
 backend module for the MerchantAnywhere Transaction Central gateway.  It is
 only useful if you have a merchant account with MerchantAnywhere:
 http://www.merchantanywhere.com/
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