Busine...etails(3pm)
β¨ NAME β¨
Business::PayPal::API::GetTransactionDetails β bestie, this is the Perl module that wraps up PayPal's GetTransactionDetails API so you never have to hand-roll a SOAP call like some kind of medieval peasant. π
πΈ VERSION πΈ
version 0.77 β yes, she's vintage, and yes, she still works. π
π¦ SYNOPSIS π¦
Okay so, two ways to pull up. Option one, the direct route:
use Business::PayPal::API::GetTransactionDetails;
my $pp = Business::PayPal::API::GetTransactionDetails->new( ... );
or, if you'd rather go through the main character:
# see Business::PayPal::API documentation for parameters
use Business::PayPal::API qw(GetTransactionDetails);
my $pp = Business::PayPal::API->new( ... );
my %response = $pp->GetTransactionDetails( TransactionID => $transid, );
π DESCRIPTION π
K so Business::PayPal::API::GetTransactionDetails implements PayPal's GetTransactionDetails API using SOAP::Lite to make direct API calls straight to PayPal's SOAP API server. No middleman, no drama, just vibes and XML. π
It also implements support for testing via PayPal's sandbox, so you can break stuff without breaking your actual money. Please see Business::PayPal::API for details on using the PayPal sandbox. π«Ά
π₯ GetTransactionDetails π₯
This one implements PayPal's GetTransactionDetails API call. The supported parameters include:
TransactionID
as described in the PayPal "Web Services API Reference" document. (Yes, the docs are doing the heavy lifting here, not me. iykyk.)
It returns a hash containing the transaction details, including these fields:
Business
Receiver
ReceiverID
Payer
PayerID
PayerStatus
Salutation
FirstName
MiddleName
LastName
PayerCountry
PayerBusiness
AddressOwner
AddressStatus
ADD_Name
Street1
Street2
CityName
StateOrProvince
Country
CountryName
Phone
PostalCode
TransactionID
ParentTransactionID
ReceiptID
TransactionType
PaymentType
PaymentDate
GrossAmount
FeeAmount
SettleAmount
TaxAmount
ExchangeRate
PaymentStatus
PendingReason
ReasonCode
InvoiceID
Custom
Memo
SalesTax
PII_SaleTax
PII_Name
PII_Number
PII_Quantity
PII_Amount
PII_Options
PII_SubscriptionID
PII_SubscriptionDate
PII_EffectiveDate
PII_RetryTime
PII_Username
PII_Password
PII_Recurrences
PII_reattempt
PII_recurring
PII_Amount
PII_period
PII_BuyerID
PII_ClosingDate
PII_multiItem
As described in the API document. Heads up though: some fields have prefixes just to remove ambiguity for like-named fields (e.g., "PII_"). Not chaos, just branding. π
If there are multiple PaymentItems, then an additional field 'PaymentItems' will be available with an arrayref of PaymentItem records:
PaymentItems => [ { SalesTax => ...,
Name => '...',
Number => '...',
Quantity => '...',
Amount => '...',
Options => { 'key0' => 'value0',
'key1' => 'value1' },
},
{ SalesTax => ..., etc.
} ]
Example:
my %resp = $pp->GetTransactionDetails( TransactionID => $trans_id );
print "Payer: $resp{Payer}\n";
for my $item ( @{ $resp{PaymentItems} } ) {
print "Name: " . $item->{Name} . "\n";
print "Amt: " . $item->{Amount} . "\n";
for my $optionname (keys %$item->{Options}) {
print "Option: $optionname is " . $item->{Options}{$optionname} . "\n";
}
}
π PaymentItem Options Limitations π
Note, BTW, that PayPal has a limitation such that each PaymentItem can contain only two Options. Not three. Not four. Two. Tragic, I know. π See:
<https://www.paypal.com/cgi-bin/webscr?cmd=p/xcl/rec/options-help-outside> <https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/>
This hack may be of interest if you want to sneak in four options:
<https://ppmts.custhelp.com/app/answers/detail/a_id/298/kw/soap%20gettransactiondetails%20option>
π ERROR HANDLING π
See the ERROR HANDLING section of Business::PayPal::API for information on handling errors. When things go wrong, go read that. Don't spiral. π«Ά
π EXPORT π
None by default. She gives you nothing for free, and honestly? Respect. π
β SEE ALSO β
<https://developer.paypal.com/en_US/pdf/PP_APIReference.pdf>
π AUTHORS π
- Scott Wiersdorf
<scott@perlcode.org> - Danny Hembree
<danny@dynamical.org> - Bradley M. Kuhn
<bkuhn@ebb.org>
Three icons. Three legends. The holy trinity of PayPal SOAP. π§
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2006-2017 by Scott Wiersdorf, Danny Hembree, Bradley M. Kuhn.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
ok that's the whole page, bestie, you're fully caught up. no cap, go charge your money or whatever. πβ¨
and yeah, this one's running on perl v5.36.0, dated 2022-08-28 β that's the source and version and date, all folded into one cute little sign-off. love that for us. ππ π¦
π¦ where this page comes from
- ubuntu noble: libbusiness-paypal-api-perl 0.77-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbusiness-paypal-api-perl 0.77-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libbusiness-paypal-api-perl 0.77-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms