blib/lib/LWP/Authen/OAuth2/ServiceProvider/Dwolla.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 51 SCAR 30.0
CC
4
Cov
0%
authorization_endpoint
6.0
token_endpoint
6.0
api_url_base
6.0
CRAP 20.0
1 package LWP::Authen::OAuth2::ServiceProvider::Dwolla;
2  
3 # ABSTRACT: Access Dwolla API v2
4 our $VERSION = '0.19'; # VERSION
5  
6 use strict;
7 use warnings;
8  
9 use base qw/LWP::Authen::OAuth2::ServiceProvider/;
10  
11 use JSON qw/decode_json/;
12  
13 sub authorization_endpoint {
14 my $self = shift;
15 my $host = $self->{use_test_urls} ? 'uat.dwolla.com' : 'www.dwolla.com';
16 return 'https://'.$host.'/oauth/v2/authenticate';
17 }
18  
19 sub token_endpoint {
20 my $self = shift;
21 my $host = $self->{use_test_urls} ? 'uat.dwolla.com' : 'www.dwolla.com';
22 return 'https://'.$host.'/oauth/v2/token';
23 }
24  
25 sub api_url_base {
26 my $self = shift;
27 my $host = $self->{use_test_urls} ? 'api-uat.dwolla.com' : 'api.dwolla.com';
28 return 'https://'.$host;
29 }
30  
31 sub authorization_required_params {
32 my $self = shift;
33 return ('scope', $self->SUPER::authorization_required_params());
34 }
35  
36 sub authorization_optional_params {
37 my $self = shift;
38 return ($self->SUPER::authorization_optional_params(), qw/dwolla_landing verified_account/);
39 }
40  
41 sub default_api_headers {
42 return { 'Content-Type' => 'application/vnd.dwolla.v1.hal+json', 'Accept' => 'application/vnd.dwolla.v1.hal+json' };
43 }
44  
45  
46 1;
47  
48 __END__