@stripe/extensibility-sdk 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensibility-sdk-alpha.d.ts +34 -37
- package/dist/extensibility-sdk-beta.d.ts +34 -37
- package/dist/extensibility-sdk-extensions-alpha.d.ts +39 -37
- package/dist/extensibility-sdk-extensions-beta.d.ts +39 -37
- package/dist/extensibility-sdk-extensions-internal.d.ts +39 -37
- package/dist/extensibility-sdk-extensions-public.d.ts +39 -37
- package/dist/extensibility-sdk-internal.d.ts +34 -37
- package/dist/extensibility-sdk-public.d.ts +34 -37
- package/dist/extensions/billing/bill/discount_calculation.d.ts +4 -5
- package/dist/extensions/billing/bill/discount_calculation.d.ts.map +1 -1
- package/dist/extensions/billing/customer_balance_application.d.ts +6 -6
- package/dist/extensions/billing/customer_balance_application.d.ts.map +1 -1
- package/dist/extensions/billing/invoice_collection_setting.d.ts +4 -4
- package/dist/extensions/billing/invoice_collection_setting.d.ts.map +1 -1
- package/dist/extensions/billing/prorations.d.ts +4 -4
- package/dist/extensions/billing/prorations.d.ts.map +1 -1
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts +6 -6
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts.map +1 -1
- package/dist/extensions/core/workflows/custom_action.d.ts +5 -6
- package/dist/extensions/core/workflows/custom_action.d.ts.map +1 -1
- package/dist/extensions/extend/workflows/custom_action.d.ts +5 -6
- package/dist/extensions/extend/workflows/custom_action.d.ts.map +1 -1
- package/dist/extensions/index.cjs +0 -2
- package/dist/extensions/index.d.ts +6 -2
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +1 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import from `@stripe/extensibility-sdk` instead.
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Opaque brand symbol used as a property key in SDK branded types.
|
|
3
8
|
*
|
|
@@ -187,22 +192,21 @@ declare namespace CustomAction {
|
|
|
187
192
|
* Executes the custom action at workflow runtime. Called when a workflow triggers this action, with the configured input values.
|
|
188
193
|
* @public
|
|
189
194
|
*/
|
|
190
|
-
type ExecuteFunction<Config
|
|
195
|
+
type ExecuteFunction<Config> = (request: ExecuteCustomActionRequest, config: Config, context: Context) => ExecuteCustomActionResponse | PromiseLike<ExecuteCustomActionResponse>;
|
|
191
196
|
/**
|
|
192
197
|
* Returns the current form state for the action's configuration UI. Called at configuration time (not runtime) to power dynamic form behavior, including dropdown options, dynamic JSON schemas, field visibility, and validation.
|
|
193
198
|
* @public
|
|
194
199
|
*/
|
|
195
|
-
type GetFormStateFunction<Config
|
|
200
|
+
type GetFormStateFunction<Config> = (request: GetFormStateRequest, config: Config, context: Context) => GetFormStateResponse | PromiseLike<GetFormStateResponse>;
|
|
196
201
|
}
|
|
197
202
|
|
|
198
203
|
/**
|
|
199
204
|
* @example
|
|
200
205
|
* ```ts
|
|
201
|
-
* import type { Core } from '@stripe/extensibility-sdk
|
|
202
|
-
* import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
206
|
+
* import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
203
207
|
*
|
|
204
208
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
205
|
-
* interface MyCustomActionConfig
|
|
209
|
+
* interface MyCustomActionConfig {}
|
|
206
210
|
*
|
|
207
211
|
* export default class MyCustomAction implements Core.Workflows
|
|
208
212
|
* .CustomAction<MyCustomActionConfig> {
|
|
@@ -233,7 +237,7 @@ declare namespace CustomAction {
|
|
|
233
237
|
* ```
|
|
234
238
|
* @public
|
|
235
239
|
*/
|
|
236
|
-
declare interface CustomAction<Config
|
|
240
|
+
declare interface CustomAction<Config> {
|
|
237
241
|
execute: CustomAction.ExecuteFunction<Config>;
|
|
238
242
|
getFormState?: CustomAction.GetFormStateFunction<Config>;
|
|
239
243
|
}
|
|
@@ -324,22 +328,21 @@ declare namespace CustomAction_2 {
|
|
|
324
328
|
* Executes the custom action at workflow runtime. Called when a workflow triggers this action, with the configured input values.
|
|
325
329
|
* @public
|
|
326
330
|
*/
|
|
327
|
-
type ExecuteFunction<Config
|
|
331
|
+
type ExecuteFunction<Config> = (request: ExecuteCustomActionRequest, config: Config, context: Context) => ExecuteCustomActionResponse | PromiseLike<ExecuteCustomActionResponse>;
|
|
328
332
|
/**
|
|
329
333
|
* Returns the current form state for the action's configuration UI. Called at configuration time (not runtime) to power dynamic form behavior, including dropdown options, dynamic JSON schemas, field visibility, and validation.
|
|
330
334
|
* @public
|
|
331
335
|
*/
|
|
332
|
-
type GetFormStateFunction<Config
|
|
336
|
+
type GetFormStateFunction<Config> = (request: GetFormStateRequest, config: Config, context: Context) => GetFormStateResponse | PromiseLike<GetFormStateResponse>;
|
|
333
337
|
}
|
|
334
338
|
|
|
335
339
|
/**
|
|
336
340
|
* @example
|
|
337
341
|
* ```ts
|
|
338
|
-
* import type { Extend } from '@stripe/extensibility-sdk
|
|
339
|
-
* import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
342
|
+
* import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
340
343
|
*
|
|
341
344
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
342
|
-
* interface MyCustomActionConfig
|
|
345
|
+
* interface MyCustomActionConfig {}
|
|
343
346
|
*
|
|
344
347
|
* export default class MyCustomAction implements Extend.Workflows
|
|
345
348
|
* .CustomAction<MyCustomActionConfig> {
|
|
@@ -370,7 +373,7 @@ declare namespace CustomAction_2 {
|
|
|
370
373
|
* ```
|
|
371
374
|
* @public
|
|
372
375
|
*/
|
|
373
|
-
declare interface CustomAction_2<Config
|
|
376
|
+
declare interface CustomAction_2<Config> {
|
|
374
377
|
execute: CustomAction_2.ExecuteFunction<Config>;
|
|
375
378
|
getFormState?: CustomAction_2.GetFormStateFunction<Config>;
|
|
376
379
|
}
|
|
@@ -421,21 +424,21 @@ declare namespace CustomerBalanceApplication {
|
|
|
421
424
|
* Determines how much of the customer's balance to apply toward a bill total. The script receives the invoice total and current customer balance, then returns how much of that balance to apply.
|
|
422
425
|
* @public
|
|
423
426
|
*/
|
|
424
|
-
type ComputeAppliedCustomerBalanceFunction<Config
|
|
427
|
+
type ComputeAppliedCustomerBalanceFunction<Config> = (request: CustomerBalanceApplicationInput, config: Config, context: Context) => CustomerBalanceApplicationResult;
|
|
425
428
|
}
|
|
426
429
|
|
|
427
430
|
/**
|
|
428
431
|
* @example
|
|
429
432
|
* ```ts
|
|
430
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
433
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
431
434
|
*
|
|
432
435
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
433
|
-
* interface
|
|
436
|
+
* interface MyBalanceAppConfig {}
|
|
434
437
|
*
|
|
435
|
-
* export default class
|
|
438
|
+
* export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
436
439
|
* computeAppliedCustomerBalance(
|
|
437
440
|
* request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
438
|
-
* _config:
|
|
441
|
+
* _config: MyBalanceAppConfig,
|
|
439
442
|
* _context: Context
|
|
440
443
|
* ) {
|
|
441
444
|
* // TODO: implement your customer balance logic here
|
|
@@ -449,7 +452,7 @@ declare namespace CustomerBalanceApplication {
|
|
|
449
452
|
* ```
|
|
450
453
|
* @public
|
|
451
454
|
*/
|
|
452
|
-
declare interface CustomerBalanceApplication<Config
|
|
455
|
+
declare interface CustomerBalanceApplication<Config> {
|
|
453
456
|
computeAppliedCustomerBalance: CustomerBalanceApplication.ComputeAppliedCustomerBalanceFunction<Config>;
|
|
454
457
|
}
|
|
455
458
|
|
|
@@ -863,17 +866,16 @@ declare namespace DiscountCalculation {
|
|
|
863
866
|
* Computes discount amounts for a discountable item and returns a discount result.
|
|
864
867
|
* @public
|
|
865
868
|
*/
|
|
866
|
-
type ComputeDiscountsFunction<Config
|
|
869
|
+
type ComputeDiscountsFunction<Config> = (request: DiscountableItem, config: Config, context: Context) => DiscountResult;
|
|
867
870
|
}
|
|
868
871
|
|
|
869
872
|
/**
|
|
870
873
|
* @example
|
|
871
874
|
* ```ts
|
|
872
|
-
* import type { Billing } from '@stripe/extensibility-sdk
|
|
873
|
-
* import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
875
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
874
876
|
*
|
|
875
877
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
876
|
-
* interface MyDiscountCalculationConfig
|
|
878
|
+
* interface MyDiscountCalculationConfig {}
|
|
877
879
|
*
|
|
878
880
|
* export default class MyDiscountCalculation implements Billing.Bill
|
|
879
881
|
* .DiscountCalculation<MyDiscountCalculationConfig> {
|
|
@@ -893,7 +895,7 @@ declare namespace DiscountCalculation {
|
|
|
893
895
|
* ```
|
|
894
896
|
* @public
|
|
895
897
|
*/
|
|
896
|
-
declare interface DiscountCalculation<Config
|
|
898
|
+
declare interface DiscountCalculation<Config> {
|
|
897
899
|
computeDiscounts: DiscountCalculation.ComputeDiscountsFunction<Config>;
|
|
898
900
|
}
|
|
899
901
|
|
|
@@ -986,16 +988,16 @@ declare namespace InvoiceCollectionSetting {
|
|
|
986
988
|
* Overrides invoice collection settings before a draft invoice is created.
|
|
987
989
|
* @public
|
|
988
990
|
*/
|
|
989
|
-
type CollectionOverrideFunction<Config
|
|
991
|
+
type CollectionOverrideFunction<Config> = (request: InvoiceCollectionRequest, config: Config, context: Context) => InvoiceCollectionResponse;
|
|
990
992
|
}
|
|
991
993
|
|
|
992
994
|
/**
|
|
993
995
|
* @example
|
|
994
996
|
* ```ts
|
|
995
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
997
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
996
998
|
*
|
|
997
999
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
998
|
-
* interface MyInvoiceCollectionSettingConfig
|
|
1000
|
+
* interface MyInvoiceCollectionSettingConfig {}
|
|
999
1001
|
*
|
|
1000
1002
|
* export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
1001
1003
|
* collectionOverride(
|
|
@@ -1012,7 +1014,7 @@ declare namespace InvoiceCollectionSetting {
|
|
|
1012
1014
|
* ```
|
|
1013
1015
|
* @public
|
|
1014
1016
|
*/
|
|
1015
|
-
declare interface InvoiceCollectionSetting<Config
|
|
1017
|
+
declare interface InvoiceCollectionSetting<Config> {
|
|
1016
1018
|
collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
|
|
1017
1019
|
}
|
|
1018
1020
|
|
|
@@ -1226,16 +1228,16 @@ declare namespace Prorations {
|
|
|
1226
1228
|
* Calculates prorated amounts for subscription items when changes occur mid-billing period. The script receives the invoice items, then returns computed proration factors for each item.
|
|
1227
1229
|
* @public
|
|
1228
1230
|
*/
|
|
1229
|
-
type ProrateItemsFunction<Config
|
|
1231
|
+
type ProrateItemsFunction<Config> = (request: ProrateItemsInput, config: Config, context: Context) => ProrateItemsResult;
|
|
1230
1232
|
}
|
|
1231
1233
|
|
|
1232
1234
|
/**
|
|
1233
1235
|
* @example
|
|
1234
1236
|
* ```ts
|
|
1235
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1237
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1236
1238
|
*
|
|
1237
1239
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1238
|
-
* interface MyProrationsConfig
|
|
1240
|
+
* interface MyProrationsConfig {}
|
|
1239
1241
|
*
|
|
1240
1242
|
* export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
|
|
1241
1243
|
* prorateItems(
|
|
@@ -1254,7 +1256,7 @@ declare namespace Prorations {
|
|
|
1254
1256
|
* ```
|
|
1255
1257
|
* @public
|
|
1256
1258
|
*/
|
|
1257
|
-
declare interface Prorations<Config
|
|
1259
|
+
declare interface Prorations<Config> {
|
|
1258
1260
|
prorateItems: Prorations.ProrateItemsFunction<Config>;
|
|
1259
1261
|
}
|
|
1260
1262
|
|
|
@@ -1496,26 +1498,26 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1496
1498
|
* Runs before invoice items are created. Decides whether each item should be created or skipped.
|
|
1497
1499
|
* @public
|
|
1498
1500
|
*/
|
|
1499
|
-
type BeforeItemCreationFunction<Config
|
|
1501
|
+
type BeforeItemCreationFunction<Config> = (request: BeforeItemCreationInput, config: Config, context: Context) => BeforeItemCreationResult;
|
|
1500
1502
|
/**
|
|
1501
1503
|
* Runs before invoices are created. Decides which items to include on the invoice. Items not included are deferred as pending invoice items.
|
|
1502
1504
|
* @public
|
|
1503
1505
|
*/
|
|
1504
|
-
type FilterItemsFunction<Config
|
|
1506
|
+
type FilterItemsFunction<Config> = (request: FilterItemsInput, config: Config, context: Context) => FilterItemsResult;
|
|
1505
1507
|
/**
|
|
1506
1508
|
* Runs before invoices are created. Decides how items are grouped across one or more invoices.
|
|
1507
1509
|
* @public
|
|
1508
1510
|
*/
|
|
1509
|
-
type GroupItemsFunction<Config
|
|
1511
|
+
type GroupItemsFunction<Config> = (request: GroupItemsInput, config: Config, context: Context) => GroupItemsResult;
|
|
1510
1512
|
}
|
|
1511
1513
|
|
|
1512
1514
|
/**
|
|
1513
1515
|
* @example
|
|
1514
1516
|
* ```ts
|
|
1515
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1517
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1516
1518
|
*
|
|
1517
1519
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1518
|
-
* interface MyRecurringBillingItemHandlingConfig
|
|
1520
|
+
* interface MyRecurringBillingItemHandlingConfig {}
|
|
1519
1521
|
*
|
|
1520
1522
|
* export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
|
|
1521
1523
|
* beforeItemCreation(
|
|
@@ -1558,7 +1560,7 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1558
1560
|
* ```
|
|
1559
1561
|
* @public
|
|
1560
1562
|
*/
|
|
1561
|
-
declare interface RecurringBillingItemHandling<Config
|
|
1563
|
+
declare interface RecurringBillingItemHandling<Config> {
|
|
1562
1564
|
beforeItemCreation: RecurringBillingItemHandling.BeforeItemCreationFunction<Config>;
|
|
1563
1565
|
filterItems: RecurringBillingItemHandling.FilterItemsFunction<Config>;
|
|
1564
1566
|
groupItems: RecurringBillingItemHandling.GroupItemsFunction<Config>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import from `@stripe/extensibility-sdk` instead.
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Opaque brand symbol used as a property key in SDK branded types.
|
|
3
8
|
*
|
|
@@ -164,22 +169,21 @@ declare namespace CustomAction {
|
|
|
164
169
|
* Executes the custom action at workflow runtime. Called when a workflow triggers this action, with the configured input values.
|
|
165
170
|
* @public
|
|
166
171
|
*/
|
|
167
|
-
type ExecuteFunction<Config
|
|
172
|
+
type ExecuteFunction<Config> = (request: ExecuteCustomActionRequest, config: Config, context: Context) => ExecuteCustomActionResponse | PromiseLike<ExecuteCustomActionResponse>;
|
|
168
173
|
/**
|
|
169
174
|
* Returns the current form state for the action's configuration UI. Called at configuration time (not runtime) to power dynamic form behavior, including dropdown options, dynamic JSON schemas, field visibility, and validation.
|
|
170
175
|
* @public
|
|
171
176
|
*/
|
|
172
|
-
type GetFormStateFunction<Config
|
|
177
|
+
type GetFormStateFunction<Config> = (request: GetFormStateRequest, config: Config, context: Context) => GetFormStateResponse | PromiseLike<GetFormStateResponse>;
|
|
173
178
|
}
|
|
174
179
|
|
|
175
180
|
/**
|
|
176
181
|
* @example
|
|
177
182
|
* ```ts
|
|
178
|
-
* import type { Core } from '@stripe/extensibility-sdk
|
|
179
|
-
* import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
183
|
+
* import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
180
184
|
*
|
|
181
185
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
182
|
-
* interface MyCustomActionConfig
|
|
186
|
+
* interface MyCustomActionConfig {}
|
|
183
187
|
*
|
|
184
188
|
* export default class MyCustomAction implements Core.Workflows
|
|
185
189
|
* .CustomAction<MyCustomActionConfig> {
|
|
@@ -210,7 +214,7 @@ declare namespace CustomAction {
|
|
|
210
214
|
* ```
|
|
211
215
|
* @public
|
|
212
216
|
*/
|
|
213
|
-
declare interface CustomAction<Config
|
|
217
|
+
declare interface CustomAction<Config> {
|
|
214
218
|
execute: CustomAction.ExecuteFunction<Config>;
|
|
215
219
|
getFormState?: CustomAction.GetFormStateFunction<Config>;
|
|
216
220
|
}
|
|
@@ -299,22 +303,21 @@ declare namespace CustomAction_2 {
|
|
|
299
303
|
* Executes the custom action at workflow runtime. Called when a workflow triggers this action, with the configured input values.
|
|
300
304
|
* @public
|
|
301
305
|
*/
|
|
302
|
-
type ExecuteFunction<Config
|
|
306
|
+
type ExecuteFunction<Config> = (request: ExecuteCustomActionRequest, config: Config, context: Context) => ExecuteCustomActionResponse | PromiseLike<ExecuteCustomActionResponse>;
|
|
303
307
|
/**
|
|
304
308
|
* Returns the current form state for the action's configuration UI. Called at configuration time (not runtime) to power dynamic form behavior, including dropdown options, dynamic JSON schemas, field visibility, and validation.
|
|
305
309
|
* @public
|
|
306
310
|
*/
|
|
307
|
-
type GetFormStateFunction<Config
|
|
311
|
+
type GetFormStateFunction<Config> = (request: GetFormStateRequest, config: Config, context: Context) => GetFormStateResponse | PromiseLike<GetFormStateResponse>;
|
|
308
312
|
}
|
|
309
313
|
|
|
310
314
|
/**
|
|
311
315
|
* @example
|
|
312
316
|
* ```ts
|
|
313
|
-
* import type { Extend } from '@stripe/extensibility-sdk
|
|
314
|
-
* import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
317
|
+
* import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
315
318
|
*
|
|
316
319
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
317
|
-
* interface MyCustomActionConfig
|
|
320
|
+
* interface MyCustomActionConfig {}
|
|
318
321
|
*
|
|
319
322
|
* export default class MyCustomAction implements Extend.Workflows
|
|
320
323
|
* .CustomAction<MyCustomActionConfig> {
|
|
@@ -345,7 +348,7 @@ declare namespace CustomAction_2 {
|
|
|
345
348
|
* ```
|
|
346
349
|
* @public
|
|
347
350
|
*/
|
|
348
|
-
declare interface CustomAction_2<Config
|
|
351
|
+
declare interface CustomAction_2<Config> {
|
|
349
352
|
execute: CustomAction_2.ExecuteFunction<Config>;
|
|
350
353
|
getFormState?: CustomAction_2.GetFormStateFunction<Config>;
|
|
351
354
|
}
|
|
@@ -395,21 +398,21 @@ declare namespace CustomerBalanceApplication {
|
|
|
395
398
|
* Determines how much of the customer's balance to apply toward a bill total. The script receives the invoice total and current customer balance, then returns how much of that balance to apply.
|
|
396
399
|
* @public
|
|
397
400
|
*/
|
|
398
|
-
type ComputeAppliedCustomerBalanceFunction<Config
|
|
401
|
+
type ComputeAppliedCustomerBalanceFunction<Config> = (request: CustomerBalanceApplicationInput, config: Config, context: Context) => CustomerBalanceApplicationResult;
|
|
399
402
|
}
|
|
400
403
|
|
|
401
404
|
/**
|
|
402
405
|
* @example
|
|
403
406
|
* ```ts
|
|
404
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
407
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
405
408
|
*
|
|
406
409
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
407
|
-
* interface
|
|
410
|
+
* interface MyBalanceAppConfig {}
|
|
408
411
|
*
|
|
409
|
-
* export default class
|
|
412
|
+
* export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
410
413
|
* computeAppliedCustomerBalance(
|
|
411
414
|
* request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
412
|
-
* _config:
|
|
415
|
+
* _config: MyBalanceAppConfig,
|
|
413
416
|
* _context: Context
|
|
414
417
|
* ) {
|
|
415
418
|
* // TODO: implement your customer balance logic here
|
|
@@ -423,7 +426,7 @@ declare namespace CustomerBalanceApplication {
|
|
|
423
426
|
* ```
|
|
424
427
|
* @public
|
|
425
428
|
*/
|
|
426
|
-
declare interface CustomerBalanceApplication<Config
|
|
429
|
+
declare interface CustomerBalanceApplication<Config> {
|
|
427
430
|
computeAppliedCustomerBalance: CustomerBalanceApplication.ComputeAppliedCustomerBalanceFunction<Config>;
|
|
428
431
|
}
|
|
429
432
|
|
|
@@ -827,17 +830,16 @@ declare namespace DiscountCalculation {
|
|
|
827
830
|
* Computes discount amounts for a discountable item and returns a discount result.
|
|
828
831
|
* @public
|
|
829
832
|
*/
|
|
830
|
-
type ComputeDiscountsFunction<Config
|
|
833
|
+
type ComputeDiscountsFunction<Config> = (request: DiscountableItem, config: Config, context: Context) => DiscountResult;
|
|
831
834
|
}
|
|
832
835
|
|
|
833
836
|
/**
|
|
834
837
|
* @example
|
|
835
838
|
* ```ts
|
|
836
|
-
* import type { Billing } from '@stripe/extensibility-sdk
|
|
837
|
-
* import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
839
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
838
840
|
*
|
|
839
841
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
840
|
-
* interface MyDiscountCalculationConfig
|
|
842
|
+
* interface MyDiscountCalculationConfig {}
|
|
841
843
|
*
|
|
842
844
|
* export default class MyDiscountCalculation implements Billing.Bill
|
|
843
845
|
* .DiscountCalculation<MyDiscountCalculationConfig> {
|
|
@@ -857,7 +859,7 @@ declare namespace DiscountCalculation {
|
|
|
857
859
|
* ```
|
|
858
860
|
* @public
|
|
859
861
|
*/
|
|
860
|
-
declare interface DiscountCalculation<Config
|
|
862
|
+
declare interface DiscountCalculation<Config> {
|
|
861
863
|
computeDiscounts: DiscountCalculation.ComputeDiscountsFunction<Config>;
|
|
862
864
|
}
|
|
863
865
|
|
|
@@ -949,16 +951,16 @@ declare namespace InvoiceCollectionSetting {
|
|
|
949
951
|
* Overrides invoice collection settings before a draft invoice is created.
|
|
950
952
|
* @public
|
|
951
953
|
*/
|
|
952
|
-
type CollectionOverrideFunction<Config
|
|
954
|
+
type CollectionOverrideFunction<Config> = (request: InvoiceCollectionRequest, config: Config, context: Context) => InvoiceCollectionResponse;
|
|
953
955
|
}
|
|
954
956
|
|
|
955
957
|
/**
|
|
956
958
|
* @example
|
|
957
959
|
* ```ts
|
|
958
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
960
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
959
961
|
*
|
|
960
962
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
961
|
-
* interface MyInvoiceCollectionSettingConfig
|
|
963
|
+
* interface MyInvoiceCollectionSettingConfig {}
|
|
962
964
|
*
|
|
963
965
|
* export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
964
966
|
* collectionOverride(
|
|
@@ -975,7 +977,7 @@ declare namespace InvoiceCollectionSetting {
|
|
|
975
977
|
* ```
|
|
976
978
|
* @public
|
|
977
979
|
*/
|
|
978
|
-
declare interface InvoiceCollectionSetting<Config
|
|
980
|
+
declare interface InvoiceCollectionSetting<Config> {
|
|
979
981
|
collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
|
|
980
982
|
}
|
|
981
983
|
|
|
@@ -1188,16 +1190,16 @@ declare namespace Prorations {
|
|
|
1188
1190
|
* Calculates prorated amounts for subscription items when changes occur mid-billing period. The script receives the invoice items, then returns computed proration factors for each item.
|
|
1189
1191
|
* @public
|
|
1190
1192
|
*/
|
|
1191
|
-
type ProrateItemsFunction<Config
|
|
1193
|
+
type ProrateItemsFunction<Config> = (request: ProrateItemsInput, config: Config, context: Context) => ProrateItemsResult;
|
|
1192
1194
|
}
|
|
1193
1195
|
|
|
1194
1196
|
/**
|
|
1195
1197
|
* @example
|
|
1196
1198
|
* ```ts
|
|
1197
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1199
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1198
1200
|
*
|
|
1199
1201
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1200
|
-
* interface MyProrationsConfig
|
|
1202
|
+
* interface MyProrationsConfig {}
|
|
1201
1203
|
*
|
|
1202
1204
|
* export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
|
|
1203
1205
|
* prorateItems(
|
|
@@ -1216,7 +1218,7 @@ declare namespace Prorations {
|
|
|
1216
1218
|
* ```
|
|
1217
1219
|
* @public
|
|
1218
1220
|
*/
|
|
1219
|
-
declare interface Prorations<Config
|
|
1221
|
+
declare interface Prorations<Config> {
|
|
1220
1222
|
prorateItems: Prorations.ProrateItemsFunction<Config>;
|
|
1221
1223
|
}
|
|
1222
1224
|
|
|
@@ -1455,26 +1457,26 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1455
1457
|
* Runs before invoice items are created. Decides whether each item should be created or skipped.
|
|
1456
1458
|
* @public
|
|
1457
1459
|
*/
|
|
1458
|
-
type BeforeItemCreationFunction<Config
|
|
1460
|
+
type BeforeItemCreationFunction<Config> = (request: BeforeItemCreationInput, config: Config, context: Context) => BeforeItemCreationResult;
|
|
1459
1461
|
/**
|
|
1460
1462
|
* Runs before invoices are created. Decides which items to include on the invoice. Items not included are deferred as pending invoice items.
|
|
1461
1463
|
* @public
|
|
1462
1464
|
*/
|
|
1463
|
-
type FilterItemsFunction<Config
|
|
1465
|
+
type FilterItemsFunction<Config> = (request: FilterItemsInput, config: Config, context: Context) => FilterItemsResult;
|
|
1464
1466
|
/**
|
|
1465
1467
|
* Runs before invoices are created. Decides how items are grouped across one or more invoices.
|
|
1466
1468
|
* @public
|
|
1467
1469
|
*/
|
|
1468
|
-
type GroupItemsFunction<Config
|
|
1470
|
+
type GroupItemsFunction<Config> = (request: GroupItemsInput, config: Config, context: Context) => GroupItemsResult;
|
|
1469
1471
|
}
|
|
1470
1472
|
|
|
1471
1473
|
/**
|
|
1472
1474
|
* @example
|
|
1473
1475
|
* ```ts
|
|
1474
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1476
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1475
1477
|
*
|
|
1476
1478
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1477
|
-
* interface MyRecurringBillingItemHandlingConfig
|
|
1479
|
+
* interface MyRecurringBillingItemHandlingConfig {}
|
|
1478
1480
|
*
|
|
1479
1481
|
* export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
|
|
1480
1482
|
* beforeItemCreation(
|
|
@@ -1517,7 +1519,7 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1517
1519
|
* ```
|
|
1518
1520
|
* @public
|
|
1519
1521
|
*/
|
|
1520
|
-
declare interface RecurringBillingItemHandling<Config
|
|
1522
|
+
declare interface RecurringBillingItemHandling<Config> {
|
|
1521
1523
|
beforeItemCreation: RecurringBillingItemHandling.BeforeItemCreationFunction<Config>;
|
|
1522
1524
|
filterItems: RecurringBillingItemHandling.FilterItemsFunction<Config>;
|
|
1523
1525
|
groupItems: RecurringBillingItemHandling.GroupItemsFunction<Config>;
|