@wix/auto_sdk_payments_wix-payments-account 1.0.13 → 1.0.14
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/build/cjs/index.d.ts +2 -2
- package/build/cjs/index.typings.d.ts +74 -0
- package/build/cjs/index.typings.js +98 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +2 -2
- package/build/es/index.typings.d.mts +74 -0
- package/build/es/index.typings.mjs +74 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +2 -2
- package/build/internal/cjs/index.typings.d.ts +74 -0
- package/build/internal/cjs/index.typings.js +98 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +2 -2
- package/build/internal/es/index.typings.d.mts +74 -0
- package/build/internal/es/index.typings.mjs +74 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/package.json +2 -2
- package/build/cjs/payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.d.ts +0 -43
- package/build/es/payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.d.mts +0 -43
- package/build/internal/cjs/payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.d.ts +0 -43
- package/build/internal/es/payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.d.mts +0 -43
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { WixPaymentsAccount, ConnectWixPaymentsAccountResponse } from './index.typings.js';
|
|
3
|
+
export { ConnectWixPaymentsAccountRequest } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function connectWixPaymentsAccount$1(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
|
|
6
6
|
interface ConnectWixPaymentsAccountSignature {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
/** An account that enables a Wix site to process customer payments. */
|
|
4
|
+
interface WixPaymentsAccount {
|
|
5
|
+
/**
|
|
6
|
+
* ID of the Wix Payments account.
|
|
7
|
+
* @format GUID
|
|
8
|
+
* @readonly
|
|
9
|
+
*/
|
|
10
|
+
_id?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* First name of the Wix Payments account owner.
|
|
13
|
+
* @maxLength 500
|
|
14
|
+
*/
|
|
15
|
+
firstName?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Last name of the Wix Payments account owner.
|
|
18
|
+
* @maxLength 500
|
|
19
|
+
*/
|
|
20
|
+
lastName?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the account owner has accepted the
|
|
23
|
+
* [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).
|
|
24
|
+
* The account owner must accept these terms for the account to be created
|
|
25
|
+
* successfully. If the terms aren't accepted, the Connect Wix Payments Account
|
|
26
|
+
* call fails.
|
|
27
|
+
*/
|
|
28
|
+
tosAccepted?: boolean | null;
|
|
29
|
+
/**
|
|
30
|
+
* Brief summary of the types of products and services offered for sale through the Wix Payments account.
|
|
31
|
+
* For example, "Sportswear and sport accessories".
|
|
32
|
+
* @maxLength 500
|
|
33
|
+
*/
|
|
34
|
+
productDescription?: string | null;
|
|
35
|
+
}
|
|
36
|
+
interface ConnectWixPaymentsAccountRequest {
|
|
37
|
+
/** Wix Payments account to connect to the site. */
|
|
38
|
+
account: WixPaymentsAccount;
|
|
39
|
+
}
|
|
40
|
+
interface ConnectWixPaymentsAccountResponse {
|
|
41
|
+
/** Connected Wix Payments account. */
|
|
42
|
+
account?: WixPaymentsAccount;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Connects a Wix Payments account to the site.
|
|
46
|
+
*
|
|
47
|
+
*
|
|
48
|
+
* The call fails if:
|
|
49
|
+
* - The site's location
|
|
50
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
|
|
51
|
+
* is outside the USA.
|
|
52
|
+
* - A Wix Payments account is already connected to the site.
|
|
53
|
+
* - You don't specify `{"tosAccepted": true}`.
|
|
54
|
+
*
|
|
55
|
+
* The connected Wix Payments account has the following limitations, which site
|
|
56
|
+
* owners can manage in their dashboard:
|
|
57
|
+
*
|
|
58
|
+
* - By default, customers can only pay via credit card, Apple Pay, or Google Pay.
|
|
59
|
+
* - To receive payments, site owners must complete onboarding to their Wix
|
|
60
|
+
* Payments account in the site's dashboard.
|
|
61
|
+
* @param account - Wix Payments account to connect to the site.
|
|
62
|
+
* @public
|
|
63
|
+
* @documentationMaturity preview
|
|
64
|
+
* @requiredField account
|
|
65
|
+
* @requiredField account.firstName
|
|
66
|
+
* @requiredField account.lastName
|
|
67
|
+
* @requiredField account.tosAccepted
|
|
68
|
+
* @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE
|
|
69
|
+
* @applicableIdentity APP
|
|
70
|
+
* @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount
|
|
71
|
+
*/
|
|
72
|
+
declare function connectWixPaymentsAccount(account: NonNullablePaths<WixPaymentsAccount, `firstName` | `lastName` | `tosAccepted`>): Promise<ConnectWixPaymentsAccountResponse>;
|
|
73
|
+
|
|
74
|
+
export { type ConnectWixPaymentsAccountRequest, type ConnectWixPaymentsAccountResponse, type WixPaymentsAccount, connectWixPaymentsAccount };
|
|
@@ -0,0 +1,98 @@
|
|
|
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.typings.ts
|
|
21
|
+
var index_typings_exports = {};
|
|
22
|
+
__export(index_typings_exports, {
|
|
23
|
+
connectWixPaymentsAccount: () => connectWixPaymentsAccount2
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_typings_exports);
|
|
26
|
+
|
|
27
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
|
|
28
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
29
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
|
|
31
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts
|
|
32
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
33
|
+
function resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(opts) {
|
|
34
|
+
const domainToMappings = {
|
|
35
|
+
"www.wixapis.com": [
|
|
36
|
+
{
|
|
37
|
+
srcPath: "/payments/v1/wix-payments-account",
|
|
38
|
+
destPath: "/v1/wix-payments-account"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
srcPath: "/payments/mcp/v1/wix-payments-account",
|
|
42
|
+
destPath: "/v1/wix-payments-account"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
};
|
|
46
|
+
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
47
|
+
}
|
|
48
|
+
var PACKAGE_NAME = "@wix/auto_sdk_payments_wix-payments-account";
|
|
49
|
+
function connectWixPaymentsAccount(payload) {
|
|
50
|
+
function __connectWixPaymentsAccount({ host }) {
|
|
51
|
+
const metadata = {
|
|
52
|
+
entityFqdn: "wix.payments.mcp.v1.wix_payments_account",
|
|
53
|
+
method: "POST",
|
|
54
|
+
methodFqn: "wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount",
|
|
55
|
+
packageName: PACKAGE_NAME,
|
|
56
|
+
url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({
|
|
57
|
+
protoPath: "/v1/wix-payments-account/connect",
|
|
58
|
+
data: payload,
|
|
59
|
+
host
|
|
60
|
+
}),
|
|
61
|
+
data: payload
|
|
62
|
+
};
|
|
63
|
+
return metadata;
|
|
64
|
+
}
|
|
65
|
+
return __connectWixPaymentsAccount;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
|
|
69
|
+
async function connectWixPaymentsAccount2(account) {
|
|
70
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
71
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ account });
|
|
72
|
+
const reqOpts = connectWixPaymentsAccount(
|
|
73
|
+
payload
|
|
74
|
+
);
|
|
75
|
+
sideEffects?.onSiteCall?.();
|
|
76
|
+
try {
|
|
77
|
+
const result = await httpClient.request(reqOpts);
|
|
78
|
+
sideEffects?.onSuccess?.(result);
|
|
79
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
80
|
+
} catch (err) {
|
|
81
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
82
|
+
err,
|
|
83
|
+
{
|
|
84
|
+
spreadPathsToArguments: {},
|
|
85
|
+
explicitPathsToArguments: { account: "$[0]" },
|
|
86
|
+
singleArgumentUnchanged: false
|
|
87
|
+
},
|
|
88
|
+
["account"]
|
|
89
|
+
);
|
|
90
|
+
sideEffects?.onError?.(err);
|
|
91
|
+
throw transformedError;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
+
0 && (module.exports = {
|
|
96
|
+
connectWixPaymentsAccount
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=index.typings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts"],"sourcesContent":["export * from './src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsMcpV1WixPaymentsAccount from './payments-mcp-v1-wix-payments-account-wix-payments-account.http.js';\n\n/** An account that enables a Wix site to process customer payments. */\nexport interface WixPaymentsAccount {\n /**\n * ID of the Wix Payments account.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * First name of the Wix Payments account owner.\n * @maxLength 500\n */\n firstName?: string | null;\n /**\n * Last name of the Wix Payments account owner.\n * @maxLength 500\n */\n lastName?: string | null;\n /**\n * Whether the account owner has accepted the\n * [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).\n * The account owner must accept these terms for the account to be created\n * successfully. If the terms aren't accepted, the Connect Wix Payments Account\n * call fails.\n */\n tosAccepted?: boolean | null;\n /**\n * Brief summary of the types of products and services offered for sale through the Wix Payments account.\n * For example, \"Sportswear and sport accessories\".\n * @maxLength 500\n */\n productDescription?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountRequest {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n}\n\nexport interface ConnectWixPaymentsAccountResponse {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n}\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param account - Wix Payments account to connect to the site.\n * @public\n * @documentationMaturity preview\n * @requiredField account\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.tosAccepted\n * @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE\n * @applicableIdentity APP\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount\n */\nexport async function connectWixPaymentsAccount(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n): Promise<ConnectWixPaymentsAccountResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ account: account });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccount(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { account: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['account']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_wix-payments-account';\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n */\nexport function connectWixPaymentsAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.mcp.v1.wix_payments_account',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount',\n packageName: PACKAGE_NAME,\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccount;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAA2B;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAoBd,SAAS,0BACd,SAC4B;AAC5B,WAAS,4BAA4B,EAAE,KAAK,GAAQ;AAClD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADeA,eAAsBC,2BACpB,SAI4C;AAE5C,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,EAAE,QAAiB,CAAC;AAE1E,QAAM,UACyC;AAAA,IAC3C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,OAAO;AAAA,QAC5C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount","connectWixPaymentsAccount","sdkTransformError"]}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConnectWixPaymentsAccountRequest as ConnectWixPaymentsAccountRequest$1, ConnectWixPaymentsAccountResponse as ConnectWixPaymentsAccountResponse$1 } from './index.typings.js';
|
|
2
|
+
import '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
/** An account that enables a Wix site to process customer payments. */
|
|
4
5
|
interface WixPaymentsAccount {
|
package/build/es/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { WixPaymentsAccount, ConnectWixPaymentsAccountResponse } from './index.typings.mjs';
|
|
3
|
+
export { ConnectWixPaymentsAccountRequest } from './index.typings.mjs';
|
|
4
4
|
|
|
5
5
|
declare function connectWixPaymentsAccount$1(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
|
|
6
6
|
interface ConnectWixPaymentsAccountSignature {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
/** An account that enables a Wix site to process customer payments. */
|
|
4
|
+
interface WixPaymentsAccount {
|
|
5
|
+
/**
|
|
6
|
+
* ID of the Wix Payments account.
|
|
7
|
+
* @format GUID
|
|
8
|
+
* @readonly
|
|
9
|
+
*/
|
|
10
|
+
_id?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* First name of the Wix Payments account owner.
|
|
13
|
+
* @maxLength 500
|
|
14
|
+
*/
|
|
15
|
+
firstName?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Last name of the Wix Payments account owner.
|
|
18
|
+
* @maxLength 500
|
|
19
|
+
*/
|
|
20
|
+
lastName?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the account owner has accepted the
|
|
23
|
+
* [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).
|
|
24
|
+
* The account owner must accept these terms for the account to be created
|
|
25
|
+
* successfully. If the terms aren't accepted, the Connect Wix Payments Account
|
|
26
|
+
* call fails.
|
|
27
|
+
*/
|
|
28
|
+
tosAccepted?: boolean | null;
|
|
29
|
+
/**
|
|
30
|
+
* Brief summary of the types of products and services offered for sale through the Wix Payments account.
|
|
31
|
+
* For example, "Sportswear and sport accessories".
|
|
32
|
+
* @maxLength 500
|
|
33
|
+
*/
|
|
34
|
+
productDescription?: string | null;
|
|
35
|
+
}
|
|
36
|
+
interface ConnectWixPaymentsAccountRequest {
|
|
37
|
+
/** Wix Payments account to connect to the site. */
|
|
38
|
+
account: WixPaymentsAccount;
|
|
39
|
+
}
|
|
40
|
+
interface ConnectWixPaymentsAccountResponse {
|
|
41
|
+
/** Connected Wix Payments account. */
|
|
42
|
+
account?: WixPaymentsAccount;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Connects a Wix Payments account to the site.
|
|
46
|
+
*
|
|
47
|
+
*
|
|
48
|
+
* The call fails if:
|
|
49
|
+
* - The site's location
|
|
50
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
|
|
51
|
+
* is outside the USA.
|
|
52
|
+
* - A Wix Payments account is already connected to the site.
|
|
53
|
+
* - You don't specify `{"tosAccepted": true}`.
|
|
54
|
+
*
|
|
55
|
+
* The connected Wix Payments account has the following limitations, which site
|
|
56
|
+
* owners can manage in their dashboard:
|
|
57
|
+
*
|
|
58
|
+
* - By default, customers can only pay via credit card, Apple Pay, or Google Pay.
|
|
59
|
+
* - To receive payments, site owners must complete onboarding to their Wix
|
|
60
|
+
* Payments account in the site's dashboard.
|
|
61
|
+
* @param account - Wix Payments account to connect to the site.
|
|
62
|
+
* @public
|
|
63
|
+
* @documentationMaturity preview
|
|
64
|
+
* @requiredField account
|
|
65
|
+
* @requiredField account.firstName
|
|
66
|
+
* @requiredField account.lastName
|
|
67
|
+
* @requiredField account.tosAccepted
|
|
68
|
+
* @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE
|
|
69
|
+
* @applicableIdentity APP
|
|
70
|
+
* @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount
|
|
71
|
+
*/
|
|
72
|
+
declare function connectWixPaymentsAccount(account: NonNullablePaths<WixPaymentsAccount, `firstName` | `lastName` | `tosAccepted`>): Promise<ConnectWixPaymentsAccountResponse>;
|
|
73
|
+
|
|
74
|
+
export { type ConnectWixPaymentsAccountRequest, type ConnectWixPaymentsAccountResponse, type WixPaymentsAccount, connectWixPaymentsAccount };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts
|
|
9
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
10
|
+
function resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(opts) {
|
|
11
|
+
const domainToMappings = {
|
|
12
|
+
"www.wixapis.com": [
|
|
13
|
+
{
|
|
14
|
+
srcPath: "/payments/v1/wix-payments-account",
|
|
15
|
+
destPath: "/v1/wix-payments-account"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
srcPath: "/payments/mcp/v1/wix-payments-account",
|
|
19
|
+
destPath: "/v1/wix-payments-account"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
};
|
|
23
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
24
|
+
}
|
|
25
|
+
var PACKAGE_NAME = "@wix/auto_sdk_payments_wix-payments-account";
|
|
26
|
+
function connectWixPaymentsAccount(payload) {
|
|
27
|
+
function __connectWixPaymentsAccount({ host }) {
|
|
28
|
+
const metadata = {
|
|
29
|
+
entityFqdn: "wix.payments.mcp.v1.wix_payments_account",
|
|
30
|
+
method: "POST",
|
|
31
|
+
methodFqn: "wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount",
|
|
32
|
+
packageName: PACKAGE_NAME,
|
|
33
|
+
url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({
|
|
34
|
+
protoPath: "/v1/wix-payments-account/connect",
|
|
35
|
+
data: payload,
|
|
36
|
+
host
|
|
37
|
+
}),
|
|
38
|
+
data: payload
|
|
39
|
+
};
|
|
40
|
+
return metadata;
|
|
41
|
+
}
|
|
42
|
+
return __connectWixPaymentsAccount;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
|
|
46
|
+
async function connectWixPaymentsAccount2(account) {
|
|
47
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
48
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ account });
|
|
49
|
+
const reqOpts = connectWixPaymentsAccount(
|
|
50
|
+
payload
|
|
51
|
+
);
|
|
52
|
+
sideEffects?.onSiteCall?.();
|
|
53
|
+
try {
|
|
54
|
+
const result = await httpClient.request(reqOpts);
|
|
55
|
+
sideEffects?.onSuccess?.(result);
|
|
56
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
const transformedError = sdkTransformError(
|
|
59
|
+
err,
|
|
60
|
+
{
|
|
61
|
+
spreadPathsToArguments: {},
|
|
62
|
+
explicitPathsToArguments: { account: "$[0]" },
|
|
63
|
+
singleArgumentUnchanged: false
|
|
64
|
+
},
|
|
65
|
+
["account"]
|
|
66
|
+
);
|
|
67
|
+
sideEffects?.onError?.(err);
|
|
68
|
+
throw transformedError;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
connectWixPaymentsAccount2 as connectWixPaymentsAccount
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=index.typings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsMcpV1WixPaymentsAccount from './payments-mcp-v1-wix-payments-account-wix-payments-account.http.js';\n\n/** An account that enables a Wix site to process customer payments. */\nexport interface WixPaymentsAccount {\n /**\n * ID of the Wix Payments account.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * First name of the Wix Payments account owner.\n * @maxLength 500\n */\n firstName?: string | null;\n /**\n * Last name of the Wix Payments account owner.\n * @maxLength 500\n */\n lastName?: string | null;\n /**\n * Whether the account owner has accepted the\n * [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).\n * The account owner must accept these terms for the account to be created\n * successfully. If the terms aren't accepted, the Connect Wix Payments Account\n * call fails.\n */\n tosAccepted?: boolean | null;\n /**\n * Brief summary of the types of products and services offered for sale through the Wix Payments account.\n * For example, \"Sportswear and sport accessories\".\n * @maxLength 500\n */\n productDescription?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountRequest {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n}\n\nexport interface ConnectWixPaymentsAccountResponse {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n}\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param account - Wix Payments account to connect to the site.\n * @public\n * @documentationMaturity preview\n * @requiredField account\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.tosAccepted\n * @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE\n * @applicableIdentity APP\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount\n */\nexport async function connectWixPaymentsAccount(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n): Promise<ConnectWixPaymentsAccountResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ account: account });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccount(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { account: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['account']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_wix-payments-account';\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n */\nexport function connectWixPaymentsAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.mcp.v1.wix_payments_account',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount',\n packageName: PACKAGE_NAME,\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccount;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,kBAAkB;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAoBd,SAAS,0BACd,SAC4B;AAC5B,WAAS,4BAA4B,EAAE,KAAK,GAAQ;AAClD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADeA,eAAsBA,2BACpB,SAI4C;AAE5C,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC,EAAE,QAAiB,CAAC;AAE1E,QAAM,UACyC;AAAA,IAC3C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,OAAO;AAAA,QAC5C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount"]}
|
package/build/es/meta.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConnectWixPaymentsAccountRequest as ConnectWixPaymentsAccountRequest$1, ConnectWixPaymentsAccountResponse as ConnectWixPaymentsAccountResponse$1 } from './index.typings.mjs';
|
|
2
|
+
import '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
/** An account that enables a Wix site to process customer payments. */
|
|
4
5
|
interface WixPaymentsAccount {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { WixPaymentsAccount, ConnectWixPaymentsAccountResponse } from './index.typings.js';
|
|
3
|
+
export { ConnectWixPaymentsAccountRequest } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function connectWixPaymentsAccount$1(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
|
|
6
6
|
interface ConnectWixPaymentsAccountSignature {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
/** An account that enables a Wix site to process customer payments. */
|
|
4
|
+
interface WixPaymentsAccount {
|
|
5
|
+
/**
|
|
6
|
+
* ID of the Wix Payments account.
|
|
7
|
+
* @format GUID
|
|
8
|
+
* @readonly
|
|
9
|
+
*/
|
|
10
|
+
_id?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* First name of the Wix Payments account owner.
|
|
13
|
+
* @maxLength 500
|
|
14
|
+
*/
|
|
15
|
+
firstName?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Last name of the Wix Payments account owner.
|
|
18
|
+
* @maxLength 500
|
|
19
|
+
*/
|
|
20
|
+
lastName?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the account owner has accepted the
|
|
23
|
+
* [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).
|
|
24
|
+
* The account owner must accept these terms for the account to be created
|
|
25
|
+
* successfully. If the terms aren't accepted, the Connect Wix Payments Account
|
|
26
|
+
* call fails.
|
|
27
|
+
*/
|
|
28
|
+
tosAccepted?: boolean | null;
|
|
29
|
+
/**
|
|
30
|
+
* Brief summary of the types of products and services offered for sale through the Wix Payments account.
|
|
31
|
+
* For example, "Sportswear and sport accessories".
|
|
32
|
+
* @maxLength 500
|
|
33
|
+
*/
|
|
34
|
+
productDescription?: string | null;
|
|
35
|
+
}
|
|
36
|
+
interface ConnectWixPaymentsAccountRequest {
|
|
37
|
+
/** Wix Payments account to connect to the site. */
|
|
38
|
+
account: WixPaymentsAccount;
|
|
39
|
+
}
|
|
40
|
+
interface ConnectWixPaymentsAccountResponse {
|
|
41
|
+
/** Connected Wix Payments account. */
|
|
42
|
+
account?: WixPaymentsAccount;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Connects a Wix Payments account to the site.
|
|
46
|
+
*
|
|
47
|
+
*
|
|
48
|
+
* The call fails if:
|
|
49
|
+
* - The site's location
|
|
50
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
|
|
51
|
+
* is outside the USA.
|
|
52
|
+
* - A Wix Payments account is already connected to the site.
|
|
53
|
+
* - You don't specify `{"tosAccepted": true}`.
|
|
54
|
+
*
|
|
55
|
+
* The connected Wix Payments account has the following limitations, which site
|
|
56
|
+
* owners can manage in their dashboard:
|
|
57
|
+
*
|
|
58
|
+
* - By default, customers can only pay via credit card, Apple Pay, or Google Pay.
|
|
59
|
+
* - To receive payments, site owners must complete onboarding to their Wix
|
|
60
|
+
* Payments account in the site's dashboard.
|
|
61
|
+
* @param account - Wix Payments account to connect to the site.
|
|
62
|
+
* @public
|
|
63
|
+
* @documentationMaturity preview
|
|
64
|
+
* @requiredField account
|
|
65
|
+
* @requiredField account.firstName
|
|
66
|
+
* @requiredField account.lastName
|
|
67
|
+
* @requiredField account.tosAccepted
|
|
68
|
+
* @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE
|
|
69
|
+
* @applicableIdentity APP
|
|
70
|
+
* @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount
|
|
71
|
+
*/
|
|
72
|
+
declare function connectWixPaymentsAccount(account: NonNullablePaths<WixPaymentsAccount, `firstName` | `lastName` | `tosAccepted`>): Promise<ConnectWixPaymentsAccountResponse>;
|
|
73
|
+
|
|
74
|
+
export { type ConnectWixPaymentsAccountRequest, type ConnectWixPaymentsAccountResponse, type WixPaymentsAccount, connectWixPaymentsAccount };
|
|
@@ -0,0 +1,98 @@
|
|
|
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.typings.ts
|
|
21
|
+
var index_typings_exports = {};
|
|
22
|
+
__export(index_typings_exports, {
|
|
23
|
+
connectWixPaymentsAccount: () => connectWixPaymentsAccount2
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_typings_exports);
|
|
26
|
+
|
|
27
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
|
|
28
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
29
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
|
|
31
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts
|
|
32
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
33
|
+
function resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(opts) {
|
|
34
|
+
const domainToMappings = {
|
|
35
|
+
"www.wixapis.com": [
|
|
36
|
+
{
|
|
37
|
+
srcPath: "/payments/v1/wix-payments-account",
|
|
38
|
+
destPath: "/v1/wix-payments-account"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
srcPath: "/payments/mcp/v1/wix-payments-account",
|
|
42
|
+
destPath: "/v1/wix-payments-account"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
};
|
|
46
|
+
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
47
|
+
}
|
|
48
|
+
var PACKAGE_NAME = "@wix/auto_sdk_payments_wix-payments-account";
|
|
49
|
+
function connectWixPaymentsAccount(payload) {
|
|
50
|
+
function __connectWixPaymentsAccount({ host }) {
|
|
51
|
+
const metadata = {
|
|
52
|
+
entityFqdn: "wix.payments.mcp.v1.wix_payments_account",
|
|
53
|
+
method: "POST",
|
|
54
|
+
methodFqn: "wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount",
|
|
55
|
+
packageName: PACKAGE_NAME,
|
|
56
|
+
url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({
|
|
57
|
+
protoPath: "/v1/wix-payments-account/connect",
|
|
58
|
+
data: payload,
|
|
59
|
+
host
|
|
60
|
+
}),
|
|
61
|
+
data: payload
|
|
62
|
+
};
|
|
63
|
+
return metadata;
|
|
64
|
+
}
|
|
65
|
+
return __connectWixPaymentsAccount;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
|
|
69
|
+
async function connectWixPaymentsAccount2(account) {
|
|
70
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
71
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ account });
|
|
72
|
+
const reqOpts = connectWixPaymentsAccount(
|
|
73
|
+
payload
|
|
74
|
+
);
|
|
75
|
+
sideEffects?.onSiteCall?.();
|
|
76
|
+
try {
|
|
77
|
+
const result = await httpClient.request(reqOpts);
|
|
78
|
+
sideEffects?.onSuccess?.(result);
|
|
79
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
80
|
+
} catch (err) {
|
|
81
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
82
|
+
err,
|
|
83
|
+
{
|
|
84
|
+
spreadPathsToArguments: {},
|
|
85
|
+
explicitPathsToArguments: { account: "$[0]" },
|
|
86
|
+
singleArgumentUnchanged: false
|
|
87
|
+
},
|
|
88
|
+
["account"]
|
|
89
|
+
);
|
|
90
|
+
sideEffects?.onError?.(err);
|
|
91
|
+
throw transformedError;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
+
0 && (module.exports = {
|
|
96
|
+
connectWixPaymentsAccount
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=index.typings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../index.typings.ts","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts"],"sourcesContent":["export * from './src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsMcpV1WixPaymentsAccount from './payments-mcp-v1-wix-payments-account-wix-payments-account.http.js';\n\n/** An account that enables a Wix site to process customer payments. */\nexport interface WixPaymentsAccount {\n /**\n * ID of the Wix Payments account.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * First name of the Wix Payments account owner.\n * @maxLength 500\n */\n firstName?: string | null;\n /**\n * Last name of the Wix Payments account owner.\n * @maxLength 500\n */\n lastName?: string | null;\n /**\n * Whether the account owner has accepted the\n * [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).\n * The account owner must accept these terms for the account to be created\n * successfully. If the terms aren't accepted, the Connect Wix Payments Account\n * call fails.\n */\n tosAccepted?: boolean | null;\n /**\n * Brief summary of the types of products and services offered for sale through the Wix Payments account.\n * For example, \"Sportswear and sport accessories\".\n * @maxLength 500\n */\n productDescription?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountRequest {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n}\n\nexport interface ConnectWixPaymentsAccountResponse {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n}\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param account - Wix Payments account to connect to the site.\n * @public\n * @documentationMaturity preview\n * @requiredField account\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.tosAccepted\n * @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE\n * @applicableIdentity APP\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount\n */\nexport async function connectWixPaymentsAccount(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n): Promise<ConnectWixPaymentsAccountResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ account: account });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccount(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { account: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['account']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_wix-payments-account';\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n */\nexport function connectWixPaymentsAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.mcp.v1.wix_payments_account',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount',\n packageName: PACKAGE_NAME,\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccount;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAA2B;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAoBd,SAAS,0BACd,SAC4B;AAC5B,WAAS,4BAA4B,EAAE,KAAK,GAAQ;AAClD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADeA,eAAsBC,2BACpB,SAI4C;AAE5C,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,EAAE,QAAiB,CAAC;AAE1E,QAAM,UACyC;AAAA,IAC3C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,OAAO;AAAA,QAC5C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount","connectWixPaymentsAccount","sdkTransformError"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConnectWixPaymentsAccountRequest as ConnectWixPaymentsAccountRequest$1, ConnectWixPaymentsAccountResponse as ConnectWixPaymentsAccountResponse$1 } from './index.typings.js';
|
|
2
|
+
import '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
/** An account that enables a Wix site to process customer payments. */
|
|
4
5
|
interface WixPaymentsAccount {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { WixPaymentsAccount, ConnectWixPaymentsAccountResponse } from './index.typings.mjs';
|
|
3
|
+
export { ConnectWixPaymentsAccountRequest } from './index.typings.mjs';
|
|
4
4
|
|
|
5
5
|
declare function connectWixPaymentsAccount$1(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
|
|
6
6
|
interface ConnectWixPaymentsAccountSignature {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
/** An account that enables a Wix site to process customer payments. */
|
|
4
|
+
interface WixPaymentsAccount {
|
|
5
|
+
/**
|
|
6
|
+
* ID of the Wix Payments account.
|
|
7
|
+
* @format GUID
|
|
8
|
+
* @readonly
|
|
9
|
+
*/
|
|
10
|
+
_id?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* First name of the Wix Payments account owner.
|
|
13
|
+
* @maxLength 500
|
|
14
|
+
*/
|
|
15
|
+
firstName?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Last name of the Wix Payments account owner.
|
|
18
|
+
* @maxLength 500
|
|
19
|
+
*/
|
|
20
|
+
lastName?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the account owner has accepted the
|
|
23
|
+
* [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).
|
|
24
|
+
* The account owner must accept these terms for the account to be created
|
|
25
|
+
* successfully. If the terms aren't accepted, the Connect Wix Payments Account
|
|
26
|
+
* call fails.
|
|
27
|
+
*/
|
|
28
|
+
tosAccepted?: boolean | null;
|
|
29
|
+
/**
|
|
30
|
+
* Brief summary of the types of products and services offered for sale through the Wix Payments account.
|
|
31
|
+
* For example, "Sportswear and sport accessories".
|
|
32
|
+
* @maxLength 500
|
|
33
|
+
*/
|
|
34
|
+
productDescription?: string | null;
|
|
35
|
+
}
|
|
36
|
+
interface ConnectWixPaymentsAccountRequest {
|
|
37
|
+
/** Wix Payments account to connect to the site. */
|
|
38
|
+
account: WixPaymentsAccount;
|
|
39
|
+
}
|
|
40
|
+
interface ConnectWixPaymentsAccountResponse {
|
|
41
|
+
/** Connected Wix Payments account. */
|
|
42
|
+
account?: WixPaymentsAccount;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Connects a Wix Payments account to the site.
|
|
46
|
+
*
|
|
47
|
+
*
|
|
48
|
+
* The call fails if:
|
|
49
|
+
* - The site's location
|
|
50
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))
|
|
51
|
+
* is outside the USA.
|
|
52
|
+
* - A Wix Payments account is already connected to the site.
|
|
53
|
+
* - You don't specify `{"tosAccepted": true}`.
|
|
54
|
+
*
|
|
55
|
+
* The connected Wix Payments account has the following limitations, which site
|
|
56
|
+
* owners can manage in their dashboard:
|
|
57
|
+
*
|
|
58
|
+
* - By default, customers can only pay via credit card, Apple Pay, or Google Pay.
|
|
59
|
+
* - To receive payments, site owners must complete onboarding to their Wix
|
|
60
|
+
* Payments account in the site's dashboard.
|
|
61
|
+
* @param account - Wix Payments account to connect to the site.
|
|
62
|
+
* @public
|
|
63
|
+
* @documentationMaturity preview
|
|
64
|
+
* @requiredField account
|
|
65
|
+
* @requiredField account.firstName
|
|
66
|
+
* @requiredField account.lastName
|
|
67
|
+
* @requiredField account.tosAccepted
|
|
68
|
+
* @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE
|
|
69
|
+
* @applicableIdentity APP
|
|
70
|
+
* @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount
|
|
71
|
+
*/
|
|
72
|
+
declare function connectWixPaymentsAccount(account: NonNullablePaths<WixPaymentsAccount, `firstName` | `lastName` | `tosAccepted`>): Promise<ConnectWixPaymentsAccountResponse>;
|
|
73
|
+
|
|
74
|
+
export { type ConnectWixPaymentsAccountRequest, type ConnectWixPaymentsAccountResponse, type WixPaymentsAccount, connectWixPaymentsAccount };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts
|
|
9
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
10
|
+
function resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(opts) {
|
|
11
|
+
const domainToMappings = {
|
|
12
|
+
"www.wixapis.com": [
|
|
13
|
+
{
|
|
14
|
+
srcPath: "/payments/v1/wix-payments-account",
|
|
15
|
+
destPath: "/v1/wix-payments-account"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
srcPath: "/payments/mcp/v1/wix-payments-account",
|
|
19
|
+
destPath: "/v1/wix-payments-account"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
};
|
|
23
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
24
|
+
}
|
|
25
|
+
var PACKAGE_NAME = "@wix/auto_sdk_payments_wix-payments-account";
|
|
26
|
+
function connectWixPaymentsAccount(payload) {
|
|
27
|
+
function __connectWixPaymentsAccount({ host }) {
|
|
28
|
+
const metadata = {
|
|
29
|
+
entityFqdn: "wix.payments.mcp.v1.wix_payments_account",
|
|
30
|
+
method: "POST",
|
|
31
|
+
methodFqn: "wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount",
|
|
32
|
+
packageName: PACKAGE_NAME,
|
|
33
|
+
url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({
|
|
34
|
+
protoPath: "/v1/wix-payments-account/connect",
|
|
35
|
+
data: payload,
|
|
36
|
+
host
|
|
37
|
+
}),
|
|
38
|
+
data: payload
|
|
39
|
+
};
|
|
40
|
+
return metadata;
|
|
41
|
+
}
|
|
42
|
+
return __connectWixPaymentsAccount;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
|
|
46
|
+
async function connectWixPaymentsAccount2(account) {
|
|
47
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
48
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ account });
|
|
49
|
+
const reqOpts = connectWixPaymentsAccount(
|
|
50
|
+
payload
|
|
51
|
+
);
|
|
52
|
+
sideEffects?.onSiteCall?.();
|
|
53
|
+
try {
|
|
54
|
+
const result = await httpClient.request(reqOpts);
|
|
55
|
+
sideEffects?.onSuccess?.(result);
|
|
56
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
const transformedError = sdkTransformError(
|
|
59
|
+
err,
|
|
60
|
+
{
|
|
61
|
+
spreadPathsToArguments: {},
|
|
62
|
+
explicitPathsToArguments: { account: "$[0]" },
|
|
63
|
+
singleArgumentUnchanged: false
|
|
64
|
+
},
|
|
65
|
+
["account"]
|
|
66
|
+
);
|
|
67
|
+
sideEffects?.onError?.(err);
|
|
68
|
+
throw transformedError;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
connectWixPaymentsAccount2 as connectWixPaymentsAccount
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=index.typings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsMcpV1WixPaymentsAccount from './payments-mcp-v1-wix-payments-account-wix-payments-account.http.js';\n\n/** An account that enables a Wix site to process customer payments. */\nexport interface WixPaymentsAccount {\n /**\n * ID of the Wix Payments account.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * First name of the Wix Payments account owner.\n * @maxLength 500\n */\n firstName?: string | null;\n /**\n * Last name of the Wix Payments account owner.\n * @maxLength 500\n */\n lastName?: string | null;\n /**\n * Whether the account owner has accepted the\n * [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).\n * The account owner must accept these terms for the account to be created\n * successfully. If the terms aren't accepted, the Connect Wix Payments Account\n * call fails.\n */\n tosAccepted?: boolean | null;\n /**\n * Brief summary of the types of products and services offered for sale through the Wix Payments account.\n * For example, \"Sportswear and sport accessories\".\n * @maxLength 500\n */\n productDescription?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountRequest {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n}\n\nexport interface ConnectWixPaymentsAccountResponse {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n}\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param account - Wix Payments account to connect to the site.\n * @public\n * @documentationMaturity preview\n * @requiredField account\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.tosAccepted\n * @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE\n * @applicableIdentity APP\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount\n */\nexport async function connectWixPaymentsAccount(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n): Promise<ConnectWixPaymentsAccountResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ account: account });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccount(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { account: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['account']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_wix-payments-account';\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n */\nexport function connectWixPaymentsAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.mcp.v1.wix_payments_account',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount',\n packageName: PACKAGE_NAME,\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccount;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,kBAAkB;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAoBd,SAAS,0BACd,SAC4B;AAC5B,WAAS,4BAA4B,EAAE,KAAK,GAAQ;AAClD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADeA,eAAsBA,2BACpB,SAI4C;AAE5C,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC,EAAE,QAAiB,CAAC;AAE1E,QAAM,UACyC;AAAA,IAC3C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,OAAO;AAAA,QAC5C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConnectWixPaymentsAccountRequest as ConnectWixPaymentsAccountRequest$1, ConnectWixPaymentsAccountResponse as ConnectWixPaymentsAccountResponse$1 } from './index.typings.mjs';
|
|
2
|
+
import '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
/** An account that enables a Wix site to process customer payments. */
|
|
4
5
|
interface WixPaymentsAccount {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/auto_sdk_payments_wix-payments-account",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"fqdn": "wix.payments.mcp.v1.wix_payments_account"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
"falconPackageHash": "
|
|
52
|
+
"falconPackageHash": "ae41cc761912708c7498def186aaabdc3bc96e55ad08c2421694df75"
|
|
53
53
|
}
|
package/build/cjs/payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** An account that enables a Wix site to process customer payments. */
|
|
2
|
-
interface WixPaymentsAccount {
|
|
3
|
-
/**
|
|
4
|
-
* ID of the Wix Payments account.
|
|
5
|
-
* @format GUID
|
|
6
|
-
* @readonly
|
|
7
|
-
*/
|
|
8
|
-
_id?: string | null;
|
|
9
|
-
/**
|
|
10
|
-
* First name of the Wix Payments account owner.
|
|
11
|
-
* @maxLength 500
|
|
12
|
-
*/
|
|
13
|
-
firstName?: string | null;
|
|
14
|
-
/**
|
|
15
|
-
* Last name of the Wix Payments account owner.
|
|
16
|
-
* @maxLength 500
|
|
17
|
-
*/
|
|
18
|
-
lastName?: string | null;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the account owner has accepted the
|
|
21
|
-
* [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).
|
|
22
|
-
* The account owner must accept these terms for the account to be created
|
|
23
|
-
* successfully. If the terms aren't accepted, the Connect Wix Payments Account
|
|
24
|
-
* call fails.
|
|
25
|
-
*/
|
|
26
|
-
tosAccepted?: boolean | null;
|
|
27
|
-
/**
|
|
28
|
-
* Brief summary of the types of products and services offered for sale through the Wix Payments account.
|
|
29
|
-
* For example, "Sportswear and sport accessories".
|
|
30
|
-
* @maxLength 500
|
|
31
|
-
*/
|
|
32
|
-
productDescription?: string | null;
|
|
33
|
-
}
|
|
34
|
-
interface ConnectWixPaymentsAccountRequest {
|
|
35
|
-
/** Wix Payments account to connect to the site. */
|
|
36
|
-
account: WixPaymentsAccount;
|
|
37
|
-
}
|
|
38
|
-
interface ConnectWixPaymentsAccountResponse {
|
|
39
|
-
/** Connected Wix Payments account. */
|
|
40
|
-
account?: WixPaymentsAccount;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type { ConnectWixPaymentsAccountResponse as C, WixPaymentsAccount as W, ConnectWixPaymentsAccountRequest as a };
|
package/build/es/payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.d.mts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** An account that enables a Wix site to process customer payments. */
|
|
2
|
-
interface WixPaymentsAccount {
|
|
3
|
-
/**
|
|
4
|
-
* ID of the Wix Payments account.
|
|
5
|
-
* @format GUID
|
|
6
|
-
* @readonly
|
|
7
|
-
*/
|
|
8
|
-
_id?: string | null;
|
|
9
|
-
/**
|
|
10
|
-
* First name of the Wix Payments account owner.
|
|
11
|
-
* @maxLength 500
|
|
12
|
-
*/
|
|
13
|
-
firstName?: string | null;
|
|
14
|
-
/**
|
|
15
|
-
* Last name of the Wix Payments account owner.
|
|
16
|
-
* @maxLength 500
|
|
17
|
-
*/
|
|
18
|
-
lastName?: string | null;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the account owner has accepted the
|
|
21
|
-
* [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).
|
|
22
|
-
* The account owner must accept these terms for the account to be created
|
|
23
|
-
* successfully. If the terms aren't accepted, the Connect Wix Payments Account
|
|
24
|
-
* call fails.
|
|
25
|
-
*/
|
|
26
|
-
tosAccepted?: boolean | null;
|
|
27
|
-
/**
|
|
28
|
-
* Brief summary of the types of products and services offered for sale through the Wix Payments account.
|
|
29
|
-
* For example, "Sportswear and sport accessories".
|
|
30
|
-
* @maxLength 500
|
|
31
|
-
*/
|
|
32
|
-
productDescription?: string | null;
|
|
33
|
-
}
|
|
34
|
-
interface ConnectWixPaymentsAccountRequest {
|
|
35
|
-
/** Wix Payments account to connect to the site. */
|
|
36
|
-
account: WixPaymentsAccount;
|
|
37
|
-
}
|
|
38
|
-
interface ConnectWixPaymentsAccountResponse {
|
|
39
|
-
/** Connected Wix Payments account. */
|
|
40
|
-
account?: WixPaymentsAccount;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type { ConnectWixPaymentsAccountResponse as C, WixPaymentsAccount as W, ConnectWixPaymentsAccountRequest as a };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** An account that enables a Wix site to process customer payments. */
|
|
2
|
-
interface WixPaymentsAccount {
|
|
3
|
-
/**
|
|
4
|
-
* ID of the Wix Payments account.
|
|
5
|
-
* @format GUID
|
|
6
|
-
* @readonly
|
|
7
|
-
*/
|
|
8
|
-
_id?: string | null;
|
|
9
|
-
/**
|
|
10
|
-
* First name of the Wix Payments account owner.
|
|
11
|
-
* @maxLength 500
|
|
12
|
-
*/
|
|
13
|
-
firstName?: string | null;
|
|
14
|
-
/**
|
|
15
|
-
* Last name of the Wix Payments account owner.
|
|
16
|
-
* @maxLength 500
|
|
17
|
-
*/
|
|
18
|
-
lastName?: string | null;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the account owner has accepted the
|
|
21
|
-
* [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).
|
|
22
|
-
* The account owner must accept these terms for the account to be created
|
|
23
|
-
* successfully. If the terms aren't accepted, the Connect Wix Payments Account
|
|
24
|
-
* call fails.
|
|
25
|
-
*/
|
|
26
|
-
tosAccepted?: boolean | null;
|
|
27
|
-
/**
|
|
28
|
-
* Brief summary of the types of products and services offered for sale through the Wix Payments account.
|
|
29
|
-
* For example, "Sportswear and sport accessories".
|
|
30
|
-
* @maxLength 500
|
|
31
|
-
*/
|
|
32
|
-
productDescription?: string | null;
|
|
33
|
-
}
|
|
34
|
-
interface ConnectWixPaymentsAccountRequest {
|
|
35
|
-
/** Wix Payments account to connect to the site. */
|
|
36
|
-
account: WixPaymentsAccount;
|
|
37
|
-
}
|
|
38
|
-
interface ConnectWixPaymentsAccountResponse {
|
|
39
|
-
/** Connected Wix Payments account. */
|
|
40
|
-
account?: WixPaymentsAccount;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type { ConnectWixPaymentsAccountResponse as C, WixPaymentsAccount as W, ConnectWixPaymentsAccountRequest as a };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** An account that enables a Wix site to process customer payments. */
|
|
2
|
-
interface WixPaymentsAccount {
|
|
3
|
-
/**
|
|
4
|
-
* ID of the Wix Payments account.
|
|
5
|
-
* @format GUID
|
|
6
|
-
* @readonly
|
|
7
|
-
*/
|
|
8
|
-
_id?: string | null;
|
|
9
|
-
/**
|
|
10
|
-
* First name of the Wix Payments account owner.
|
|
11
|
-
* @maxLength 500
|
|
12
|
-
*/
|
|
13
|
-
firstName?: string | null;
|
|
14
|
-
/**
|
|
15
|
-
* Last name of the Wix Payments account owner.
|
|
16
|
-
* @maxLength 500
|
|
17
|
-
*/
|
|
18
|
-
lastName?: string | null;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the account owner has accepted the
|
|
21
|
-
* [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).
|
|
22
|
-
* The account owner must accept these terms for the account to be created
|
|
23
|
-
* successfully. If the terms aren't accepted, the Connect Wix Payments Account
|
|
24
|
-
* call fails.
|
|
25
|
-
*/
|
|
26
|
-
tosAccepted?: boolean | null;
|
|
27
|
-
/**
|
|
28
|
-
* Brief summary of the types of products and services offered for sale through the Wix Payments account.
|
|
29
|
-
* For example, "Sportswear and sport accessories".
|
|
30
|
-
* @maxLength 500
|
|
31
|
-
*/
|
|
32
|
-
productDescription?: string | null;
|
|
33
|
-
}
|
|
34
|
-
interface ConnectWixPaymentsAccountRequest {
|
|
35
|
-
/** Wix Payments account to connect to the site. */
|
|
36
|
-
account: WixPaymentsAccount;
|
|
37
|
-
}
|
|
38
|
-
interface ConnectWixPaymentsAccountResponse {
|
|
39
|
-
/** Connected Wix Payments account. */
|
|
40
|
-
account?: WixPaymentsAccount;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type { ConnectWixPaymentsAccountResponse as C, WixPaymentsAccount as W, ConnectWixPaymentsAccountRequest as a };
|