Stripe/Billing/Plan/TransformUsage.pm

filter: Statementstmt 80.0% 8 / 10 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 76.4% 13 / 17 CC 1 SCAR 3.4
CC
1
Cov
80%
divide_by
2.0
round
2.0
BEGIN
1.0
CRAP 1.4
« Stripe/Billing/Invoice/Period.pm ↑ Summary Stripe/Connect/Account/Settings/CardPayments.pm »
1 ##----------------------------------------------------------------------------
2 ## Stripe API - ~/lib/Net/API/Stripe/Billing/Plan/TransformUsage.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::TransformUsage;
11 BEGIN
12 {
13 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶ use parent qw( Net::API::Stripe::Generic );
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶ our( $VERSION ) = 'v0.100.0';
Subroutine BEGIN: called CC=1 SCAR=0.0
16 };
17  
18 0 ▶sub divide_by { shift->_set_get_scalar( 'divide_by', @_ ); }
Subroutine divide_by: not called CC=1 SCAR=6.9
Pod documented
19  
20 0 ▶sub round { shift->_set_get_scalar( 'round', @_ ); }
Subroutine round: not called CC=1 SCAR=6.9
Pod documented
21  
22 1 1;
23  
24 __END__
25  
26 =encoding utf8
27  
28 =head1 NAME
29  
30 Net::API::Stripe::Billing::Plan::TransformUsage - A Stripe Plan Transform Usage Object
31  
32 =head1 SYNOPSIS
33  
34 my $usage = $plan->transform_usage({
35 divide_by => 2,
36 round => 0,
37 });
38  
39 =head1 VERSION
40  
41 v0.100.0
42  
43 =head1 DESCRIPTION
44  
45 Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with tiers.
46  
47 Called from method B<transform_usage> in L<Net::API::Stripe::Billing::Plan>
48  
49 =head1 CONSTRUCTOR
50  
51 =over 4
52  
53 =item B<new>( %ARG )
54  
55 Creates a new L<Net::API::Stripe::Billing::Plan::TransformUsage> object.
56 It may also take an hash like arguments, that also are method of the same name.
57  
58 =back
59  
60 =head1 METHODS
61  
62 =over 4
63  
64 =item B<divide_by> integer
65  
66 Divide usage by this number.
67  
68 =item B<round> string
69  
70 After division, either round the result up or down.
71  
72 =back
73  
74 =head1 API SAMPLE
75  
76 {
77 "id": "expert-monthly-jpy",
78 "object": "plan",
79 "active": true,
80 "aggregate_usage": null,
81 "amount": 8000,
82 "amount_decimal": "8000",
83 "billing_scheme": "per_unit",
84 "created": 1507273129,
85 "currency": "jpy",
86 "interval": "month",
87 "interval_count": 1,
88 "livemode": false,
89 "metadata": {},
90 "nickname": null,
91 "product": "prod_fake123456789",
92 "tiers": null,
93 "tiers_mode": null,
94 "transform_usage": null,
95 "trial_period_days": null,
96 "usage_type": "licensed"
97 }
98  
99 =head1 HISTORY
100  
101 =head2 v0.1
102  
103 Initial version
104  
105 =head1 AUTHOR
106  
107 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
108  
109 =head1 SEE ALSO
110  
111 Stripe API documentation:
112  
113 L<https://stripe.com/docs/api/plans/object>
114  
115 =head1 COPYRIGHT & LICENSE
116  
117 Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
118  
119 You can use, copy, modify and redistribute this package and associated
120 files under the same terms as Perl itself.
121  
122 =cut
« Stripe/Billing/Invoice/Period.pm ↑ Summary Stripe/Connect/Account/Settings/CardPayments.pm »