2013-11-15 23:05:29 +00:00
|
|
|
package Business::PayPal::API::GetBalance;
|
|
|
|
|
|
|
|
use 5.008001;
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use SOAP::Lite 0.67;
|
|
|
|
use Business::PayPal::API ();
|
|
|
|
|
2014-03-23 02:31:50 +00:00
|
|
|
our @ISA = qw(Business::PayPal::API);
|
|
|
|
our @EXPORT_OK = qw(GetBalance); ## fake exporter
|
2013-11-15 23:05:29 +00:00
|
|
|
|
|
|
|
sub GetBalance {
|
|
|
|
my $self = shift;
|
|
|
|
my %args = @_;
|
|
|
|
|
|
|
|
my @trans = ( $self->version_req, );
|
|
|
|
|
|
|
|
my $request
|
|
|
|
= SOAP::Data->name(
|
|
|
|
GetBalanceRequest => \SOAP::Data->value( @trans ) )
|
|
|
|
->type( "ns:GetBalanceRequestType" );
|
|
|
|
|
|
|
|
my $som = $self->doCall( GetBalanceReq => $request )
|
|
|
|
or return;
|
|
|
|
|
|
|
|
my $path = '/Envelope/Body/GetBalanceResponse';
|
|
|
|
|
|
|
|
my %response = ();
|
|
|
|
unless ( $self->getBasic( $som, $path, \%response ) ) {
|
|
|
|
$self->getErrors( $som, $path, \%response );
|
|
|
|
return %response;
|
|
|
|
}
|
|
|
|
|
|
|
|
$self->getFields(
|
|
|
|
$som, $path,
|
|
|
|
\%response,
|
|
|
|
{ Balance => 'Balance',
|
|
|
|
BalanceTimeStamp => 'BalanceTimeStamp',
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
return %response;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
__END__
|
|
|
|
|