0.02 unreleased
[Business-OnlinePayment-IATSPayments.git] / lib / Business / OnlinePayment / IATSPayments.pm
index dd6dc5b..69495ab 100644 (file)
@@ -8,7 +8,7 @@ use Business::CreditCard;
 use SOAP::Lite;
 #SOAP::Lite->import(+trace=>'debug');
 
-our $VERSION = '0.01';
+our $VERSION = '0.02';
 $VERSION = eval $VERSION; # modperlstyle: convert the string into a number
 
 sub _info {
@@ -287,6 +287,8 @@ sub submit {
 
   my $processresult = $iatsresponse->{PROCESSRESULT};
 
+  $processresult->{TRANSACTIONID} =~ s/^\s+//;
+  $processresult->{TRANSACTIONID} =~ s/\s+$//;
   $self->authorization($processresult->{TRANSACTIONID} || '');
 
   if ( $processresult->{AUTHORIZATIONRESULT} =~ /^\s*OK(:\s*\d+:)?(\w)?\s*$/i ) {
@@ -303,6 +305,7 @@ sub submit {
           )
   {
     $self->is_success(0);
+    $self->result_code($2);
     $self->error_message( $reject{$2} || $processresult->{AUTHORIZATIONRESULT});
     $self->failure_status( $failure_status{$2} || 'decline' );