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