line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## Stripe API - ~/lib/Net/API/Stripe/Checkout/Item.pm |
3
|
|
|
|
|
|
|
## Version v0.200.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2019 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2019/11/02 |
7
|
|
|
|
|
|
|
## Modified 2020/05/15 |
8
|
|
|
|
|
|
|
## |
9
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
BEGIN |
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
use strict; |
13
|
1
|
|
|
1
|
|
976
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
14
|
1
|
|
|
1
|
|
4
|
use parent qw( Net::API::Stripe::List::Item ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
15
|
1
|
|
|
1
|
|
5
|
use vars qw( $VERSION ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
16
|
1
|
|
|
1
|
|
67
|
our( $VERSION ) = 'v0.200.0'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
17
|
1
|
|
|
1
|
|
19
|
}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
use strict; |
20
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
21
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
151
|
|
22
|
|
|
|
|
|
|
# Method amount is inherited |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# Method currency is inherited |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
1
|
|
# Method description is inherited |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
1
|
|
|
32
|
|
|
|
|
|
|
# Method quantity is inherited |
33
|
0
|
|
|
0
|
1
|
|
|
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
0
|
1
|
|
# Method type is inherited |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
0
|
1
|
|
|
40
|
|
|
|
|
|
|
=encoding utf8 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 NAME |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Net::API::Stripe::Checkout::Item - A Stripe Checkout Item |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SYNOPSIS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $item = $stripe->session->display_items([ |
49
|
|
|
|
|
|
|
{ |
50
|
|
|
|
|
|
|
amount => 2000, |
51
|
|
|
|
|
|
|
currency => 'jpy', |
52
|
|
|
|
|
|
|
description => 'Some item', |
53
|
|
|
|
|
|
|
name => 'Session item', |
54
|
|
|
|
|
|
|
plan => $plan_object, |
55
|
|
|
|
|
|
|
quantity => 1, |
56
|
|
|
|
|
|
|
type => 'plan', |
57
|
|
|
|
|
|
|
}]); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 VERSION |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
v0.200.0 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
The line items, plans, or SKUs purchased by the customer. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This is part of the L<Net::API::Stripe::Checkout::Session> object an called from the method B<display_items> |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
It inherits from L<Net::API::Stripe::List::Item> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 new |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Creates a new L<Net::API::Stripe::Checkout::Item> object. |
76
|
|
|
|
|
|
|
It may also take an hash like arguments, that also are method of the same name. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 METHODS |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head2 amount integer |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Amount for the display item. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 currency currency |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Three-letter ISO currency code, in lowercase. Must be a supported currency. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 custom hash |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=over 4 |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=item I<description> string |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
The description of the line item. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item I<images> array containing strings |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
The images of the line item. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item I<name> string |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
The name of the line item. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=back |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 description string |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
The description for the line item. This is used in session checkout I<line_items>. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head2 images string |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
A list of images representing this line item. This is used in session checkout I<line_items>. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 name string |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
The name for the line item. This is used in session checkout I<line_items>. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head2 plan hash, plan object |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
This is a L<Net::API::Stripe::Billing::Plan> object. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head2 quantity integer |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Quantity of the display item being purchased. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head2 sku hash, sku object |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
This is a L<Net::API::Stripe::Order::SKU> object. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head2 type string |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
The type of display item. One of custom, plan or sku |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 API SAMPLE |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
{ |
137
|
|
|
|
|
|
|
"id": "ppage_fake123456789", |
138
|
|
|
|
|
|
|
"object": "checkout.session", |
139
|
|
|
|
|
|
|
"billing_address_collection": null, |
140
|
|
|
|
|
|
|
"cancel_url": "https://example.com/cancel", |
141
|
|
|
|
|
|
|
"client_reference_id": null, |
142
|
|
|
|
|
|
|
"customer": null, |
143
|
|
|
|
|
|
|
"customer_email": null, |
144
|
|
|
|
|
|
|
"display_items": [ |
145
|
|
|
|
|
|
|
{ |
146
|
|
|
|
|
|
|
"amount": 1500, |
147
|
|
|
|
|
|
|
"currency": "usd", |
148
|
|
|
|
|
|
|
"custom": { |
149
|
|
|
|
|
|
|
"description": "Comfortable cotton t-shirt", |
150
|
|
|
|
|
|
|
"images": null, |
151
|
|
|
|
|
|
|
"name": "T-shirt" |
152
|
|
|
|
|
|
|
}, |
153
|
|
|
|
|
|
|
"quantity": 2, |
154
|
|
|
|
|
|
|
"type": "custom" |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
], |
157
|
|
|
|
|
|
|
"livemode": false, |
158
|
|
|
|
|
|
|
"locale": null, |
159
|
|
|
|
|
|
|
"mode": null, |
160
|
|
|
|
|
|
|
"payment_intent": "pi_fake123456789", |
161
|
|
|
|
|
|
|
"payment_method_types": [ |
162
|
|
|
|
|
|
|
"card" |
163
|
|
|
|
|
|
|
], |
164
|
|
|
|
|
|
|
"setup_intent": null, |
165
|
|
|
|
|
|
|
"submit_type": null, |
166
|
|
|
|
|
|
|
"subscription": null, |
167
|
|
|
|
|
|
|
"success_url": "https://example.com/success", |
168
|
|
|
|
|
|
|
"line_items": [ |
169
|
|
|
|
|
|
|
{ |
170
|
|
|
|
|
|
|
"name": "T-shirt", |
171
|
|
|
|
|
|
|
"description": "Comfortable cotton t-shirt", |
172
|
|
|
|
|
|
|
"amount": 1500, |
173
|
|
|
|
|
|
|
"currency": "jpy", |
174
|
|
|
|
|
|
|
"quantity": 2 |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
] |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=head1 HISTORY |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head2 v0.1 |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Initial version |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head1 AUTHOR |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head1 SEE ALSO |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
Stripe API documentation: |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
L<https://stripe.com/docs/api> |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
Copyright (c) 2019-2020 DEGUEST Pte. Ltd. |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
200
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=cut |
203
|
|
|
|
|
|
|
|