Busine...Request(3pm)

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

πŸ’³ Busine...Request(3pm) β€” aka Business::PayPal::API::AuthorizationRequest

okay bestie, listen up, we're in the User Contributed Perl Documentation section and this little gem is called Business::PayPal::API::AuthorizationRequest. It's giving "I take your money and I do it over SOAP" energy and honestly? iconic. πŸ’…


✨ NAME ✨

Business::PayPal::API::AuthorizationRequest β€” the PayPal AuthorizationRequest API, but make it Perl. 🫢


πŸŽ€ VERSION πŸŽ€

version 0.77 β€” yes she's got a number, yes she's proud of it. πŸ’–


🌸 SYNOPSIS 🌸

here's the vibe, copy-paste ready, no cap:

  use Business::PayPal::API::AuthorizationRequest;

  ## see Business::PayPal::API documentation for parameters
  my $pp = new Business::PayPal::API::DoAuthorizationRequest ( ... );

  my %response = $pp->DoAuthorizationRequest (
                                         TransactionID => $transid,
                                         CurrencyID    => $currencyID,
                                         Amount         => $amout,
                                         );
⚠️ note: that's $amout up there, not $amount. That's literally what the original says. Not me mis-typing, not you mis-reading. We respect the source in this house. πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

So Business::PayPal::API::AuthorizationRequest implements PayPal's AuthorizationRequest API, and the way it does that is by using SOAP::Lite to make direct API calls to PayPal's SOAP API server. Direct. No middleman. Main character energy fr fr. πŸ”₯

It also implements support for testing via PayPal's sandbox (yes bestie, you can rehearse the whole thing before you go live, we love a rehearsal). Please see Business::PayPal::API for details on using the PayPal sandbox. 🧚

BIG IMPORTANT ONE: this request is only used with "Order" type Authorizations. An "Order" must first be placed using the ExpressCheckout module. DirectPayment authorizations can only be used for "Basic" authorizations. No mixing and matching, periodt. πŸ’€

πŸ’œ AuthorizationRequest

This here implements PayPal's AuthorizationRequest API call. The supported parameters include:

TransactionID
Amount
currencyID (defaults to 'USD' if not supplied)

...as described in the PayPal "Web Services API Reference" document. And just so it's crystal clear: the default currencyID setting is 'USD' if not otherwise specified. πŸ’΅

It returns a hash containing the results of the transaction. That's the good stuff. 🎁

Example time, look at her go:

  my %resp = $pp->DoAuthorizationRequest (
                                          TransactionID => $trans_id,
                                          Amount        => '15.00',
                                          );

  unless( $resp{Ack} ne 'Success' ) {
      for my $error ( @{$response{Errors}} ) {
          warn "Error: " . $error->{LongMessage} . "\n";
      }
  }

😭 ERROR HANDLING

See the ERROR HANDLING section of Business::PayPal::API for information on handling errors. She's not gonna repeat herself, go read the other page bestie. 🫢

🌈 EXPORT

None by default. Nada. Zero. Nothing gets exported unless you ask. πŸŽ€


⭐ SEE ALSO ⭐


πŸ‘‘ AUTHORS πŸ‘‘

The legends who built her:

  • Scott Wiersdorf <scott@perlcode.org>
  • Danny Hembree <danny@dynamical.org>
  • Bradley M. Kuhn <bkuhn@ebb.org>

three icons, one module. we stan. πŸ’–


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. Free as in freedom, slay. πŸ•ŠοΈ


and that's the whole page bestie ✨ β€” brought to you by perl v5.36.0, dated 2022-08-28, filed under Busine...Request(3pm) because apparently even man pages get truncated names. she's mysterious like that. mwah πŸ’‹πŸ’–

πŸ“¦ where this page comes from