@stripe/extensibility-sdk 0.26.0 → 1.0.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/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
|
@@ -88,7 +88,7 @@ declare namespace Bill {
|
|
|
88
88
|
declare namespace Billing {
|
|
89
89
|
export {
|
|
90
90
|
CustomerBalanceApplication,
|
|
91
|
-
|
|
91
|
+
InvoiceCollectionOptions,
|
|
92
92
|
Prorations,
|
|
93
93
|
RecurringBillingItemHandling,
|
|
94
94
|
Bill,
|
|
@@ -502,7 +502,7 @@ declare interface CustomerBalanceApplication<Config> {
|
|
|
502
502
|
*
|
|
503
503
|
* @example
|
|
504
504
|
* ```ts
|
|
505
|
-
* import { Decimal, RoundDirection } from '@stripe/extensibility-sdk
|
|
505
|
+
* import { Decimal, RoundDirection } from '@stripe/extensibility-sdk';
|
|
506
506
|
*
|
|
507
507
|
* const price = Decimal.from('19.99');
|
|
508
508
|
* const tax = price.mul(Decimal.from('0.0825'));
|
|
@@ -1005,58 +1005,65 @@ declare interface IntegerCompanion {
|
|
|
1005
1005
|
declare type IntegerRoundDirection = 'ceil' | 'floor' | 'half-up' | 'round-down' | 'round-up';
|
|
1006
1006
|
|
|
1007
1007
|
/** @public */
|
|
1008
|
-
declare namespace
|
|
1008
|
+
declare namespace InvoiceCollectionOptions {
|
|
1009
1009
|
/** @public */
|
|
1010
|
-
type
|
|
1011
|
-
/** @public */
|
|
1012
|
-
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';
|
|
1010
|
+
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';
|
|
1013
1011
|
/** @public */
|
|
1014
1012
|
type CollectionMethod = 'charge_automatically' | 'send_invoice';
|
|
1015
1013
|
/**
|
|
1016
|
-
* The result of the invoice collection
|
|
1014
|
+
* The result of the invoice collection options override extension.
|
|
1017
1015
|
* @public
|
|
1018
1016
|
*/
|
|
1019
|
-
interface
|
|
1017
|
+
interface InvoiceCollectionOptionsResult {
|
|
1020
1018
|
/** Override the auto-advancement setting. Set to false to keep the invoice in draft. Return null to use the default. */
|
|
1021
1019
|
autoAdvance?: boolean;
|
|
1022
1020
|
}
|
|
1023
1021
|
/** @public */
|
|
1024
|
-
type
|
|
1022
|
+
type InvoiceCollectionOptionsInput = ({
|
|
1025
1023
|
customer: Customer;
|
|
1026
1024
|
payer: 'customer';
|
|
1027
1025
|
} | {
|
|
1028
1026
|
otherPayer: string;
|
|
1029
1027
|
payer: 'other';
|
|
1030
|
-
}) & {
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
}
|
|
1028
|
+
}) & ({
|
|
1029
|
+
invoiceParentType: 'other';
|
|
1030
|
+
otherInvoiceParentType: string;
|
|
1031
|
+
} | {
|
|
1032
|
+
invoiceParentType: 'subscription';
|
|
1033
|
+
subscription: SubscriptionParent;
|
|
1034
|
+
} | { invoiceParentType: 'cadence' } | { invoiceParentType: 'contract' } | { invoiceParentType: 'quote' } | { invoiceParentType: 'schedule' }) & { collectionOptions: CollectionOptions };
|
|
1034
1035
|
/** @public */
|
|
1035
1036
|
interface Customer {
|
|
1036
1037
|
id: string;
|
|
1037
1038
|
metadata: Record<string, string>;
|
|
1038
1039
|
}
|
|
1040
|
+
/** @public */
|
|
1041
|
+
type ContractParent = Record<string, never>;
|
|
1039
1042
|
/**
|
|
1040
|
-
* The
|
|
1043
|
+
* The Subscription that triggered the invoice creation.
|
|
1041
1044
|
* @public
|
|
1042
1045
|
*/
|
|
1043
|
-
interface
|
|
1044
|
-
/** The
|
|
1045
|
-
|
|
1046
|
-
/**
|
|
1046
|
+
interface SubscriptionParent {
|
|
1047
|
+
/** The unique identifier for the subscription. */
|
|
1048
|
+
id: string;
|
|
1049
|
+
/** The metadata of the subscription. */
|
|
1047
1050
|
metadata: Record<string, string>;
|
|
1048
1051
|
}
|
|
1052
|
+
/** @public */
|
|
1053
|
+
type ScheduleParent = Record<string, never>;
|
|
1054
|
+
/** @public */
|
|
1055
|
+
type QuoteParent = Record<string, never>;
|
|
1056
|
+
/** @public */
|
|
1057
|
+
type CadenceParent = Record<string, never>;
|
|
1049
1058
|
/**
|
|
1050
|
-
* The collection
|
|
1059
|
+
* The collection options for an invoice.
|
|
1051
1060
|
* @public
|
|
1052
1061
|
*/
|
|
1053
|
-
interface
|
|
1062
|
+
interface CollectionOptions {
|
|
1054
1063
|
/** Whether the invoice automatically advances through its lifecycle. */
|
|
1055
1064
|
autoAdvance: boolean;
|
|
1056
1065
|
/** The payment collection method: charge_automatically or send_invoice. */
|
|
1057
1066
|
collectionMethod: CollectionMethod;
|
|
1058
|
-
/** The delay before the invoice is finalized, in hours. */
|
|
1059
|
-
finalizationGracePeriod: number;
|
|
1060
1067
|
/** The payment methods configured for this invoice. */
|
|
1061
1068
|
paymentMethods: PaymentMethodType[];
|
|
1062
1069
|
}
|
|
@@ -1064,56 +1071,34 @@ declare namespace InvoiceCollectionSetting {
|
|
|
1064
1071
|
* @public
|
|
1065
1072
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1066
1073
|
*/
|
|
1067
|
-
function
|
|
1074
|
+
function prepareArgsOverrideOptions(proto: unknown): InvoiceCollectionOptionsInput;
|
|
1068
1075
|
/**
|
|
1069
1076
|
* @public
|
|
1070
1077
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1071
1078
|
*/
|
|
1072
|
-
function
|
|
1079
|
+
function prepareResultOverrideOptions(result: InvoiceCollectionOptionsResult): InvoiceCollectionOptionsResult;
|
|
1073
1080
|
/** @internal */
|
|
1074
|
-
function $
|
|
1081
|
+
function $platformWrapOverrideOptions(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { overrideOptions(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
1075
1082
|
/**
|
|
1076
1083
|
* @public
|
|
1077
1084
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1078
1085
|
*/
|
|
1079
|
-
const prepareArgs: typeof
|
|
1086
|
+
const prepareArgs: typeof prepareArgsOverrideOptions;
|
|
1080
1087
|
/**
|
|
1081
1088
|
* @public
|
|
1082
1089
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
1083
1090
|
*/
|
|
1084
|
-
const prepareResult: typeof
|
|
1091
|
+
const prepareResult: typeof prepareResultOverrideOptions;
|
|
1085
1092
|
/**
|
|
1086
|
-
* Overrides invoice collection
|
|
1093
|
+
* Overrides invoice collection options before a draft invoice is created.
|
|
1087
1094
|
* @public
|
|
1088
1095
|
*/
|
|
1089
|
-
type
|
|
1096
|
+
type OverrideOptionsFunction<Config> = (request: InvoiceCollectionOptionsInput, config: Config, context: Context) => InvoiceCollectionOptionsResult;
|
|
1090
1097
|
}
|
|
1091
1098
|
|
|
1092
|
-
/**
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1096
|
-
*
|
|
1097
|
-
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1098
|
-
* interface MyInvoiceCollectionSettingConfig {}
|
|
1099
|
-
*
|
|
1100
|
-
* export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
1101
|
-
* collectionOverride(
|
|
1102
|
-
* _request: Billing.InvoiceCollectionSetting.InvoiceCollectionRequest,
|
|
1103
|
-
* _config: MyInvoiceCollectionSettingConfig,
|
|
1104
|
-
* _context: Context
|
|
1105
|
-
* ) {
|
|
1106
|
-
* // TODO: implement your collection setting logic here
|
|
1107
|
-
*
|
|
1108
|
-
* return {};
|
|
1109
|
-
* }
|
|
1110
|
-
* }
|
|
1111
|
-
*
|
|
1112
|
-
* ```
|
|
1113
|
-
* @public
|
|
1114
|
-
*/
|
|
1115
|
-
declare interface InvoiceCollectionSetting<Config> {
|
|
1116
|
-
collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
|
|
1099
|
+
/** @public */
|
|
1100
|
+
declare interface InvoiceCollectionOptions<Config> {
|
|
1101
|
+
overrideOptions: InvoiceCollectionOptions.OverrideOptionsFunction<Config>;
|
|
1117
1102
|
}
|
|
1118
1103
|
|
|
1119
1104
|
/**
|
|
@@ -1444,6 +1429,15 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1444
1429
|
}
|
|
1445
1430
|
/** @public */
|
|
1446
1431
|
type Item = ({
|
|
1432
|
+
creditedItems: 'invoiceItem';
|
|
1433
|
+
invoiceItem: CreditedInvoiceItem;
|
|
1434
|
+
} | {
|
|
1435
|
+
creditedItems: 'invoiceLineItems';
|
|
1436
|
+
invoiceLineItems: InvoiceLineItems;
|
|
1437
|
+
} | {
|
|
1438
|
+
creditedItems: 'other';
|
|
1439
|
+
otherCreditedItems: string;
|
|
1440
|
+
}) & ({
|
|
1447
1441
|
customPricingUnitOverageRate: CustomPricingUnitOverageRate;
|
|
1448
1442
|
priceKind: 'customPricingUnitOverageRate';
|
|
1449
1443
|
} | {
|
|
@@ -1465,6 +1459,40 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1465
1459
|
servicePeriod: AnyTimeRange;
|
|
1466
1460
|
type: ItemType;
|
|
1467
1461
|
};
|
|
1462
|
+
/**
|
|
1463
|
+
* The invoice item corresponding to a credit item.
|
|
1464
|
+
* @public
|
|
1465
|
+
*/
|
|
1466
|
+
interface CreditedInvoiceItem {
|
|
1467
|
+
/** The id of the invoice item. */
|
|
1468
|
+
id: string;
|
|
1469
|
+
}
|
|
1470
|
+
/**
|
|
1471
|
+
* Information about debit line items corresponding to a credit item.
|
|
1472
|
+
* @public
|
|
1473
|
+
*/
|
|
1474
|
+
interface InvoiceLineItems {
|
|
1475
|
+
/** The invoice containing the line items. */
|
|
1476
|
+
invoice: CreditedInvoice;
|
|
1477
|
+
/** The line items corresponding to the credit. */
|
|
1478
|
+
invoiceLineItems: CreditedInvoiceLineItem[];
|
|
1479
|
+
}
|
|
1480
|
+
/**
|
|
1481
|
+
* The invoice line item corresponding to a credit item.
|
|
1482
|
+
* @public
|
|
1483
|
+
*/
|
|
1484
|
+
interface CreditedInvoiceLineItem {
|
|
1485
|
+
/** The id of the invoice line item. */
|
|
1486
|
+
id: string;
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* The invoice corresponding to a credit item.
|
|
1490
|
+
* @public
|
|
1491
|
+
*/
|
|
1492
|
+
interface CreditedInvoice {
|
|
1493
|
+
/** The id of the invoice. */
|
|
1494
|
+
id: string;
|
|
1495
|
+
}
|
|
1468
1496
|
/** @public */
|
|
1469
1497
|
interface CustomPricingUnitOverageRate {
|
|
1470
1498
|
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;
|