Minor cleanup, mostly around debugging.

This commit is contained in:
Olaf Alders 2014-03-23 00:40:54 -04:00
parent 3878e90817
commit 2d5812cf10
2 changed files with 13 additions and 11 deletions

View file

@ -4,10 +4,11 @@ use 5.008001;
use strict; use strict;
use warnings; use warnings;
use Data::Printer;
use SOAP::Lite 0.67; # +trace => 'all'; use SOAP::Lite 0.67; # +trace => 'all';
use Carp qw(carp); use Carp qw(carp);
our $Debug = 0; our $Debug = $ENV{WPP_DEBUG} || 0;
## NOTE: This package exists only until I can figure out how to use ## NOTE: This package exists only until I can figure out how to use
## NOTE: SOAP::Lite's WSDL support for complex types and importing ## NOTE: SOAP::Lite's WSDL support for complex types and importing
@ -151,9 +152,6 @@ sub doCall {
"\n"; "\n";
} }
# $Soap{$self}->readable( $Debug );
# $Soap{$self}->outputxml( $Debug );
no warnings 'redefine'; no warnings 'redefine';
local *SOAP::Deserializer::typecast = sub { shift; return shift }; local *SOAP::Deserializer::typecast = sub { shift; return shift };
eval { eval {
@ -168,8 +166,7 @@ sub doCall {
if ( $Debug ) { if ( $Debug ) {
## FIXME: would be nicer to dump a SOM to XML, but how to do that? ## FIXME: would be nicer to dump a SOM to XML, but how to do that?
require Data::Dumper; p( $som->envelope );
print STDERR Data::Dumper::Dumper( $som->envelope );
} }
if ( ref( $som ) && $som->fault ) { if ( ref( $som ) && $som->fault ) {
@ -363,8 +360,8 @@ invoke the various methods, instead of creating a new object for each
subclass. Here is an example of a B<API> object used to invoke various subclass. Here is an example of a B<API> object used to invoke various
PayPal APIs with the same object: PayPal APIs with the same object:
use Business::PayPal::API qw( GetTransactionDetails use Business::PayPal::API qw( GetTransactionDetails
TransactionSearch TransactionSearch
RefundTransaction ); RefundTransaction );
my $pp = new Business::PayPal::API( ... ); my $pp = new Business::PayPal::API( ... );
my $records = $pp->TransactionSearch( ... ); my $records = $pp->TransactionSearch( ... );
@ -580,6 +577,9 @@ sure:
* you're not trying to use your live username and password for * you're not trying to use your live username and password for
sandbox testing and vice versa. sandbox testing and vice versa.
* you are using a US Business Sandbox account. you may also need to have
"PayPal Payments Pro" enabled.
* if the sandbox works but "live" does not, make sure you've turned * if the sandbox works but "live" does not, make sure you've turned
off the 'sandbox' parameter correctly. Otherwise you'll be off the 'sandbox' parameter correctly. Otherwise you'll be
passing your PayPal sandbox credentials to PayPal's live site passing your PayPal sandbox credentials to PayPal's live site
@ -599,10 +599,10 @@ sure:
## delete all HTTPS, SSL env ## delete all HTTPS, SSL env
delete $ENV{$_} for grep { /^(HTTPS|SSL)/ } keys %ENV; delete $ENV{$_} for grep { /^(HTTPS|SSL)/ } keys %ENV;
## now put our own HTTPS env back in ## now put our own HTTPS env back in
$ENV{HTTPS_CERT_FILE} = '/var/path/to/cert.pem'; $ENV{HTTPS_CERT_FILE} = '/var/path/to/cert.pem';
## create our paypal object ## create our paypal object
my $pp = new Business::PayPal::API... my $pp = new Business::PayPal::API...

View file

@ -1,7 +1,9 @@
#!/usr/bin/perl #!/usr/bin/perl
use strict; use strict;
use warnings; use warnings;
use Test::More;
use Test::Most;
if ( !$ENV{WPP_TEST} || !-f $ENV{WPP_TEST} ) { if ( !$ENV{WPP_TEST} || !-f $ENV{WPP_TEST} ) {
plan skip_all => plan skip_all =>