Modified API.pm to for looser Success test and corrected boolean test with undefined variable.

This commit is contained in:
Danny Hembree 2009-12-03 13:42:54 -08:00
parent 925e625e76
commit c2bf6d6357
2 changed files with 17 additions and 5 deletions

11
Changes
View file

@ -1,4 +1,15 @@
Revision history for Perl extension Business::PayPal::API.
Release 0.68 - First hembreed release
-------------------------------------
I've moved the module's scm to http://github.com/hembreed/Business-PayPal-API so others may share my pain. The tar ball at CPAN will be updated from there.
- API.pm
1. Changed eq 'Success' to =~ /Success/ to accomodate variations introduced
by PayPal.
2. Changed test for duplicates to test for defined variable first. This
was causing errors in 5.10+ perl versions.
Release 0.62 - last scottw release
----------------------------

View file

@ -7,7 +7,7 @@ use warnings;
use SOAP::Lite 0.67; # +trace => 'all';
use Carp qw(carp);
our $VERSION = '0.62';
our $VERSION = '0.69';
our $CVS_VERSION = '$Id: API.pm,v 1.24 2009/07/28 18:00:58 scott Exp $';
our $Debug = 0;
@ -181,9 +181,10 @@ sub getFieldsList {
@response{keys %$fields} = @{$rec}{keys %$fields};
## avoid duplicates
next if $trans_id{$response{TransactionID}};
if( defined $response{TransactionID}){
$trans_id{$response{TransactionID}}? next :
$trans_id{$response{TransactionID}} = 1;
}
push @records, \%response;
}
@ -243,7 +244,7 @@ sub getBasic {
$details->{$field} = $som->valueof("$path/$field") || '';
}
return $details->{Ack} eq 'Success';
return $details->{Ack} =~ /Success/;
}
sub getErrors {