@stripe/extensibility-sdk 0.26.0 → 0.27.1
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/README.md +29 -4
- package/dist/extensibility-sdk-alpha.d.ts +83 -58
- package/dist/extensibility-sdk-beta.d.ts +83 -58
- package/dist/extensibility-sdk-extensions-alpha.d.ts +82 -54
- package/dist/extensibility-sdk-extensions-beta.d.ts +82 -54
- package/dist/extensibility-sdk-extensions-internal.d.ts +82 -54
- package/dist/extensibility-sdk-extensions-public.d.ts +82 -54
- package/dist/extensibility-sdk-internal.d.ts +83 -58
- package/dist/extensibility-sdk-public.d.ts +83 -58
- package/dist/extensions/billing/index.d.ts +1 -1
- package/dist/extensions/billing/invoice_collection_options.d.ts +111 -0
- package/dist/extensions/billing/invoice_collection_options.d.ts.map +1 -0
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts +43 -0
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts.map +1 -1
- package/dist/extensions/index.cjs +111 -52
- package/dist/extensions/index.js +111 -52
- package/dist/index.cjs +103 -56
- package/dist/index.js +103 -55
- package/dist/internal.cjs +7 -7
- package/dist/internal.js +7 -7
- package/dist/stdlib/decimal.d.ts +1 -1
- package/dist/stdlib/index.d.ts +1 -5
- package/dist/stdlib/index.d.ts.map +1 -1
- package/dist/stdlib/refs.d.ts +0 -8
- package/dist/stdlib/refs.d.ts.map +1 -1
- package/dist/stdlib/scalars.d.ts +0 -4
- package/dist/stdlib/scalars.d.ts.map +1 -1
- package/dist/stdlib/to-const.d.ts +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -10
- package/dist/extensibility-sdk-stdlib-alpha.d.ts +0 -579
- package/dist/extensibility-sdk-stdlib-beta.d.ts +0 -579
- package/dist/extensibility-sdk-stdlib-internal.d.ts +0 -971
- package/dist/extensibility-sdk-stdlib-public.d.ts +0 -579
- package/dist/extensions/billing/invoice_collection_setting.d.ts +0 -117
- package/dist/extensions/billing/invoice_collection_setting.d.ts.map +0 -1
- package/dist/stdlib/index.cjs +0 -1754
- package/dist/stdlib/index.js +0 -1697
|
@@ -75,7 +75,7 @@ declare namespace Bill {
|
|
|
75
75
|
declare namespace Billing {
|
|
76
76
|
export {
|
|
77
77
|
CustomerBalanceApplication,
|
|
78
|
-
|
|
78
|
+
InvoiceCollectionOptions,
|
|
79
79
|
Prorations,
|
|
80
80
|
RecurringBillingItemHandling,
|
|
81
81
|
Bill,
|
|
@@ -472,7 +472,7 @@ declare interface CustomerBalanceApplication<Config> {
|
|
|
472
472
|
*
|
|
473
473
|
* @example
|
|
474
474
|
* ```ts
|
|
475
|
-
* import { Decimal, RoundDirection } from '@stripe/extensibility-sdk
|
|
475
|
+
* import { Decimal, RoundDirection } from '@stripe/extensibility-sdk';
|
|
476
476
|
*
|
|
477
477
|
* const price = Decimal.from('19.99');
|
|
478
478
|
* const tax = price.mul(Decimal.from('0.0825'));
|
|
@@ -965,58 +965,65 @@ declare interface IntegerCompanion {
|
|
|
965
965
|
declare type IntegerRoundDirection = 'ceil' | 'floor' | 'half-up' | 'round-down' | 'round-up';
|
|
966
966
|
|
|
967
967
|
/** @public */
|
|
968
|
-
declare namespace
|
|
968
|
+
declare namespace InvoiceCollectionOptions {
|
|
969
969
|
/** @public */
|
|
970
|
-
type
|
|
971
|
-
/** @public */
|
|
972
|
-
type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'boleto' | 'card' | 'cashapp' | 'eps' | 'fpx' | 'giropay' | 'grabpay' | 'ideal' | 'klarna' | 'konbini' | 'link' | 'multibanco' | 'oxxo' | 'p24' | 'paynow' | 'paypal' | 'promptpay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' | 'us_bank_account' | 'wechat_pay';
|
|
970
|
+
type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'blik' | 'boleto' | 'card' | 'cashapp' | 'eps' | 'fpx' | 'giropay' | 'grabpay' | 'ideal' | 'klarna' | 'konbini' | 'link' | 'multibanco' | 'oxxo' | 'p24' | 'paynow' | 'paypal' | 'promptpay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' | 'us_bank_account' | 'wechat_pay';
|
|
973
971
|
/** @public */
|
|
974
972
|
type CollectionMethod = 'charge_automatically' | 'send_invoice';
|
|
975
973
|
/**
|
|
976
|
-
* The result of the invoice collection
|
|
974
|
+
* The result of the invoice collection options override extension.
|
|
977
975
|
* @public
|
|
978
976
|
*/
|
|
979
|
-
interface
|
|
977
|
+
interface InvoiceCollectionOptionsResult {
|
|
980
978
|
/** Override the auto-advancement setting. Set to false to keep the invoice in draft. Return null to use the default. */
|
|
981
979
|
autoAdvance?: boolean;
|
|
982
980
|
}
|
|
983
981
|
/** @public */
|
|
984
|
-
type
|
|
982
|
+
type InvoiceCollectionOptionsInput = ({
|
|
985
983
|
customer: Customer;
|
|
986
984
|
payer: 'customer';
|
|
987
985
|
} | {
|
|
988
986
|
otherPayer: string;
|
|
989
987
|
payer: 'other';
|
|
990
|
-
}) & {
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
}
|
|
988
|
+
}) & ({
|
|
989
|
+
invoiceParentType: 'other';
|
|
990
|
+
otherInvoiceParentType: string;
|
|
991
|
+
} | {
|
|
992
|
+
invoiceParentType: 'subscription';
|
|
993
|
+
subscription: SubscriptionParent;
|
|
994
|
+
} | { invoiceParentType: 'cadence' } | { invoiceParentType: 'contract' } | { invoiceParentType: 'quote' } | { invoiceParentType: 'schedule' }) & { collectionOptions: CollectionOptions };
|
|
994
995
|
/** @public */
|
|
995
996
|
interface Customer {
|
|
996
997
|
id: string;
|
|
997
998
|
metadata: Record<string, string>;
|
|
998
999
|
}
|
|
1000
|
+
/** @public */
|
|
1001
|
+
type ContractParent = Record<string, never>;
|
|
999
1002
|
/**
|
|
1000
|
-
* The
|
|
1003
|
+
* The Subscription that triggered the invoice creation.
|
|
1001
1004
|
* @public
|
|
1002
1005
|
*/
|
|
1003
|
-
interface
|
|
1004
|
-
/** The
|
|
1005
|
-
|
|
1006
|
-
/**
|
|
1006
|
+
interface SubscriptionParent {
|
|
1007
|
+
/** The unique identifier for the subscription. */
|
|
1008
|
+
id: string;
|
|
1009
|
+
/** The metadata of the subscription. */
|
|
1007
1010
|
metadata: Record<string, string>;
|
|
1008
1011
|
}
|
|
1012
|
+
/** @public */
|
|
1013
|
+
type ScheduleParent = Record<string, never>;
|
|
1014
|
+
/** @public */
|
|
1015
|
+
type QuoteParent = Record<string, never>;
|
|
1016
|
+
/** @public */
|
|
1017
|
+
type CadenceParent = Record<string, never>;
|
|
1009
1018
|
/**
|
|
1010
|
-
* The collection
|
|
1019
|
+
* The collection options for an invoice.
|
|
1011
1020
|
* @public
|
|
1012
1021
|
*/
|
|
1013
|
-
interface
|
|
1022
|
+
interface CollectionOptions {
|
|
1014
1023
|
/** Whether the invoice automatically advances through its lifecycle. */
|
|
1015
1024
|
autoAdvance: boolean;
|
|
1016
1025
|
/** The payment collection method: charge_automatically or send_invoice. */
|
|
1017
1026
|
collectionMethod: CollectionMethod;
|
|
1018
|
-
/** The delay before the invoice is finalized, in hours. */
|
|
1019
|
-
finalizationGracePeriod: number;
|
|
1020
1027
|
/** The payment methods configured for this invoice. */
|
|
1021
1028
|
paymentMethods: PaymentMethodType[];
|
|
1022
1029
|
}
|
|
@@ -1024,55 +1031,33 @@ declare namespace InvoiceCollectionSetting {
|
|
|
1024
1031
|
* @public
|
|
1025
1032
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1026
1033
|
*/
|
|
1027
|
-
function
|
|
1034
|
+
function prepareArgsOverrideOptions(proto: unknown): InvoiceCollectionOptionsInput;
|
|
1028
1035
|
/**
|
|
1029
1036
|
* @public
|
|
1030
1037
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1031
1038
|
*/
|
|
1032
|
-
function
|
|
1033
|
-
/* Excluded from this release type: $
|
|
1039
|
+
function prepareResultOverrideOptions(result: InvoiceCollectionOptionsResult): InvoiceCollectionOptionsResult;
|
|
1040
|
+
/* Excluded from this release type: $platformWrapOverrideOptions */
|
|
1034
1041
|
/**
|
|
1035
1042
|
* @public
|
|
1036
1043
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1037
1044
|
*/
|
|
1038
|
-
const prepareArgs: typeof
|
|
1045
|
+
const prepareArgs: typeof prepareArgsOverrideOptions;
|
|
1039
1046
|
/**
|
|
1040
1047
|
* @public
|
|
1041
1048
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1042
1049
|
*/
|
|
1043
|
-
const prepareResult: typeof
|
|
1050
|
+
const prepareResult: typeof prepareResultOverrideOptions;
|
|
1044
1051
|
/**
|
|
1045
|
-
* Overrides invoice collection
|
|
1052
|
+
* Overrides invoice collection options before a draft invoice is created.
|
|
1046
1053
|
* @public
|
|
1047
1054
|
*/
|
|
1048
|
-
type
|
|
1055
|
+
type OverrideOptionsFunction<Config> = (request: InvoiceCollectionOptionsInput, config: Config, context: Context) => InvoiceCollectionOptionsResult;
|
|
1049
1056
|
}
|
|
1050
1057
|
|
|
1051
|
-
/**
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1055
|
-
*
|
|
1056
|
-
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1057
|
-
* interface MyInvoiceCollectionSettingConfig {}
|
|
1058
|
-
*
|
|
1059
|
-
* export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
1060
|
-
* collectionOverride(
|
|
1061
|
-
* _request: Billing.InvoiceCollectionSetting.InvoiceCollectionRequest,
|
|
1062
|
-
* _config: MyInvoiceCollectionSettingConfig,
|
|
1063
|
-
* _context: Context
|
|
1064
|
-
* ) {
|
|
1065
|
-
* // TODO: implement your collection setting logic here
|
|
1066
|
-
*
|
|
1067
|
-
* return {};
|
|
1068
|
-
* }
|
|
1069
|
-
* }
|
|
1070
|
-
*
|
|
1071
|
-
* ```
|
|
1072
|
-
* @public
|
|
1073
|
-
*/
|
|
1074
|
-
declare interface InvoiceCollectionSetting<Config> {
|
|
1075
|
-
collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
|
|
1058
|
+
/** @public */
|
|
1059
|
+
declare interface InvoiceCollectionOptions<Config> {
|
|
1060
|
+
overrideOptions: InvoiceCollectionOptions.OverrideOptionsFunction<Config>;
|
|
1076
1061
|
}
|
|
1077
1062
|
|
|
1078
1063
|
/**
|
|
@@ -1402,6 +1387,15 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1402
1387
|
}
|
|
1403
1388
|
/** @public */
|
|
1404
1389
|
type Item = ({
|
|
1390
|
+
creditedItems: 'invoiceItem';
|
|
1391
|
+
invoiceItem: CreditedInvoiceItem;
|
|
1392
|
+
} | {
|
|
1393
|
+
creditedItems: 'invoiceLineItems';
|
|
1394
|
+
invoiceLineItems: InvoiceLineItems;
|
|
1395
|
+
} | {
|
|
1396
|
+
creditedItems: 'other';
|
|
1397
|
+
otherCreditedItems: string;
|
|
1398
|
+
}) & ({
|
|
1405
1399
|
customPricingUnitOverageRate: CustomPricingUnitOverageRate;
|
|
1406
1400
|
priceKind: 'customPricingUnitOverageRate';
|
|
1407
1401
|
} | {
|
|
@@ -1423,6 +1417,40 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1423
1417
|
servicePeriod: AnyTimeRange;
|
|
1424
1418
|
type: ItemType;
|
|
1425
1419
|
};
|
|
1420
|
+
/**
|
|
1421
|
+
* The invoice item corresponding to a credit item.
|
|
1422
|
+
* @public
|
|
1423
|
+
*/
|
|
1424
|
+
interface CreditedInvoiceItem {
|
|
1425
|
+
/** The id of the invoice item. */
|
|
1426
|
+
id: string;
|
|
1427
|
+
}
|
|
1428
|
+
/**
|
|
1429
|
+
* Information about debit line items corresponding to a credit item.
|
|
1430
|
+
* @public
|
|
1431
|
+
*/
|
|
1432
|
+
interface InvoiceLineItems {
|
|
1433
|
+
/** The invoice containing the line items. */
|
|
1434
|
+
invoice: CreditedInvoice;
|
|
1435
|
+
/** The line items corresponding to the credit. */
|
|
1436
|
+
invoiceLineItems: CreditedInvoiceLineItem[];
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* The invoice line item corresponding to a credit item.
|
|
1440
|
+
* @public
|
|
1441
|
+
*/
|
|
1442
|
+
interface CreditedInvoiceLineItem {
|
|
1443
|
+
/** The id of the invoice line item. */
|
|
1444
|
+
id: string;
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* The invoice corresponding to a credit item.
|
|
1448
|
+
* @public
|
|
1449
|
+
*/
|
|
1450
|
+
interface CreditedInvoice {
|
|
1451
|
+
/** The id of the invoice. */
|
|
1452
|
+
id: string;
|
|
1453
|
+
}
|
|
1426
1454
|
/** @public */
|
|
1427
1455
|
interface CustomPricingUnitOverageRate {
|
|
1428
1456
|
id: string;
|
|
@@ -75,7 +75,7 @@ declare namespace Bill {
|
|
|
75
75
|
declare namespace Billing {
|
|
76
76
|
export {
|
|
77
77
|
CustomerBalanceApplication,
|
|
78
|
-
|
|
78
|
+
InvoiceCollectionOptions,
|
|
79
79
|
Prorations,
|
|
80
80
|
RecurringBillingItemHandling,
|
|
81
81
|
Bill,
|
|
@@ -472,7 +472,7 @@ declare interface CustomerBalanceApplication<Config> {
|
|
|
472
472
|
*
|
|
473
473
|
* @example
|
|
474
474
|
* ```ts
|
|
475
|
-
* import { Decimal, RoundDirection } from '@stripe/extensibility-sdk
|
|
475
|
+
* import { Decimal, RoundDirection } from '@stripe/extensibility-sdk';
|
|
476
476
|
*
|
|
477
477
|
* const price = Decimal.from('19.99');
|
|
478
478
|
* const tax = price.mul(Decimal.from('0.0825'));
|
|
@@ -965,58 +965,65 @@ declare interface IntegerCompanion {
|
|
|
965
965
|
declare type IntegerRoundDirection = 'ceil' | 'floor' | 'half-up' | 'round-down' | 'round-up';
|
|
966
966
|
|
|
967
967
|
/** @public */
|
|
968
|
-
declare namespace
|
|
968
|
+
declare namespace InvoiceCollectionOptions {
|
|
969
969
|
/** @public */
|
|
970
|
-
type
|
|
971
|
-
/** @public */
|
|
972
|
-
type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'boleto' | 'card' | 'cashapp' | 'eps' | 'fpx' | 'giropay' | 'grabpay' | 'ideal' | 'klarna' | 'konbini' | 'link' | 'multibanco' | 'oxxo' | 'p24' | 'paynow' | 'paypal' | 'promptpay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' | 'us_bank_account' | 'wechat_pay';
|
|
970
|
+
type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'blik' | 'boleto' | 'card' | 'cashapp' | 'eps' | 'fpx' | 'giropay' | 'grabpay' | 'ideal' | 'klarna' | 'konbini' | 'link' | 'multibanco' | 'oxxo' | 'p24' | 'paynow' | 'paypal' | 'promptpay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' | 'us_bank_account' | 'wechat_pay';
|
|
973
971
|
/** @public */
|
|
974
972
|
type CollectionMethod = 'charge_automatically' | 'send_invoice';
|
|
975
973
|
/**
|
|
976
|
-
* The result of the invoice collection
|
|
974
|
+
* The result of the invoice collection options override extension.
|
|
977
975
|
* @public
|
|
978
976
|
*/
|
|
979
|
-
interface
|
|
977
|
+
interface InvoiceCollectionOptionsResult {
|
|
980
978
|
/** Override the auto-advancement setting. Set to false to keep the invoice in draft. Return null to use the default. */
|
|
981
979
|
autoAdvance?: boolean;
|
|
982
980
|
}
|
|
983
981
|
/** @public */
|
|
984
|
-
type
|
|
982
|
+
type InvoiceCollectionOptionsInput = ({
|
|
985
983
|
customer: Customer;
|
|
986
984
|
payer: 'customer';
|
|
987
985
|
} | {
|
|
988
986
|
otherPayer: string;
|
|
989
987
|
payer: 'other';
|
|
990
|
-
}) & {
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
}
|
|
988
|
+
}) & ({
|
|
989
|
+
invoiceParentType: 'other';
|
|
990
|
+
otherInvoiceParentType: string;
|
|
991
|
+
} | {
|
|
992
|
+
invoiceParentType: 'subscription';
|
|
993
|
+
subscription: SubscriptionParent;
|
|
994
|
+
} | { invoiceParentType: 'cadence' } | { invoiceParentType: 'contract' } | { invoiceParentType: 'quote' } | { invoiceParentType: 'schedule' }) & { collectionOptions: CollectionOptions };
|
|
994
995
|
/** @public */
|
|
995
996
|
interface Customer {
|
|
996
997
|
id: string;
|
|
997
998
|
metadata: Record<string, string>;
|
|
998
999
|
}
|
|
1000
|
+
/** @public */
|
|
1001
|
+
type ContractParent = Record<string, never>;
|
|
999
1002
|
/**
|
|
1000
|
-
* The
|
|
1003
|
+
* The Subscription that triggered the invoice creation.
|
|
1001
1004
|
* @public
|
|
1002
1005
|
*/
|
|
1003
|
-
interface
|
|
1004
|
-
/** The
|
|
1005
|
-
|
|
1006
|
-
/**
|
|
1006
|
+
interface SubscriptionParent {
|
|
1007
|
+
/** The unique identifier for the subscription. */
|
|
1008
|
+
id: string;
|
|
1009
|
+
/** The metadata of the subscription. */
|
|
1007
1010
|
metadata: Record<string, string>;
|
|
1008
1011
|
}
|
|
1012
|
+
/** @public */
|
|
1013
|
+
type ScheduleParent = Record<string, never>;
|
|
1014
|
+
/** @public */
|
|
1015
|
+
type QuoteParent = Record<string, never>;
|
|
1016
|
+
/** @public */
|
|
1017
|
+
type CadenceParent = Record<string, never>;
|
|
1009
1018
|
/**
|
|
1010
|
-
* The collection
|
|
1019
|
+
* The collection options for an invoice.
|
|
1011
1020
|
* @public
|
|
1012
1021
|
*/
|
|
1013
|
-
interface
|
|
1022
|
+
interface CollectionOptions {
|
|
1014
1023
|
/** Whether the invoice automatically advances through its lifecycle. */
|
|
1015
1024
|
autoAdvance: boolean;
|
|
1016
1025
|
/** The payment collection method: charge_automatically or send_invoice. */
|
|
1017
1026
|
collectionMethod: CollectionMethod;
|
|
1018
|
-
/** The delay before the invoice is finalized, in hours. */
|
|
1019
|
-
finalizationGracePeriod: number;
|
|
1020
1027
|
/** The payment methods configured for this invoice. */
|
|
1021
1028
|
paymentMethods: PaymentMethodType[];
|
|
1022
1029
|
}
|
|
@@ -1024,55 +1031,33 @@ declare namespace InvoiceCollectionSetting {
|
|
|
1024
1031
|
* @public
|
|
1025
1032
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1026
1033
|
*/
|
|
1027
|
-
function
|
|
1034
|
+
function prepareArgsOverrideOptions(proto: unknown): InvoiceCollectionOptionsInput;
|
|
1028
1035
|
/**
|
|
1029
1036
|
* @public
|
|
1030
1037
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1031
1038
|
*/
|
|
1032
|
-
function
|
|
1033
|
-
/* Excluded from this release type: $
|
|
1039
|
+
function prepareResultOverrideOptions(result: InvoiceCollectionOptionsResult): InvoiceCollectionOptionsResult;
|
|
1040
|
+
/* Excluded from this release type: $platformWrapOverrideOptions */
|
|
1034
1041
|
/**
|
|
1035
1042
|
* @public
|
|
1036
1043
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1037
1044
|
*/
|
|
1038
|
-
const prepareArgs: typeof
|
|
1045
|
+
const prepareArgs: typeof prepareArgsOverrideOptions;
|
|
1039
1046
|
/**
|
|
1040
1047
|
* @public
|
|
1041
1048
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1042
1049
|
*/
|
|
1043
|
-
const prepareResult: typeof
|
|
1050
|
+
const prepareResult: typeof prepareResultOverrideOptions;
|
|
1044
1051
|
/**
|
|
1045
|
-
* Overrides invoice collection
|
|
1052
|
+
* Overrides invoice collection options before a draft invoice is created.
|
|
1046
1053
|
* @public
|
|
1047
1054
|
*/
|
|
1048
|
-
type
|
|
1055
|
+
type OverrideOptionsFunction<Config> = (request: InvoiceCollectionOptionsInput, config: Config, context: Context) => InvoiceCollectionOptionsResult;
|
|
1049
1056
|
}
|
|
1050
1057
|
|
|
1051
|
-
/**
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1055
|
-
*
|
|
1056
|
-
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1057
|
-
* interface MyInvoiceCollectionSettingConfig {}
|
|
1058
|
-
*
|
|
1059
|
-
* export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
1060
|
-
* collectionOverride(
|
|
1061
|
-
* _request: Billing.InvoiceCollectionSetting.InvoiceCollectionRequest,
|
|
1062
|
-
* _config: MyInvoiceCollectionSettingConfig,
|
|
1063
|
-
* _context: Context
|
|
1064
|
-
* ) {
|
|
1065
|
-
* // TODO: implement your collection setting logic here
|
|
1066
|
-
*
|
|
1067
|
-
* return {};
|
|
1068
|
-
* }
|
|
1069
|
-
* }
|
|
1070
|
-
*
|
|
1071
|
-
* ```
|
|
1072
|
-
* @public
|
|
1073
|
-
*/
|
|
1074
|
-
declare interface InvoiceCollectionSetting<Config> {
|
|
1075
|
-
collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
|
|
1058
|
+
/** @public */
|
|
1059
|
+
declare interface InvoiceCollectionOptions<Config> {
|
|
1060
|
+
overrideOptions: InvoiceCollectionOptions.OverrideOptionsFunction<Config>;
|
|
1076
1061
|
}
|
|
1077
1062
|
|
|
1078
1063
|
/**
|
|
@@ -1402,6 +1387,15 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1402
1387
|
}
|
|
1403
1388
|
/** @public */
|
|
1404
1389
|
type Item = ({
|
|
1390
|
+
creditedItems: 'invoiceItem';
|
|
1391
|
+
invoiceItem: CreditedInvoiceItem;
|
|
1392
|
+
} | {
|
|
1393
|
+
creditedItems: 'invoiceLineItems';
|
|
1394
|
+
invoiceLineItems: InvoiceLineItems;
|
|
1395
|
+
} | {
|
|
1396
|
+
creditedItems: 'other';
|
|
1397
|
+
otherCreditedItems: string;
|
|
1398
|
+
}) & ({
|
|
1405
1399
|
customPricingUnitOverageRate: CustomPricingUnitOverageRate;
|
|
1406
1400
|
priceKind: 'customPricingUnitOverageRate';
|
|
1407
1401
|
} | {
|
|
@@ -1423,6 +1417,40 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1423
1417
|
servicePeriod: AnyTimeRange;
|
|
1424
1418
|
type: ItemType;
|
|
1425
1419
|
};
|
|
1420
|
+
/**
|
|
1421
|
+
* The invoice item corresponding to a credit item.
|
|
1422
|
+
* @public
|
|
1423
|
+
*/
|
|
1424
|
+
interface CreditedInvoiceItem {
|
|
1425
|
+
/** The id of the invoice item. */
|
|
1426
|
+
id: string;
|
|
1427
|
+
}
|
|
1428
|
+
/**
|
|
1429
|
+
* Information about debit line items corresponding to a credit item.
|
|
1430
|
+
* @public
|
|
1431
|
+
*/
|
|
1432
|
+
interface InvoiceLineItems {
|
|
1433
|
+
/** The invoice containing the line items. */
|
|
1434
|
+
invoice: CreditedInvoice;
|
|
1435
|
+
/** The line items corresponding to the credit. */
|
|
1436
|
+
invoiceLineItems: CreditedInvoiceLineItem[];
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* The invoice line item corresponding to a credit item.
|
|
1440
|
+
* @public
|
|
1441
|
+
*/
|
|
1442
|
+
interface CreditedInvoiceLineItem {
|
|
1443
|
+
/** The id of the invoice line item. */
|
|
1444
|
+
id: string;
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* The invoice corresponding to a credit item.
|
|
1448
|
+
* @public
|
|
1449
|
+
*/
|
|
1450
|
+
interface CreditedInvoice {
|
|
1451
|
+
/** The id of the invoice. */
|
|
1452
|
+
id: string;
|
|
1453
|
+
}
|
|
1426
1454
|
/** @public */
|
|
1427
1455
|
interface CustomPricingUnitOverageRate {
|
|
1428
1456
|
id: string;
|