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