Busine...action(3pm)

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

πŸ’– 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>

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