| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package WebService::PayPal::PaymentsAdvanced::Mocker::Helper; |
|
2
|
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
62
|
use Moo; |
|
|
7
|
|
|
|
|
18
|
|
|
|
7
|
|
|
|
|
75
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
2941
|
use namespace::autoclean; |
|
|
7
|
|
|
|
|
23
|
|
|
|
7
|
|
|
|
|
62
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.000028'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
7
|
|
|
7
|
|
2112
|
use Data::GUID (); |
|
|
7
|
|
|
|
|
54186
|
|
|
|
7
|
|
|
|
|
192
|
|
|
10
|
7
|
|
|
7
|
|
4004
|
use DateTime (); |
|
|
7
|
|
|
|
|
1906493
|
|
|
|
7
|
|
|
|
|
356
|
|
|
11
|
7
|
|
|
7
|
|
2718
|
use DateTime::Format::MySQL (); |
|
|
7
|
|
|
|
|
312463
|
|
|
|
7
|
|
|
|
|
213
|
|
|
12
|
7
|
|
|
7
|
|
76
|
use DateTime::TimeZone (); |
|
|
7
|
|
|
|
|
28
|
|
|
|
7
|
|
|
|
|
197
|
|
|
13
|
7
|
|
|
7
|
|
53
|
use Types::Standard qw( InstanceOf ); |
|
|
7
|
|
|
|
|
30
|
|
|
|
7
|
|
|
|
|
158
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has _time_zone => ( |
|
16
|
|
|
|
|
|
|
is => 'lazy', |
|
17
|
|
|
|
|
|
|
isa => InstanceOf ['DateTime::TimeZone'], |
|
18
|
|
|
|
|
|
|
default => |
|
19
|
|
|
|
|
|
|
sub { DateTime::TimeZone->new( name => 'America/Los_Angeles' ) }, |
|
20
|
|
|
|
|
|
|
); |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub baid { |
|
23
|
4
|
|
|
4
|
1
|
37
|
my $self = shift; |
|
24
|
4
|
|
|
|
|
24
|
return 'B-' . $self->unique_id(17); |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub correlationid { |
|
28
|
26
|
|
|
26
|
1
|
573
|
return lc shift->unique_id(13); |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub pnref { |
|
32
|
27
|
|
|
27
|
1
|
248
|
return shift->unique_id(12); |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub ppref { |
|
36
|
26
|
|
|
26
|
1
|
444
|
return shift->unique_id(17); |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub secure_token { |
|
40
|
17
|
|
|
17
|
1
|
2079
|
return shift->unique_id(25); |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub token { |
|
44
|
2
|
|
|
2
|
1
|
25
|
return 'EC-' . shift->unique_id(17); |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub transtime { |
|
48
|
28
|
|
|
28
|
1
|
1251
|
return DateTime::Format::MySQL->format_datetime( shift->datetime_now ); |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub unique_id { |
|
52
|
102
|
|
|
102
|
1
|
205
|
my $self = shift; |
|
53
|
102
|
|
50
|
|
|
287
|
my $length = shift || die 'length param required'; |
|
54
|
|
|
|
|
|
|
|
|
55
|
102
|
|
|
|
|
555
|
my $id = Data::GUID->new->as_string; |
|
56
|
102
|
|
|
|
|
5321
|
$id =~ s{-}{}g; |
|
57
|
102
|
|
|
|
|
585
|
return substr( $id, 0, $length ); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub datetime_now { |
|
61
|
28
|
|
|
28
|
1
|
711
|
return DateTime->now( time_zone => shift->_time_zone ); |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=pod |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=encoding UTF-8 |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 NAME |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
WebService::PayPal::PaymentsAdvanced::Mocker::Helper - Helper methods used when mocking PayPal web services |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 VERSION |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
version 0.000028 |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
use WebService::PayPal::PaymentsAdvanced::Mocker::Helper; |
|
81
|
|
|
|
|
|
|
my $helper = WebService::PayPal::PaymentsAdvanced::Mocker::Helper->new; |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
print $helper->transtime; |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head2 baid |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Returns a new, unique BAID |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 correlationid |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Returns a new, unique CORRELATIONID |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 pnref |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Returns a new, unique PNREF |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 ppref |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Returns a new, unique PPREF |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 secure_token |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Returns a new, unique SECURETOKEN |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 token |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Returns a new, unique SECURETOKENID |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head2 transtime |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Returns a TRANSTIME based on the current time |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 unique_id( $length ) |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
A generic method for creating unique ids. |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head2 datetime_now |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
Returns a new DateTime object with the current time, using the same time zone |
|
120
|
|
|
|
|
|
|
which the PayPal services use. |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Helper methods used when mocking PayPal web |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 SUPPORT |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
Bugs may be submitted through L<https://github.com/maxmind/webservice-paypal-paymentsadvanced/issues>. |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 AUTHOR |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Olaf Alders <olaf@wundercounter.com> |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
This software is copyright (c) 2022 by MaxMind, Inc. |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
139
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=cut |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
__END__ |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# ABSTRACT: Helper methods used when mocking PayPal web services |
|
146
|
|
|
|
|
|
|
|