Busine...etails(3pm)

πŸ“¦
version 0.77 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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. 🧚


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