@stripe/extensibility-sdk 1.1.0 → 1.3.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 +17 -15
- package/dist/config-values/generate.cjs +1 -1
- package/dist/config-values/generate.d.ts +1 -1
- package/dist/config-values/generate.d.ts.map +1 -1
- package/dist/config-values/generate.js +1 -1
- package/dist/extensibility-sdk-alpha.d.ts +29 -157
- package/dist/extensibility-sdk-beta.d.ts +29 -157
- package/dist/extensibility-sdk-config-values-internal.d.ts +1 -1
- package/dist/extensibility-sdk-extensions-alpha.d.ts +7 -157
- package/dist/extensibility-sdk-extensions-beta.d.ts +7 -157
- package/dist/extensibility-sdk-extensions-billing-bill-discount_calculation-alpha.d.ts +631 -0
- package/dist/extensibility-sdk-extensions-billing-bill-discount_calculation-beta.d.ts +631 -0
- package/dist/extensibility-sdk-extensions-billing-bill-discount_calculation-internal.d.ts +666 -0
- package/dist/extensibility-sdk-extensions-billing-bill-discount_calculation-public.d.ts +631 -0
- package/dist/extensibility-sdk-extensions-billing-customer_balance_application-alpha.d.ts +475 -0
- package/dist/extensibility-sdk-extensions-billing-customer_balance_application-beta.d.ts +475 -0
- package/dist/extensibility-sdk-extensions-billing-customer_balance_application-internal.d.ts +510 -0
- package/dist/extensibility-sdk-extensions-billing-customer_balance_application-public.d.ts +475 -0
- package/dist/extensibility-sdk-extensions-billing-invoice_collection_options-alpha.d.ts +110 -0
- package/dist/extensibility-sdk-extensions-billing-invoice_collection_options-beta.d.ts +110 -0
- package/dist/extensibility-sdk-extensions-billing-invoice_collection_options-internal.d.ts +123 -0
- package/dist/extensibility-sdk-extensions-billing-invoice_collection_options-public.d.ts +110 -0
- package/dist/extensibility-sdk-extensions-billing-prorations-alpha.d.ts +607 -0
- package/dist/extensibility-sdk-extensions-billing-prorations-beta.d.ts +607 -0
- package/dist/extensibility-sdk-extensions-billing-prorations-internal.d.ts +642 -0
- package/dist/extensibility-sdk-extensions-billing-prorations-public.d.ts +607 -0
- package/dist/extensibility-sdk-extensions-billing-recurring_billing_item_handling-alpha.d.ts +735 -0
- package/dist/extensibility-sdk-extensions-billing-recurring_billing_item_handling-beta.d.ts +735 -0
- package/dist/extensibility-sdk-extensions-billing-recurring_billing_item_handling-internal.d.ts +772 -0
- package/dist/extensibility-sdk-extensions-billing-recurring_billing_item_handling-public.d.ts +735 -0
- package/dist/extensibility-sdk-extensions-core-workflows-custom_action-alpha.d.ts +126 -0
- package/dist/extensibility-sdk-extensions-core-workflows-custom_action-beta.d.ts +126 -0
- package/dist/extensibility-sdk-extensions-core-workflows-custom_action-internal.d.ts +140 -0
- package/dist/extensibility-sdk-extensions-core-workflows-custom_action-public.d.ts +126 -0
- package/dist/extensibility-sdk-extensions-extend-workflows-custom_action-alpha.d.ts +126 -0
- package/dist/extensibility-sdk-extensions-extend-workflows-custom_action-beta.d.ts +126 -0
- package/dist/extensibility-sdk-extensions-extend-workflows-custom_action-internal.d.ts +140 -0
- package/dist/extensibility-sdk-extensions-extend-workflows-custom_action-public.d.ts +126 -0
- package/dist/extensibility-sdk-extensions-internal.d.ts +7 -157
- package/dist/extensibility-sdk-extensions-public.d.ts +7 -157
- package/dist/extensibility-sdk-internal-internal.d.ts +2 -2
- package/dist/extensibility-sdk-internal.d.ts +145 -162
- package/dist/extensibility-sdk-public.d.ts +29 -157
- package/dist/extensibility-sdk-stdlib-alpha.d.ts +593 -0
- package/dist/extensibility-sdk-stdlib-beta.d.ts +593 -0
- package/dist/extensibility-sdk-stdlib-internal.d.ts +1096 -0
- package/dist/extensibility-sdk-stdlib-public.d.ts +593 -0
- package/dist/extensions/billing/bill/discount_calculation.cjs +437 -0
- package/dist/extensions/billing/bill/discount_calculation.d.ts +0 -20
- package/dist/extensions/billing/bill/discount_calculation.d.ts.map +1 -1
- package/dist/extensions/billing/bill/discount_calculation.js +430 -0
- package/dist/extensions/billing/customer_balance_application.cjs +297 -0
- package/dist/extensions/billing/customer_balance_application.d.ts +0 -20
- package/dist/extensions/billing/customer_balance_application.d.ts.map +1 -1
- package/dist/extensions/billing/customer_balance_application.js +284 -0
- package/dist/extensions/billing/invoice_collection_options.cjs +166 -0
- package/dist/extensions/billing/invoice_collection_options.d.ts +4 -24
- package/dist/extensions/billing/invoice_collection_options.d.ts.map +1 -1
- package/dist/extensions/billing/invoice_collection_options.js +155 -0
- package/dist/extensions/billing/prorations.cjs +501 -0
- package/dist/extensions/billing/prorations.d.ts +0 -20
- package/dist/extensions/billing/prorations.d.ts.map +1 -1
- package/dist/extensions/billing/prorations.js +492 -0
- package/dist/extensions/billing/recurring_billing_item_handling.cjs +639 -0
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts +0 -30
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts.map +1 -1
- package/dist/extensions/billing/recurring_billing_item_handling.js +632 -0
- package/dist/extensions/core/workflows/custom_action.cjs +124 -0
- package/dist/extensions/core/workflows/custom_action.d.ts +1 -21
- package/dist/extensions/core/workflows/custom_action.d.ts.map +1 -1
- package/dist/extensions/core/workflows/custom_action.js +111 -0
- package/dist/extensions/extend/workflows/custom_action.cjs +124 -0
- package/dist/extensions/extend/workflows/custom_action.d.ts +1 -21
- package/dist/extensions/extend/workflows/custom_action.d.ts.map +1 -1
- package/dist/extensions/extend/workflows/custom_action.js +111 -0
- package/dist/extensions/index.cjs +27 -265
- package/dist/extensions/index.js +27 -265
- package/dist/extensions/registry.d.ts +2 -2
- package/dist/extensions/registry.d.ts.map +1 -1
- package/dist/index.cjs +452 -2390
- package/dist/index.js +479 -2286
- package/dist/internal.cjs +22 -54
- package/dist/internal.js +22 -54
- package/dist/stdlib/generated.d.ts +1 -1
- package/dist/stdlib/generated.d.ts.map +1 -1
- package/dist/stdlib/index.cjs +2003 -0
- package/dist/stdlib/index.d.ts +2 -2
- package/dist/stdlib/index.d.ts.map +1 -1
- package/dist/stdlib/index.js +1943 -0
- package/dist/stdlib/transform-strategies.d.ts +46 -6
- package/dist/stdlib/transform-strategies.d.ts.map +1 -1
- package/dist/stdlib/types.d.ts +82 -0
- package/dist/stdlib/types.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +65 -1
- package/dist/stdlib/extension-method.d.ts +0 -27
- package/dist/stdlib/extension-method.d.ts.map +0 -1
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/extensions/billing/invoice_collection_options.ts
|
|
21
|
+
var invoice_collection_options_exports = {};
|
|
22
|
+
__export(invoice_collection_options_exports, {
|
|
23
|
+
InvoiceCollectionOptions: () => InvoiceCollectionOptions
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(invoice_collection_options_exports);
|
|
26
|
+
var import_stdlib = require("@stripe/extensibility-sdk/stdlib");
|
|
27
|
+
var InvoiceCollectionOptions;
|
|
28
|
+
((InvoiceCollectionOptions2) => {
|
|
29
|
+
const paymentMethodTypeEnumValues = new import_stdlib._ProtoEnum({
|
|
30
|
+
PAYMENT_METHOD_TYPE_CARD: "card",
|
|
31
|
+
PAYMENT_METHOD_TYPE_ACH_DEBIT: "ach_debit",
|
|
32
|
+
PAYMENT_METHOD_TYPE_ACH_CREDIT_TRANSFER: "ach_credit_transfer",
|
|
33
|
+
PAYMENT_METHOD_TYPE_SEPA_DEBIT: "sepa_debit",
|
|
34
|
+
PAYMENT_METHOD_TYPE_SEPA_CREDIT_TRANSFER: "sepa_credit_transfer",
|
|
35
|
+
PAYMENT_METHOD_TYPE_BACS_DEBIT: "bacs_debit",
|
|
36
|
+
PAYMENT_METHOD_TYPE_AU_BECS_DEBIT: "au_becs_debit",
|
|
37
|
+
PAYMENT_METHOD_TYPE_US_BANK_ACCOUNT: "us_bank_account",
|
|
38
|
+
PAYMENT_METHOD_TYPE_LINK: "link",
|
|
39
|
+
PAYMENT_METHOD_TYPE_BOLETO: "boleto",
|
|
40
|
+
PAYMENT_METHOD_TYPE_OXXO: "oxxo",
|
|
41
|
+
PAYMENT_METHOD_TYPE_IDEAL: "ideal",
|
|
42
|
+
PAYMENT_METHOD_TYPE_BANCONTACT: "bancontact",
|
|
43
|
+
PAYMENT_METHOD_TYPE_GIROPAY: "giropay",
|
|
44
|
+
PAYMENT_METHOD_TYPE_EPS: "eps",
|
|
45
|
+
PAYMENT_METHOD_TYPE_P24: "p24",
|
|
46
|
+
PAYMENT_METHOD_TYPE_SOFORT: "sofort",
|
|
47
|
+
PAYMENT_METHOD_TYPE_ALIPAY: "alipay",
|
|
48
|
+
PAYMENT_METHOD_TYPE_WECHAT_PAY: "wechat_pay",
|
|
49
|
+
PAYMENT_METHOD_TYPE_KLARNA: "klarna",
|
|
50
|
+
PAYMENT_METHOD_TYPE_AFFIRM: "affirm",
|
|
51
|
+
PAYMENT_METHOD_TYPE_AFTERPAY_CLEARPAY: "afterpay_clearpay",
|
|
52
|
+
PAYMENT_METHOD_TYPE_CASHAPP: "cashapp",
|
|
53
|
+
PAYMENT_METHOD_TYPE_PAYPAL: "paypal",
|
|
54
|
+
PAYMENT_METHOD_TYPE_MULTIBANCO: "multibanco",
|
|
55
|
+
PAYMENT_METHOD_TYPE_KONBINI: "konbini",
|
|
56
|
+
PAYMENT_METHOD_TYPE_PROMPTPAY: "promptpay",
|
|
57
|
+
PAYMENT_METHOD_TYPE_PAYNOW: "paynow",
|
|
58
|
+
PAYMENT_METHOD_TYPE_GRABPAY: "grabpay",
|
|
59
|
+
PAYMENT_METHOD_TYPE_FPX: "fpx",
|
|
60
|
+
PAYMENT_METHOD_TYPE_BLIK: "blik"
|
|
61
|
+
});
|
|
62
|
+
const collectionMethodEnumValues = new import_stdlib._ProtoEnum({
|
|
63
|
+
COLLECTION_METHOD_SEND_INVOICE: "send_invoice",
|
|
64
|
+
COLLECTION_METHOD_CHARGE_AUTOMATICALLY: "charge_automatically"
|
|
65
|
+
});
|
|
66
|
+
const InvoiceCollectionOptionsResultDescriptor = new import_stdlib._ShapeDescriptor("InvoiceCollectionOptionsResult", [
|
|
67
|
+
{ type: "autoAdvance", transform: (0, import_stdlib._required)() }
|
|
68
|
+
]);
|
|
69
|
+
const InvoiceCollectionOptionsInputDescriptor = new import_stdlib._ShapeDescriptor(
|
|
70
|
+
"InvoiceCollectionOptionsInput",
|
|
71
|
+
[
|
|
72
|
+
{
|
|
73
|
+
type: "collectionOptions",
|
|
74
|
+
transform: (0, import_stdlib._required)((0, import_stdlib._translateShape)(() => CollectionOptionsDescriptor))
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
{
|
|
79
|
+
discriminant: "invoiceParentType",
|
|
80
|
+
optional: true,
|
|
81
|
+
branches: [
|
|
82
|
+
{ wireKey: "cadence", typeKey: "cadence" },
|
|
83
|
+
{ wireKey: "quote", typeKey: "quote" },
|
|
84
|
+
{ wireKey: "schedule", typeKey: "schedule" },
|
|
85
|
+
{
|
|
86
|
+
wireKey: "subscription",
|
|
87
|
+
typeKey: "subscription",
|
|
88
|
+
transform: (0, import_stdlib._translateShape)(() => SubscriptionParentDescriptor)
|
|
89
|
+
},
|
|
90
|
+
{ wireKey: "contract", typeKey: "contract" }
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
discriminant: "payer",
|
|
95
|
+
optional: true,
|
|
96
|
+
branches: [
|
|
97
|
+
{
|
|
98
|
+
wireKey: "customer",
|
|
99
|
+
typeKey: "customer",
|
|
100
|
+
transform: (0, import_stdlib._translateShape)(() => CustomerDescriptor)
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
);
|
|
106
|
+
const CustomerDescriptor = new import_stdlib._ShapeDescriptor("Customer", [
|
|
107
|
+
{ type: "id", transform: (0, import_stdlib._required)() },
|
|
108
|
+
{ type: "metadata", transform: (0, import_stdlib._required)((0, import_stdlib._translateMap)(import_stdlib._identity, import_stdlib._identity)) }
|
|
109
|
+
]);
|
|
110
|
+
const SubscriptionParentDescriptor = new import_stdlib._ShapeDescriptor(
|
|
111
|
+
"SubscriptionParent",
|
|
112
|
+
[
|
|
113
|
+
{ type: "id", transform: (0, import_stdlib._required)() },
|
|
114
|
+
{ type: "metadata", transform: (0, import_stdlib._required)((0, import_stdlib._translateMap)(import_stdlib._identity, import_stdlib._identity)) }
|
|
115
|
+
]
|
|
116
|
+
);
|
|
117
|
+
const CollectionOptionsDescriptor = new import_stdlib._ShapeDescriptor(
|
|
118
|
+
"CollectionOptions",
|
|
119
|
+
[
|
|
120
|
+
{ type: "autoAdvance", transform: (0, import_stdlib._required)() },
|
|
121
|
+
{
|
|
122
|
+
type: "collectionMethod",
|
|
123
|
+
transform: (0, import_stdlib._required)((0, import_stdlib._translateEnum)(collectionMethodEnumValues))
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
type: "paymentMethods",
|
|
127
|
+
transform: (0, import_stdlib._required)(
|
|
128
|
+
(0, import_stdlib._translateArray)((0, import_stdlib._translateEnum)(paymentMethodTypeEnumValues))
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
);
|
|
133
|
+
function $platformWrapOverrideOptions(configTransformer) {
|
|
134
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
135
|
+
const instance = new cls();
|
|
136
|
+
const request = (0, import_stdlib._apply)(
|
|
137
|
+
InvoiceCollectionOptionsInputDescriptor,
|
|
138
|
+
import_stdlib._ProtoWireToType,
|
|
139
|
+
wireArgs
|
|
140
|
+
);
|
|
141
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, (0, import_stdlib._configAppContextFromContext)(ctx)) : wireConfig;
|
|
142
|
+
const result = instance.overrideOptions(request, config, ctx);
|
|
143
|
+
if ((0, import_stdlib._isPromiseLike)(result)) {
|
|
144
|
+
return Promise.resolve(result).then((r) => {
|
|
145
|
+
const typedR = r;
|
|
146
|
+
return (0, import_stdlib._apply)(
|
|
147
|
+
InvoiceCollectionOptionsResultDescriptor,
|
|
148
|
+
import_stdlib._TypeToProtoWire,
|
|
149
|
+
typedR
|
|
150
|
+
);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const typedResult = result;
|
|
154
|
+
return (0, import_stdlib._apply)(
|
|
155
|
+
InvoiceCollectionOptionsResultDescriptor,
|
|
156
|
+
import_stdlib._TypeToProtoWire,
|
|
157
|
+
typedResult
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
InvoiceCollectionOptions2.$platformWrapOverrideOptions = $platformWrapOverrideOptions;
|
|
162
|
+
})(InvoiceCollectionOptions || (InvoiceCollectionOptions = {}));
|
|
163
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
164
|
+
0 && (module.exports = {
|
|
165
|
+
InvoiceCollectionOptions
|
|
166
|
+
});
|
|
@@ -11,8 +11,8 @@ export declare namespace InvoiceCollectionOptions {
|
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
13
|
interface InvoiceCollectionOptionsResult {
|
|
14
|
-
/** Override the auto-advancement setting. Set to false to keep the invoice in draft.
|
|
15
|
-
autoAdvance
|
|
14
|
+
/** Override the auto-advancement setting. Set to false to keep the invoice in draft. */
|
|
15
|
+
autoAdvance: boolean;
|
|
16
16
|
}
|
|
17
17
|
/** @public */
|
|
18
18
|
type InvoiceCollectionOptionsInput = {
|
|
@@ -78,30 +78,10 @@ export declare namespace InvoiceCollectionOptions {
|
|
|
78
78
|
/** The payment methods configured for this invoice. */
|
|
79
79
|
paymentMethods: PaymentMethodType[];
|
|
80
80
|
}
|
|
81
|
-
/**
|
|
82
|
-
* @public
|
|
83
|
-
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
84
|
-
*/
|
|
85
|
-
function prepareArgsOverrideOptions(proto: unknown): InvoiceCollectionOptionsInput;
|
|
86
|
-
/**
|
|
87
|
-
* @public
|
|
88
|
-
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
89
|
-
*/
|
|
90
|
-
function prepareResultOverrideOptions(result: InvoiceCollectionOptionsResult): InvoiceCollectionOptionsResult;
|
|
91
81
|
/** @internal */
|
|
92
82
|
function $platformWrapOverrideOptions(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
93
83
|
overrideOptions(...a: unknown[]): unknown;
|
|
94
84
|
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
95
|
-
/**
|
|
96
|
-
* @public
|
|
97
|
-
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
98
|
-
*/
|
|
99
|
-
const prepareArgs: typeof prepareArgsOverrideOptions;
|
|
100
|
-
/**
|
|
101
|
-
* @public
|
|
102
|
-
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
103
|
-
*/
|
|
104
|
-
const prepareResult: typeof prepareResultOverrideOptions;
|
|
105
85
|
/**
|
|
106
86
|
* Overrides invoice collection options before a draft invoice is created.
|
|
107
87
|
* @public
|
|
@@ -118,13 +98,13 @@ export declare namespace InvoiceCollectionOptions {
|
|
|
118
98
|
*
|
|
119
99
|
* export default class MyInvoiceCollectionOptions implements Billing.InvoiceCollectionOptions<MyInvoiceCollectionOptionsConfig> {
|
|
120
100
|
* overrideOptions(
|
|
121
|
-
*
|
|
101
|
+
* request: Billing.InvoiceCollectionOptions.InvoiceCollectionOptionsInput,
|
|
122
102
|
* _config: MyInvoiceCollectionOptionsConfig,
|
|
123
103
|
* _context: Context
|
|
124
104
|
* ) {
|
|
125
105
|
* // TODO: implement your collection setting logic here
|
|
126
106
|
*
|
|
127
|
-
* return {};
|
|
107
|
+
* return { autoAdvance: request.collectionOptions.autoAdvance };
|
|
128
108
|
* }
|
|
129
109
|
* }
|
|
130
110
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice_collection_options.d.ts","sourceRoot":"","sources":["../../../src/extensions/billing/invoice_collection_options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAEV,yBAAyB,EAI1B,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"invoice_collection_options.d.ts","sourceRoot":"","sources":["../../../src/extensions/billing/invoice_collection_options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAEV,yBAAyB,EAI1B,MAAM,uBAAuB,CAAC;AAsB/B,cAAc;AACd,yBAAiB,wBAAwB,CAAC;IACxC,cAAc;IACd,KAAY,iBAAiB,GACzB,MAAM,GACN,WAAW,GACX,qBAAqB,GACrB,YAAY,GACZ,sBAAsB,GACtB,YAAY,GACZ,eAAe,GACf,iBAAiB,GACjB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,YAAY,GACZ,SAAS,GACT,KAAK,GACL,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,mBAAmB,GACnB,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,SAA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+
_ShapeDescriptor,
|
|
6
|
+
_TypeToProtoWire,
|
|
7
|
+
_apply,
|
|
8
|
+
_configAppContextFromContext,
|
|
9
|
+
_identity,
|
|
10
|
+
_isPromiseLike,
|
|
11
|
+
_required,
|
|
12
|
+
_translateArray,
|
|
13
|
+
_translateEnum,
|
|
14
|
+
_translateMap,
|
|
15
|
+
_translateShape
|
|
16
|
+
} from "@stripe/extensibility-sdk/stdlib";
|
|
17
|
+
var InvoiceCollectionOptions;
|
|
18
|
+
((InvoiceCollectionOptions2) => {
|
|
19
|
+
const paymentMethodTypeEnumValues = new _ProtoEnum({
|
|
20
|
+
PAYMENT_METHOD_TYPE_CARD: "card",
|
|
21
|
+
PAYMENT_METHOD_TYPE_ACH_DEBIT: "ach_debit",
|
|
22
|
+
PAYMENT_METHOD_TYPE_ACH_CREDIT_TRANSFER: "ach_credit_transfer",
|
|
23
|
+
PAYMENT_METHOD_TYPE_SEPA_DEBIT: "sepa_debit",
|
|
24
|
+
PAYMENT_METHOD_TYPE_SEPA_CREDIT_TRANSFER: "sepa_credit_transfer",
|
|
25
|
+
PAYMENT_METHOD_TYPE_BACS_DEBIT: "bacs_debit",
|
|
26
|
+
PAYMENT_METHOD_TYPE_AU_BECS_DEBIT: "au_becs_debit",
|
|
27
|
+
PAYMENT_METHOD_TYPE_US_BANK_ACCOUNT: "us_bank_account",
|
|
28
|
+
PAYMENT_METHOD_TYPE_LINK: "link",
|
|
29
|
+
PAYMENT_METHOD_TYPE_BOLETO: "boleto",
|
|
30
|
+
PAYMENT_METHOD_TYPE_OXXO: "oxxo",
|
|
31
|
+
PAYMENT_METHOD_TYPE_IDEAL: "ideal",
|
|
32
|
+
PAYMENT_METHOD_TYPE_BANCONTACT: "bancontact",
|
|
33
|
+
PAYMENT_METHOD_TYPE_GIROPAY: "giropay",
|
|
34
|
+
PAYMENT_METHOD_TYPE_EPS: "eps",
|
|
35
|
+
PAYMENT_METHOD_TYPE_P24: "p24",
|
|
36
|
+
PAYMENT_METHOD_TYPE_SOFORT: "sofort",
|
|
37
|
+
PAYMENT_METHOD_TYPE_ALIPAY: "alipay",
|
|
38
|
+
PAYMENT_METHOD_TYPE_WECHAT_PAY: "wechat_pay",
|
|
39
|
+
PAYMENT_METHOD_TYPE_KLARNA: "klarna",
|
|
40
|
+
PAYMENT_METHOD_TYPE_AFFIRM: "affirm",
|
|
41
|
+
PAYMENT_METHOD_TYPE_AFTERPAY_CLEARPAY: "afterpay_clearpay",
|
|
42
|
+
PAYMENT_METHOD_TYPE_CASHAPP: "cashapp",
|
|
43
|
+
PAYMENT_METHOD_TYPE_PAYPAL: "paypal",
|
|
44
|
+
PAYMENT_METHOD_TYPE_MULTIBANCO: "multibanco",
|
|
45
|
+
PAYMENT_METHOD_TYPE_KONBINI: "konbini",
|
|
46
|
+
PAYMENT_METHOD_TYPE_PROMPTPAY: "promptpay",
|
|
47
|
+
PAYMENT_METHOD_TYPE_PAYNOW: "paynow",
|
|
48
|
+
PAYMENT_METHOD_TYPE_GRABPAY: "grabpay",
|
|
49
|
+
PAYMENT_METHOD_TYPE_FPX: "fpx",
|
|
50
|
+
PAYMENT_METHOD_TYPE_BLIK: "blik"
|
|
51
|
+
});
|
|
52
|
+
const collectionMethodEnumValues = new _ProtoEnum({
|
|
53
|
+
COLLECTION_METHOD_SEND_INVOICE: "send_invoice",
|
|
54
|
+
COLLECTION_METHOD_CHARGE_AUTOMATICALLY: "charge_automatically"
|
|
55
|
+
});
|
|
56
|
+
const InvoiceCollectionOptionsResultDescriptor = new _ShapeDescriptor("InvoiceCollectionOptionsResult", [
|
|
57
|
+
{ type: "autoAdvance", transform: _required() }
|
|
58
|
+
]);
|
|
59
|
+
const InvoiceCollectionOptionsInputDescriptor = new _ShapeDescriptor(
|
|
60
|
+
"InvoiceCollectionOptionsInput",
|
|
61
|
+
[
|
|
62
|
+
{
|
|
63
|
+
type: "collectionOptions",
|
|
64
|
+
transform: _required(_translateShape(() => CollectionOptionsDescriptor))
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
{
|
|
69
|
+
discriminant: "invoiceParentType",
|
|
70
|
+
optional: true,
|
|
71
|
+
branches: [
|
|
72
|
+
{ wireKey: "cadence", typeKey: "cadence" },
|
|
73
|
+
{ wireKey: "quote", typeKey: "quote" },
|
|
74
|
+
{ wireKey: "schedule", typeKey: "schedule" },
|
|
75
|
+
{
|
|
76
|
+
wireKey: "subscription",
|
|
77
|
+
typeKey: "subscription",
|
|
78
|
+
transform: _translateShape(() => SubscriptionParentDescriptor)
|
|
79
|
+
},
|
|
80
|
+
{ wireKey: "contract", typeKey: "contract" }
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
discriminant: "payer",
|
|
85
|
+
optional: true,
|
|
86
|
+
branches: [
|
|
87
|
+
{
|
|
88
|
+
wireKey: "customer",
|
|
89
|
+
typeKey: "customer",
|
|
90
|
+
transform: _translateShape(() => CustomerDescriptor)
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
);
|
|
96
|
+
const CustomerDescriptor = new _ShapeDescriptor("Customer", [
|
|
97
|
+
{ type: "id", transform: _required() },
|
|
98
|
+
{ type: "metadata", transform: _required(_translateMap(_identity, _identity)) }
|
|
99
|
+
]);
|
|
100
|
+
const SubscriptionParentDescriptor = new _ShapeDescriptor(
|
|
101
|
+
"SubscriptionParent",
|
|
102
|
+
[
|
|
103
|
+
{ type: "id", transform: _required() },
|
|
104
|
+
{ type: "metadata", transform: _required(_translateMap(_identity, _identity)) }
|
|
105
|
+
]
|
|
106
|
+
);
|
|
107
|
+
const CollectionOptionsDescriptor = new _ShapeDescriptor(
|
|
108
|
+
"CollectionOptions",
|
|
109
|
+
[
|
|
110
|
+
{ type: "autoAdvance", transform: _required() },
|
|
111
|
+
{
|
|
112
|
+
type: "collectionMethod",
|
|
113
|
+
transform: _required(_translateEnum(collectionMethodEnumValues))
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: "paymentMethods",
|
|
117
|
+
transform: _required(
|
|
118
|
+
_translateArray(_translateEnum(paymentMethodTypeEnumValues))
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
);
|
|
123
|
+
function $platformWrapOverrideOptions(configTransformer) {
|
|
124
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
125
|
+
const instance = new cls();
|
|
126
|
+
const request = _apply(
|
|
127
|
+
InvoiceCollectionOptionsInputDescriptor,
|
|
128
|
+
_ProtoWireToType,
|
|
129
|
+
wireArgs
|
|
130
|
+
);
|
|
131
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext(ctx)) : wireConfig;
|
|
132
|
+
const result = instance.overrideOptions(request, config, ctx);
|
|
133
|
+
if (_isPromiseLike(result)) {
|
|
134
|
+
return Promise.resolve(result).then((r) => {
|
|
135
|
+
const typedR = r;
|
|
136
|
+
return _apply(
|
|
137
|
+
InvoiceCollectionOptionsResultDescriptor,
|
|
138
|
+
_TypeToProtoWire,
|
|
139
|
+
typedR
|
|
140
|
+
);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const typedResult = result;
|
|
144
|
+
return _apply(
|
|
145
|
+
InvoiceCollectionOptionsResultDescriptor,
|
|
146
|
+
_TypeToProtoWire,
|
|
147
|
+
typedResult
|
|
148
|
+
);
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
InvoiceCollectionOptions2.$platformWrapOverrideOptions = $platformWrapOverrideOptions;
|
|
152
|
+
})(InvoiceCollectionOptions || (InvoiceCollectionOptions = {}));
|
|
153
|
+
export {
|
|
154
|
+
InvoiceCollectionOptions
|
|
155
|
+
};
|