File Coverage

lib/Net/API/Stripe/Billing/TestClock.pm
Criterion Covered Total %
statement 19 21 90.4
branch n/a
condition n/a
subroutine 7 9 77.7
pod 2 2 100.0
total 28 32 87.5


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