-
Notifications
You must be signed in to change notification settings - Fork 719
/
Configurations.d.ts
252 lines (207 loc) · 7.76 KB
/
Configurations.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
// File generated from our OpenAPI spec
declare module 'stripe' {
namespace Stripe {
namespace BillingPortal {
/**
* A portal configuration describes the functionality and behavior of a portal session.
*/
interface Configuration {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing_portal.configuration';
/**
* Whether the configuration is active and can be used to create portal sessions.
*/
active: boolean;
/**
* ID of the Connect Application that created the configuration.
*/
application:
| string
| Stripe.Application
| Stripe.DeletedApplication
| null;
business_profile: Configuration.BusinessProfile;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session.
*/
default_return_url: string | null;
features: Configuration.Features;
/**
* Whether the configuration is the default. If `true`, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session.
*/
is_default: boolean;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
login_page: Configuration.LoginPage;
/**
* Set of [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.
*/
metadata: Stripe.Metadata | null;
/**
* Time at which the object was last updated. Measured in seconds since the Unix epoch.
*/
updated: number;
}
namespace Configuration {
interface BusinessProfile {
/**
* The messaging shown to customers in the portal.
*/
headline: string | null;
/**
* A link to the business's publicly available privacy policy.
*/
privacy_policy_url: string | null;
/**
* A link to the business's publicly available terms of service.
*/
terms_of_service_url: string | null;
}
interface Features {
customer_update: Features.CustomerUpdate;
invoice_history: Features.InvoiceHistory;
payment_method_update: Features.PaymentMethodUpdate;
subscription_cancel: Features.SubscriptionCancel;
subscription_update: Features.SubscriptionUpdate;
}
namespace Features {
interface CustomerUpdate {
/**
* The types of customer updates that are supported. When empty, customers are not updateable.
*/
allowed_updates: Array<CustomerUpdate.AllowedUpdate>;
/**
* Whether the feature is enabled.
*/
enabled: boolean;
}
namespace CustomerUpdate {
type AllowedUpdate =
| 'address'
| 'email'
| 'name'
| 'phone'
| 'shipping'
| 'tax_id';
}
interface InvoiceHistory {
/**
* Whether the feature is enabled.
*/
enabled: boolean;
}
interface PaymentMethodUpdate {
/**
* Whether the feature is enabled.
*/
enabled: boolean;
}
interface SubscriptionCancel {
cancellation_reason: SubscriptionCancel.CancellationReason;
/**
* Whether the feature is enabled.
*/
enabled: boolean;
/**
* Whether to cancel subscriptions immediately or at the end of the billing period.
*/
mode: SubscriptionCancel.Mode;
/**
* Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`.
*/
proration_behavior: SubscriptionCancel.ProrationBehavior;
}
namespace SubscriptionCancel {
interface CancellationReason {
/**
* Whether the feature is enabled.
*/
enabled: boolean;
/**
* Which cancellation reasons will be given as options to the customer.
*/
options: Array<CancellationReason.Option>;
}
namespace CancellationReason {
type Option =
| 'customer_service'
| 'low_quality'
| 'missing_features'
| 'other'
| 'switched_service'
| 'too_complex'
| 'too_expensive'
| 'unused';
}
type Mode = 'at_period_end' | 'immediately';
type ProrationBehavior =
| 'always_invoice'
| 'create_prorations'
| 'none';
}
interface SubscriptionUpdate {
/**
* The types of subscription updates that are supported for items listed in the `products` attribute. When empty, subscriptions are not updateable.
*/
default_allowed_updates: Array<
SubscriptionUpdate.DefaultAllowedUpdate
>;
/**
* Whether the feature is enabled.
*/
enabled: boolean;
/**
* The list of up to 10 products that support subscription updates.
*/
products?: Array<SubscriptionUpdate.Product> | null;
/**
* Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation.
*/
proration_behavior: SubscriptionUpdate.ProrationBehavior;
}
namespace SubscriptionUpdate {
type DefaultAllowedUpdate = 'price' | 'promotion_code' | 'quantity';
interface Product {
/**
* The list of price IDs which, when subscribed to, a subscription can be updated.
*/
prices: Array<string>;
/**
* The product ID.
*/
product: string;
}
type ProrationBehavior =
| 'always_invoice'
| 'create_prorations'
| 'none';
}
}
interface LoginPage {
/**
* If `true`, a shareable `url` will be generated that will take your customers to a hosted login page for the customer portal.
*
* If `false`, the previously generated `url`, if any, will be deactivated.
*/
enabled: boolean;
/**
* A shareable URL to the hosted portal login page. Your customers will be able to log in with their [email](https://stripe.com/docs/api/customers/object#customer_object-email) and receive a link to their customer portal.
*/
url: string | null;
}
}
}
}
}