File Coverage

blib/lib/Net/API/Stripe/Billing/Plan/Tiers.pm
Criterion Covered Total %
statement 7 12 58.3
branch n/a
condition n/a
subroutine 3 8 37.5
pod 5 5 100.0
total 15 25 60.0


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Billing/Plan/Tiers.pm
3             ## Version v0.100.0
4             ## Copyright(c) 2019 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <@sitael.tokyo.deguest.jp>
6             ## Created 2019/11/02
7             ## Modified 2020/05/15
8             ##
9             ##----------------------------------------------------------------------------
10             package Net::API::Stripe::Billing::Plan::Tiers;
11             BEGIN
12             {
13 1     1   880 use strict;
  1         2  
  1         30  
14 1     1   4 use parent qw( Net::API::Stripe::Generic );
  1         2  
  1         4  
15 1     1   145 our( $VERSION ) = 'v0.100.0';
16             };
17              
18 0     0 1   sub flat_amount { return( shift->_set_get_number( 'flat_amount', @_ ) ); }
19              
20 0     0 1   sub flat_amount_decimal { return( shift->_set_get_number( 'flat_amount_decimal', @_ ) ); }
21              
22 0     0 1   sub unit_amount { shift->_set_get_number( 'unit_amount', @_ ); }
23              
24 0     0 1   sub unit_amount_decimal { return( shift->_set_get_number( 'unit_amount_decimal', @_ ) ); }
25              
26 0     0 1   sub up_to { shift->_set_get_number( 'up_to', @_ ); }
27              
28             1;
29              
30             __END__
31              
32             =encoding utf8
33              
34             =head1 NAME
35              
36             Net::API::Stripe::Billing::Plan::Tiers - A Stripe Plan Tiers Object
37              
38             =head1 SYNOPSIS
39              
40             my $tiers = $plan->tiers({
41             flat_amount => 2000,
42             flat_amount_decimal => 2000,
43             });
44              
45             =head1 VERSION
46              
47             v0.100.0
48              
49             =head1 DESCRIPTION
50              
51             Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme.
52              
53             =head1 CONSTRUCTOR
54              
55             =over 4
56              
57             =item B<new>( %ARG )
58              
59             Creates a new L<Net::API::Stripe::Billing::Plan::Tiers> object.
60             It may also take an hash like arguments, that also are method of the same name.
61              
62             =back
63              
64             =head1 METHODS
65              
66             =over 4
67              
68             =item B<flat_amount> integer
69              
70             Price for the entire tier. This is a L<AI::API::Stripe::Number> object.
71              
72             =item B<flat_amount_decimal> decimal string
73              
74             Same as flat_amount, but contains a decimal value with at most 12 decimal places.
75              
76             This is a L<AI::API::Stripe::Number> object.
77            
78             =item B<unit_amount> integer
79              
80             Per unit price for units relevant to the tier. This is a L<AI::API::Stripe::Number> object.
81              
82             =item B<unit_amount_decimal> decimal string
83              
84             Same as unit_amount, but contains a decimal value with at most 12 decimal places. This is a L<AI::API::Stripe::Number> object.
85              
86             =item B<up_to> integer
87              
88             Up to and including to this quantity will be contained in the tier. This is a L<AI::API::Stripe::Number> object.
89              
90             =back
91              
92             =head1 API SAMPLE
93              
94             {
95             "id": "expert-monthly-jpy",
96             "object": "plan",
97             "active": true,
98             "aggregate_usage": null,
99             "amount": 8000,
100             "amount_decimal": "8000",
101             "billing_scheme": "per_unit",
102             "created": 1507273129,
103             "currency": "jpy",
104             "interval": "month",
105             "interval_count": 1,
106             "livemode": false,
107             "metadata": {},
108             "nickname": null,
109             "product": "prod_fake123456789",
110             "tiers": null,
111             "tiers_mode": null,
112             "transform_usage": null,
113             "trial_period_days": null,
114             "usage_type": "licensed"
115             }
116              
117             =head1 HISTORY
118              
119             =head2 v0.1
120              
121             Initial version
122              
123             =head1 AUTHOR
124              
125             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
126              
127             =head1 SEE ALSO
128              
129             Stripe API documentation:
130              
131             L<https://stripe.com/docs/api/plans/object>
132              
133             =head1 COPYRIGHT & LICENSE
134              
135             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
136              
137             You can use, copy, modify and redistribute this package and associated
138             files under the same terms as Perl itself.
139              
140             =cut