File Coverage

lib/Net/API/Stripe/Payment/Intent/NextAction.pm
Criterion Covered Total %
statement 19 34 55.8
branch n/a
condition n/a
subroutine 7 22 31.8
pod 13 15 86.6
total 39 71 54.9


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Payment/Intent/NextAction.pm
3             ## Version v0.101.0
4             ## Copyright(c) 2020 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2019/11/02
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   24450123 use warnings;
  2         15  
  2         64  
17 2     2   14 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         66  
18 2     2   14 use vars qw( $VERSION );
  2         4  
  2         14  
19 2     2   151 our( $VERSION ) = 'v0.101.0';
  2         4  
  2         114  
20 2     2   41 };
21              
22             use strict;
23 2     2   13 use warnings;
  2         5  
  2         55  
24 2     2   11  
  2         7  
  2         1504  
25             native_data => { type => "scalar" },
26 0     0 0   native_url => { type => "scalar" },
27             return_url => { type => "scalar" },
28             url => { type => "scalar" },
29             }, @_ ) ); }
30              
31             {
32             expires_at => { type => "datetime" },
33 0     0 1   hosted_voucher_url => { type => "scalar" },
34             number => { type => "scalar" },
35             pdf => { type => "scalar" },
36             }, @_ ) ); }
37              
38             {
39             charge_attempt_at => { type => "datetime" },
40             customer_approval_required => { type => "boolean" },
41 0     0 1   }, @_ ) ); }
42              
43             {
44             amount_remaining => { type => "number" },
45             currency => { type => "number" },
46             financial_addresses => {
47 0     0 1   definition => {
48             iban => {
49             definition => {
50             account_holder_name => { type => "scalar" },
51             bic => { type => "scalar" },
52             country => { type => "scalar" },
53             iban => { type => "scalar" },
54             },
55             type => "class",
56             },
57             sort_code => {
58             definition => {
59             account_holder_name => { type => "scalar" },
60             account_number => { type => "scalar" },
61             sort_code => { type => "scalar" },
62             },
63             type => "class",
64             },
65             spei => {
66             definition => {
67             bank_code => { type => "scalar" },
68             bank_name => { type => "scalar" },
69             clabe => { type => "scalar" },
70             },
71             type => "class",
72             },
73             supported_networks => { type => "array" },
74             type => { type => "scalar" },
75             zengin => {
76             definition => {
77             account_holder_name => { type => "scalar" },
78             account_number => { type => "scalar" },
79             account_type => { type => "scalar" },
80             bank_code => { type => "scalar" },
81             bank_name => { type => "scalar" },
82             branch_code => { type => "scalar" },
83             branch_name => { type => "scalar" },
84             },
85             type => "class",
86             },
87             },
88             type => "class_array",
89             },
90             hosted_instructions_url => { type => "scalar" },
91             reference => { type => "scalar" },
92             type => { type => "scalar" },
93             }, @_ ) ); }
94              
95             {
96             expires_at => { type => "datetime" },
97             hosted_voucher_url => { type => "scalar" },
98             stores => {
99             definition => {
100 0     0 1   familymart => {
101             definition => {
102             confirmation_number => { type => "scalar" },
103             payment_code => { type => "scalar" },
104             },
105             type => "class",
106             },
107             lawson => {
108             definition => {
109             confirmation_number => { type => "scalar" },
110             payment_code => { type => "scalar" },
111             },
112             type => "class",
113             },
114             ministop => {
115             definition => {
116             confirmation_number => { type => "scalar" },
117             payment_code => { type => "scalar" },
118             },
119             type => "class",
120             },
121             seicomart => {
122             definition => {
123             confirmation_number => { type => "scalar" },
124             payment_code => { type => "scalar" },
125             },
126             type => "class",
127             },
128             },
129             type => "class",
130             },
131             }, @_ ) ); }
132              
133             expires_after => { type => "datetime" },
134             hosted_voucher_url => { type => "scalar" },
135             number => { type => "scalar" },
136             }, @_ ) ); }
137              
138             # sub redirect_to_url { return( shift->_set_get_hash( 'redirect_to_url', @_ ) ); }
139 0     0 0    
140             {
141             data => { type => "scalar" },
142             image_url_png => { type => "scalar" },
143             image_url_svg => { type => "scalar" },
144             }, @_ ) ); }
145              
146             {
147 0     0 1   data => { type => "scalar" },
148             hosted_instructions_url => { type => "scalar" },
149             image_url_png => { type => "scalar" },
150             image_url_svg => { type => "scalar" },
151             }, @_ ) ); }
152              
153             {
154 0     0 1   return( shift->_set_get_class( 'redirect_to_url',
155             {
156             return_url => { type => 'uri' },
157             url => { type => 'uri' },
158             }, @_ ) );
159             }
160              
161              
162              
163             {
164 0     0 1   arrival_date => { type => "datetime" },
165             hosted_verification_url => { type => "scalar" },
166             microdeposit_type => { type => "scalar" },
167             }, @_ ) ); }
168              
169             {
170             data => { type => "scalar" },
171 0     0 1   image_data_url => { type => "scalar" },
172             image_url_png => { type => "scalar" },
173 0     0 1   image_url_svg => { type => "scalar" },
174             }, @_ ) ); }
175 0     0 1    
176             {
177             app_id => { type => "scalar" },
178             nonce_str => { type => "scalar" },
179             package => { type => "scalar" },
180             partner_id => { type => "scalar" },
181             prepay_id => { type => "scalar" },
182 0     0 1   sign => { type => "scalar" },
183             timestamp => { type => "scalar" },
184             }, @_ ) ); }
185              
186             { native_url => { type => "scalar" } }, @_ ) ); }
187              
188             1;
189              
190 0     0 1    
191             =encoding utf8
192              
193             =head1 NAME
194              
195             Net::API::Stripe::Payment::Intent::NextAction - A Stripe Payment Next Action Object
196              
197             =head1 SYNOPSIS
198              
199             my $next = $stripe->payment_intent->next_action({
200             redirect_to_url =>
201 0     0 1   {
202             return_url => 'https://example.com/pay/return',
203             url => 'https://example.com/pay/auth',
204             },
205             type => 'redirect_to_url',
206             });
207              
208             =head1 VERSION
209              
210             v0.101.0
211              
212             =head1 DESCRIPTION
213              
214             If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.
215              
216             It used to be NextSourceAction, but the naming changed in Stripe API as of 2019-02-11
217              
218             This is instantiated by method B<next_action> in module L<Net::API::Stripe::Payment::Intent>
219              
220             =head1 CONSTRUCTOR
221              
222             =head2 new( %ARG )
223              
224             Creates a new L<Net::API::Stripe::Payment::Intent::NextAction> object.
225             It may also take an hash like arguments, that also are method of the same name.
226              
227             =head1 METHODS
228              
229             =head2 boleto_display_details hash
230              
231             Contains Boleto details necessary for the customer to complete the payment.
232              
233             It has the following properties:
234              
235             =over 4
236              
237             =item C<expires_at> timestamp
238              
239             The timestamp after which the boleto expires.
240              
241             =item C<hosted_voucher_url> string
242              
243             The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher.
244              
245             =item C<number> string
246              
247             The boleto number.
248              
249             =item C<pdf> string
250              
251             The URL to the downloadable boleto voucher PDF.
252              
253             =back
254              
255             =head2 card_await_notification hash
256              
257             Contains instructions for processing off session recurring payments with Indian issued cards.
258              
259             It has the following properties:
260              
261             =over 4
262              
263             =item C<charge_attempt_at> timestamp
264              
265             The time that payment will be attempted. If customer approval is required, they need to provide approval before this time.
266              
267             =item C<customer_approval_required> boolean
268              
269             For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required.
270              
271             =back
272              
273             =head2 display_bank_transfer_instructions hash
274              
275             Contains the bank transfer details necessary for the customer to complete the payment.
276              
277             It has the following properties:
278              
279             =over 4
280              
281             =item C<amount_remaining> integer
282              
283             The remaining amount that needs to be transferred to complete the payment.
284              
285             =item C<currency> currency
286              
287             Three-letter L<ISO currency code|https://www.iso.org/iso-4217-currency-codes.html>, in lowercase. Must be a L<supported currency|https://stripe.com/docs/currencies>.
288              
289             =item C<financial_addresses> array
290              
291             A list of financial addresses that can be used to fund the customer balance
292              
293             =over 8
294              
295             =item C<iban> hash
296              
297             An IBAN-based FinancialAddress
298              
299             =over 12
300              
301             =item C<account_holder_name> string
302              
303             The name of the person or business that owns the bank account
304              
305             =item C<bic> string
306              
307             The BIC/SWIFT code of the account.
308              
309             =item C<country> string
310              
311             Two-letter country code (L<ISO 3166-1 alpha-2|https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)>.
312              
313             =item C<iban> string
314              
315             The IBAN of the account.
316              
317              
318             =back
319              
320             =item C<sort_code> hash
321              
322             An account number and sort code-based FinancialAddress
323              
324             =over 12
325              
326             =item C<account_holder_name> string
327              
328             The name of the person or business that owns the bank account
329              
330             =item C<account_number> string
331              
332             The account number
333              
334             =item C<sort_code> string
335              
336             The six-digit sort code
337              
338              
339             =back
340              
341             =item C<spei> hash
342              
343             A SPEI-based FinancialAddress
344              
345             =over 12
346              
347             =item C<bank_code> string
348              
349             The three-digit bank code
350              
351             =item C<bank_name> string
352              
353             The short banking institution name
354              
355             =item C<clabe> string
356              
357             The CLABE number
358              
359              
360             =back
361              
362             =item C<supported_networks> array
363              
364             The payment networks supported by this FinancialAddress
365              
366             =item C<type> string
367              
368             The type of financial address
369              
370             =item C<zengin> hash
371              
372             A Zengin-based FinancialAddress
373              
374             =over 12
375              
376             =item C<account_holder_name> string
377              
378             The account holder name
379              
380             =item C<account_number> string
381              
382             The account number
383              
384             =item C<account_type> string
385              
386             The bank account type. In Japan, this can only be C<futsu> or C<toza>.
387              
388             =item C<bank_code> string
389              
390             The bank code of the account
391              
392             =item C<bank_name> string
393              
394             The bank name of the account
395              
396             =item C<branch_code> string
397              
398             The branch code of the account
399              
400             =item C<branch_name> string
401              
402             The branch name of the account
403              
404              
405             =back
406              
407              
408             =back
409              
410             =item C<hosted_instructions_url> string
411              
412             A link to a hosted page that guides your customer through completing the transfer.
413              
414             =item C<reference> string
415              
416             A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer.
417              
418             =item C<type> string
419              
420             Type of bank transfer
421              
422             =back
423              
424             =head2 konbini_display_details hash
425              
426             Contains Konbini details necessary for the customer to complete the payment.
427              
428             It has the following properties:
429              
430             =over 4
431              
432             =item C<expires_at> timestamp
433              
434             The timestamp at which the pending Konbini payment expires.
435              
436             =item C<hosted_voucher_url> string
437              
438             The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher.
439              
440             =item C<stores> hash
441              
442             Payment instruction details grouped by convenience store chain.
443              
444             =over 8
445              
446             =item C<familymart> hash
447              
448             FamilyMart instruction details.
449              
450             =over 12
451              
452             =item C<confirmation_number> string
453              
454             The confirmation number.
455              
456             =item C<payment_code> string
457              
458             The payment code.
459              
460              
461             =back
462              
463             =item C<lawson> hash
464              
465             Lawson instruction details.
466              
467             =over 12
468              
469             =item C<confirmation_number> string
470              
471             The confirmation number.
472              
473             =item C<payment_code> string
474              
475             The payment code.
476              
477              
478             =back
479              
480             =item C<ministop> hash
481              
482             Ministop instruction details.
483              
484             =over 12
485              
486             =item C<confirmation_number> string
487              
488             The confirmation number.
489              
490             =item C<payment_code> string
491              
492             The payment code.
493              
494              
495             =back
496              
497             =item C<seicomart> hash
498              
499             Seicomart instruction details.
500              
501             =over 12
502              
503             =item C<confirmation_number> string
504              
505             The confirmation number.
506              
507             =item C<payment_code> string
508              
509             The payment code.
510              
511              
512             =back
513              
514              
515             =back
516              
517             =back
518              
519             =head2 paynow_display_qr_code hash
520              
521             The field that contains PayNow QR code info
522              
523             It has the following properties:
524              
525             =over 4
526              
527             =item C<data> string
528              
529             The raw data string used to generate QR code, it should be used together with QR code library.
530              
531             =item C<image_url_png> string
532              
533             The image_url_png string used to render QR code
534              
535             =item C<image_url_svg> string
536              
537             The image_url_svg string used to render QR code
538              
539             =back
540              
541             =head2 promptpay_display_qr_code hash
542              
543             The field that contains PromptPay QR code info
544              
545             It has the following properties:
546              
547             =over 4
548              
549             =item C<data> string
550              
551             The raw data string used to generate QR code, it should be used together with QR code library.
552              
553             =item C<hosted_instructions_url> string
554              
555             The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code.
556              
557             =item C<image_url_png> string
558              
559             The imageI<url>png string used to render QR code, can be used as <img src="…" />
560              
561             =item C<image_url_svg> string
562              
563             The imageI<url>svg string used to render QR code, can be used as <img src="…" />
564              
565             =back
566              
567             =head2 redirect_to_url hash
568              
569             Contains instructions for authenticating a payment by redirecting your customer to another page or application.
570              
571             This is actually a dynamic class L<Net::API::Stripe::Payment::Intent::NextAction::RedirectToUrl> so the following property can be accessed as methods:
572              
573             =over 4
574              
575             =item I<return_url> string
576              
577             If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
578              
579             =item I<url> string
580              
581             The URL you must redirect your customer to in order to authenticate the payment.
582              
583             =back
584              
585             =head2 type string
586              
587             Type of the next action to perform, one of redirect_to_url or use_stripe_sdk.
588              
589             =head2 use_stripe_sdk hash
590              
591             When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
592              
593             =head2 verify_with_microdeposits hash
594              
595             Contains details describing microdeposits verification flow.
596              
597             It has the following properties:
598              
599             =over 4
600              
601             =item C<arrival_date> timestamp
602              
603             The timestamp when the microdeposits are expected to land.
604              
605             =item C<hosted_verification_url> string
606              
607             The URL for the hosted verification page, which allows customers to verify their bank account.
608              
609             =item C<microdeposit_type> string
610              
611             The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
612              
613             =back
614              
615             =head2 wechat_pay_display_qr_code hash
616              
617             The field that contains WeChat Pay QR code info
618              
619             It has the following properties:
620              
621             =over 4
622              
623             =item C<data> string
624              
625             The data being used to generate QR code
626              
627             =item C<image_data_url> string
628              
629             The base64 image data for a pre-generated QR code
630              
631             =item C<image_url_png> string
632              
633             The image_url_png string used to render QR code
634              
635             =item C<image_url_svg> string
636              
637             The image_url_svg string used to render QR code
638              
639             =back
640              
641             =head2 wechat_pay_redirect_to_android_app hash
642              
643             Info required for android app to app redirect
644              
645             It has the following properties:
646              
647             =over 4
648              
649             =item C<app_id> string
650              
651             app_id is the APP ID registered on WeChat open platform
652              
653             =item C<nonce_str> string
654              
655             nonce_str is a random string
656              
657             =item C<package> string
658              
659             package is static value
660              
661             =item C<partner_id> string
662              
663             an unique merchant ID assigned by WeChat Pay
664              
665             =item C<prepay_id> string
666              
667             an unique trading ID assigned by WeChat Pay
668              
669             =item C<sign> string
670              
671             A signature
672              
673             =item C<timestamp> string
674              
675             Specifies the current time in epoch format
676              
677             =back
678              
679             =head2 wechat_pay_redirect_to_ios_app hash
680              
681             Info required for iOS app to app redirect
682              
683             It has the following properties:
684              
685             =over 4
686              
687             =item C<native_url> string
688              
689             An universal link that redirect to WeChat Pay app
690              
691             =back
692              
693             =head1 API SAMPLE
694              
695             {
696             "id": "pi_fake123456789",
697             "object": "payment_intent",
698             "amount": 1099,
699             "amount_capturable": 0,
700             "amount_received": 0,
701             "application": null,
702             "application_fee_amount": null,
703             "canceled_at": null,
704             "cancellation_reason": null,
705             "capture_method": "automatic",
706             "charges": {
707             "object": "list",
708             "data": [],
709             "has_more": false,
710             "url": "/v1/charges?payment_intent=pi_fake123456789"
711             },
712             "client_secret": "pi_fake123456789_secret_ksjfjfbsjbfsmbfmf",
713             "confirmation_method": "automatic",
714             "created": 1556596976,
715             "currency": "jpy",
716             "customer": null,
717             "description": null,
718             "invoice": null,
719             "last_payment_error": null,
720             "livemode": false,
721             "metadata": {},
722             "next_action": null,
723             "on_behalf_of": null,
724             "payment_method": null,
725             "payment_method_options": {},
726             "payment_method_types": [
727             "card"
728             ],
729             "receipt_email": null,
730             "review": null,
731             "setup_future_usage": null,
732             "shipping": null,
733             "statement_descriptor": null,
734             "statement_descriptor_suffix": null,
735             "status": "requires_payment_method",
736             "transfer_data": null,
737             "transfer_group": null
738             }
739              
740             =head1 HISTORY
741              
742             =head2 v0.1
743              
744             Initial version
745              
746             =head1 AUTHOR
747              
748             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
749              
750             =head1 SEE ALSO
751              
752             Stripe API documentation:
753              
754             L<https://stripe.com/docs/api/payment_intents/object>
755              
756             =head1 COPYRIGHT & LICENSE
757              
758             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
759              
760             You can use, copy, modify and redistribute this package and associated
761             files under the same terms as Perl itself.
762              
763             =cut