| 1 | package WWW::PayPal; | ||||||||||
| 2 | |||||||||||
| 3 | # ABSTRACT: Perl client for the PayPal REST API | ||||||||||
| 4 | |||||||||||
| 5 | 2 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use Carp qw(croak); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | ▶ | use WWW::PayPal::API::Orders; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | ▶ | use WWW::PayPal::API::Payments; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | ▶ | use WWW::PayPal::API::Products; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | ▶ | use WWW::PayPal::API::Plans; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 2 | ▶ | use WWW::PayPal::API::Subscriptions; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 2 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 2 | our $VERSION = '0.001'; | |||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | has client_id => ( | ||||||||||
| 18 | is => 'ro', | ||||||||||
| 19 | 0 | ▶ | default => sub { $ENV{PAYPAL_CLIENT_ID} }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 20 | 2 | ); | |||||||||
| 21 | |||||||||||
| 22 | |||||||||||
| 23 | has secret => ( | ||||||||||
| 24 | is => 'ro', | ||||||||||
| 25 | 0 | ▶ | default => sub { $ENV{PAYPAL_SECRET} }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 26 | 2 | ); | |||||||||
| 27 | |||||||||||
| 28 | |||||||||||
| 29 | has sandbox => ( | ||||||||||
| 30 | is => 'ro', | ||||||||||
| 31 | 0 | ▶ | default => sub { $ENV{PAYPAL_SANDBOX} ? 1 : 0 }, | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 32 | 2 | ); | |||||||||
| 33 | |||||||||||
| 34 | |||||||||||
| 35 | has base_url => ( | ||||||||||
| 36 | is => 'lazy', | ||||||||||
| 37 | builder => sub { | ||||||||||
| 38 | 1 | ▶ | $_[0]->sandbox | ||||||||
|
Subroutine
_build_base_url: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||
| 39 | ? 'https://api-m.sandbox.paypal.com' | ||||||||||
| 40 | : 'https://api-m.paypal.com'; | ||||||||||
| 41 | }, | ||||||||||
| 42 | 2 | ); | |||||||||
| 43 | |||||||||||
| 44 | |||||||||||
| 45 | 2 | with 'WWW::PayPal::Role::HTTP'; | |||||||||
| 46 | |||||||||||
| 47 | has orders => ( | ||||||||||
| 48 | is => 'lazy', | ||||||||||
| 49 | 0 | ▶ | builder => sub { WWW::PayPal::API::Orders->new(client => $_[0]) }, | ||||||||
|
Subroutine
_build_orders: not called CC=1 SCAR=1.2
Subroutine
__ANON__: called CC=1 SCAR=1.2
| |||||||||||
| 50 | 2 | ); | |||||||||
| 51 | |||||||||||
| 52 | |||||||||||
| 53 | has payments => ( | ||||||||||
| 54 | is => 'lazy', | ||||||||||
| 55 | 0 | ▶ | builder => sub { WWW::PayPal::API::Payments->new(client => $_[0]) }, | ||||||||
|
Subroutine
_build_payments: not called CC=1 SCAR=6.9
| |||||||||||
| 56 | 2 | ); | |||||||||
| 57 | |||||||||||
| 58 | |||||||||||
| 59 | has products => ( | ||||||||||
| 60 | is => 'lazy', | ||||||||||
| 61 | 1 | ▶ | builder => sub { WWW::PayPal::API::Products->new(client => $_[0]) }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 62 | 2 | ); | |||||||||
| 63 | |||||||||||
| 64 | |||||||||||
| 65 | has plans => ( | ||||||||||
| 66 | is => 'lazy', | ||||||||||
| 67 | 1 | ▶ | builder => sub { WWW::PayPal::API::Plans->new(client => $_[0]) }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 68 | 2 | ); | |||||||||
| 69 | |||||||||||
| 70 | |||||||||||
| 71 | has subscriptions => ( | ||||||||||
| 72 | is => 'lazy', | ||||||||||
| 73 | 1 | ▶ | builder => sub { WWW::PayPal::API::Subscriptions->new(client => $_[0]) }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 74 | 2 | ); | |||||||||
| 75 | |||||||||||
| 76 | |||||||||||
| 77 | |||||||||||
| 78 | 2 | 1; | |||||||||
| 79 | |||||||||||
| 80 | __END__ | ||||||||||