Stripe/Mandate.pm

filter: Statementstmt 44.4% 8 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 23.0% 3 / 13 Podpod 100% 10 / 10 totaltotal 51.2% 21 / 41 CC 1 SCAR 5.7
CC
1
Cov
44%
id
2.0
object
2.0
customer_acceptance
2.0
CRAP 1.8
« Stripe/Fraud/ValueList.pm ↑ Summary Stripe/Reporting/ReportRun.pm »
1 ##----------------------------------------------------------------------------
2 ## Stripe API - ~/lib/Net/API/Stripe/Mandate.pm
3 ## Version v0.100.0
4 ## Copyright(c) 2019 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <@sitael.tokyo.deguest.jp>
6 ## Created 2019/12/25
7 ## Modified 2020/05/15
8 ##
9 ##----------------------------------------------------------------------------
10 package Net::API::Stripe::Mandate;
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 id { return( shift->_set_get_scalar( 'id', @_ ) ); }
Subroutine id: not called CC=1 SCAR=6.9
Pod documented
19  
20 0 ▶sub object { return( shift->_set_get_scalar( 'object', @_ ) ); }
Subroutine object: not called CC=1 SCAR=6.9
Pod documented
21  
22 sub customer_acceptance
23 {
24 0 ▶ return( shift->_set_get_class( 'customer_acceptance',
Subroutine customer_acceptance: not called CC=1 SCAR=6.9
Pod documented
25 {
26 accepted_at => { type => 'datetime' },
27 offline => { type => 'hash_as_object' },
28 online => { type => 'hash_as_object' },
29 type => { type => 'scalar' },
30 }, @_ )
31 );
32 }
33  
34 0 ▶sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
Subroutine livemode: not called CC=1 SCAR=6.9
Pod documented
35  
36 0 ▶sub multi_use { return( shift->_set_get_hash( 'multi_use', @_ ) ); }
Subroutine multi_use: not called CC=1 SCAR=6.9
Pod documented
37  
38 0 ▶sub payment_method { return( shift->_set_get_scalar_or_object( 'payment_method', 'Net::API::Stripe::Payment::Method', @_ ) ); }
Subroutine payment_method: not called CC=1 SCAR=6.9
Pod documented
39  
40 sub payment_method_details
41 {
42 0 ▶ return( shift->_set_get_class( 'payment_method_details',
Subroutine payment_method_details: not called CC=1 SCAR=6.9
Pod documented
43 {
44 card => { type => 'hash' },
45 sepa_debit => { type => 'hash' },
46 type => { type => 'scalar' },
47 }, @_ )
48 );
49 }
50  
51 sub single_use
52 {
53 0 ▶ return( shift->_set_get_class( 'single_use',
Subroutine single_use: not called CC=1 SCAR=6.9
Pod documented
54 {
55 amount => { type => 'number' },
56 currency => { type => 'scalar' },
57 }, @_ )
58 );
59 }
60  
61 0 ▶sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
Subroutine status: not called CC=1 SCAR=6.9
Pod documented
62  
63 0 ▶sub type { return( shift->_set_get_scalar( 'type', @_ ) ); }
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
64  
65 1 1;
66  
67 __END__
68  
69 =encoding utf8
70  
71 =head1 NAME
72  
73 Net::API::Stripe::Mandate - A Stripe Mandate Object
74  
75 =head1 SYNOPSIS
76  
77 my $mandate = $stripe->mandate({
78 customer_acceptance =>
79 {
80 accepted_at => '2020-04-12T07:30:45',
81 offline => {},
82 online => {},
83 type => 'online',
84 },
85 payment_method => $payment_method_object,
86 single_use =>
87 {
88 amount => 2000,
89 currency => 'jpy',
90 },
91 status => 'active',
92 type => 'mandate',
93 });
94  
95 See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
96  
97 =head1 VERSION
98  
99 v0.100.0
100  
101 =head1 DESCRIPTION
102  
103 A Mandate is a record of the permission a customer has given you to debit their payment method.
104  
105 =head1 CONSTRUCTOR
106  
107 =over 4
108  
109 =item B<new>( %ARG )
110  
111 Creates a new L<Net::API::Stripe::Mandate> object.
112 It may also take an hash like arguments, that also are method of the same name.
113  
114 =back
115  
116 =head1 METHODS
117  
118 =over 4
119  
120 =item B<id> string
121  
122 Unique identifier for the object.
123  
124 =item B<object> string, value is "mandate"
125  
126 String representing the object’s type. Objects of the same type share the same value.
127  
128 =item B<customer_acceptance> hash
129  
130 Details about the customer’s acceptance of the mandate.
131  
132 =over 8
133  
134 =item I<accepted_at> timestamp
135  
136 The time at which the customer accepted the Mandate.
137  
138 =item I<offline> hash
139  
140 If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
141  
142 =item I<online> hash
143  
144 If this is a Mandate accepted online, this hash contains details about the online acceptance.
145  
146 =item I<type> string
147  
148 The type of customer acceptance information included with the Mandate. One of online or offline.
149  
150 =back
151  
152 =item B<livemode> boolean
153  
154 Has the value true if the object exists in live mode or the value false if the object exists in test mode.
155  
156 =item B<multi_use> hash
157  
158 If this is a multi_use mandate, this hash contains details about the mandate.
159  
160 =item B< payment_method> string expandable
161  
162 ID of the payment method associated with this mandate.
163  
164 =item B<payment_method_details> hash
165  
166 Additional mandate information specific to the payment method type.
167  
168 =over 8
169  
170 =item I<card> hash
171  
172 If this mandate is associated with a card payment method, this hash contains mandate information specific to the card payment method.
173  
174 =item I<sepa_debit> hash
175  
176 If this mandate is associated with a sepa_debit payment method, this hash contains mandate information specific to the sepa_debit payment method.
177  
178 =item I<type> string
179  
180 The type of the payment method associated with this mandate. An additional hash is included on payment_method_details with a name matching this value. It contains mandate information specific to the payment method.
181  
182 =back
183  
184 =item B<single_use> hash
185  
186 If this is a single_use mandate, this hash contains details about the mandate.
187  
188 =over 8
189  
190 =item I<amount> integer
191  
192 On a single use mandate, the amount of the payment.
193  
194 =item I<currency> currency
195  
196 On a single use mandate, the currency of the payment.
197  
198 =back
199  
200 =item B<status> string
201  
202 The status of the Mandate, one of active, inactive, or pending. The Mandate can be used to initiate a payment only if status=active.
203  
204 =item B<type> string
205  
206 The type of the mandate, one of multi_use or single_use
207  
208 =back
209  
210 =head1 API SAMPLE
211  
212 {
213 "id": "mandate_123456789",
214 "object": "mandate",
215 "customer_acceptance": {
216 "accepted_at": 123456789,
217 "online": {
218 "ip_address": "127.0.0.0",
219 "user_agent": "device"
220 },
221 "type": "online"
222 },
223 "livemode": false,
224 "multi_use": {},
225 "payment_method": "pm_123456789",
226 "payment_method_details": {
227 "sepa_debit": {
228 "reference": "123456789",
229 "url": ""
230 },
231 "type": "sepa_debit"
232 },
233 "status": "active",
234 "type": "multi_use"
235 }
236  
237 =head1 HISTORY
238  
239 =head2 v0.1
240  
241 Initial version
242  
243 =head1 AUTHOR
244  
245 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
246  
247 =head1 SEE ALSO
248  
249 Stripe API documentation:
250  
251 L<https://stripe.com/docs/api>, L<https://stripe.com/docs/api/mandates/object>
252  
253 =head1 COPYRIGHT & LICENSE
254  
255 Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
256  
257 You can use, copy, modify and redistribute this package and associated
258 files under the same terms as Perl itself.
259  
260 =cut
« Stripe/Fraud/ValueList.pm ↑ Summary Stripe/Reporting/ReportRun.pm »