WebService::PayPal::PaymentsAdvanced::Mocker - A class which returns mocked PPA apps.
version 0.000008
use WebService::PayPal::PaymentsAdvanced::Mocker; my $mocker = WebService::PayPal::PaymentsAdvanced::Mocker->new( plack => 1 ); my $app = $mocker->payflow_pro; # returns a PSGI app # OR, to use with a mocking UserAgent use Test::LWP::UserAgent; use HTTP::Message::PSGI; my $ua = Test::LWP::UserAgent->new; my $mocker = WebService::PayPal::PaymentsAdvanced::Mocker->new( plack => 1 ); $ua->register_psgi( 'pilot-payflowpro.paypal.com', $mocker->payflow_pro ); $ua->register_psgi( 'pilot-payflowlink.paypal.com', $mocker->payflow_link ); my $ppa = WebService::PayPal::PaymentsAdvanced->new( ua => $ua, ... );
You can use this class to facilitate mocking your PPA integration. When running under $ENV{HARNESS_ACTIVE}, you can pass a Test::LWP::UserAgent to WebService::PayPal::PaymentsAdvanced as in the SYNOPSIS above. Adjust the hostnames as necessary.
If you require a PSGI app to be returned, you'll need to enable this option. Disabled by default.
use WebService::PayPal::PaymentsAdvanced::Mocker; my $mocker = WebService::PayPal::PaymentsAdvanced::Mocker->new( plack => 1 ); my $app = $mocker->payflow_pro; # returns a PSGI app
If may provide your own UserAgent object to this class. This is only necessary if you intend to call the mocked_ua method and need to provide your own customized UserAgent. The object must be Test::LWP::UserAgent object, or a subclass of it.
mocked_ua
Returns a Mojolicious::Lite app which mocks the Payflow Link web service.
Returns a Mojolicious::Lite app which mocks the Payflow Pro web service.
Returns a UserAgent object mocking already enabled for both live and sandbox PayPal hostnames. The UserAgent will either be the object which you passed via the ua option when you created the object or a vanilla Test::LWP::UserAgent object which this class will create.
ua
Olaf Alders <olaf@wundercounter.com>
This software is Copyright (c) 2015 by MaxMind, Inc..
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install WebService::PayPal::PaymentsAdvanced, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::PayPal::PaymentsAdvanced
CPAN shell
perl -MCPAN -e shell install WebService::PayPal::PaymentsAdvanced
For more information on module installation, please visit the detailed CPAN module installation guide.