File Coverage

lib/Net/API/Stripe/Billing/Plan/Tiers.pm
Criterion Covered Total %
statement 19 24 79.1
branch n/a
condition n/a
subroutine 7 12 58.3
pod 5 5 100.0
total 31 41 75.6


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