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.20'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
894
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
7
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
28
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
6
|
use base qw/LWP::Authen::OAuth2::ServiceProvider/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
130
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
7
|
use JSON qw/decode_json/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub authorization_endpoint { |
14
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
15
|
1
|
50
|
|
|
|
3
|
my $host = $self->{use_test_urls} ? 'uat.dwolla.com' : 'www.dwolla.com'; |
16
|
1
|
|
|
|
|
4
|
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
|
|
|
|
|
28
|
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
|
2
|
my $self = shift; |
33
|
1
|
|
|
|
|
13
|
return ('scope', $self->SUPER::authorization_required_params()); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub authorization_optional_params { |
37
|
1
|
|
|
1
|
0
|
3
|
my $self = shift; |
38
|
1
|
|
|
|
|
4
|
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__ |