line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## Stripe API - ~/lib/Net/API/Stripe/Billing/TestClock.pm |
3
|
|
|
|
|
|
|
## Version v0.1.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2022 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2022/07/11 |
7
|
|
|
|
|
|
|
## Modified 2022/07/11 |
8
|
|
|
|
|
|
|
## All rights reserved |
9
|
|
|
|
|
|
|
## |
10
|
|
|
|
|
|
|
## This program is free software; you can redistribute it and/or modify it |
11
|
|
|
|
|
|
|
## under the same terms as Perl itself. |
12
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
13
|
|
|
|
|
|
|
BEGIN |
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
use strict; |
16
|
1
|
|
|
1
|
|
963
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
17
|
1
|
|
|
1
|
|
4
|
use parent qw( Net::API::Stripe::Generic ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
18
|
1
|
|
|
1
|
|
5
|
use vars qw( $VERSION ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
19
|
1
|
|
|
1
|
|
130
|
our $VERSION = 'v0.1.0'; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
50
|
|
20
|
1
|
|
|
1
|
|
18
|
}; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use strict; |
23
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
18
|
|
24
|
1
|
|
|
1
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
75
|
|
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
1
|
|
|
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
0
|
1
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
# NOTE: POD |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=encoding utf-8 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Net::API::Stripe::Billing::TestClock - The test clock object |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SYNOPSIS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
use Net::API::Stripe::Billing::TestClock; |
41
|
|
|
|
|
|
|
my $this = Net::API::Stripe::Billing::TestClock->new || |
42
|
|
|
|
|
|
|
die( Net::API::Stripe::Billing::TestClock->error, "\n" ); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 VERSION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
v0.1.0 |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
A test clock enables deterministic control over objects in testmode. With a test clock, you can create objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances, you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 new |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Creates a new L<Net::API::Stripe::Billing::TaxID> object. |
57
|
|
|
|
|
|
|
It may also take an hash like arguments, that also are method of the same name. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 METHODS |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 id string |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Unique identifier for the object. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 object string, value is "tax_id" |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
String representing the object’s type. Objects of the same type share the same value. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 created timestamp |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Time at which the object was created. Measured in seconds since the Unix epoch. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 deletes_after timestamp |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Time at which this clock is scheduled to auto delete. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 frozen_time timestamp |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Time at which all objects belonging to this clock are frozen. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 livemode boolean |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Has the value true if the object exists in live mode or the value false if the object exists in test mode. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head2 name string |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
The custom name supplied at creation. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 status enum |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
The status of the Test Clock. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Possible enum values |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=over 4 |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=item * C<ready> |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
All test clock objects have advanced to the frozen_time. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item * C<advancing> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
In the process of advancing time for the test clock objects. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=item * C<internal_failure> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Failed to advance time. Future requests to advance time will fail. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=back |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 API SAMPLE |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
{ |
114
|
|
|
|
|
|
|
"id": "clock_1LKKwJCeyNCl6fY2ggn0eCSi", |
115
|
|
|
|
|
|
|
"object": "test_helpers.test_clock", |
116
|
|
|
|
|
|
|
"created": 1657539491, |
117
|
|
|
|
|
|
|
"deletes_after": 1658144291, |
118
|
|
|
|
|
|
|
"frozen_time": 1577836800, |
119
|
|
|
|
|
|
|
"livemode": false, |
120
|
|
|
|
|
|
|
"name": null, |
121
|
|
|
|
|
|
|
"status": "ready" |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 AUTHOR |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 SEE ALSO |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Stripe API documentation: |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/test_clocks/object> |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Copyright(c) 2022 DEGUEST Pte. Ltd. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
All rights reserved. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=cut |