File Coverage

lib/Net/API/Stripe/SetupAttempt.pm
Criterion Covered Total %
statement 25 40 62.5
branch n/a
condition n/a
subroutine 9 24 37.5
pod 15 15 100.0
total 49 79 62.0


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/SetupAttempt.pm
3             ## Version v0.2.0
4             ## Copyright(c) 2020 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2020/11/20
7             ## Modified 2022/10/29
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             BEGIN
14             {
15             use strict;
16 2     2   24157090 use warnings;
  2         14  
  2         63  
17 2     2   14 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         60  
18 2     2   12 use vars qw( $VERSION );
  2         6  
  2         11  
19 2     2   149 our( $VERSION ) = 'v0.2.0';
  2         6  
  2         117  
20 2     2   39 };
21              
22             use strict;
23 2     2   13 use warnings;
  2         6  
  2         56  
24 2     2   11  
  2         4  
  2         51  
25             use strict;
26 2     2   11 use warnings;
  2         31  
  2         44  
27 2     2   10  
  2         5  
  2         1199  
28              
29 0     0 1    
30              
31 0     0 1    
32              
33 0     0 1    
34              
35 0     0 1    
36              
37 0     0 1    
38             {
39 0     0 1   bancontact => {
40             definition => {
41 0     0 1   bank_code => { type => "scalar" },
42             bank_name => { type => "scalar" },
43 0     0 1   bic => { type => "scalar" },
44             generated_sepa_debit => {
45 0     0 1   package => "Net::API::Stripe::Payment::Method",
46             type => "scalar_or_object",
47 0     0 1   },
48             generated_sepa_debit_mandate => { package => "Net::API::Stripe::Mandate", type => "scalar_or_object" },
49 0     0 1   iban_last4 => { type => "scalar" },
50             preferred_language => { type => "scalar" },
51             verified_name => { type => "scalar" },
52             },
53             type => "class",
54             },
55             card => {
56             definition => {
57             three_d_secure => {
58             definition => {
59             authentication_flow => { type => "scalar" },
60             result => { type => "scalar" },
61             result_reason => { type => "scalar" },
62             version => { type => "scalar" },
63             },
64             type => "class",
65             },
66             },
67             type => "class",
68             },
69             ideal => {
70             definition => {
71             bank => { type => "scalar" },
72             bic => { type => "scalar" },
73             generated_sepa_debit => {
74             package => "Net::API::Stripe::Payment::Method",
75             type => "scalar_or_object",
76             },
77             generated_sepa_debit_mandate => { package => "Net::API::Stripe::Mandate", type => "scalar_or_object" },
78             iban_last4 => { type => "scalar" },
79             verified_name => { type => "scalar" },
80             },
81             type => "class",
82             },
83             sofort => {
84             definition => {
85             bank_code => { type => "scalar" },
86             bank_name => { type => "scalar" },
87             bic => { type => "scalar" },
88             generated_sepa_debit => {
89             package => "Net::API::Stripe::Payment::Method",
90             type => "scalar_or_object",
91             },
92             generated_sepa_debit_mandate => { package => "Net::API::Stripe::Mandate", type => "scalar_or_object" },
93             iban_last4 => { type => "scalar" },
94             preferred_language => { type => "scalar" },
95             verified_name => { type => "scalar" },
96             },
97             type => "class",
98             },
99             type => { type => "scalar" },
100             }, @_ ) ); }
101              
102             {
103             code => { type => "scalar" },
104             decline_code => { type => "scalar" },
105             doc_url => { type => "scalar" },
106             message => { type => "scalar" },
107             param => { type => "scalar" },
108             payment_method => { package => "Net::API::Stripe::Payment::Method", type => "object" },
109             payment_method_type => { type => "scalar" },
110             type => { type => "scalar" },
111             }, @_ ) ); }
112              
113              
114 0     0 1    
115              
116             1;
117              
118              
119             =encoding utf8
120              
121             =head1 NAME
122              
123             Net::API::Stripe::SetupAttempt - The SetupAttempt object
124              
125             =head1 SYNOPSIS
126 0     0 1    
127             my $setup = $stripe->setup_attempt({
128 0     0 1   ## Net::API::Stripe::Connect::Account
129             application => $connect_account_object,
130 0     0 1   created => '2020-11-17T12:15:20',
131             ## Net::API::Stripe::Customer
132             customer => $customer_id_or_object,
133             livemode => $stripe->true,
134             on_behalf_of => $account_object,
135             payment_method => $stripe_pm_id,
136             payment_method_details => $hash,
137             setup_error => $hash,
138             ## Net::API::Stripe::Payment::Intent::Setup
139             setup_intent => $intent_id_or_object,
140             status => 'succeeded',
141             usage => 'off_session',
142             });
143              
144             =head1 VERSION
145              
146             v0.2.0
147              
148             =head1 DESCRIPTION
149              
150             A SetupAttempt describes one attempted confirmation of a SetupIntent, whether that confirmation was successful or unsuccessful. You can use SetupAttempts to inspect details of a specific attempt at setting up a payment method using a SetupIntent.
151              
152             =head1 METHODS
153              
154             =head2 id string
155              
156             Unique identifier for the object.
157              
158             =head2 object string
159              
160             String representing the object's type. Objects of the same type share the same value.
161              
162             =head2 application expandable
163              
164             The value of L<application|https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application> on the SetupIntent at the time of this confirmation.
165              
166             When expanded this is an L<Net::API::Stripe::Connect::Account> object.
167              
168             =head2 attach_to_self boolean
169              
170             If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
171              
172             It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
173              
174             =head2 created timestamp
175              
176             Time at which the object was created. Measured in seconds since the Unix epoch.
177              
178             =head2 customer expandable
179              
180             The value of L<customer|https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer> on the SetupIntent at the time of this confirmation.
181              
182             When expanded this is an L<Net::API::Stripe::Customer> object.
183              
184             =head2 flow_directions array
185              
186             Indicates the directions of money movement for which this payment method is intended to be used.
187              
188             Include C<inbound> if you intend to use the payment method as the origin to pull funds from. Include C<outbound> if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.
189              
190             =head2 livemode boolean
191              
192             Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
193              
194             =head2 on_behalf_of expandable
195              
196             The value of L<on_behalf_of|https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of> on the SetupIntent at the time of this confirmation.
197              
198             When expanded this is an L<Net::API::Stripe::Connect::Account> object.
199              
200             =head2 payment_method expandable
201              
202             ID of the payment method used with this SetupAttempt.
203              
204             When expanded this is an L<Net::API::Stripe::Payment::Method> object.
205              
206             =head2 payment_method_details hash
207              
208             Details about the payment method at the time of SetupIntent confirmation.
209              
210             It has the following properties:
211              
212             =over 4
213              
214             =item I<bancontact> hash
215              
216             If this is a C<bancontact> payment method, this hash contains confirmation-specific information for the C<bancontact> payment method.
217              
218             =over 8
219              
220             =item I<bank_code> string
221              
222             Bank code of bank associated with the bank account.
223              
224             =item I<bank_name> string
225              
226             Name of the bank associated with the bank account.
227              
228             =item I<bic> string
229              
230             Bank Identifier Code of the bank associated with the bank account.
231              
232             =item I<generated_sepa_debit> string expandable
233              
234             The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
235              
236             When expanded this is an L<Net::API::Stripe::Payment::Method> object.
237              
238             =item I<generated_sepa_debit_mandate> string expandable
239              
240             The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
241              
242             When expanded this is an L<Net::API::Stripe::Mandate> object.
243              
244             =item I<iban_last4> string
245              
246             Last four characters of the IBAN.
247              
248             =item I<preferred_language> string
249              
250             Preferred language of the Bancontact authorization page that the customer is redirected to.
251             Can be one of C<en>, C<de>, C<fr>, or C<nl>
252              
253             =item I<verified_name> string
254              
255             Owner's verified full name. Values are verified or provided by Bancontact directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
256              
257             =back
258              
259             =item I<card> hash
260              
261             If this is a C<card> payment method, this hash contains confirmation-specific information for the C<card> payment method.
262              
263             =over 8
264              
265             =item I<three_d_secure> hash
266              
267             Populated if this authorization used 3D Secure authentication.
268              
269             =over 12
270              
271             =item I<authentication_flow> string
272              
273             For authenticated transactions: how the customer was authenticated by the issuing bank.
274              
275             =item I<result> string
276              
277             Indicates the outcome of 3D Secure authentication.
278              
279             =item I<result_reason> string
280              
281             Additional information about why 3D Secure succeeded or failed based on the `result`.
282              
283             =item I<version> string
284              
285             The version of 3D Secure that was used.
286              
287             =back
288              
289             =back
290              
291             =item I<ideal> hash
292              
293             If this is a C<ideal> payment method, this hash contains confirmation-specific information for the C<ideal> payment method.
294              
295             =over 8
296              
297             =item I<bank> string
298              
299             The customer's bank. Can be one of C<abn_amro>, C<asn_bank>, C<bunq>, C<handelsbanken>, C<ing>, C<knab>, C<moneyou>, C<rabobank>, C<regiobank>, C<sns_bank>, C<triodos_bank>, or C<van_lanschot>.
300              
301             =item I<bic> string
302              
303             The Bank Identifier Code of the customer's bank.
304              
305             =item I<generated_sepa_debit> string expandable
306              
307             The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
308              
309             When expanded this is an L<Net::API::Stripe::Payment::Method> object.
310              
311             =item I<generated_sepa_debit_mandate> string expandable
312              
313             The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
314              
315             When expanded this is an L<Net::API::Stripe::Mandate> object.
316              
317             =item I<iban_last4> string
318              
319             Last four characters of the IBAN.
320              
321             =item I<verified_name> string
322              
323             Owner's verified full name. Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
324              
325             =back
326              
327             =item I<sofort> hash
328              
329             If this is a C<sofort> payment method, this hash contains confirmation-specific information for the C<sofort> payment method.
330              
331             =over 8
332              
333             =item I<bank_code> string
334              
335             Bank code of bank associated with the bank account.
336              
337             =item I<bank_name> string
338              
339             Name of the bank associated with the bank account.
340              
341             =item I<bic> string
342              
343             Bank Identifier Code of the bank associated with the bank account.
344              
345             =item I<generated_sepa_debit> string expandable
346              
347             The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
348              
349             When expanded this is an L<Net::API::Stripe::Payment::Method> object.
350              
351             =item I<generated_sepa_debit_mandate> string expandable
352              
353             The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
354              
355             When expanded this is an L<Net::API::Stripe::Mandate> object.
356              
357             =item I<iban_last4> string
358              
359             Last four characters of the IBAN.
360              
361             =item I<preferred_language> string
362              
363             Preferred language of the Sofort authorization page that the customer is redirected to.
364             Can be one of C<en>, C<de>, C<fr>, or C<nl>
365              
366             =item I<verified_name> string
367              
368             Owner's verified full name. Values are verified or provided by Sofort directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
369              
370             =back
371              
372             =item I<type> string
373              
374             The type of the payment method used in the SetupIntent (e.g., C<card>). An additional hash is included on C<payment_method_details> with a name matching this value. It contains confirmation-specific information for the payment method.
375              
376             =back
377              
378             =head2 setup_error hash
379              
380             The error encountered during this attempt to confirm the SetupIntent, if any.
381              
382             It has the following properties:
383              
384             =over 4
385              
386             =item I<code> string
387              
388             For some errors that could be handled programmatically, a short string indicating the [error code](/docs/error-codes) reported.
389              
390             =item I<decline_code> string
391              
392             For card errors resulting from a card issuer decline, a short string indicating the L<card issuer's reason for the decline|https://stripe.com/docs/declines#issuer-declines> if they provide one.
393              
394             =item I<doc_url> string
395              
396             A URL to more information about the L<error code|https://stripe.com/docs/error-codes> reported.
397              
398             =item I<message> string
399              
400             A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
401              
402             =item I<param> string
403              
404             If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
405              
406             =item I<payment_method> hash
407              
408             The PaymentMethod object for errors returned on a request involving a PaymentMethod.
409              
410             When expanded, this is a L<Net::API::Stripe::Payment::Method> object.
411              
412             =item I<payment_method_type> string
413              
414             If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
415              
416             =item I<type> string
417              
418             The type of error returned. One of C<api_connection_error>, C<api_error>, C<authentication_error>, C<card_error>, C<idempotency_error>, C<invalid_request_error>, or C<rate_limit_error>
419              
420             =back
421              
422             =head2 setup_intent expandable
423              
424             ID of the SetupIntent that this attempt belongs to.
425              
426             When expanded this is an L<Net::API::Stripe::Payment::Intent::Setup> object.
427              
428             =head2 status string
429              
430             Status of this SetupAttempt, one of C<requires_confirmation>, C<requires_action>, C<processing>, C<succeeded>, C<failed>, or C<abandoned>.
431              
432             =head2 usage string
433              
434             The value of L<usage|https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage> on the SetupIntent at the time of this confirmation, one of C<off_session> or C<on_session>.
435              
436             =head1 API SAMPLE
437              
438             {
439             "id": "setatt_1ErTsH2eZvKYlo2CI7ukcoF7",
440             "object": "setup_attempt",
441             "application": null,
442             "created": 1562004309,
443             "customer": null,
444             "livemode": false,
445             "on_behalf_of": null,
446             "payment_method": "pm_1ErTsG2eZvKYlo2CH0DNen59",
447             "payment_method_details": {
448             "card": {
449             "three_d_secure": null
450             },
451             "type": "card"
452             },
453             "setup_error": null,
454             "setup_intent": "seti_1ErTsG2eZvKYlo2CKaT8MITz",
455             "status": "succeeded",
456             "usage": "off_session"
457             }
458              
459             =head1 HISTORY
460              
461             =head2 v0.1.0
462              
463             Initial version
464              
465             =head1 AUTHOR
466              
467             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
468              
469             =head1 SEE ALSO
470              
471             Stripe API documentation:
472              
473             L<https://stripe.com/docs/api#setup_attempt_object>
474              
475             =head1 COPYRIGHT & LICENSE
476              
477             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
478              
479             You can use, copy, modify and redistribute this package and associated
480             files under the same terms as Perl itself.
481              
482             =cut