File Coverage

lib/LWP/Authen/OAuth2/ServiceProvider/Dwolla.pm
Criterion Covered Total %
statement 22 26 84.6
branch 2 6 33.3
condition n/a
subroutine 8 10 80.0
pod 2 6 33.3
total 34 48 70.8


line stmt bran cond sub pod time code
1             package LWP::Authen::OAuth2::ServiceProvider::Dwolla;
2              
3             # ABSTRACT: Access Dwolla API v2
4             our $VERSION = '0.18'; # VERSION
5              
6 1     1   681 use strict;
  1         2  
  1         24  
7 1     1   5 use warnings;
  1         3  
  1         24  
8              
9 1     1   4 use base qw/LWP::Authen::OAuth2::ServiceProvider/;
  1         2  
  1         85  
10              
11 1     1   6 use JSON qw/decode_json/;
  1         2  
  1         5  
12              
13             sub authorization_endpoint {
14 1     1 1 2 my $self = shift;
15 1 50       3 my $host = $self->{use_test_urls} ? 'uat.dwolla.com' : 'www.dwolla.com';
16 1         3 return 'https://'.$host.'/oauth/v2/authenticate';
17             }
18              
19             sub token_endpoint {
20 1     1 1 2 my $self = shift;
21 1 50       5 my $host = $self->{use_test_urls} ? 'uat.dwolla.com' : 'www.dwolla.com';
22 1         7 return 'https://'.$host.'/oauth/v2/token';
23             }
24              
25             sub api_url_base {
26 0     0 0 0 my $self = shift;
27 0 0       0 my $host = $self->{use_test_urls} ? 'api-uat.dwolla.com' : 'api.dwolla.com';
28 0         0 return 'https://'.$host;
29             }
30              
31             sub authorization_required_params {
32 1     1 0 1 my $self = shift;
33 1         12 return ('scope', $self->SUPER::authorization_required_params());
34             }
35              
36             sub authorization_optional_params {
37 1     1 0 2 my $self = shift;
38 1         5 return ($self->SUPER::authorization_optional_params(), qw/dwolla_landing verified_account/);
39             }
40              
41             sub default_api_headers {
42 0     0 0   return { 'Content-Type' => 'application/vnd.dwolla.v1.hal+json', 'Accept' => 'application/vnd.dwolla.v1.hal+json' };
43             }
44              
45              
46             1;
47              
48             __END__