summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-02-13 22:24:56 -0800
committerIvan Kohler <ivan@freeside.biz>2014-02-13 22:24:56 -0800
commit97691c77e7ace2c14c5e145cb124130e0f0a888e (patch)
tree4669196f6e4ac89566d6f9207dd023d2416ed7a5
parentbee7c61ee07328b28ae2d17e631dc47037e7700a (diff)
0.02 unreleased
- trim spaces from authorization (TRANSACTIONID) - return numeric IATS error message as result_code
-rw-r--r--Changes4
-rw-r--r--lib/Business/OnlinePayment/IATSPayments.pm5
2 files changed, 8 insertions, 1 deletions
diff --git a/Changes b/Changes
index 75ba5da..4ff4c4f 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,10 @@
Revision history for Perl extension Business::OnlinePayment::IATSPayments.
+0.02 unreleased
+ - trim spaces from authorization (TRANSACTIONID)
+ - return numeric IATS error message as result_code
+
0.01 unreleased
- original version. the world might suspect something's afoot.
diff --git a/lib/Business/OnlinePayment/IATSPayments.pm b/lib/Business/OnlinePayment/IATSPayments.pm
index dd6dc5b..69495ab 100644
--- a/lib/Business/OnlinePayment/IATSPayments.pm
+++ b/lib/Business/OnlinePayment/IATSPayments.pm
@@ -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' );