File Coverage

lib/Net/API/Stripe/Checkout/Session.pm
Criterion Covered Total %
statement 19 70 27.1
branch n/a
condition n/a
subroutine 7 58 12.0
pod 50 51 98.0
total 76 179 42.4


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Checkout/Session.pm
3             ## Version v0.102.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             ## https://stripe.com/docs/api/checkout/sessions
14             package Net::API::Stripe::Checkout::Session;
15             BEGIN
16             {
17 2     2   21401219 use strict;
  2         15  
  2         75  
18 2     2   10 use warnings;
  2         4  
  2         60  
19 2     2   11 use parent qw( Net::API::Stripe::Generic );
  2         3  
  2         10  
20 2     2   141 use vars qw( $VERSION );
  2         9  
  2         120  
21 2     2   36 our( $VERSION ) = 'v0.102.0';
22             };
23              
24 2     2   14 use strict;
  2         4  
  2         39  
25 2     2   9 use warnings;
  2         4  
  2         2222  
26              
27 0     0 1   sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
28              
29 0     0 1   sub object { return( shift->_set_get_scalar( 'object', @_ ) ); }
30              
31 0     0 1   sub after_expiration { return( shift->_set_get_class( 'after_expiration',
32             {
33             recovery =>
34             {
35             type => 'class',
36             definition =>
37             {
38             allow_promotion_codes => { type => 'boolean' },
39             enabled => { type => 'boolean' },
40             expires_at => { type => 'datetime' },
41             url => { type => 'uri' },
42             }
43             }
44             }, @_ ) ); }
45              
46 0     0 1   sub allow_promotion_codes { return( shift->_set_get_boolean( 'allow_promotion_codes', @_ ) ); }
47              
48 0     0 1   sub amount_subtotal { return( shift->_set_get_number( 'amount_subtotal', @_ ) ); }
49              
50 0     0 1   sub amount_total { return( shift->_set_get_number( 'amount_total', @_ ) ); }
51              
52 0     0 1   sub automatic_tax { return( shift->_set_get_class( 'automatic_tax',
53             {
54             enabled => { type => 'boolean' },
55             status => { type => 'scalar' },
56             }, @_ ) ); }
57              
58 0     0 1   sub billing_address_collection { return( shift->_set_get_scalar( 'billing_address_collection', @_ ) ); }
59              
60 0     0 1   sub cancel_url { return( shift->_set_get_uri( 'cancel_url', @_ ) ); }
61              
62 0     0 1   sub client_reference_id { return( shift->_set_get_scalar( 'client_reference_id', @_ ) ); }
63              
64 0     0 1   sub consent { return( shift->_set_get_class( 'consent',
65             {
66             promotions => { type => 'scalar' },
67             }, @_ ) ); }
68              
69 0     0 1   sub consent_collection { return( shift->_set_get_class( 'consent',
70             {
71             promotions => { type => 'scalar' },
72             }, @_ ) ); }
73              
74 0     0 1   sub currency { return( shift->_set_get_number( 'currency', @_ ) ); }
75              
76 0     0 1   sub customer { return( shift->_set_get_scalar_or_object( 'customer', 'Net::API::Stripe::Customer', @_ ) ); }
77              
78 0     0 1   sub customer_creation { return( shift->_set_get_scalar( 'customer_creation', @_ ) ); }
79              
80 0     0 1   sub customer_details { return( shift->_set_get_object( 'customer_details', 'Net::API::Stripe::Customer', @_ ) ); }
81              
82 0     0 1   sub customer_email { return( shift->_set_get_scalar( 'customer_email', @_ ) ); }
83              
84 0     0 1   sub display_items { return( shift->_set_get_object_array( 'display_items', 'Net::API::Stripe::Checkout::Item', @_ ) ); }
85              
86 0     0 1   sub expires_at { return( shift->_set_get_datetime( 'expires_at', @_ ) ); }
87              
88 0     0 1   sub interval { return( shift->_set_get_scalar( 'interval', @_ ) ); }
89              
90 0     0 1   sub interval_count { return( shift->_set_get_scalar( 'interval_count', @_ ) ); }
91              
92 0     0 0   sub line_items { return( shift->_set_get_object( 'line_items', 'Net::API::Stripe::List', @_ ) ); }
93              
94 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
95              
96 0     0 1   sub locale { return( shift->_set_get_scalar( 'locale', @_ ) ); }
97              
98 0     0 1   sub metadata { return( shift->_set_get_hash( 'metadata', @_ ) ); }
99              
100             # payment, setup, or subscription
101              
102 0     0 1   sub mode { return( shift->_set_get_scalar( 'mode', @_ ) ); }
103              
104 0     0 1   sub payment_intent { return( shift->_set_get_scalar_or_object( 'payment_intent', 'Net::API::Stripe::Payment::Intent', @_ ) ); }
105              
106 0     0 1   sub payment_intent_data { return( shift->_set_get_object( 'payment_intent_data', 'Net::API::Stripe::Payment::Intent', @_ ) ); }
107              
108 0     0 1   sub payment_link { return( shift->_set_get_scalar_or_object( 'payment_link', 'Net::API::Stripe::Payment::Link', @_ ) ); }
109              
110 0     0 1   sub payment_method_collection { return( shift->_set_get_scalar( 'payment_method_collection', @_ ) ); }
111              
112 0     0 1   sub payment_method_options { return( shift->_set_get_object( 'payment_method_options', 'Net::API::Stripe::Payment::Method::Options', @_ ) ); }
113              
114 0     0 1   sub payment_method_types { return( shift->_set_get_array( 'payment_method_types', @_ ) ); }
115              
116 0     0 1   sub payment_status { return( shift->_set_get_scalar( 'payment_status', @_ ) ); }
117              
118 0     0 1   sub phone_number_collection { return( shift->_set_get_class( 'phone_number_collection',
119             {
120             enabled => { type => 'boolean' },
121             }, @_ ) ); }
122              
123 0     0 1   sub recovered_from { return( shift->_set_get_scalar( 'recovered_from', @_ ) ); }
124              
125 0     0 1   sub setup_intent { return( shift->_set_get_scalar_or_object( 'setup_intent', 'Net::API::Stripe::Payment::Intent::Setup', @_ ) ); }
126              
127 0     0 1   sub setup_intent_data { return( shift->_set_get_object( 'setup_intent_data', 'Net::API::Stripe::Payment::Intent::Setup', @_ ) ); }
128              
129 0     0 1   sub shipping { return( shift->_set_get_class( 'shipping',
130             {
131             address => { package => "Net::API::Stripe::Address", type => "object" },
132             name => { type => "scalar" },
133             }, @_ ) ); }
134              
135 0     0 1   sub shipping_address_collection { return( shift->_set_get_class( 'shipping_address_collection',
136             { allowed_countries => { type => "array" } }, @_ ) ); }
137              
138 0     0 1   sub shipping_cost { return( shift->_set_get_object( 'shipping_cost', 'Net::API::Stripe::Checkout::Session', @_ ) ); }
139              
140 0     0 1   sub shipping_details { return( shift->_set_get_object( 'shipping_details', 'Net::API::Stripe::Billing::Details', @_ ) ); }
141              
142 0     0 1   sub shipping_options { return( shift->_set_get_class_array( 'shipping_options',
143             {
144             shipping_amount => { type => 'integer' },
145             shipping_rate => { type => 'object', class => 'Net::API::Stripe::Shipping::Rate' },
146             }, @_ ) ); }
147              
148 0     0 1   sub shipping_rate { return( shift->_set_get_scalar_or_object( 'shipping_rate', 'Net::API::Stripe::Shipping::Rate', @_ ) ); }
149              
150 0     0 1   sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
151              
152 0     0 1   sub submit_type { return( shift->_set_get_scalar( 'submit_type', @_ ) ); }
153              
154 0     0 1   sub subscription { return( shift->_set_get_scalar_or_object( 'subscription', 'Net::API::Stripe::Billing::Subscription', @_ ) ); }
155              
156 0     0 1   sub subscription_data { return( shift->_set_get_object( 'subscription_data', 'Net::API::Stripe::Billing::Subscription', @_ ) ); }
157              
158 0     0 1   sub success_url { return( shift->_set_get_uri( 'success_url', @_ ) ); }
159              
160 0     0 1   sub tax_id_collection { return( shift->_set_get_class( 'tax_id_collection',
161             {
162             enabled => { type => 'boolean' },
163             }, @_ ) ); }
164              
165 0     0 1   sub total_details { return( shift->_set_get_class( 'total_details',
166             {
167             amount_discount => { type => "number" },
168             amount_shipping => { type => "integer" },
169             amount_tax => { type => "number" },
170             breakdown => {
171             definition => {
172             discounts => {
173             definition => { amount => { type => "number" }, discount => { type => "hash" } },
174             type => "class_array",
175             },
176             taxes => {
177             definition => {
178             amount => { type => "number" },
179             rate => { class => "Net::API::Stripe::Tax::Rate", type => "object" },
180             },
181             type => "class_array",
182             },
183             },
184             type => "class",
185             },
186             }, @_ ) ); }
187              
188 0     0 1   sub url { return( shift->_set_get_uri( 'url', @_ ) ); }
189              
190             1;
191              
192             __END__
193              
194             =encoding utf8
195              
196             =head1 NAME
197              
198             Net::API::Stripe::Checkout::Session - A Stripe Checkout Session Object
199              
200             =head1 SYNOPSIS
201              
202             my $session = $stripe->session({
203             # This easy to implement with Net::API::REST
204             cancel_url => 'https://api.example.com/v1/stripe/cancel',
205             success_url => 'https://api.example.com/v1/stripe/success',
206             client_reference_id => '1F7F749C-D9C9-46EB-B692-986628BD7302',
207             customer => $customer_object,
208             customer_email => 'john.doe@example.com',
209             # Japanese please
210             locale => 'ja',
211             mode => 'subscription',
212             payment_intent => $payment_intent_object,
213             submit_type => 'pay',
214             subscription => $subscription_object,
215             });
216              
217             =head1 VERSION
218              
219             v0.102.0
220              
221             =head1 DESCRIPTION
222              
223             A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout (L<https://stripe.com/docs/payments/checkout>). Stripe recommends creating a new Session each time your customer attempts to pay.
224              
225             Once payment is successful, the Checkout Session will contain a reference to the Customer (L<Net::API::Stripe::Customer> / L<https://stripe.com/docs/api/customers>), and either the successful PaymentIntent (L<Net::API::Stripe::Payment::Intent> / L<https://stripe.com/docs/api/payment_intents>) or an active Subscription (L<Net::API::Stripe::Billing::Subscription> / L<https://stripe.com/docs/api/subscriptions>).
226              
227             You can create a Checkout Session on your server and pass its ID to the client to begin Checkout.
228              
229             =head1 CONSTRUCTOR
230              
231             =head2 new
232              
233             Creates a new L<Net::API::Stripe::Checkout::Session> object.
234              
235             =head1 METHODS
236              
237             =head2 id string
238              
239             Unique identifier for the object. Used to pass to redirectToCheckout in Stripe.js.
240              
241             =head2 object string, value is "checkout.session"
242              
243             String representing the object’s type. Objects of the same type share the same value.
244              
245             =head2 after_expiration hash
246              
247             When set, provides configuration for actions to take if this Checkout Session expires.
248              
249             =over 4
250              
251             =item recovery
252              
253             =over 8
254              
255             =item allow_promotion_codes boolean
256              
257             Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to false
258              
259             =item enabled boolean
260              
261             If true, a recovery url will be generated to recover this Checkout Session if it expires before a transaction is completed. It will be attached to the Checkout Session object upon expiration.
262              
263             =item expires_at timestamp
264              
265             The timestamp at which the recovery URL will expire.
266              
267             =item url string
268              
269             URL that creates a new Checkout Session when clicked that is a copy of this expired Checkout Session
270              
271             =back
272              
273             =back
274              
275             =head2 allow_promotion_codes boolean
276              
277             Enables user redeemable promotion codes.
278              
279             =head2 amount_subtotal integer
280              
281             Total of all items before discounts or taxes are applied.
282              
283             =head2 amount_total integer
284              
285             Total of all items after discounts and taxes are applied.
286              
287             =head2 automatic_tax hash
288              
289             Details on the state of automatic tax for the session, including the status of the latest tax calculation.
290              
291             =over 4
292              
293             =item enabled boolean
294              
295             Indicates whether automatic tax is enabled for the session
296              
297             =item status enum
298              
299             The status of the most recent automated tax calculation for this session.
300              
301             Possible enum values
302              
303             =over 4
304              
305             =item requires_location_inputs
306              
307             The location details entered by the customer aren’t valid or don’t provide enough location information to accurately determine tax rates.
308              
309             =item complete
310              
311             Stripe successfully calculated tax automatically for this session.
312              
313             =item failed
314              
315             The Stripe Tax service failed.
316              
317             =back
318              
319             =back
320              
321             =head2 billing_address_collection string
322              
323             The value (auto or required) for whether Checkout collected the customer’s billing address.
324              
325             =head2 cancel_url string
326              
327             The URL the customer will be directed to if they decide to cancel payment and return to your website.
328              
329             This is a L<URI> object.
330              
331             =head2 client_reference_id string
332              
333             A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems.
334              
335             =head2 consent hash
336              
337             Results of consent_collection for this session.
338              
339             =over 4
340              
341             =item promotions string
342              
343             If C<opt_in>, the customer consents to receiving promotional communications from the merchant about this Checkout Session.
344              
345             =back
346              
347             =head2 consent_collection hash
348              
349             When set, provides configuration for the Checkout Session to gather active consent from customers.
350              
351             =over 4
352              
353             =item promotions string
354              
355             If set to C<auto>, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer’s locale. Only available to US merchants.
356              
357             =back
358              
359             =head2 currency currency
360              
361             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>.
362              
363             =head2 customer string (expandable)
364              
365             The ID of the customer for this session. For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the session unless an existing customer was provided when the session was created.
366              
367             When expanded, this is a L<Net::API::Stripe::Customer> object.
368              
369             =head2 customer_creation enum
370              
371             Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
372              
373             =over 4
374              
375             =item if_required
376              
377             The Checkout Session will only create a Customer if it is required for Session confirmation. Currently, only subscription mode Sessions require a Customer.
378              
379             =item always
380              
381             The Checkout Session will always create a Customer when a Session confirmation is attempted.
382              
383             =back
384              
385             =head2 customer_details object
386              
387             The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in C<setup> mode.
388              
389             This is a L<Net::API::Stripe::Customer> object.
390              
391             =head2 customer_email string
392              
393             If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once a session is complete, use the customer field.
394              
395             =head2 display_items array of hashes
396              
397             The line items, plans, or SKUs purchased by the customer.
398              
399             This is an array of L<Net::API::Stripe::Checkout::Item> objects.
400              
401             =head2 expires_at timestamp
402              
403             The timestamp at which the Checkout Session will expire.
404              
405             =head2 interval string
406              
407             One of I<day>, I<week>, I<month> or I<year>. The frequency with which a subscription should be billed.
408              
409             =head2 interval_count positive integer
410              
411             The number of intervals (specified in the I<interval> property) between subscription billings. For example, I<interval=month> and I<interval_count=3> bills every 3 months.
412              
413             =head2 livemode boolean
414              
415             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
416              
417             =head2 locale string
418              
419             The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser’s locale is used.
420              
421             =head2 metadata hash
422              
423             Set of L<key-value pairs|https://stripe.com/docs/api/metadata> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
424              
425             =head2 mode string
426              
427             The mode of the Checkout Session, one of payment, setup, or subscription.
428              
429             =head2 payment_intent string (expandable)
430              
431             The ID of the PaymentIntent for Checkout Sessions in payment mode. If it is expanded, it contains a L<Net::API::Stripe::Payment::Intent> object.
432              
433             =head2 payment_intent_data object
434              
435             A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in payment mode.
436              
437             This is a L<Net::API::Stripe::Payment::Intent> object and used to create a checkout session.
438              
439             =head2 payment_link string expandable
440              
441             The ID of the Payment Link that created this Session.
442              
443             When expanded, it contains a L<Net::API::Stripe::Payment::Link> object.
444              
445             =head2 payment_method_collection string
446              
447             Configure whether a Checkout Session should collect a payment method.
448              
449             =head2 payment_method_options hash
450              
451             Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
452              
453             =over 4
454              
455             =item acss_debit hash
456              
457             If the Checkout Session’s payment_method_types includes acss_debit, this hash contains the configurations that will be applied to each payment attempt of that type.
458              
459             =over 8
460              
461             =item currency enum
462              
463             Currency supported by the bank account. Returned when the Session is in setup mode.
464              
465             =over 12
466              
467             =item cad
468              
469             Canadian dollars
470              
471             =item usd
472              
473             US dollars
474              
475             =back
476              
477             =item mandate_options hash
478              
479             Additional fields for Mandate creation
480              
481             =over 8
482              
483             =item custom_mandate_url string
484              
485             A URL for custom mandate text
486              
487             =item default_for array of enum values
488              
489             List of Stripe products where this mandate can be selected automatically. Returned when the Session is in setup mode.
490              
491             Possible enum values
492              
493             =over 12
494              
495             =item invoice
496              
497             Enables payments for Stripe Invoices. C<subscription> must also be provided.
498              
499             =item subscription
500              
501             Enables payments for Stripe Subscriptions. C<invoice> must also be provided.
502              
503             =back
504              
505             =item interval_description string
506              
507             Description of the interval. Only required if the C<payment_schedule> parameter is C<interval> or C<combined>.
508              
509             =item payment_schedule enum
510              
511             Payment schedule for the mandate.
512              
513             Possible enum values
514              
515             =over 12
516              
517             =item interval
518              
519             Payments are initiated at a regular pre-defined interval
520              
521             =item sporadic
522              
523             Payments are initiated sporadically
524              
525             =item combined
526              
527             Payments can be initiated at a pre-defined interval or sporadically
528              
529             =back
530              
531             =item transaction_type enum
532              
533             Transaction type of the mandate.
534              
535             Possible enum values
536              
537             =over 12
538              
539             =item personal
540              
541             Transactions are made for personal reasons
542              
543             =item business
544              
545             Transactions are made for business reasons
546              
547             =back
548              
549             =back
550              
551             =item verification_method enum
552              
553             Bank account verification method.
554              
555             =over 8
556              
557             =item automatic
558              
559             Instant verification with fallback to microdeposits.
560              
561             =item instant
562              
563             Instant verification.
564              
565             =item microdeposits
566              
567             Verification using microdeposits.
568              
569             =back
570              
571             =back
572              
573             =item boleto hash
574              
575             If the Checkout Session’s payment_method_types includes boleto, this hash contains the configurations that will be applied to each payment attempt of that type.
576              
577             =over 8
578              
579             =item expires_after_days integer
580              
581             The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time.
582              
583             =back
584              
585             =item oxxo hash
586              
587             If the Checkout Session’s payment_method_types includes oxxo, this hash contains the configurations that will be applied to each payment attempt of that type.
588              
589             =over 8
590              
591             =item expires_after_days integer
592              
593             The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
594              
595             =back
596              
597             =back
598              
599             =head2 payment_method_types array containing strings
600              
601             A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
602              
603             =head2 payment_status string
604              
605             The payment status of the Checkout Session, one of C<paid>, C<unpaid>, or C<no_payment_required>.
606             You can use this value to decide when to fulfill your customer's order.
607              
608             =head2 phone_number_collection hash
609              
610             Details on the state of phone number collection for the session.
611              
612             =over 4
613              
614             =item enabled boolean
615              
616             Indicates whether phone number collection is enabled for the session
617              
618             =back
619              
620             =head2 recovered_from string
621              
622             The ID of the original expired Checkout Session that triggered the recovery flow.
623              
624             =head2 setup_intent string (expandable)
625              
626             The ID of the SetupIntent for Checkout Sessions in setup mode.
627              
628             When expanded, this is a L<Net::API::Stripe::Payment::Intent> object.
629              
630             =head2 setup_intent_data object
631              
632             A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in setup mode.
633              
634             This is a L<Net::API::Stripe::Payment::Intent> object and used to create a checkout session.
635              
636             =head2 shipping object
637              
638             Shipping information for this Checkout Session.
639              
640             This is a L<Net::API::Stripe::Shipping> object.
641              
642             It has the following properties:
643              
644             =over 4
645              
646             =item I<address> object
647              
648             Shipping address.
649              
650             This is a L<Net::API::Stripe::Address> object.
651              
652             =item I<name> string
653              
654             Recipient name.
655              
656             =back
657              
658             =head2 shipping_address_collection hash
659              
660             When set, provides configuration for Checkout to collect a shipping address from a customer.
661              
662             It has the following properties:
663              
664             =over 4
665              
666             =item I<allowed_countries> array
667              
668             An array of two-letter ISO country codes representing which countries Checkout should provide as options for
669             shipping locations. Unsupported country codes: C<AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI>.
670              
671             =back
672              
673             =head2 shipping_cost object
674              
675             The details of the customer cost of shipping, including the customer chosen ShippingRate.
676              
677             This is a L<Net::API::Stripe::Checkout::Session> object.
678              
679             =head2 shipping_details object
680              
681             Shipping information for this Checkout Session.
682              
683             This is a L<Net::API::Stripe::Billing::Details> object.
684              
685             =head2 shipping_options array of hashes
686              
687             The shipping rate options applied to this Session.
688              
689             =over 4
690              
691             =item shipping_amount integer
692              
693             A non-negative integer in cents representing how much to charge.
694              
695             =item shipping_rate string expandable
696              
697             The shipping rate.
698              
699             =back
700              
701             =head2 shipping_rate string expandable
702              
703             The ID of the ShippingRate for Checkout Sessions in payment mode.
704              
705             =head2 status enum
706              
707             The status of the Checkout Session, one of open, complete, or expired.
708              
709             Possible enum values
710              
711             =over 4
712              
713             =item open
714              
715             The checkout session is still in progress. Payment processing has not started
716              
717             =item complete
718              
719             The checkout session is complete. Payment processing may still be in progress
720              
721             =item expired
722              
723             The checkout session has expired. No further processing will occur
724              
725             =back
726              
727             =head2 submit_type string
728              
729             Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode, but not Checkout Sessions in subscription or setup mode. Supported values are C<auto>, C<book>, C<donate>, or C<pay>.
730              
731             =head2 subscription string (expandable)
732              
733             The ID of the subscription for Checkout Sessions in subscription mode. If it is expanded, this is the L<Net::API::Stripe::Billing::Subscription> object.
734              
735             =head2 subscription_data object
736              
737             A subset of parameters to be passed to subscription creation for Checkout Sessions in subscription mode.
738              
739             This is a L<Net::API::Stripe::Billing::Subscription> object and used to create a checkout session.
740              
741             =head2 success_url string
742              
743             The URL the customer will be directed to after the payment or subscription creation is successful.
744              
745             =head2 tax_id_collection hash
746              
747             Details on the state of tax ID collection for the session.
748              
749             Hide child attributes
750              
751             =over 4
752              
753             =item enabled boolean
754              
755             Indicates whether tax ID collection is enabled for the session
756              
757             =back
758              
759             =head2 total_details hash
760              
761             Tax and discount details for the computed total amount.
762              
763             It has the following properties:
764              
765             =over 4
766              
767             =item I<amount_discount> integer
768              
769             This is the sum of all the line item discounts.
770              
771             =item amount_shipping integer
772              
773             This is the sum of all the line item shipping amounts.
774              
775             =item I<amount_tax> integer
776              
777             This is the sum of all the line item tax amounts.
778              
779             =item I<breakdown> hash
780              
781             Breakdown of individual tax and discount amounts that add up to the totals.
782              
783             =over 8
784              
785             =item I<discounts> array
786              
787             The aggregated line item discounts.
788              
789             =over 12
790              
791             =item I<amount> integer
792              
793             The amount discounted.
794              
795             =item I<discount> hash
796              
797             The discount applied.
798              
799             =back
800              
801             =item I<taxes> array
802              
803             The aggregated line item tax amounts by rate.
804              
805             =over 12
806              
807             =item I<amount> integer
808              
809             Amount of tax applied for this rate.
810              
811             =item I<rate> hash
812              
813             The tax rate applied.
814              
815             When expanded, this is a L<Net::API::Stripe::Tax::Rate> object.
816              
817             =back
818              
819             =back
820              
821             =back
822              
823             =head2 url string
824              
825             The URL to the Checkout Session.
826              
827             =head1 API SAMPLE
828              
829             {
830             "id": "cs_test_ksjfkjfkljslfkjlfkflsfklskflskflskfs",
831             "object": "checkout.session",
832             "billing_address_collection": null,
833             "cancel_url": "https://example.com/cancel",
834             "client_reference_id": null,
835             "customer": null,
836             "customer_email": null,
837             "display_items": [
838             {
839             "amount": 1500,
840             "currency": "usd",
841             "custom": {
842             "description": "Comfortable cotton t-shirt",
843             "images": null,
844             "name": "T-shirt"
845             },
846             "quantity": 2,
847             "type": "custom"
848             }
849             ],
850             "livemode": false,
851             "locale": null,
852             "mode": null,
853             "payment_intent": "pi_fake123456789",
854             "payment_method_types": [
855             "card"
856             ],
857             "setup_intent": null,
858             "submit_type": null,
859             "subscription": null,
860             "success_url": "https://example.com/success"
861             }
862              
863             =head1 HISTORY
864              
865             =head2 v0.1
866              
867             Initial version
868              
869             =head1 AUTHOR
870              
871             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
872              
873             =head1 SEE ALSO
874              
875             Stripe API documentation:
876              
877             L<https://stripe.com/docs/api/checkout/sessions>, L<https://stripe.com/docs/payments/checkout/api>
878              
879             =head1 COPYRIGHT & LICENSE
880              
881             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
882              
883             You can use, copy, modify and redistribute this package and associated
884             files under the same terms as Perl itself.
885              
886             =cut