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