Busine...action(3pm)
π NAME π
Business::PayPal::API::RefundTransaction β the PayPal RefundTransaction API, bestie. It's a Perl thing (from the User Contributed Perl Documentation corner of the manual, section 3pm, for the record β¨).
πΈ VERSION πΈ
version 0.77 π
β¨ SYNOPSIS β¨
okay so here's the whole vibe in code form:
use Business::PayPal::API::RefundTransaction;
## see Business::PayPal::API documentation for parameters
my $pp = Business::PayPal::API::RefundTransaction->new( ... );
my %response = $pp->RefundTransaction(
TransactionID => $transid,
RefundType => 'Full',
Memo => "Please come again!"
);
π¦ DESCRIPTION π¦
So Business::PayPal::API::RefundTransaction implements PayPal's RefundTransaction API, and it does it by using SOAP::Lite to make direct API calls to PayPal's SOAP API server. Iconic. It also ships with support for testing via PayPal's sandbox, because obviously you're not gonna yolo real refunds on the first try π
. Peep Business::PayPal::API for all the deets on using the PayPal sandbox.
π RefundTransaction
This one implements PayPal's RefundTransaction API call. The supported parameters include:
TransactionID
RefundType (defaults to 'Full' if not supplied)
Amount
Memo
currencyID (defaults to 'USD' if not supplied)
β¦and all of those are as described in the PayPal "Web Services API Reference" document, k? The default currencyID setting is 'USD' if it's not otherwise specified. The default RefundType setting is 'Full' if it's not otherwise specified. No cap.
If RefundType is set to 'Full', then Amount is ignored (even if you set it β the audacity, I know π). If RefundType is set to 'Partial', then Amount is required. That's the rule, periodt.
It returns a hash containing the results of the transaction. The Ack element is likely the only useful return value at the time of this revision β and ngl the Nov. 2005 errata to the Web Services API says that the documented fields 'TransactionID', 'GrossAmount', etc. are not returned with this API call. so likeβ¦ don't go looking for them π.
Example:
my %resp = $pp->RefundTransaction( TransactionID => $trans_id,
RefundType => 'Partial',
Amount => '15.00', );
unless( $resp{Ack} !~ /Success/ ) {
for my $error ( @{$response{Errors}} ) {
warn "Error: " . $error->{LongMessage} . "\n";
}
}
π ERROR HANDLING
Go read the ERROR HANDLING section of Business::PayPal::API for all the tea on handling errors π«Ά.
π EXPORT
None by default. that's it, that's the section β¨
π SEE ALSO π
π AUTHORS π
- Scott Wiersdorf
<scott@perlcode.org> - Danny Hembree
<danny@dynamical.org> - Bradley M. Kuhn
<bkuhn@ebb.org>
π 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.
And that's the whole page, bestie π
this was perl v5.36.0, dated 2022-08-28, and it lives in the Busine...action(3pm) manual page. slay, go refund something responsibly πΈ
π¦ 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