I
Ignoramus7272
I am using PayPal API class
Business:ayPal::API::TransactionSearch
It uses some very weird code
my %response = ();
unless( $self->getBasic($som, $path, \%response) ) {
$self->getErrors($som, $path, \%response);
return %response;
}
return $self->getFieldsList( $som, $path . '/PaymentTransactions',
{ Timestamp => 'Timestamp',
Timezone => 'Timezone',
Type => 'Type',
Payer => 'Payer',
PayerDisplayName => 'PayerDisplayName',
TransactionID => 'TransactionID',
Status => 'Status',
GrossAmount => 'GrossAmount',
FeeAmount => 'FeeAmount',
NetAmount => 'NetAmount',
} );
that is, it returns a hash when there is error, and a list reference when there is not.
I am bewildered, just how can I get this result into one variable and
then figure out if I am dealing with success (so that I can print
results from the list reference), or failure (so that I can print a
hash element error message).
Any idea? I tried obvious things like setting a scalar to the result
of this function, and could not.
The man pages gloss over this issue. I did read them in their entirety.
i
Business:ayPal::API::TransactionSearch
It uses some very weird code
my %response = ();
unless( $self->getBasic($som, $path, \%response) ) {
$self->getErrors($som, $path, \%response);
return %response;
}
return $self->getFieldsList( $som, $path . '/PaymentTransactions',
{ Timestamp => 'Timestamp',
Timezone => 'Timezone',
Type => 'Type',
Payer => 'Payer',
PayerDisplayName => 'PayerDisplayName',
TransactionID => 'TransactionID',
Status => 'Status',
GrossAmount => 'GrossAmount',
FeeAmount => 'FeeAmount',
NetAmount => 'NetAmount',
} );
that is, it returns a hash when there is error, and a list reference when there is not.
I am bewildered, just how can I get this result into one variable and
then figure out if I am dealing with success (so that I can print
results from the list reference), or failure (so that I can print a
hash element error message).
Any idea? I tried obvious things like setting a scalar to the result
of this function, and could not.
The man pages gloss over this issue. I did read them in their entirety.
i