@wix/auto_sdk_payments_wix-payments-account 1.0.28 → 1.0.29
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.js +7 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +10 -0
- package/build/cjs/index.typings.js +7 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +5 -0
- package/build/es/index.mjs +7 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +10 -0
- package/build/es/index.typings.mjs +7 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +5 -0
- package/build/internal/cjs/index.js +7 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +10 -0
- package/build/internal/cjs/index.typings.js +7 -2
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +5 -0
- package/build/internal/es/index.mjs +7 -2
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +10 -0
- package/build/internal/es/index.typings.mjs +7 -2
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +5 -0
- package/package.json +2 -2
package/build/cjs/index.js
CHANGED
|
@@ -132,7 +132,8 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
132
132
|
const { httpClient, sideEffects } = arguments[2];
|
|
133
133
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
134
134
|
account,
|
|
135
|
-
siteId: options?.siteId
|
|
135
|
+
siteId: options?.siteId,
|
|
136
|
+
userId: options?.userId
|
|
136
137
|
});
|
|
137
138
|
const reqOpts = connectWixPaymentsAccountBase44(
|
|
138
139
|
payload
|
|
@@ -147,7 +148,11 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
147
148
|
err,
|
|
148
149
|
{
|
|
149
150
|
spreadPathsToArguments: {},
|
|
150
|
-
explicitPathsToArguments: {
|
|
151
|
+
explicitPathsToArguments: {
|
|
152
|
+
account: "$[0]",
|
|
153
|
+
siteId: "$[1].siteId",
|
|
154
|
+
userId: "$[1].userId"
|
|
155
|
+
},
|
|
151
156
|
singleArgumentUnchanged: false
|
|
152
157
|
},
|
|
153
158
|
["account", "options"]
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.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","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts"],"sourcesContent":["export * from './src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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]', siteId: '$[1].siteId' },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountBase44ApplicationErrors,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as universalConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n >;\n}\n\nexport function connectWixPaymentsAccountBase44(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountBase44Signature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ) =>\n universalConnectWixPaymentsAccountBase44(\n account,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountBase44Signature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n >;\n}\n\nexport {\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n TermsOfServiceAcceptance,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import {\n connectWixPaymentsAccount as publicConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as publicConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\nexport const connectWixPaymentsAccountBase44: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccountBase44> &\n typeof publicConnectWixPaymentsAccountBase44\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccountBase44);\n\nexport {\n WixPaymentsAccount,\n TermsOfServiceAcceptance,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\nexport { ConnectWixPaymentsAccountBase44ApplicationErrors } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,uCAAAC;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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;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,kBA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;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,EACnB,CAAC;AAED,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,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,QAAQ,QAAQ,cAAc;AAAA,QACnE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEpQO,SAASE,2BACd,YACoC;AACpC,SAAO,CACL,YAMAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqCO,SAASC,iCACd,YAC0C;AAC1C,SAAO,CACL,SAKA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC9EA,IAAAC,uBAAiC;AAG1B,IAAMC,6BAGK,2DAAiBA,0BAA+B;AAC3D,IAAMC,mCAGK,2DAAiBA,gCAAqC;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","sdkTransformError","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44","import_rest_modules","connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
1
|
+
{"version":3,"sources":["../../index.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","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts"],"sourcesContent":["export * from './src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n userId: options?.userId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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: {\n account: '$[0]',\n siteId: '$[1].siteId',\n userId: '$[1].userId',\n },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountBase44ApplicationErrors,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as universalConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n >;\n}\n\nexport function connectWixPaymentsAccountBase44(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountBase44Signature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ) =>\n universalConnectWixPaymentsAccountBase44(\n account,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountBase44Signature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n >;\n}\n\nexport {\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n TermsOfServiceAcceptance,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import {\n connectWixPaymentsAccount as publicConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as publicConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\nexport const connectWixPaymentsAccountBase44: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccountBase44> &\n typeof publicConnectWixPaymentsAccountBase44\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccountBase44);\n\nexport {\n WixPaymentsAccount,\n TermsOfServiceAcceptance,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\nexport { ConnectWixPaymentsAccountBase44ApplicationErrors } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,uCAAAC;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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;AAoBO,SAAS,gCACd,SAC4B;AAC5B,WAAS,kCAAkC,EAAE,KAAK,GAAQ;AACxD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA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AA0B;AAAA,UACxB,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,QACV;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE9QO,SAASE,2BACd,YACoC;AACpC,SAAO,CACL,YAMAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqCO,SAASC,iCACd,YAC0C;AAC1C,SAAO,CACL,SAKA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC9EA,IAAAC,uBAAiC;AAG1B,IAAMC,6BAGK,2DAAiBA,0BAA+B;AAC3D,IAAMC,mCAGK,2DAAiBA,gCAAqC;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","sdkTransformError","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44","import_rest_modules","connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
@@ -75,6 +75,11 @@ interface ConnectWixPaymentsAccountBase44Request {
|
|
|
75
75
|
* @format GUID
|
|
76
76
|
*/
|
|
77
77
|
siteId?: string | null;
|
|
78
|
+
/**
|
|
79
|
+
* User id
|
|
80
|
+
* @format GUID
|
|
81
|
+
*/
|
|
82
|
+
userId?: string | null;
|
|
78
83
|
}
|
|
79
84
|
interface ConnectWixPaymentsAccountBase44Response {
|
|
80
85
|
/** Connected Wix Payments account. */
|
|
@@ -163,6 +168,11 @@ interface ConnectWixPaymentsAccountBase44Options {
|
|
|
163
168
|
* @format GUID
|
|
164
169
|
*/
|
|
165
170
|
siteId?: string | null;
|
|
171
|
+
/**
|
|
172
|
+
* User id
|
|
173
|
+
* @format GUID
|
|
174
|
+
*/
|
|
175
|
+
userId?: string | null;
|
|
166
176
|
}
|
|
167
177
|
|
|
168
178
|
export { type Base44Metadata, type ConnectWixPaymentsAccountBase44ApplicationErrors, type ConnectWixPaymentsAccountBase44Options, type ConnectWixPaymentsAccountBase44Request, type ConnectWixPaymentsAccountBase44Response, type ConnectWixPaymentsAccountRequest, type ConnectWixPaymentsAccountResponse, type TermsOfServiceAcceptance, type WixPaymentsAccount, connectWixPaymentsAccount, connectWixPaymentsAccountBase44 };
|
|
@@ -132,7 +132,8 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
132
132
|
const { httpClient, sideEffects } = arguments[2];
|
|
133
133
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
134
134
|
account,
|
|
135
|
-
siteId: options?.siteId
|
|
135
|
+
siteId: options?.siteId,
|
|
136
|
+
userId: options?.userId
|
|
136
137
|
});
|
|
137
138
|
const reqOpts = connectWixPaymentsAccountBase44(
|
|
138
139
|
payload
|
|
@@ -147,7 +148,11 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
147
148
|
err,
|
|
148
149
|
{
|
|
149
150
|
spreadPathsToArguments: {},
|
|
150
|
-
explicitPathsToArguments: {
|
|
151
|
+
explicitPathsToArguments: {
|
|
152
|
+
account: "$[0]",
|
|
153
|
+
siteId: "$[1].siteId",
|
|
154
|
+
userId: "$[1].userId"
|
|
155
|
+
},
|
|
151
156
|
singleArgumentUnchanged: false
|
|
152
157
|
},
|
|
153
158
|
["account", "options"]
|
|
@@ -1 +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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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]', siteId: '$[1].siteId' },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,uCAAAC;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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,C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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,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,QAAQ,QAAQ,cAAc;AAAA,QACnE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","sdkTransformError","connectWixPaymentsAccountBase44"]}
|
|
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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n userId: options?.userId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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: {\n account: '$[0]',\n siteId: '$[1].siteId',\n userId: '$[1].userId',\n },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixP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AA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","sdkTransformError","connectWixPaymentsAccountBase44"]}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -76,6 +76,11 @@ interface ConnectWixPaymentsAccountBase44Request {
|
|
|
76
76
|
* @format GUID
|
|
77
77
|
*/
|
|
78
78
|
siteId?: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* User id
|
|
81
|
+
* @format GUID
|
|
82
|
+
*/
|
|
83
|
+
userId?: string | null;
|
|
79
84
|
}
|
|
80
85
|
interface ConnectWixPaymentsAccountBase44Response {
|
|
81
86
|
/** Connected Wix Payments account. */
|
package/build/es/index.mjs
CHANGED
|
@@ -108,7 +108,8 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
108
108
|
const { httpClient, sideEffects } = arguments[2];
|
|
109
109
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
110
110
|
account,
|
|
111
|
-
siteId: options?.siteId
|
|
111
|
+
siteId: options?.siteId,
|
|
112
|
+
userId: options?.userId
|
|
112
113
|
});
|
|
113
114
|
const reqOpts = connectWixPaymentsAccountBase44(
|
|
114
115
|
payload
|
|
@@ -123,7 +124,11 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
123
124
|
err,
|
|
124
125
|
{
|
|
125
126
|
spreadPathsToArguments: {},
|
|
126
|
-
explicitPathsToArguments: {
|
|
127
|
+
explicitPathsToArguments: {
|
|
128
|
+
account: "$[0]",
|
|
129
|
+
siteId: "$[1].siteId",
|
|
130
|
+
userId: "$[1].userId"
|
|
131
|
+
},
|
|
127
132
|
singleArgumentUnchanged: false
|
|
128
133
|
},
|
|
129
134
|
["account", "options"]
|
package/build/es/index.mjs.map
CHANGED
|
@@ -1 +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","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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]', siteId: '$[1].siteId' },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountBase44ApplicationErrors,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as universalConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n >;\n}\n\nexport function connectWixPaymentsAccountBase44(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountBase44Signature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ) =>\n universalConnectWixPaymentsAccountBase44(\n account,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountBase44Signature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n >;\n}\n\nexport {\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n TermsOfServiceAcceptance,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import {\n connectWixPaymentsAccount as publicConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as publicConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\nexport const connectWixPaymentsAccountBase44: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccountBase44> &\n typeof publicConnectWixPaymentsAccountBase44\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccountBase44);\n\nexport {\n WixPaymentsAccount,\n TermsOfServiceAcceptance,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\nexport { ConnectWixPaymentsAccountBase44ApplicationErrors } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;AAoBO,SAAS,gCACd,SAC4B;AAC5B,WAAS,kCAAkC,EAAE,KAAK,GAAQ;AACxD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QA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ACnE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEpQO,SAASC,2BACd,YACoC;AACpC,SAAO,CACL,YAMAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqCO,SAASC,iCACd,YAC0C;AAC1C,SAAO,CACL,SAKA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC9EA,SAAS,wBAAwB;AAG1B,IAAMC,6BAGK,iCAAiBA,0BAA+B;AAC3D,IAAMC,mCAGK,iCAAiBA,gCAAqC;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
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","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n userId: options?.userId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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: {\n account: '$[0]',\n siteId: '$[1].siteId',\n userId: '$[1].userId',\n },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountBase44ApplicationErrors,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as universalConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n >;\n}\n\nexport function connectWixPaymentsAccountBase44(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountBase44Signature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ) =>\n universalConnectWixPaymentsAccountBase44(\n account,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountBase44Signature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n >;\n}\n\nexport {\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n TermsOfServiceAcceptance,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import {\n connectWixPaymentsAccount as publicConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as publicConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\nexport const connectWixPaymentsAccountBase44: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccountBase44> &\n typeof publicConnectWixPaymentsAccountBase44\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccountBase44);\n\nexport {\n WixPaymentsAccount,\n TermsOfServiceAcceptance,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\nexport { ConnectWixPaymentsAccountBase44ApplicationErrors } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,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WixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
@@ -75,6 +75,11 @@ interface ConnectWixPaymentsAccountBase44Request {
|
|
|
75
75
|
* @format GUID
|
|
76
76
|
*/
|
|
77
77
|
siteId?: string | null;
|
|
78
|
+
/**
|
|
79
|
+
* User id
|
|
80
|
+
* @format GUID
|
|
81
|
+
*/
|
|
82
|
+
userId?: string | null;
|
|
78
83
|
}
|
|
79
84
|
interface ConnectWixPaymentsAccountBase44Response {
|
|
80
85
|
/** Connected Wix Payments account. */
|
|
@@ -163,6 +168,11 @@ interface ConnectWixPaymentsAccountBase44Options {
|
|
|
163
168
|
* @format GUID
|
|
164
169
|
*/
|
|
165
170
|
siteId?: string | null;
|
|
171
|
+
/**
|
|
172
|
+
* User id
|
|
173
|
+
* @format GUID
|
|
174
|
+
*/
|
|
175
|
+
userId?: string | null;
|
|
166
176
|
}
|
|
167
177
|
|
|
168
178
|
export { type Base44Metadata, type ConnectWixPaymentsAccountBase44ApplicationErrors, type ConnectWixPaymentsAccountBase44Options, type ConnectWixPaymentsAccountBase44Request, type ConnectWixPaymentsAccountBase44Response, type ConnectWixPaymentsAccountRequest, type ConnectWixPaymentsAccountResponse, type TermsOfServiceAcceptance, type WixPaymentsAccount, connectWixPaymentsAccount, connectWixPaymentsAccountBase44 };
|
|
@@ -108,7 +108,8 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
108
108
|
const { httpClient, sideEffects } = arguments[2];
|
|
109
109
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
110
110
|
account,
|
|
111
|
-
siteId: options?.siteId
|
|
111
|
+
siteId: options?.siteId,
|
|
112
|
+
userId: options?.userId
|
|
112
113
|
});
|
|
113
114
|
const reqOpts = connectWixPaymentsAccountBase44(
|
|
114
115
|
payload
|
|
@@ -123,7 +124,11 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
123
124
|
err,
|
|
124
125
|
{
|
|
125
126
|
spreadPathsToArguments: {},
|
|
126
|
-
explicitPathsToArguments: {
|
|
127
|
+
explicitPathsToArguments: {
|
|
128
|
+
account: "$[0]",
|
|
129
|
+
siteId: "$[1].siteId",
|
|
130
|
+
userId: "$[1].userId"
|
|
131
|
+
},
|
|
127
132
|
singleArgumentUnchanged: false
|
|
128
133
|
},
|
|
129
134
|
["account", "options"]
|
|
@@ -1 +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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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]', siteId: '$[1].siteId' },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU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I;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;AA8BA,eAAsBC,iCACpB,SAKA,SAaA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,EACnB,CAAC;AAED,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,QAAQ,QAAQ,cAAc;AAAA,QACnE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n userId: options?.userId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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: {\n account: '$[0]',\n siteId: '$[1].siteId',\n userId: '$[1].userId',\n },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;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ACF;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;AAAA,UACxB,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,QACV;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
package/build/es/meta.d.mts
CHANGED
|
@@ -76,6 +76,11 @@ interface ConnectWixPaymentsAccountBase44Request {
|
|
|
76
76
|
* @format GUID
|
|
77
77
|
*/
|
|
78
78
|
siteId?: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* User id
|
|
81
|
+
* @format GUID
|
|
82
|
+
*/
|
|
83
|
+
userId?: string | null;
|
|
79
84
|
}
|
|
80
85
|
interface ConnectWixPaymentsAccountBase44Response {
|
|
81
86
|
/** Connected Wix Payments account. */
|
|
@@ -132,7 +132,8 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
132
132
|
const { httpClient, sideEffects } = arguments[2];
|
|
133
133
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
134
134
|
account,
|
|
135
|
-
siteId: options?.siteId
|
|
135
|
+
siteId: options?.siteId,
|
|
136
|
+
userId: options?.userId
|
|
136
137
|
});
|
|
137
138
|
const reqOpts = connectWixPaymentsAccountBase44(
|
|
138
139
|
payload
|
|
@@ -147,7 +148,11 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
147
148
|
err,
|
|
148
149
|
{
|
|
149
150
|
spreadPathsToArguments: {},
|
|
150
|
-
explicitPathsToArguments: {
|
|
151
|
+
explicitPathsToArguments: {
|
|
152
|
+
account: "$[0]",
|
|
153
|
+
siteId: "$[1].siteId",
|
|
154
|
+
userId: "$[1].userId"
|
|
155
|
+
},
|
|
151
156
|
singleArgumentUnchanged: false
|
|
152
157
|
},
|
|
153
158
|
["account", "options"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../index.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","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts"],"sourcesContent":["export * from './src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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]', siteId: '$[1].siteId' },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountBase44ApplicationErrors,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as universalConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n >;\n}\n\nexport function connectWixPaymentsAccountBase44(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountBase44Signature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ) =>\n universalConnectWixPaymentsAccountBase44(\n account,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountBase44Signature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n >;\n}\n\nexport {\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n TermsOfServiceAcceptance,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import {\n connectWixPaymentsAccount as publicConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as publicConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\nexport const connectWixPaymentsAccountBase44: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccountBase44> &\n typeof publicConnectWixPaymentsAccountBase44\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccountBase44);\n\nexport {\n WixPaymentsAccount,\n TermsOfServiceAcceptance,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\nexport { ConnectWixPaymentsAccountBase44ApplicationErrors } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,uCAAAC;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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;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,kBAAkB;AAAA,QAChB,wBAAwB;AA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Q,SAAS;AAAA,EACnB,CAAC;AAED,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,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,QAAQ,QAAQ,cAAc;AAAA,QACnE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEpQO,SAASE,2BACd,YACoC;AACpC,SAAO,CACL,YAMAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqCO,SAASC,iCACd,YAC0C;AAC1C,SAAO,CACL,SAKA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC9EA,IAAAC,uBAAiC;AAG1B,IAAMC,6BAGK,2DAAiBA,0BAA+B;AAC3D,IAAMC,mCAGK,2DAAiBA,gCAAqC;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","sdkTransformError","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44","import_rest_modules","connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
1
|
+
{"version":3,"sources":["../../../index.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","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts"],"sourcesContent":["export * from './src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n userId: options?.userId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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: {\n account: '$[0]',\n siteId: '$[1].siteId',\n userId: '$[1].userId',\n },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountBase44ApplicationErrors,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as universalConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n >;\n}\n\nexport function connectWixPaymentsAccountBase44(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountBase44Signature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ) =>\n universalConnectWixPaymentsAccountBase44(\n account,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountBase44Signature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n >;\n}\n\nexport {\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n TermsOfServiceAcceptance,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import {\n connectWixPaymentsAccount as publicConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as publicConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\nexport const connectWixPaymentsAccountBase44: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccountBase44> &\n typeof publicConnectWixPaymentsAccountBase44\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccountBase44);\n\nexport {\n WixPaymentsAccount,\n TermsOfServiceAcceptance,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\nexport { ConnectWixPaymentsAccountBase44ApplicationErrors } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,uCAAAC;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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;AAoBO,SAAS,gCACd,SAC4B;AAC5B,WAAS,kCAAkC,EAAE,KAAK,GAAQ;AACxD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,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S;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,QACV;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE9QO,SAASE,2BACd,YACoC;AACpC,SAAO,CACL,YAMAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqCO,SAASC,iCACd,YAC0C;AAC1C,SAAO,CACL,SAKA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC9EA,IAAAC,uBAAiC;AAG1B,IAAMC,6BAGK,2DAAiBA,0BAA+B;AAC3D,IAAMC,mCAGK,2DAAiBA,gCAAqC;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","sdkTransformError","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44","import_rest_modules","connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
@@ -75,6 +75,11 @@ interface ConnectWixPaymentsAccountBase44Request {
|
|
|
75
75
|
* @format GUID
|
|
76
76
|
*/
|
|
77
77
|
siteId?: string | null;
|
|
78
|
+
/**
|
|
79
|
+
* User id
|
|
80
|
+
* @format GUID
|
|
81
|
+
*/
|
|
82
|
+
userId?: string | null;
|
|
78
83
|
}
|
|
79
84
|
interface ConnectWixPaymentsAccountBase44Response {
|
|
80
85
|
/** Connected Wix Payments account. */
|
|
@@ -163,6 +168,11 @@ interface ConnectWixPaymentsAccountBase44Options {
|
|
|
163
168
|
* @format GUID
|
|
164
169
|
*/
|
|
165
170
|
siteId?: string | null;
|
|
171
|
+
/**
|
|
172
|
+
* User id
|
|
173
|
+
* @format GUID
|
|
174
|
+
*/
|
|
175
|
+
userId?: string | null;
|
|
166
176
|
}
|
|
167
177
|
|
|
168
178
|
export { type Base44Metadata, type ConnectWixPaymentsAccountBase44ApplicationErrors, type ConnectWixPaymentsAccountBase44Options, type ConnectWixPaymentsAccountBase44Request, type ConnectWixPaymentsAccountBase44Response, type ConnectWixPaymentsAccountRequest, type ConnectWixPaymentsAccountResponse, type TermsOfServiceAcceptance, type WixPaymentsAccount, connectWixPaymentsAccount, connectWixPaymentsAccountBase44 };
|
|
@@ -132,7 +132,8 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
132
132
|
const { httpClient, sideEffects } = arguments[2];
|
|
133
133
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
134
134
|
account,
|
|
135
|
-
siteId: options?.siteId
|
|
135
|
+
siteId: options?.siteId,
|
|
136
|
+
userId: options?.userId
|
|
136
137
|
});
|
|
137
138
|
const reqOpts = connectWixPaymentsAccountBase44(
|
|
138
139
|
payload
|
|
@@ -147,7 +148,11 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
147
148
|
err,
|
|
148
149
|
{
|
|
149
150
|
spreadPathsToArguments: {},
|
|
150
|
-
explicitPathsToArguments: {
|
|
151
|
+
explicitPathsToArguments: {
|
|
152
|
+
account: "$[0]",
|
|
153
|
+
siteId: "$[1].siteId",
|
|
154
|
+
userId: "$[1].userId"
|
|
155
|
+
},
|
|
151
156
|
singleArgumentUnchanged: false
|
|
152
157
|
},
|
|
153
158
|
["account", "options"]
|
|
@@ -1 +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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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]', siteId: '$[1].siteId' },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,uCAAAC;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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MA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AAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,QAAQ,QAAQ,cAAc;AAAA,QACnE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","sdkTransformError","connectWixPaymentsAccountBase44"]}
|
|
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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n userId: options?.userId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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: {\n account: '$[0]',\n siteId: '$[1].siteId',\n userId: '$[1].userId',\n },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\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B;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","sdkTransformError","connectWixPaymentsAccountBase44"]}
|
|
@@ -76,6 +76,11 @@ interface ConnectWixPaymentsAccountBase44Request {
|
|
|
76
76
|
* @format GUID
|
|
77
77
|
*/
|
|
78
78
|
siteId?: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* User id
|
|
81
|
+
* @format GUID
|
|
82
|
+
*/
|
|
83
|
+
userId?: string | null;
|
|
79
84
|
}
|
|
80
85
|
interface ConnectWixPaymentsAccountBase44Response {
|
|
81
86
|
/** Connected Wix Payments account. */
|
|
@@ -108,7 +108,8 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
108
108
|
const { httpClient, sideEffects } = arguments[2];
|
|
109
109
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
110
110
|
account,
|
|
111
|
-
siteId: options?.siteId
|
|
111
|
+
siteId: options?.siteId,
|
|
112
|
+
userId: options?.userId
|
|
112
113
|
});
|
|
113
114
|
const reqOpts = connectWixPaymentsAccountBase44(
|
|
114
115
|
payload
|
|
@@ -123,7 +124,11 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
123
124
|
err,
|
|
124
125
|
{
|
|
125
126
|
spreadPathsToArguments: {},
|
|
126
|
-
explicitPathsToArguments: {
|
|
127
|
+
explicitPathsToArguments: {
|
|
128
|
+
account: "$[0]",
|
|
129
|
+
siteId: "$[1].siteId",
|
|
130
|
+
userId: "$[1].userId"
|
|
131
|
+
},
|
|
127
132
|
singleArgumentUnchanged: false
|
|
128
133
|
},
|
|
129
134
|
["account", "options"]
|
|
@@ -1 +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","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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]', siteId: '$[1].siteId' },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountBase44ApplicationErrors,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as universalConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n >;\n}\n\nexport function connectWixPaymentsAccountBase44(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountBase44Signature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ) =>\n universalConnectWixPaymentsAccountBase44(\n account,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountBase44Signature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n >;\n}\n\nexport {\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n TermsOfServiceAcceptance,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import {\n connectWixPaymentsAccount as publicConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as publicConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\nexport const connectWixPaymentsAccountBase44: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccountBase44> &\n typeof publicConnectWixPaymentsAccountBase44\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccountBase44);\n\nexport {\n WixPaymentsAccount,\n TermsOfServiceAcceptance,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\nexport { ConnectWixPaymentsAccountBase44ApplicationErrors } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;AAoBO,SAAS,gCACd,SAC4B;AAC5B,WAAS,kCAAkC,EAAE,KAAK,GAAQ;AACxD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MA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AU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEpQO,SAASC,2BACd,YACoC;AACpC,SAAO,CACL,YAMAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqCO,SAASC,iCACd,YAC0C;AAC1C,SAAO,CACL,SAKA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC9EA,SAAS,wBAAwB;AAG1B,IAAMC,6BAGK,iCAAiBA,0BAA+B;AAC3D,IAAMC,mCAGK,iCAAiBA,gCAAqC;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
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","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n userId: options?.userId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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: {\n account: '$[0]',\n siteId: '$[1].siteId',\n userId: '$[1].userId',\n },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountBase44ApplicationErrors,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as universalConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n >;\n}\n\nexport function connectWixPaymentsAccountBase44(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountBase44Signature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ) =>\n universalConnectWixPaymentsAccountBase44(\n account,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountBase44Signature {\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 - Wix Payments account to connect to the site.\n */\n (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n ): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n >;\n}\n\nexport {\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n TermsOfServiceAcceptance,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import {\n connectWixPaymentsAccount as publicConnectWixPaymentsAccount,\n connectWixPaymentsAccountBase44 as publicConnectWixPaymentsAccountBase44,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\nexport const connectWixPaymentsAccountBase44: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccountBase44> &\n typeof publicConnectWixPaymentsAccountBase44\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccountBase44);\n\nexport {\n WixPaymentsAccount,\n TermsOfServiceAcceptance,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n ConnectWixPaymentsAccountBase44Request,\n ConnectWixPaymentsAccountBase44Response,\n Base44Metadata,\n ConnectWixPaymentsAccountBase44Options,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\nexport { ConnectWixPaymentsAccountBase44ApplicationErrors } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAA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AAAA,QAC5C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AA8BA,eAAsBC,iCACpB,SAKA,SAaA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,IACjB,QAAQ,SAAS;AAAA,EACnB,CAAC;AAED,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;AAAA,UACxB,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,QACV;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE9QO,SAASC,2BACd,YACoC;AACpC,SAAO,CACL,YAMAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqCO,SAASC,iCACd,YAC0C;AAC1C,SAAO,CACL,SAKA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC9EA,SAAS,wBAAwB;AAG1B,IAAMC,6BAGK,iCAAiBA,0BAA+B;AAC3D,IAAMC,mCAGK,iCAAiBA,gCAAqC;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44","connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
@@ -75,6 +75,11 @@ interface ConnectWixPaymentsAccountBase44Request {
|
|
|
75
75
|
* @format GUID
|
|
76
76
|
*/
|
|
77
77
|
siteId?: string | null;
|
|
78
|
+
/**
|
|
79
|
+
* User id
|
|
80
|
+
* @format GUID
|
|
81
|
+
*/
|
|
82
|
+
userId?: string | null;
|
|
78
83
|
}
|
|
79
84
|
interface ConnectWixPaymentsAccountBase44Response {
|
|
80
85
|
/** Connected Wix Payments account. */
|
|
@@ -163,6 +168,11 @@ interface ConnectWixPaymentsAccountBase44Options {
|
|
|
163
168
|
* @format GUID
|
|
164
169
|
*/
|
|
165
170
|
siteId?: string | null;
|
|
171
|
+
/**
|
|
172
|
+
* User id
|
|
173
|
+
* @format GUID
|
|
174
|
+
*/
|
|
175
|
+
userId?: string | null;
|
|
166
176
|
}
|
|
167
177
|
|
|
168
178
|
export { type Base44Metadata, type ConnectWixPaymentsAccountBase44ApplicationErrors, type ConnectWixPaymentsAccountBase44Options, type ConnectWixPaymentsAccountBase44Request, type ConnectWixPaymentsAccountBase44Response, type ConnectWixPaymentsAccountRequest, type ConnectWixPaymentsAccountResponse, type TermsOfServiceAcceptance, type WixPaymentsAccount, connectWixPaymentsAccount, connectWixPaymentsAccountBase44 };
|
|
@@ -108,7 +108,8 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
108
108
|
const { httpClient, sideEffects } = arguments[2];
|
|
109
109
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
110
110
|
account,
|
|
111
|
-
siteId: options?.siteId
|
|
111
|
+
siteId: options?.siteId,
|
|
112
|
+
userId: options?.userId
|
|
112
113
|
});
|
|
113
114
|
const reqOpts = connectWixPaymentsAccountBase44(
|
|
114
115
|
payload
|
|
@@ -123,7 +124,11 @@ async function connectWixPaymentsAccountBase442(account, options) {
|
|
|
123
124
|
err,
|
|
124
125
|
{
|
|
125
126
|
spreadPathsToArguments: {},
|
|
126
|
-
explicitPathsToArguments: {
|
|
127
|
+
explicitPathsToArguments: {
|
|
128
|
+
account: "$[0]",
|
|
129
|
+
siteId: "$[1].siteId",
|
|
130
|
+
userId: "$[1].userId"
|
|
131
|
+
},
|
|
127
132
|
singleArgumentUnchanged: false
|
|
128
133
|
},
|
|
129
134
|
["account", "options"]
|
|
@@ -1 +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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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]', siteId: '$[1].siteId' },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,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A,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;AA8BA,eAAsBC,iCACpB,SAKA,SAaA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,EACnB,CAAC;AAED,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,QAAQ,QAAQ,cAAc;AAAA,QACnE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
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 * @deprecated 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 * @replacedBy terms_of_service_acceptance\n * @targetRemovalDate 2026-07-31\n */\n tosAccepted?: boolean | null;\n termsOfServiceAcceptance?: TermsOfServiceAcceptance;\n /**\n * email of the Wix Payments account owner.\n * @format EMAIL\n */\n email?: string | 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 * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** @maxLength 50 */\n softDescriptor?: string | null;\n /** @format WEB_URL */\n businessUrl?: string | null;\n}\n\nexport interface TermsOfServiceAcceptance {\n /** @format IPV4 */\n ip?: string;\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\nexport interface ConnectWixPaymentsAccountBase44Request {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountBase44Response {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n base44Metadata?: Base44Metadata;\n}\n\nexport interface Base44Metadata {\n /** @format GUID */\n siteId?: string;\n /** @maxLength 500 */\n webhookPublicKey?: string;\n /** @maxLength 500 */\n appSecret?: string;\n /** @maxLength 500 */\n apiKey?: string;\n}\n\n/** @docsIgnore */\nexport type ConnectWixPaymentsAccountBase44ApplicationErrors = {\n code?: 'MISSING_TERMS_OF_SERVICE';\n description?: string;\n data?: Record<string, any>;\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 2\n >\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountResponse,\n `account.termsOfServiceAcceptance.ip`,\n 4\n >\n> {\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\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.email\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.termsOfServiceAcceptance\n * @permissionId PAYMENTS.CONNECT_PAYMENTS\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccountBase44\n */\nexport async function connectWixPaymentsAccountBase44(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `email` | `firstName` | `lastName` | `termsOfServiceAcceptance`,\n 2\n >,\n options?: ConnectWixPaymentsAccountBase44Options\n): Promise<\n NonNullablePaths<\n ConnectWixPaymentsAccountBase44Response,\n | `account.termsOfServiceAcceptance.ip`\n | `base44Metadata.siteId`\n | `base44Metadata.webhookPublicKey`\n | `base44Metadata.appSecret`\n | `base44Metadata.apiKey`,\n 4\n > & {\n __applicationErrorsType?: ConnectWixPaymentsAccountBase44ApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n account: account,\n siteId: options?.siteId,\n userId: options?.userId,\n });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccountBase44(\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: {\n account: '$[0]',\n siteId: '$[1].siteId',\n userId: '$[1].userId',\n },\n singleArgumentUnchanged: false,\n },\n ['account', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConnectWixPaymentsAccountBase44Options {\n /**\n * MetaSite id\n * @format GUID\n */\n siteId?: string | null;\n /**\n * User id\n * @format GUID\n */\n userId?: string | null;\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 '*.dev.wix-code.com': [\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\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 migrationOptions: {\n optInTransformResponse: true,\n },\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\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 connectWixPaymentsAccountBase44(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccountBase44({ 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.ConnectWixPaymentsAccountBase44',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect-base44',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccountBase44;\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,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA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AAO;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;AAAA,UACxB,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,QACV;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["connectWixPaymentsAccount","connectWixPaymentsAccountBase44"]}
|
|
@@ -76,6 +76,11 @@ interface ConnectWixPaymentsAccountBase44Request {
|
|
|
76
76
|
* @format GUID
|
|
77
77
|
*/
|
|
78
78
|
siteId?: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* User id
|
|
81
|
+
* @format GUID
|
|
82
|
+
*/
|
|
83
|
+
userId?: string | null;
|
|
79
84
|
}
|
|
80
85
|
interface ConnectWixPaymentsAccountBase44Response {
|
|
81
86
|
/** Connected Wix Payments account. */
|
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.29",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"fqdn": "wix.payments.mcp.v1.wix_payments_account"
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
"falconPackageHash": "
|
|
53
|
+
"falconPackageHash": "4299ca33c55aca84d52a6a47f3ac7d64616219380e65a000ed2573cb"
|
|
54
54
|
}
|