| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
|
2
|
|
|
|
|
|
|
## Stripe API - ~/lib/Net/API/Stripe/Billing/PortalSession.pm |
|
3
|
|
|
|
|
|
|
## Version v0.100.0 |
|
4
|
|
|
|
|
|
|
## Copyright(c) 2019 DEGUEST Pte. Ltd. |
|
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
|
6
|
|
|
|
|
|
|
## Created 2019/11/02 |
|
7
|
|
|
|
|
|
|
## Modified 2022/07/10 |
|
8
|
|
|
|
|
|
|
## |
|
9
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
|
10
|
|
|
|
|
|
|
package Net::API::Stripe::Billing::PortalSession; |
|
11
|
|
|
|
|
|
|
BEGIN |
|
12
|
|
|
|
|
|
|
{ |
|
13
|
2
|
|
|
2
|
|
21094040
|
use strict; |
|
|
2
|
|
|
|
|
13
|
|
|
|
2
|
|
|
|
|
64
|
|
|
14
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
60
|
|
|
15
|
2
|
|
|
2
|
|
18
|
use parent qw( Net::API::Stripe::Generic ); |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
13
|
|
|
16
|
2
|
|
|
2
|
|
148
|
use vars qw( $VERSION ); |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
122
|
|
|
17
|
2
|
|
|
2
|
|
44
|
our( $VERSION ) = 'v0.1.0'; |
|
18
|
|
|
|
|
|
|
}; |
|
19
|
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
14
|
use strict; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
85
|
|
|
21
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
|
2
|
|
|
|
|
8
|
|
|
|
2
|
|
|
|
|
487
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
1
|
|
sub id { return( shift->_set_get_scalar( 'id', @_ ) ); } |
|
24
|
|
|
|
|
|
|
|
|
25
|
0
|
|
|
0
|
1
|
|
sub object { return( shift->_set_get_scalar( 'object', @_ ) ); } |
|
26
|
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
1
|
|
sub configuration { return( shift->_set_get_scalar_or_object( 'configuration', 'Net::API::Stripe::Billing::PortalConfiguration', @_ ) ); } |
|
28
|
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
|
sub created { return( shift->_set_get_datetime( 'created', @_ ) ); } |
|
30
|
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
1
|
|
sub customer { return( shift->_set_get_scalar_or_object( 'customer', 'Net::API::Stripe::Customer', @_ ) ); } |
|
32
|
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
1
|
|
sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); } |
|
34
|
|
|
|
|
|
|
|
|
35
|
0
|
|
|
0
|
1
|
|
sub locale { return( shift->_set_get_scalar( 'locale', @_ ) ); } |
|
36
|
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
1
|
|
sub on_behalf_of { return( shift->_set_get_scalar_or_object( 'on_behalf_of', 'Net::API::Stripe::Connect::Account', @_ ) ); } |
|
38
|
|
|
|
|
|
|
|
|
39
|
0
|
|
|
0
|
1
|
|
sub return_url { return( shift->_set_get_uri( 'return_url', @_ ) ); } |
|
40
|
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
1
|
|
sub url { return( shift->_set_get_scalar( 'url', @_ ) ); } |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=encoding utf8 |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Net::API::Stripe::Billing::PortalSession - The session object |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
my $portal = $stripe->portal_session({ |
|
56
|
|
|
|
|
|
|
created => 'now', |
|
57
|
|
|
|
|
|
|
customer => 'cust_fake123456789', |
|
58
|
|
|
|
|
|
|
livemode => $stripe->false, |
|
59
|
|
|
|
|
|
|
return_url => 'https://example.com/ec/df63685a-6cd2-4c5d-9d4c-81b417646a58', |
|
60
|
|
|
|
|
|
|
url => 'https://billing.stripe.com/session/{SESSION_SECRET}', |
|
61
|
|
|
|
|
|
|
}); |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 VERSION |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
v0.1.0 |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
A session describes the instantiation of the customer portal for a particular customer. By visiting the session's URL, the customer can manage their subscriptions and billing details. For security reasons, sessions are short-lived and will expire if the customer does not visit the URL. |
|
70
|
|
|
|
|
|
|
Create sessions on-demand when customers intend to manage their subscriptions and billing details. |
|
71
|
|
|
|
|
|
|
Integration guide: [Billing customer portal](/docs/billing/subscriptions/integrating-customer-portal). |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 METHODS |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 id string |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Unique identifier for the object. |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 object string |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
String representing the object's type. Objects of the same type share the same value. |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 configuration string |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Expandable to L<Net::API::Stripe::Billing::PortalConfiguration> |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
The configuration used by this session, describing the features available. |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 created timestamp |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Time at which the object was created. Measured in seconds since the Unix epoch. |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 customer string |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
The ID of the customer for this session. |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 livemode boolean |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 locale enum |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
The IETF language tag of the locale Customer Portal is displayed in (e.g. C<ja> or C<en-GB>. If blank or set to C<auto>, the customer’s C<preferred_locales> or browser’s locale is used. |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 on_behalf_of string |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Connect only |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
The L<account|Net::API::Stripe::Connect::Account> for which the session was created on behalf of. When specified, only subscriptions and invoices with this C<on_behalf_of> account appear in the portal. For more information, see the docs. Use the Accounts API to modify the C<on_behalf_of> account’s branding settings, which the portal displays. |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 return_url string |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
The URL to which Stripe should send customers when they click on the link to return to your website. |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head2 url string |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
The short-lived URL of the session giving customers access to the customer portal. |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 API SAMPLE |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
{ |
|
122
|
|
|
|
|
|
|
"id": "bps_1LK7CQCeyNCl6fY2zTGZOzQa", |
|
123
|
|
|
|
|
|
|
"object": "billing_portal.session", |
|
124
|
|
|
|
|
|
|
"configuration": "bpc_1LK7CQCeyNCl6fY2ESFdGr6O", |
|
125
|
|
|
|
|
|
|
"created": 1657486674, |
|
126
|
|
|
|
|
|
|
"customer": "cus_AODr7KhjWjH7Yk", |
|
127
|
|
|
|
|
|
|
"livemode": true, |
|
128
|
|
|
|
|
|
|
"locale": null, |
|
129
|
|
|
|
|
|
|
"on_behalf_of": null, |
|
130
|
|
|
|
|
|
|
"return_url": "https://example.com/account", |
|
131
|
|
|
|
|
|
|
"url": "https://billing.stripe.com/session/{SESSION_SECRET}" |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 HISTORY |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head2 v0.1.0 |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Initial version |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 AUTHOR |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Stripe API documentation: |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#portal_session_object> |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Copyright (c) 2019-2022 DEGUEST Pte. Ltd. |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
|
155
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=cut |