@wix/auto_sdk_payments_checkout-sessions 1.0.21 → 1.0.22
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/package.json +4 -11
- package/build/cjs/schemas.d.ts +0 -61
- package/build/cjs/schemas.js +0 -141
- package/build/cjs/schemas.js.map +0 -1
- package/build/es/schemas.d.mts +0 -61
- package/build/es/schemas.mjs +0 -103
- package/build/es/schemas.mjs.map +0 -1
- package/build/internal/cjs/index.js +0 -173
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.js +0 -159
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.js +0 -146
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/schemas.d.ts +0 -61
- package/build/internal/cjs/schemas.js +0 -141
- package/build/internal/cjs/schemas.js.map +0 -1
- package/build/internal/es/index.mjs +0 -147
- package/build/internal/es/index.mjs.map +0 -1
- package/build/internal/es/index.typings.mjs +0 -133
- package/build/internal/es/index.typings.mjs.map +0 -1
- package/build/internal/es/meta.mjs +0 -117
- package/build/internal/es/meta.mjs.map +0 -1
- package/build/internal/es/schemas.d.mts +0 -61
- package/build/internal/es/schemas.mjs +0 -103
- package/build/internal/es/schemas.mjs.map +0 -1
- package/schemas/package.json +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/auto_sdk_payments_checkout-sessions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -21,23 +21,16 @@
|
|
|
21
21
|
"import": "./build/es/meta.mjs",
|
|
22
22
|
"require": "./build/cjs/meta.js",
|
|
23
23
|
"types": "./build/es/meta.d.mts"
|
|
24
|
-
},
|
|
25
|
-
"./schemas": {
|
|
26
|
-
"import": "./build/es/schemas.mjs",
|
|
27
|
-
"require": "./build/cjs/schemas.js",
|
|
28
|
-
"types": "./build/es/schemas.d.mts"
|
|
29
24
|
}
|
|
30
25
|
},
|
|
31
26
|
"files": [
|
|
32
27
|
"build",
|
|
33
28
|
"meta",
|
|
34
|
-
"service-plugins"
|
|
35
|
-
"schemas"
|
|
29
|
+
"service-plugins"
|
|
36
30
|
],
|
|
37
31
|
"dependencies": {
|
|
38
32
|
"@wix/sdk-runtime": "^1.0.24",
|
|
39
|
-
"@wix/sdk-types": "^1.17.11"
|
|
40
|
-
"zod": "^4.3.6"
|
|
33
|
+
"@wix/sdk-types": "^1.17.11"
|
|
41
34
|
},
|
|
42
35
|
"devDependencies": {
|
|
43
36
|
"tsup": "^8.4.0",
|
|
@@ -57,5 +50,5 @@
|
|
|
57
50
|
"fqdn": "wix.payments.platform.v1.checkout_session"
|
|
58
51
|
}
|
|
59
52
|
},
|
|
60
|
-
"falconPackageHash": "
|
|
53
|
+
"falconPackageHash": "34b5776f0fd81e0dd41139f3b1fda0c0d8b08852cf5edf4be3427825"
|
|
61
54
|
}
|
package/build/cjs/schemas.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
|
|
3
|
-
declare const GenerateCheckoutSessionRequest: z.ZodObject<{
|
|
4
|
-
cart: z.ZodObject<{
|
|
5
|
-
items: z.ZodArray<z.ZodObject<{
|
|
6
|
-
name: z.ZodString;
|
|
7
|
-
quantity: z.ZodNumber;
|
|
8
|
-
price: z.ZodString;
|
|
9
|
-
subscriptionInfo: z.ZodOptional<z.ZodObject<{
|
|
10
|
-
subscriptionSettings: z.ZodObject<{
|
|
11
|
-
frequency: z.ZodEnum<{
|
|
12
|
-
UNDEFINED: "UNDEFINED";
|
|
13
|
-
DAY: "DAY";
|
|
14
|
-
WEEK: "WEEK";
|
|
15
|
-
MONTH: "MONTH";
|
|
16
|
-
YEAR: "YEAR";
|
|
17
|
-
}>;
|
|
18
|
-
interval: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
19
|
-
autoRenewal: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
20
|
-
billingCycles: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
21
|
-
freeTrialPeriod: z.ZodOptional<z.ZodObject<{
|
|
22
|
-
frequency: z.ZodEnum<{
|
|
23
|
-
UNDEFINED: "UNDEFINED";
|
|
24
|
-
DAY: "DAY";
|
|
25
|
-
WEEK: "WEEK";
|
|
26
|
-
MONTH: "MONTH";
|
|
27
|
-
YEAR: "YEAR";
|
|
28
|
-
}>;
|
|
29
|
-
interval: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
}, z.core.$strip>>;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
title: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
33
|
-
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
34
|
-
}, z.core.$strip>>;
|
|
35
|
-
physicalProperties: z.ZodOptional<z.ZodObject<{
|
|
36
|
-
shippable: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
37
|
-
}, z.core.$strip>>;
|
|
38
|
-
}, z.core.$strip>>;
|
|
39
|
-
customerInfo: z.ZodOptional<z.ZodObject<{
|
|
40
|
-
firstName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
41
|
-
lastName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
42
|
-
phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
43
|
-
email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
44
|
-
}, z.core.$strip>>;
|
|
45
|
-
}, z.core.$strip>;
|
|
46
|
-
options: z.ZodObject<{
|
|
47
|
-
callbackUrls: z.ZodObject<{
|
|
48
|
-
postFlowUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
49
|
-
thankYouPageUrl: z.ZodString;
|
|
50
|
-
continueBrowsingUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
51
|
-
}, z.core.$strip>;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
declare const GenerateCheckoutSessionResponse: z.ZodObject<{
|
|
55
|
-
checkoutSession: z.ZodOptional<z.ZodObject<{
|
|
56
|
-
_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
57
|
-
redirectUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
58
|
-
}, z.core.$strip>>;
|
|
59
|
-
}, z.core.$strip>;
|
|
60
|
-
|
|
61
|
-
export { GenerateCheckoutSessionRequest, GenerateCheckoutSessionResponse };
|
package/build/cjs/schemas.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// schemas.ts
|
|
31
|
-
var schemas_exports = {};
|
|
32
|
-
__export(schemas_exports, {
|
|
33
|
-
GenerateCheckoutSessionRequest: () => GenerateCheckoutSessionRequest,
|
|
34
|
-
GenerateCheckoutSessionResponse: () => GenerateCheckoutSessionResponse
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(schemas_exports);
|
|
37
|
-
|
|
38
|
-
// src/payments-platform-v1-checkout-session-checkout-sessions.schemas.ts
|
|
39
|
-
var z = __toESM(require("zod"));
|
|
40
|
-
var GenerateCheckoutSessionRequest = /* @__PURE__ */ z.object({
|
|
41
|
-
cart: z.object({
|
|
42
|
-
items: z.array(
|
|
43
|
-
z.object({
|
|
44
|
-
name: z.string().describe("Name of the item, shown on the checkout page.").min(1).max(255),
|
|
45
|
-
quantity: z.number().int().describe("Quantity of this item to charge for.").min(1),
|
|
46
|
-
price: z.string().describe(
|
|
47
|
-
'Per-unit price as a decimal string in the merchant account currency. For example, `"19.99"`.'
|
|
48
|
-
).min(1).max(50),
|
|
49
|
-
subscriptionInfo: z.object({
|
|
50
|
-
subscriptionSettings: z.object({
|
|
51
|
-
frequency: z.enum([
|
|
52
|
-
"UNDEFINED",
|
|
53
|
-
"DAY",
|
|
54
|
-
"WEEK",
|
|
55
|
-
"MONTH",
|
|
56
|
-
"YEAR"
|
|
57
|
-
]),
|
|
58
|
-
interval: z.number().int().describe(
|
|
59
|
-
"Number of frequency units between charges. For `DAY` frequency, the minimum is 7. The shortest\nbilling cadence supported is weekly; values 1\u20136 with `frequency: DAY` are rejected with\n`INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\n\nNote that `freeTrialPeriod.interval` doesn't share this floor: a `DAY` trial may have\n`interval` as low as 1."
|
|
60
|
-
).min(1).max(3650).optional().nullable(),
|
|
61
|
-
autoRenewal: z.boolean().describe(
|
|
62
|
-
"Whether the subscription renews automatically. Can't be `true` when `billingCycles` is set.\n\nDefault: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\nis set and `autoRenewal` is omitted."
|
|
63
|
-
).optional().nullable(),
|
|
64
|
-
billingCycles: z.number().int().describe(
|
|
65
|
-
"Number of billing cycles before the subscription stops. Can't be set when `autoRenewal` is `true`.\n\nWhen omitted along with `autoRenewal`, the subscription renews indefinitely."
|
|
66
|
-
).min(1).optional().nullable(),
|
|
67
|
-
freeTrialPeriod: z.object({
|
|
68
|
-
frequency: z.enum([
|
|
69
|
-
"UNDEFINED",
|
|
70
|
-
"DAY",
|
|
71
|
-
"WEEK",
|
|
72
|
-
"MONTH",
|
|
73
|
-
"YEAR"
|
|
74
|
-
]),
|
|
75
|
-
interval: z.number().int().describe(
|
|
76
|
-
"Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\ngives a 14-day trial.\n\nUnlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1`. No weekly floor applies\nto the trial length. Values \u2264 0 are rejected with `INVALID_ARGUMENT` (rule code\n`MIN_VALUE`)."
|
|
77
|
-
).min(1).max(999).optional()
|
|
78
|
-
}).describe("Free trial period before the first charge.").optional()
|
|
79
|
-
}).describe(
|
|
80
|
-
"Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\nline item."
|
|
81
|
-
),
|
|
82
|
-
title: z.string().describe(
|
|
83
|
-
"Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\ncheckout page (the heading of that block)."
|
|
84
|
-
).max(150).optional().nullable(),
|
|
85
|
-
description: z.string().describe(
|
|
86
|
-
"Subscription description shown to the buyer in the recurring-billing summary block on the\nWix-hosted checkout page (the body text below the title)."
|
|
87
|
-
).max(500).optional().nullable()
|
|
88
|
-
}).describe(
|
|
89
|
-
"Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n`subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\ncycle is `price \xD7 quantity`, and `quantity` is locked at session creation.\n\nAt most 1 line item per request may set `subscriptionInfo`. Wix rejects requests with 2 or more\nsubscription line items with `MULTIPLE_SUBSCRIPTION_ITEMS`."
|
|
90
|
-
).optional(),
|
|
91
|
-
physicalProperties: z.object({
|
|
92
|
-
shippable: z.boolean().describe("Whether the item requires shipping.").optional().nullable()
|
|
93
|
-
}).describe(
|
|
94
|
-
"Optional. Physical properties of the item, used when the item requires shipping."
|
|
95
|
-
).optional()
|
|
96
|
-
})
|
|
97
|
-
).max(100),
|
|
98
|
-
customerInfo: z.object({
|
|
99
|
-
firstName: z.string().describe("Buyer's first name.").max(100).optional().nullable(),
|
|
100
|
-
lastName: z.string().describe("Buyer's last name.").max(100).optional().nullable(),
|
|
101
|
-
phone: z.string().describe("Buyer's phone number.").optional().nullable(),
|
|
102
|
-
email: z.string().describe("Buyer's email address.").email().optional().nullable()
|
|
103
|
-
}).describe(
|
|
104
|
-
"Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\nWix checkout page."
|
|
105
|
-
).optional()
|
|
106
|
-
}).describe(
|
|
107
|
-
"Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details."
|
|
108
|
-
),
|
|
109
|
-
options: z.object({
|
|
110
|
-
callbackUrls: z.object({
|
|
111
|
-
postFlowUrl: z.string().describe(
|
|
112
|
-
"URL the buyer is redirected to from the Wix checkout page when they choose to leave without\ncompleting payment, either when they click **Continue browsing** or when they navigate back to\na cart-style page.\n\nDeprecated. Use `continueBrowsingUrl` instead."
|
|
113
|
-
).url().optional().nullable(),
|
|
114
|
-
thankYouPageUrl: z.string().describe(
|
|
115
|
-
"URL the buyer is redirected to after a successful payment."
|
|
116
|
-
).url(),
|
|
117
|
-
continueBrowsingUrl: z.string().describe(
|
|
118
|
-
"URL the buyer is redirected to from the Wix checkout page when they choose to leave without\ncompleting payment, either when they click **Continue browsing** or when they navigate back to\na cart-style page."
|
|
119
|
-
).url().optional().nullable()
|
|
120
|
-
}).describe(
|
|
121
|
-
"URLs the buyer is redirected to after completing or leaving the checkout flow."
|
|
122
|
-
)
|
|
123
|
-
})
|
|
124
|
-
});
|
|
125
|
-
var GenerateCheckoutSessionResponse = /* @__PURE__ */ z.object({
|
|
126
|
-
checkoutSession: z.object({
|
|
127
|
-
_id: z.string().describe("Checkout session ID.").regex(
|
|
128
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
129
|
-
"Must be a valid GUID"
|
|
130
|
-
).optional().nullable(),
|
|
131
|
-
redirectUrl: z.string().describe(
|
|
132
|
-
"URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page\nas an anonymous shopper, and any session held by the calling app isn't carried over.\n\nThe URL carries query parameters Wix needs to render the page correctly (for example, a\n`successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\nbuyer unchanged. Don't strip, reorder, rewrite, or otherwise mutate its query string."
|
|
133
|
-
).url().optional().nullable()
|
|
134
|
-
}).describe("The created checkout session.").optional()
|
|
135
|
-
});
|
|
136
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
137
|
-
0 && (module.exports = {
|
|
138
|
-
GenerateCheckoutSessionRequest,
|
|
139
|
-
GenerateCheckoutSessionResponse
|
|
140
|
-
});
|
|
141
|
-
//# sourceMappingURL=schemas.js.map
|
package/build/cjs/schemas.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../schemas.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.schemas.ts"],"sourcesContent":["export * from './src/payments-platform-v1-checkout-session-checkout-sessions.schemas.js';\n","import * as z from 'zod';\n\nexport const GenerateCheckoutSessionRequest = /*#__PURE__*/ z.object({\n cart: z\n .object({\n items: z\n .array(\n z.object({\n name: z\n .string()\n .describe('Name of the item, shown on the checkout page.')\n .min(1)\n .max(255),\n quantity: z\n .number()\n .int()\n .describe('Quantity of this item to charge for.')\n .min(1),\n price: z\n .string()\n .describe(\n 'Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.'\n )\n .min(1)\n .max(50),\n subscriptionInfo: z\n .object({\n subscriptionSettings: z\n .object({\n frequency: z.enum([\n 'UNDEFINED',\n 'DAY',\n 'WEEK',\n 'MONTH',\n 'YEAR',\n ]),\n interval: z\n .number()\n .int()\n .describe(\n \"Number of frequency units between charges. For `DAY` frequency, the minimum is 7. The shortest\\nbilling cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\\n`INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\\n\\nNote that `freeTrialPeriod.interval` doesn't share this floor: a `DAY` trial may have\\n`interval` as low as 1.\"\n )\n .min(1)\n .max(3650)\n .optional()\n .nullable(),\n autoRenewal: z\n .boolean()\n .describe(\n \"Whether the subscription renews automatically. Can't be `true` when `billingCycles` is set.\\n\\nDefault: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\\nis set and `autoRenewal` is omitted.\"\n )\n .optional()\n .nullable(),\n billingCycles: z\n .number()\n .int()\n .describe(\n \"Number of billing cycles before the subscription stops. Can't be set when `autoRenewal` is `true`.\\n\\nWhen omitted along with `autoRenewal`, the subscription renews indefinitely.\"\n )\n .min(1)\n .optional()\n .nullable(),\n freeTrialPeriod: z\n .object({\n frequency: z.enum([\n 'UNDEFINED',\n 'DAY',\n 'WEEK',\n 'MONTH',\n 'YEAR',\n ]),\n interval: z\n .number()\n .int()\n .describe(\n \"Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\\ngives a 14-day trial.\\n\\nUnlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1`. No weekly floor applies\\nto the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\\n`MIN_VALUE`).\"\n )\n .min(1)\n .max(999)\n .optional(),\n })\n .describe('Free trial period before the first charge.')\n .optional(),\n })\n .describe(\n 'Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\\nline item.'\n ),\n title: z\n .string()\n .describe(\n 'Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\\ncheckout page (the heading of that block).'\n )\n .max(150)\n .optional()\n .nullable(),\n description: z\n .string()\n .describe(\n 'Subscription description shown to the buyer in the recurring-billing summary block on the\\nWix-hosted checkout page (the body text below the title).'\n )\n .max(500)\n .optional()\n .nullable(),\n })\n .describe(\n 'Subscription configuration. When set, the line item follows a scheduled-billing model defined by\\n`subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\\ncycle is `price × quantity`, and `quantity` is locked at session creation.\\n\\nAt most 1 line item per request may set `subscriptionInfo`. Wix rejects requests with 2 or more\\nsubscription line items with `MULTIPLE_SUBSCRIPTION_ITEMS`.'\n )\n .optional(),\n physicalProperties: z\n .object({\n shippable: z\n .boolean()\n .describe('Whether the item requires shipping.')\n .optional()\n .nullable(),\n })\n .describe(\n 'Optional. Physical properties of the item, used when the item requires shipping.'\n )\n .optional(),\n })\n )\n .max(100),\n customerInfo: z\n .object({\n firstName: z\n .string()\n .describe(\"Buyer's first name.\")\n .max(100)\n .optional()\n .nullable(),\n lastName: z\n .string()\n .describe(\"Buyer's last name.\")\n .max(100)\n .optional()\n .nullable(),\n phone: z\n .string()\n .describe(\"Buyer's phone number.\")\n .optional()\n .nullable(),\n email: z\n .string()\n .describe(\"Buyer's email address.\")\n .email()\n .optional()\n .nullable(),\n })\n .describe(\n 'Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\\nWix checkout page.'\n )\n .optional(),\n })\n .describe(\n 'Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.'\n ),\n options: z.object({\n callbackUrls: z\n .object({\n postFlowUrl: z\n .string()\n .describe(\n 'URL the buyer is redirected to from the Wix checkout page when they choose to leave without\\ncompleting payment, either when they click **Continue browsing** or when they navigate back to\\na cart-style page.\\n\\nDeprecated. Use `continueBrowsingUrl` instead.'\n )\n .url()\n .optional()\n .nullable(),\n thankYouPageUrl: z\n .string()\n .describe(\n 'URL the buyer is redirected to after a successful payment.'\n )\n .url(),\n continueBrowsingUrl: z\n .string()\n .describe(\n 'URL the buyer is redirected to from the Wix checkout page when they choose to leave without\\ncompleting payment, either when they click **Continue browsing** or when they navigate back to\\na cart-style page.'\n )\n .url()\n .optional()\n .nullable(),\n })\n .describe(\n 'URLs the buyer is redirected to after completing or leaving the checkout flow.'\n ),\n }),\n});\nexport const GenerateCheckoutSessionResponse = /*#__PURE__*/ z.object({\n checkoutSession: z\n .object({\n _id: z\n .string()\n .describe('Checkout session ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional()\n .nullable(),\n redirectUrl: z\n .string()\n .describe(\n \"URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page\\nas an anonymous shopper, and any session held by the calling app isn't carried over.\\n\\nThe URL carries query parameters Wix needs to render the page correctly (for example, a\\n`successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\\nbuyer unchanged. Don't strip, reorder, rewrite, or otherwise mutate its query string.\"\n )\n .url()\n .optional()\n .nullable(),\n })\n .describe('The created checkout session.')\n .optional(),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAEZ,IAAM,iCAA+C,gBAAE,SAAO;AAAA,EACnE,MACG,SAAO;AAAA,IACN,OACG;AAAA,MACG,SAAO;AAAA,QACP,MACG,SAAO,EACP,SAAS,+CAA+C,EACxD,IAAI,CAAC,EACL,IAAI,GAAG;AAAA,QACV,UACG,SAAO,EACP,IAAI,EACJ,SAAS,sCAAsC,EAC/C,IAAI,CAAC;AAAA,QACR,OACG,SAAO,EACP;AAAA,UACC;AAAA,QACF,EACC,IAAI,CAAC,EACL,IAAI,EAAE;AAAA,QACT,kBACG,SAAO;AAAA,UACN,sBACG,SAAO;AAAA,YACN,WAAa,OAAK;AAAA,cAChB;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF,CAAC;AAAA,YACD,UACG,SAAO,EACP,IAAI,EACJ;AAAA,cACC;AAAA,YACF,EACC,IAAI,CAAC,EACL,IAAI,IAAI,EACR,SAAS,EACT,SAAS;AAAA,YACZ,aACG,UAAQ,EACR;AAAA,cACC;AAAA,YACF,EACC,SAAS,EACT,SAAS;AAAA,YACZ,eACG,SAAO,EACP,IAAI,EACJ;AAAA,cACC;AAAA,YACF,EACC,IAAI,CAAC,EACL,SAAS,EACT,SAAS;AAAA,YACZ,iBACG,SAAO;AAAA,cACN,WAAa,OAAK;AAAA,gBAChB;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cACF,CAAC;AAAA,cACD,UACG,SAAO,EACP,IAAI,EACJ;AAAA,gBACC;AAAA,cACF,EACC,IAAI,CAAC,EACL,IAAI,GAAG,EACP,SAAS;AAAA,YACd,CAAC,EACA,SAAS,4CAA4C,EACrD,SAAS;AAAA,UACd,CAAC,EACA;AAAA,YACC;AAAA,UACF;AAAA,UACF,OACG,SAAO,EACP;AAAA,YACC;AAAA,UACF,EACC,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,UACZ,aACG,SAAO,EACP;AAAA,YACC;AAAA,UACF,EACC,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,QACd,CAAC,EACA;AAAA,UACC;AAAA,QACF,EACC,SAAS;AAAA,QACZ,oBACG,SAAO;AAAA,UACN,WACG,UAAQ,EACR,SAAS,qCAAqC,EAC9C,SAAS,EACT,SAAS;AAAA,QACd,CAAC,EACA;AAAA,UACC;AAAA,QACF,EACC,SAAS;AAAA,MACd,CAAC;AAAA,IACH,EACC,IAAI,GAAG;AAAA,IACV,cACG,SAAO;AAAA,MACN,WACG,SAAO,EACP,SAAS,qBAAqB,EAC9B,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,MACZ,UACG,SAAO,EACP,SAAS,oBAAoB,EAC7B,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,MACZ,OACG,SAAO,EACP,SAAS,uBAAuB,EAChC,SAAS,EACT,SAAS;AAAA,MACZ,OACG,SAAO,EACP,SAAS,wBAAwB,EACjC,MAAM,EACN,SAAS,EACT,SAAS;AAAA,IACd,CAAC,EACA;AAAA,MACC;AAAA,IACF,EACC,SAAS;AAAA,EACd,CAAC,EACA;AAAA,IACC;AAAA,EACF;AAAA,EACF,SAAW,SAAO;AAAA,IAChB,cACG,SAAO;AAAA,MACN,aACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI,EACJ,SAAS,EACT,SAAS;AAAA,MACZ,iBACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI;AAAA,MACP,qBACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI,EACJ,SAAS,EACT,SAAS;AAAA,IACd,CAAC,EACA;AAAA,MACC;AAAA,IACF;AAAA,EACJ,CAAC;AACH,CAAC;AACM,IAAM,kCAAgD,gBAAE,SAAO;AAAA,EACpE,iBACG,SAAO;AAAA,IACN,KACG,SAAO,EACP,SAAS,sBAAsB,EAC/B;AAAA,MACC;AAAA,MACA;AAAA,IACF,EACC,SAAS,EACT,SAAS;AAAA,IACZ,aACG,SAAO,EACP;AAAA,MACC;AAAA,IACF,EACC,IAAI,EACJ,SAAS,EACT,SAAS;AAAA,EACd,CAAC,EACA,SAAS,+BAA+B,EACxC,SAAS;AACd,CAAC;","names":[]}
|
package/build/es/schemas.d.mts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
|
|
3
|
-
declare const GenerateCheckoutSessionRequest: z.ZodObject<{
|
|
4
|
-
cart: z.ZodObject<{
|
|
5
|
-
items: z.ZodArray<z.ZodObject<{
|
|
6
|
-
name: z.ZodString;
|
|
7
|
-
quantity: z.ZodNumber;
|
|
8
|
-
price: z.ZodString;
|
|
9
|
-
subscriptionInfo: z.ZodOptional<z.ZodObject<{
|
|
10
|
-
subscriptionSettings: z.ZodObject<{
|
|
11
|
-
frequency: z.ZodEnum<{
|
|
12
|
-
UNDEFINED: "UNDEFINED";
|
|
13
|
-
DAY: "DAY";
|
|
14
|
-
WEEK: "WEEK";
|
|
15
|
-
MONTH: "MONTH";
|
|
16
|
-
YEAR: "YEAR";
|
|
17
|
-
}>;
|
|
18
|
-
interval: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
19
|
-
autoRenewal: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
20
|
-
billingCycles: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
21
|
-
freeTrialPeriod: z.ZodOptional<z.ZodObject<{
|
|
22
|
-
frequency: z.ZodEnum<{
|
|
23
|
-
UNDEFINED: "UNDEFINED";
|
|
24
|
-
DAY: "DAY";
|
|
25
|
-
WEEK: "WEEK";
|
|
26
|
-
MONTH: "MONTH";
|
|
27
|
-
YEAR: "YEAR";
|
|
28
|
-
}>;
|
|
29
|
-
interval: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
}, z.core.$strip>>;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
title: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
33
|
-
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
34
|
-
}, z.core.$strip>>;
|
|
35
|
-
physicalProperties: z.ZodOptional<z.ZodObject<{
|
|
36
|
-
shippable: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
37
|
-
}, z.core.$strip>>;
|
|
38
|
-
}, z.core.$strip>>;
|
|
39
|
-
customerInfo: z.ZodOptional<z.ZodObject<{
|
|
40
|
-
firstName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
41
|
-
lastName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
42
|
-
phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
43
|
-
email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
44
|
-
}, z.core.$strip>>;
|
|
45
|
-
}, z.core.$strip>;
|
|
46
|
-
options: z.ZodObject<{
|
|
47
|
-
callbackUrls: z.ZodObject<{
|
|
48
|
-
postFlowUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
49
|
-
thankYouPageUrl: z.ZodString;
|
|
50
|
-
continueBrowsingUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
51
|
-
}, z.core.$strip>;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
declare const GenerateCheckoutSessionResponse: z.ZodObject<{
|
|
55
|
-
checkoutSession: z.ZodOptional<z.ZodObject<{
|
|
56
|
-
_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
57
|
-
redirectUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
58
|
-
}, z.core.$strip>>;
|
|
59
|
-
}, z.core.$strip>;
|
|
60
|
-
|
|
61
|
-
export { GenerateCheckoutSessionRequest, GenerateCheckoutSessionResponse };
|
package/build/es/schemas.mjs
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// src/payments-platform-v1-checkout-session-checkout-sessions.schemas.ts
|
|
2
|
-
import * as z from "zod";
|
|
3
|
-
var GenerateCheckoutSessionRequest = /* @__PURE__ */ z.object({
|
|
4
|
-
cart: z.object({
|
|
5
|
-
items: z.array(
|
|
6
|
-
z.object({
|
|
7
|
-
name: z.string().describe("Name of the item, shown on the checkout page.").min(1).max(255),
|
|
8
|
-
quantity: z.number().int().describe("Quantity of this item to charge for.").min(1),
|
|
9
|
-
price: z.string().describe(
|
|
10
|
-
'Per-unit price as a decimal string in the merchant account currency. For example, `"19.99"`.'
|
|
11
|
-
).min(1).max(50),
|
|
12
|
-
subscriptionInfo: z.object({
|
|
13
|
-
subscriptionSettings: z.object({
|
|
14
|
-
frequency: z.enum([
|
|
15
|
-
"UNDEFINED",
|
|
16
|
-
"DAY",
|
|
17
|
-
"WEEK",
|
|
18
|
-
"MONTH",
|
|
19
|
-
"YEAR"
|
|
20
|
-
]),
|
|
21
|
-
interval: z.number().int().describe(
|
|
22
|
-
"Number of frequency units between charges. For `DAY` frequency, the minimum is 7. The shortest\nbilling cadence supported is weekly; values 1\u20136 with `frequency: DAY` are rejected with\n`INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\n\nNote that `freeTrialPeriod.interval` doesn't share this floor: a `DAY` trial may have\n`interval` as low as 1."
|
|
23
|
-
).min(1).max(3650).optional().nullable(),
|
|
24
|
-
autoRenewal: z.boolean().describe(
|
|
25
|
-
"Whether the subscription renews automatically. Can't be `true` when `billingCycles` is set.\n\nDefault: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\nis set and `autoRenewal` is omitted."
|
|
26
|
-
).optional().nullable(),
|
|
27
|
-
billingCycles: z.number().int().describe(
|
|
28
|
-
"Number of billing cycles before the subscription stops. Can't be set when `autoRenewal` is `true`.\n\nWhen omitted along with `autoRenewal`, the subscription renews indefinitely."
|
|
29
|
-
).min(1).optional().nullable(),
|
|
30
|
-
freeTrialPeriod: z.object({
|
|
31
|
-
frequency: z.enum([
|
|
32
|
-
"UNDEFINED",
|
|
33
|
-
"DAY",
|
|
34
|
-
"WEEK",
|
|
35
|
-
"MONTH",
|
|
36
|
-
"YEAR"
|
|
37
|
-
]),
|
|
38
|
-
interval: z.number().int().describe(
|
|
39
|
-
"Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\ngives a 14-day trial.\n\nUnlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1`. No weekly floor applies\nto the trial length. Values \u2264 0 are rejected with `INVALID_ARGUMENT` (rule code\n`MIN_VALUE`)."
|
|
40
|
-
).min(1).max(999).optional()
|
|
41
|
-
}).describe("Free trial period before the first charge.").optional()
|
|
42
|
-
}).describe(
|
|
43
|
-
"Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\nline item."
|
|
44
|
-
),
|
|
45
|
-
title: z.string().describe(
|
|
46
|
-
"Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\ncheckout page (the heading of that block)."
|
|
47
|
-
).max(150).optional().nullable(),
|
|
48
|
-
description: z.string().describe(
|
|
49
|
-
"Subscription description shown to the buyer in the recurring-billing summary block on the\nWix-hosted checkout page (the body text below the title)."
|
|
50
|
-
).max(500).optional().nullable()
|
|
51
|
-
}).describe(
|
|
52
|
-
"Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n`subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\ncycle is `price \xD7 quantity`, and `quantity` is locked at session creation.\n\nAt most 1 line item per request may set `subscriptionInfo`. Wix rejects requests with 2 or more\nsubscription line items with `MULTIPLE_SUBSCRIPTION_ITEMS`."
|
|
53
|
-
).optional(),
|
|
54
|
-
physicalProperties: z.object({
|
|
55
|
-
shippable: z.boolean().describe("Whether the item requires shipping.").optional().nullable()
|
|
56
|
-
}).describe(
|
|
57
|
-
"Optional. Physical properties of the item, used when the item requires shipping."
|
|
58
|
-
).optional()
|
|
59
|
-
})
|
|
60
|
-
).max(100),
|
|
61
|
-
customerInfo: z.object({
|
|
62
|
-
firstName: z.string().describe("Buyer's first name.").max(100).optional().nullable(),
|
|
63
|
-
lastName: z.string().describe("Buyer's last name.").max(100).optional().nullable(),
|
|
64
|
-
phone: z.string().describe("Buyer's phone number.").optional().nullable(),
|
|
65
|
-
email: z.string().describe("Buyer's email address.").email().optional().nullable()
|
|
66
|
-
}).describe(
|
|
67
|
-
"Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\nWix checkout page."
|
|
68
|
-
).optional()
|
|
69
|
-
}).describe(
|
|
70
|
-
"Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details."
|
|
71
|
-
),
|
|
72
|
-
options: z.object({
|
|
73
|
-
callbackUrls: z.object({
|
|
74
|
-
postFlowUrl: z.string().describe(
|
|
75
|
-
"URL the buyer is redirected to from the Wix checkout page when they choose to leave without\ncompleting payment, either when they click **Continue browsing** or when they navigate back to\na cart-style page.\n\nDeprecated. Use `continueBrowsingUrl` instead."
|
|
76
|
-
).url().optional().nullable(),
|
|
77
|
-
thankYouPageUrl: z.string().describe(
|
|
78
|
-
"URL the buyer is redirected to after a successful payment."
|
|
79
|
-
).url(),
|
|
80
|
-
continueBrowsingUrl: z.string().describe(
|
|
81
|
-
"URL the buyer is redirected to from the Wix checkout page when they choose to leave without\ncompleting payment, either when they click **Continue browsing** or when they navigate back to\na cart-style page."
|
|
82
|
-
).url().optional().nullable()
|
|
83
|
-
}).describe(
|
|
84
|
-
"URLs the buyer is redirected to after completing or leaving the checkout flow."
|
|
85
|
-
)
|
|
86
|
-
})
|
|
87
|
-
});
|
|
88
|
-
var GenerateCheckoutSessionResponse = /* @__PURE__ */ z.object({
|
|
89
|
-
checkoutSession: z.object({
|
|
90
|
-
_id: z.string().describe("Checkout session ID.").regex(
|
|
91
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
92
|
-
"Must be a valid GUID"
|
|
93
|
-
).optional().nullable(),
|
|
94
|
-
redirectUrl: z.string().describe(
|
|
95
|
-
"URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page\nas an anonymous shopper, and any session held by the calling app isn't carried over.\n\nThe URL carries query parameters Wix needs to render the page correctly (for example, a\n`successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\nbuyer unchanged. Don't strip, reorder, rewrite, or otherwise mutate its query string."
|
|
96
|
-
).url().optional().nullable()
|
|
97
|
-
}).describe("The created checkout session.").optional()
|
|
98
|
-
});
|
|
99
|
-
export {
|
|
100
|
-
GenerateCheckoutSessionRequest,
|
|
101
|
-
GenerateCheckoutSessionResponse
|
|
102
|
-
};
|
|
103
|
-
//# sourceMappingURL=schemas.mjs.map
|
package/build/es/schemas.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/payments-platform-v1-checkout-session-checkout-sessions.schemas.ts"],"sourcesContent":["import * as z from 'zod';\n\nexport const GenerateCheckoutSessionRequest = /*#__PURE__*/ z.object({\n cart: z\n .object({\n items: z\n .array(\n z.object({\n name: z\n .string()\n .describe('Name of the item, shown on the checkout page.')\n .min(1)\n .max(255),\n quantity: z\n .number()\n .int()\n .describe('Quantity of this item to charge for.')\n .min(1),\n price: z\n .string()\n .describe(\n 'Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.'\n )\n .min(1)\n .max(50),\n subscriptionInfo: z\n .object({\n subscriptionSettings: z\n .object({\n frequency: z.enum([\n 'UNDEFINED',\n 'DAY',\n 'WEEK',\n 'MONTH',\n 'YEAR',\n ]),\n interval: z\n .number()\n .int()\n .describe(\n \"Number of frequency units between charges. For `DAY` frequency, the minimum is 7. The shortest\\nbilling cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\\n`INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\\n\\nNote that `freeTrialPeriod.interval` doesn't share this floor: a `DAY` trial may have\\n`interval` as low as 1.\"\n )\n .min(1)\n .max(3650)\n .optional()\n .nullable(),\n autoRenewal: z\n .boolean()\n .describe(\n \"Whether the subscription renews automatically. Can't be `true` when `billingCycles` is set.\\n\\nDefault: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\\nis set and `autoRenewal` is omitted.\"\n )\n .optional()\n .nullable(),\n billingCycles: z\n .number()\n .int()\n .describe(\n \"Number of billing cycles before the subscription stops. Can't be set when `autoRenewal` is `true`.\\n\\nWhen omitted along with `autoRenewal`, the subscription renews indefinitely.\"\n )\n .min(1)\n .optional()\n .nullable(),\n freeTrialPeriod: z\n .object({\n frequency: z.enum([\n 'UNDEFINED',\n 'DAY',\n 'WEEK',\n 'MONTH',\n 'YEAR',\n ]),\n interval: z\n .number()\n .int()\n .describe(\n \"Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\\ngives a 14-day trial.\\n\\nUnlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1`. No weekly floor applies\\nto the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\\n`MIN_VALUE`).\"\n )\n .min(1)\n .max(999)\n .optional(),\n })\n .describe('Free trial period before the first charge.')\n .optional(),\n })\n .describe(\n 'Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\\nline item.'\n ),\n title: z\n .string()\n .describe(\n 'Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\\ncheckout page (the heading of that block).'\n )\n .max(150)\n .optional()\n .nullable(),\n description: z\n .string()\n .describe(\n 'Subscription description shown to the buyer in the recurring-billing summary block on the\\nWix-hosted checkout page (the body text below the title).'\n )\n .max(500)\n .optional()\n .nullable(),\n })\n .describe(\n 'Subscription configuration. When set, the line item follows a scheduled-billing model defined by\\n`subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\\ncycle is `price × quantity`, and `quantity` is locked at session creation.\\n\\nAt most 1 line item per request may set `subscriptionInfo`. Wix rejects requests with 2 or more\\nsubscription line items with `MULTIPLE_SUBSCRIPTION_ITEMS`.'\n )\n .optional(),\n physicalProperties: z\n .object({\n shippable: z\n .boolean()\n .describe('Whether the item requires shipping.')\n .optional()\n .nullable(),\n })\n .describe(\n 'Optional. Physical properties of the item, used when the item requires shipping.'\n )\n .optional(),\n })\n )\n .max(100),\n customerInfo: z\n .object({\n firstName: z\n .string()\n .describe(\"Buyer's first name.\")\n .max(100)\n .optional()\n .nullable(),\n lastName: z\n .string()\n .describe(\"Buyer's last name.\")\n .max(100)\n .optional()\n .nullable(),\n phone: z\n .string()\n .describe(\"Buyer's phone number.\")\n .optional()\n .nullable(),\n email: z\n .string()\n .describe(\"Buyer's email address.\")\n .email()\n .optional()\n .nullable(),\n })\n .describe(\n 'Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\\nWix checkout page.'\n )\n .optional(),\n })\n .describe(\n 'Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.'\n ),\n options: z.object({\n callbackUrls: z\n .object({\n postFlowUrl: z\n .string()\n .describe(\n 'URL the buyer is redirected to from the Wix checkout page when they choose to leave without\\ncompleting payment, either when they click **Continue browsing** or when they navigate back to\\na cart-style page.\\n\\nDeprecated. Use `continueBrowsingUrl` instead.'\n )\n .url()\n .optional()\n .nullable(),\n thankYouPageUrl: z\n .string()\n .describe(\n 'URL the buyer is redirected to after a successful payment.'\n )\n .url(),\n continueBrowsingUrl: z\n .string()\n .describe(\n 'URL the buyer is redirected to from the Wix checkout page when they choose to leave without\\ncompleting payment, either when they click **Continue browsing** or when they navigate back to\\na cart-style page.'\n )\n .url()\n .optional()\n .nullable(),\n })\n .describe(\n 'URLs the buyer is redirected to after completing or leaving the checkout flow.'\n ),\n }),\n});\nexport const GenerateCheckoutSessionResponse = /*#__PURE__*/ z.object({\n checkoutSession: z\n .object({\n _id: z\n .string()\n .describe('Checkout session ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional()\n .nullable(),\n redirectUrl: z\n .string()\n .describe(\n \"URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page\\nas an anonymous shopper, and any session held by the calling app isn't carried over.\\n\\nThe URL carries query parameters Wix needs to render the page correctly (for example, a\\n`successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\\nbuyer unchanged. Don't strip, reorder, rewrite, or otherwise mutate its query string.\"\n )\n .url()\n .optional()\n .nullable(),\n })\n .describe('The created checkout session.')\n .optional(),\n});\n"],"mappings":"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","names":[]}
|
|
@@ -1,173 +0,0 @@
|
|
|
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
|
-
// index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
SubscriptionFrequency: () => SubscriptionFrequency,
|
|
24
|
-
WebhookType: () => WebhookType,
|
|
25
|
-
generateCheckoutSession: () => generateCheckoutSession4
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(index_exports);
|
|
28
|
-
|
|
29
|
-
// src/payments-platform-v1-checkout-session-checkout-sessions.universal.ts
|
|
30
|
-
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
31
|
-
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
32
|
-
|
|
33
|
-
// src/payments-platform-v1-checkout-session-checkout-sessions.http.ts
|
|
34
|
-
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
35
|
-
function resolveWixPaymentsPlatformV1CheckoutSessionsUrl(opts) {
|
|
36
|
-
const domainToMappings = {
|
|
37
|
-
"www.wixapis.com": [
|
|
38
|
-
{
|
|
39
|
-
srcPath: "/payments/platform/v1/checkout-sessions",
|
|
40
|
-
destPath: "/v1/checkout-sessions"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
srcPath: "/payments/base44/v1/subscriptions",
|
|
44
|
-
destPath: "/v1/subscriptions"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
srcPath: "/payments/platform/v1/service-plugin-registrations",
|
|
48
|
-
destPath: "/v1/service-plugin-registrations"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
"manage._base_domain_": [
|
|
52
|
-
{
|
|
53
|
-
srcPath: "/_api/checkout-sessions",
|
|
54
|
-
destPath: ""
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
"manage.base44.com": [
|
|
58
|
-
{
|
|
59
|
-
srcPath: "/_api/checkout-sessions",
|
|
60
|
-
destPath: ""
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"payments.base44.com": [
|
|
64
|
-
{
|
|
65
|
-
srcPath: "/_api/checkout-sessions",
|
|
66
|
-
destPath: ""
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"*.dev.wix-code.com": [
|
|
70
|
-
{
|
|
71
|
-
srcPath: "/payments/platform/v1/checkout-sessions",
|
|
72
|
-
destPath: "/v1/checkout-sessions"
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
_: [
|
|
76
|
-
{
|
|
77
|
-
srcPath: "/payments/platform/v1/checkout-sessions",
|
|
78
|
-
destPath: "/v1/checkout-sessions"
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
};
|
|
82
|
-
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
83
|
-
}
|
|
84
|
-
var PACKAGE_NAME = "@wix/auto_sdk_payments_checkout-sessions";
|
|
85
|
-
function generateCheckoutSession(payload) {
|
|
86
|
-
function __generateCheckoutSession({ host }) {
|
|
87
|
-
const metadata = {
|
|
88
|
-
entityFqdn: "wix.payments.platform.v1.checkout_session",
|
|
89
|
-
method: "POST",
|
|
90
|
-
methodFqn: "wix.payments.platform.v1.CheckoutSessions.GenerateCheckoutSession",
|
|
91
|
-
packageName: PACKAGE_NAME,
|
|
92
|
-
migrationOptions: {
|
|
93
|
-
optInTransformResponse: true
|
|
94
|
-
},
|
|
95
|
-
url: resolveWixPaymentsPlatformV1CheckoutSessionsUrl({
|
|
96
|
-
protoPath: "/v1/checkout-sessions/generate",
|
|
97
|
-
data: payload,
|
|
98
|
-
host
|
|
99
|
-
}),
|
|
100
|
-
data: payload
|
|
101
|
-
};
|
|
102
|
-
return metadata;
|
|
103
|
-
}
|
|
104
|
-
return __generateCheckoutSession;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// src/payments-platform-v1-checkout-session-checkout-sessions.universal.ts
|
|
108
|
-
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
109
|
-
SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
|
|
110
|
-
SubscriptionFrequency2["DAY"] = "DAY";
|
|
111
|
-
SubscriptionFrequency2["WEEK"] = "WEEK";
|
|
112
|
-
SubscriptionFrequency2["MONTH"] = "MONTH";
|
|
113
|
-
SubscriptionFrequency2["YEAR"] = "YEAR";
|
|
114
|
-
return SubscriptionFrequency2;
|
|
115
|
-
})(SubscriptionFrequency || {});
|
|
116
|
-
var WebhookType = /* @__PURE__ */ ((WebhookType2) => {
|
|
117
|
-
WebhookType2["ORDER_APPROVED"] = "ORDER_APPROVED";
|
|
118
|
-
WebhookType2["SUBSCRIPTION_CANCELED"] = "SUBSCRIPTION_CANCELED";
|
|
119
|
-
WebhookType2["SUBSCRIPTION_ENDED"] = "SUBSCRIPTION_ENDED";
|
|
120
|
-
return WebhookType2;
|
|
121
|
-
})(WebhookType || {});
|
|
122
|
-
async function generateCheckoutSession2(cart, options) {
|
|
123
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
124
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
125
|
-
cart,
|
|
126
|
-
callbackUrls: options?.callbackUrls
|
|
127
|
-
});
|
|
128
|
-
const reqOpts = generateCheckoutSession(
|
|
129
|
-
payload
|
|
130
|
-
);
|
|
131
|
-
sideEffects?.onSiteCall?.();
|
|
132
|
-
try {
|
|
133
|
-
const result = await httpClient.request(reqOpts);
|
|
134
|
-
sideEffects?.onSuccess?.(result);
|
|
135
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
136
|
-
} catch (err) {
|
|
137
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
138
|
-
err,
|
|
139
|
-
{
|
|
140
|
-
spreadPathsToArguments: {},
|
|
141
|
-
explicitPathsToArguments: {
|
|
142
|
-
cart: "$[0]",
|
|
143
|
-
callbackUrls: "$[1].callbackUrls"
|
|
144
|
-
},
|
|
145
|
-
singleArgumentUnchanged: false
|
|
146
|
-
},
|
|
147
|
-
["cart", "options"]
|
|
148
|
-
);
|
|
149
|
-
sideEffects?.onError?.(err);
|
|
150
|
-
throw transformedError;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// src/payments-platform-v1-checkout-session-checkout-sessions.public.ts
|
|
155
|
-
function generateCheckoutSession3(httpClient) {
|
|
156
|
-
return (cart, options) => generateCheckoutSession2(
|
|
157
|
-
cart,
|
|
158
|
-
options,
|
|
159
|
-
// @ts-ignore
|
|
160
|
-
{ httpClient }
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// src/payments-platform-v1-checkout-session-checkout-sessions.context.ts
|
|
165
|
-
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
166
|
-
var generateCheckoutSession4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(generateCheckoutSession3);
|
|
167
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
168
|
-
0 && (module.exports = {
|
|
169
|
-
SubscriptionFrequency,
|
|
170
|
-
WebhookType,
|
|
171
|
-
generateCheckoutSession
|
|
172
|
-
});
|
|
173
|
-
//# sourceMappingURL=index.js.map
|