Business-PayPal-API

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

    use strict;
    use warnings;

    use SOAP::Lite 0.67;
    use Business::PayPal::API ();

    our @ISA = qw(Business::PayPal::API);
    our @EXPORT_OK = qw( SomeAPIMethod );

    sub SomeAPIMethod {
     ...
    }

Notice the **@EXPORT\_OK** variable. This is _not_ used by **Exporter**
(we don't load Exporter at all): it is a special variable used by
**Business::PayPal::API** to know which methods to import when
**Business::PayPal::API** is run like this:

    use Business::PayPal::API qw( SomeAPI );

That is, **Business::PayPal::API** will import any subroutine into its
own namespace from the **@EXPORT\_OK** array. Now it can be used like this:

    use Business::PayPal::API qw( SomeAPI );
    my $pp = Business::PayPal::API->new( ... );
    $pp->SomeAPIMethod( ... );

Of course, we also do a 'use Business::PayPal::API' in the module so
that it can be used as a standalone module, if necessary:

    use Business::PayPal::API::SomeAPI;
    my $pp = Business::PayPal::API::SomeAPI->new( ... ); ## same args as superclass
    $pp->SomeAPIMethod( ... );

Adding the **@EXPORT\_OK** array in your module allows your module to be
used in the most convenient way for the given circumstances.

# EXAMPLES

Andy Spiegl <paypalcheckout.Spiegl@kascada.com> has kindly donated
some example code (in German) for the ExpressCheckout API which may be
found in the `eg` directory of this archive. Additional code examples
for other APIs may be found in the `t` test directory.

# EXPORT

None by default.

# CAVEATS

Because I haven't figured out how to make SOAP::Lite read the WSDL
definitions directly and simply implement those (help, anyone?), I
have essentially recreated all of those WSDL structures internally in
this module.

(Note - 6 Oct 2006: SOAP::Lite's WSDL support is moving ahead, but
slowly. The methods used by this API are considered "best practice"
and are safe to use).

As with all web services, if PayPal stop supporting their API
endpoint, this module \*may stop working\*. You can help me keep this
module up-to-date if you notice such an event occurring.

Also, I didn't implement a big fat class hierarchy to make this module
"academically" correct. You'll notice that I fudged colliding
parameter names in **DoExpressCheckoutPayment** and similar fudging may
be found in **GetTransactionDetails**. The good news is that this was
written quickly, works, and is dead-simple to use. The bad news is
that this sort of collision might occur again as more and more data is
sent in the API (call it 'eBay API bloat'). I'm willing to take the
risk this will be rare (PayPal--please make it rare!).

# ACKNOWLEDGEMENTS

Wherein I acknowledge all the good folks who have contributed to this
module in some way:

- Daniel P. Hembree

    for authoring the AuthorizationRequest, CaptureRequest,
    DirectPayments, ReauthorizationRequest, and VoidRequest extensions.

- &lt;jshiles at base16consulting daught com>

    for finding some API typos in the ExpressCheckout API

- Andy Spiegl <paypalcheckout.Spiegl@kascada.com>

    for giving me the heads-up on PayPal's new 3-token auth URI and for a
    sample command-line program (found in the 'eg' directory)
    demonstrating the ExpressCheckout API.

- Ollie Ready &lt;oready at drjays daught com>

    for the heads-up on the newest 3-token auth URI as well as a pile of
    documentation inconsistencies.

- Michael Hendricks &lt;michael at ndrix daught org>

    for a patch that adds ShippingTotal to the DirectPayments module.

- Erik Aronesty, Drew Simpson via rt.cpan.org (#28596)

    for a patch to fix getFields() when multiple items are returned

- Sebastian Böhm via email, SDC via rt.cpan.org (#38915)

    for a heads-up that the PayPal documentation for MassPay API was wrong
    regarding the _UniqueId_ parameter.

- Jonathon Wright via email

    for patches for **ExpressCheckout** and **RecurringPayments** that
    implement _BillingAgreement_ and _DoReferenceTransaction_ API
    calls.

# SEE ALSO

[SOAP::Lite](https://metacpan.org/pod/SOAP::Lite),
[PayPal User Guide](https://developer.paypal.com/webapps/developer/docs/classic/products),
[PayPal API Reference](https://developer.paypal.com/webapps/developer/docs/api/overview)



( run in 2.300 seconds using v1.01-cache-2.11-cpan-5837b0d9d2c )