@monei-js/node-sdk
Version:
Node.js SDK for MONEI Digital Payment Gateway
1 lines • 329 kB
Source Map (JSON)
{"version":3,"file":"index.cjs","sources":["../src/base.ts","../src/common.ts","../src/api/apple-pay-domain-api.ts","../src/api/bizum-api.ts","../src/api/payment-methods-api.ts","../src/api/payments-api.ts","../src/api/subscriptions-api.ts","../src/configuration.ts","../src/model/payment-cancellation-reason.ts","../src/model/payment-last-refund-reason.ts","../src/model/payment-message-channel.ts","../src/model/payment-message-language.ts","../src/model/payment-next-action.ts","../src/model/payment-payment-method.ts","../src/model/payment-payment-method-card.ts","../src/model/payment-payment-method-klarna.ts","../src/model/payment-refund-reason.ts","../src/model/payment-sequence.ts","../src/model/payment-status.ts","../src/model/payment-transaction-type.ts","../src/model/send-subscription-link-request.ts","../src/model/send-subscription-status-request.ts","../src/model/subscription-interval.ts","../src/model/subscription-payment-method.ts","../src/model/subscription-payment-method-card.ts","../src/model/subscription-retry-schedule-inner.ts","../src/model/subscription-status.ts","../index.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n/**\n * MONEI API v1\n * The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code.\n *\n * The version of the OpenAPI document: 1.7.3\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport type {Configuration} from './configuration';\n// Some imports not used depending on template conditions\n// @ts-ignore\nimport type {AxiosPromise, AxiosInstance, RawAxiosRequestConfig} from './axios';\nimport globalAxios from 'axios';\n\nexport const BASE_PATH = 'https://api.monei.com/v1'.replace(/\\/+$/, '');\n\n/**\n *\n * @export\n */\nexport const COLLECTION_FORMATS = {\n csv: ',',\n ssv: ' ',\n tsv: '\\t',\n pipes: '|'\n};\n\n/**\n *\n * @export\n * @interface RequestArgs\n */\nexport interface RequestArgs {\n url: string;\n options: RawAxiosRequestConfig;\n}\n\n/**\n *\n * @export\n * @class BaseAPI\n */\nexport class BaseAPI {\n protected configuration: Configuration | undefined;\n\n constructor(\n configuration?: Configuration,\n protected basePath: string = BASE_PATH,\n protected axios: AxiosInstance = globalAxios\n ) {\n if (configuration) {\n this.configuration = configuration;\n this.basePath = configuration.basePath ?? basePath;\n }\n }\n}\n\n/**\n *\n * @export\n * @class RequiredError\n * @extends {Error}\n */\nexport class RequiredError extends Error {\n constructor(\n public field: string,\n msg?: string\n ) {\n super(msg);\n this.name = 'RequiredError';\n }\n}\n\ninterface ServerMap {\n [key: string]: {\n url: string;\n description: string;\n }[];\n}\n\n/**\n *\n * @export\n */\nexport const operationServerMap: ServerMap = {};\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * MONEI API v1\n * The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code.\n *\n * The version of the OpenAPI document: 1.7.3\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport type {Configuration} from './configuration';\nimport type {RequestArgs} from './base';\nimport type {AxiosInstance, AxiosResponse} from 'axios';\nimport {RequiredError} from './base';\n\n/**\n *\n * @export\n */\nexport const DUMMY_BASE_URL = 'https://example.com';\n\n/**\n *\n * @throws {RequiredError}\n * @export\n */\nexport const assertParamExists = function (\n functionName: string,\n paramName: string,\n paramValue: unknown\n) {\n if (paramValue === null || paramValue === undefined) {\n throw new RequiredError(\n paramName,\n `Required parameter ${paramName} was null or undefined when calling ${functionName}.`\n );\n }\n};\n\n/**\n *\n * @export\n */\nexport const setApiKeyToObject = async function (\n object: any,\n keyParamName: string,\n configuration?: Configuration\n) {\n if (configuration && configuration.apiKey) {\n const localVarApiKeyValue =\n typeof configuration.apiKey === 'function'\n ? await configuration.apiKey(keyParamName)\n : await configuration.apiKey;\n object[keyParamName] = localVarApiKeyValue;\n }\n};\n\n/**\n *\n * @export\n */\nexport const setBasicAuthToObject = function (object: any, configuration?: Configuration) {\n if (configuration && (configuration.username || configuration.password)) {\n object['auth'] = {username: configuration.username, password: configuration.password};\n }\n};\n\n/**\n *\n * @export\n */\nexport const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {\n if (configuration && configuration.accessToken) {\n const accessToken =\n typeof configuration.accessToken === 'function'\n ? await configuration.accessToken()\n : await configuration.accessToken;\n object['Authorization'] = 'Bearer ' + accessToken;\n }\n};\n\n/**\n *\n * @export\n */\nexport const setOAuthToObject = async function (\n object: any,\n name: string,\n scopes: string[],\n configuration?: Configuration\n) {\n if (configuration && configuration.accessToken) {\n const localVarAccessTokenValue =\n typeof configuration.accessToken === 'function'\n ? await configuration.accessToken(name, scopes)\n : await configuration.accessToken;\n object['Authorization'] = 'Bearer ' + localVarAccessTokenValue;\n }\n};\n\nfunction setFlattenedQueryParams(\n urlSearchParams: URLSearchParams,\n parameter: any,\n key: string = ''\n): void {\n if (parameter == null) return;\n if (typeof parameter === 'object') {\n if (Array.isArray(parameter)) {\n (parameter as any[]).forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));\n } else {\n Object.keys(parameter).forEach((currentKey) =>\n setFlattenedQueryParams(\n urlSearchParams,\n parameter[currentKey],\n `${key}${key !== '' ? '.' : ''}${currentKey}`\n )\n );\n }\n } else {\n if (urlSearchParams.has(key)) {\n urlSearchParams.append(key, parameter);\n } else {\n urlSearchParams.set(key, parameter);\n }\n }\n}\n\n/**\n *\n * @export\n */\nexport const setSearchParams = function (url: URL, ...objects: any[]) {\n const searchParams = new URLSearchParams(url.search);\n setFlattenedQueryParams(searchParams, objects);\n url.search = searchParams.toString();\n};\n\n/**\n *\n * @export\n */\nexport const serializeDataIfNeeded = function (\n value: any,\n requestOptions: any,\n configuration?: Configuration\n) {\n const nonString = typeof value !== 'string';\n const needsSerialization =\n nonString && configuration && configuration.isJsonMime\n ? configuration.isJsonMime(requestOptions.headers['Content-Type'])\n : nonString;\n return needsSerialization ? JSON.stringify(value !== undefined ? value : {}) : value || '';\n};\n\n/**\n *\n * @export\n */\nexport const toPathString = function (url: URL) {\n return url.pathname + url.search + url.hash;\n};\n\n/**\n *\n * @export\n */\nexport const createRequestFunction = function (\n axiosArgs: RequestArgs,\n globalAxios: AxiosInstance,\n BASE_PATH: string,\n configuration?: Configuration\n) {\n return <T = unknown, R = AxiosResponse<T>>(\n axios: AxiosInstance = globalAxios,\n basePath: string = BASE_PATH\n ) => {\n const axiosRequestArgs = {\n ...axiosArgs.options,\n url: (axios.defaults.baseURL ? '' : (configuration?.basePath ?? basePath)) + axiosArgs.url\n };\n return axios.request<T, R>(axiosRequestArgs);\n };\n};\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * MONEI API v1\n * The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code.\n *\n * The version of the OpenAPI document: 1.7.3\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport type {Configuration} from '../configuration';\nimport type {AxiosPromise, AxiosInstance, RawAxiosRequestConfig} from '../axios';\nimport globalAxios from 'axios';\n// Some imports not used depending on template conditions\n// @ts-ignore\nimport {\n DUMMY_BASE_URL,\n assertParamExists,\n setApiKeyToObject,\n setBasicAuthToObject,\n setBearerAuthToObject,\n setOAuthToObject,\n setSearchParams,\n serializeDataIfNeeded,\n toPathString,\n createRequestFunction\n} from '../common';\n// @ts-ignore\nimport {\n BASE_PATH,\n COLLECTION_FORMATS,\n type RequestArgs,\n BaseAPI,\n RequiredError,\n operationServerMap\n} from '../base';\n// @ts-ignore\nimport type {ApplePayDomainRegister200Response} from '../model';\n// @ts-ignore\nimport type {BadRequestError} from '../model';\n// @ts-ignore\nimport type {InternalServerError} from '../model';\n// @ts-ignore\nimport type {NotFoundError} from '../model';\n// @ts-ignore\nimport type {RegisterApplePayDomainRequest} from '../model';\n// @ts-ignore\nimport type {ServiceUnavailableError} from '../model';\n// @ts-ignore\nimport type {UnauthorizedError} from '../model';\n// @ts-ignore\nimport type {UnprocessableEntityError} from '../model';\n/**\n * ApplePayDomainApi - axios parameter creator\n * @export\n */\nexport const ApplePayDomainApiAxiosParamCreator = function (configuration?: Configuration) {\n return {\n /**\n * Registers a domain with Apple Pay. This endpoint allows you to register your website domain with Apple Pay, which is required before you can accept Apple Pay payments on your website. The domain must be accessible via HTTPS and have a valid SSL certificate. Before registering, you must download this [domain association file](https://assets.monei.com/apple-pay/apple-developer-merchantid-domain-association/) and host it at `/.well-known/apple-developer-merchantid-domain-association` on your site. For example, if you\\'re registering `example.com`, make that file available at `https://example.com/.well-known/apple-developer-merchantid-domain-association`. After registration, Apple will verify your domain. Once verified, you can display Apple Pay buttons and process Apple Pay payments on your website.\n * @summary Register Domain\n * @param {RegisterApplePayDomainRequest} registerApplePayDomainRequest\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n register: async (\n registerApplePayDomainRequest: RegisterApplePayDomainRequest,\n options: RawAxiosRequestConfig = {}\n ): Promise<RequestArgs> => {\n // verify required parameter 'registerApplePayDomainRequest' is not null or undefined\n assertParamExists('register', 'registerApplePayDomainRequest', registerApplePayDomainRequest);\n const localVarPath = `/apple-pay/domains`;\n // use dummy base URL string because the URL constructor only accepts absolute URLs.\n const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);\n let baseOptions;\n if (configuration) {\n baseOptions = configuration.baseOptions;\n }\n\n const localVarRequestOptions = {method: 'POST', ...baseOptions, ...options};\n const localVarHeaderParameter = {} as any;\n const localVarQueryParameter = {} as any;\n\n // authentication APIKey required\n await setApiKeyToObject(localVarHeaderParameter, 'Authorization', configuration);\n\n localVarHeaderParameter['Content-Type'] = 'application/json';\n\n setSearchParams(localVarUrlObj, localVarQueryParameter);\n let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};\n localVarRequestOptions.headers = {\n ...localVarHeaderParameter,\n ...headersFromBaseOptions,\n ...options.headers\n };\n localVarRequestOptions.data = serializeDataIfNeeded(\n registerApplePayDomainRequest,\n localVarRequestOptions,\n configuration\n );\n\n return {\n url: toPathString(localVarUrlObj),\n options: localVarRequestOptions\n };\n }\n };\n};\n\n/**\n * ApplePayDomainApi - functional programming interface\n * @export\n */\nexport const ApplePayDomainApiFp = function (configuration?: Configuration) {\n const localVarAxiosParamCreator = ApplePayDomainApiAxiosParamCreator(configuration);\n return {\n /**\n * Registers a domain with Apple Pay. This endpoint allows you to register your website domain with Apple Pay, which is required before you can accept Apple Pay payments on your website. The domain must be accessible via HTTPS and have a valid SSL certificate. Before registering, you must download this [domain association file](https://assets.monei.com/apple-pay/apple-developer-merchantid-domain-association/) and host it at `/.well-known/apple-developer-merchantid-domain-association` on your site. For example, if you\\'re registering `example.com`, make that file available at `https://example.com/.well-known/apple-developer-merchantid-domain-association`. After registration, Apple will verify your domain. Once verified, you can display Apple Pay buttons and process Apple Pay payments on your website.\n * @summary Register Domain\n * @param {RegisterApplePayDomainRequest} registerApplePayDomainRequest\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n async register(\n registerApplePayDomainRequest: RegisterApplePayDomainRequest,\n options?: RawAxiosRequestConfig\n ): Promise<\n (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplePayDomainRegister200Response>\n > {\n const localVarAxiosArgs = await localVarAxiosParamCreator.register(\n registerApplePayDomainRequest,\n options\n );\n const localVarOperationServerIndex = configuration?.serverIndex ?? 0;\n const localVarOperationServerBasePath =\n operationServerMap['ApplePayDomainApi.register']?.[localVarOperationServerIndex]?.url;\n return (axios, basePath) =>\n createRequestFunction(\n localVarAxiosArgs,\n globalAxios,\n BASE_PATH,\n configuration\n )(axios, localVarOperationServerBasePath || basePath);\n }\n };\n};\n\n/**\n * ApplePayDomainApi - factory interface\n * @export\n */\nexport const ApplePayDomainApiFactory = function (\n configuration?: Configuration,\n basePath?: string,\n axios?: AxiosInstance\n) {\n const localVarFp = ApplePayDomainApiFp(configuration);\n return {\n /**\n * Registers a domain with Apple Pay. This endpoint allows you to register your website domain with Apple Pay, which is required before you can accept Apple Pay payments on your website. The domain must be accessible via HTTPS and have a valid SSL certificate. Before registering, you must download this [domain association file](https://assets.monei.com/apple-pay/apple-developer-merchantid-domain-association/) and host it at `/.well-known/apple-developer-merchantid-domain-association` on your site. For example, if you\\'re registering `example.com`, make that file available at `https://example.com/.well-known/apple-developer-merchantid-domain-association`. After registration, Apple will verify your domain. Once verified, you can display Apple Pay buttons and process Apple Pay payments on your website.\n * @summary Register Domain\n * @param {RegisterApplePayDomainRequest} registerApplePayDomainRequest\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n register(\n registerApplePayDomainRequest: RegisterApplePayDomainRequest,\n options?: RawAxiosRequestConfig\n ): AxiosPromise<ApplePayDomainRegister200Response> {\n return localVarFp\n .register(registerApplePayDomainRequest, options)\n .then((request) => request(axios, basePath));\n }\n };\n};\n\n/**\n * ApplePayDomainApi - object-oriented interface\n * @export\n * @class ApplePayDomainApi\n * @extends {BaseAPI}\n */\nexport class ApplePayDomainApi extends BaseAPI {\n /**\n * Registers a domain with Apple Pay. This endpoint allows you to register your website domain with Apple Pay, which is required before you can accept Apple Pay payments on your website. The domain must be accessible via HTTPS and have a valid SSL certificate. Before registering, you must download this [domain association file](https://assets.monei.com/apple-pay/apple-developer-merchantid-domain-association/) and host it at `/.well-known/apple-developer-merchantid-domain-association` on your site. For example, if you\\'re registering `example.com`, make that file available at `https://example.com/.well-known/apple-developer-merchantid-domain-association`. After registration, Apple will verify your domain. Once verified, you can display Apple Pay buttons and process Apple Pay payments on your website.\n * @summary Register Domain\n * @param {RegisterApplePayDomainRequest} registerApplePayDomainRequest\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof ApplePayDomainApi\n */\n public register(\n registerApplePayDomainRequest: RegisterApplePayDomainRequest,\n options?: RawAxiosRequestConfig\n ) {\n return ApplePayDomainApiFp(this.configuration)\n .register(registerApplePayDomainRequest, options)\n .then((request) => request(this.axios, this.basePath));\n }\n}\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * MONEI API v1\n * The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code.\n *\n * The version of the OpenAPI document: 1.7.3\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport type {Configuration} from '../configuration';\nimport type {AxiosPromise, AxiosInstance, RawAxiosRequestConfig} from '../axios';\nimport globalAxios from 'axios';\n// Some imports not used depending on template conditions\n// @ts-ignore\nimport {\n DUMMY_BASE_URL,\n assertParamExists,\n setApiKeyToObject,\n setBasicAuthToObject,\n setBearerAuthToObject,\n setOAuthToObject,\n setSearchParams,\n serializeDataIfNeeded,\n toPathString,\n createRequestFunction\n} from '../common';\n// @ts-ignore\nimport {\n BASE_PATH,\n COLLECTION_FORMATS,\n type RequestArgs,\n BaseAPI,\n RequiredError,\n operationServerMap\n} from '../base';\n// @ts-ignore\nimport type {BadRequestError} from '../model';\n// @ts-ignore\nimport type {BizumValidatePhone200Response} from '../model';\n// @ts-ignore\nimport type {InternalServerError} from '../model';\n// @ts-ignore\nimport type {NotFoundError} from '../model';\n// @ts-ignore\nimport type {ServiceUnavailableError} from '../model';\n// @ts-ignore\nimport type {UnauthorizedError} from '../model';\n// @ts-ignore\nimport type {UnprocessableEntityError} from '../model';\n// @ts-ignore\nimport type {ValidateBizumPhoneRequest} from '../model';\n/**\n * BizumApi - axios parameter creator\n * @export\n */\nexport const BizumApiAxiosParamCreator = function (configuration?: Configuration) {\n return {\n /**\n * Validates if a phone number is registered with Bizum. Use this endpoint to check if a customer\\'s phone number can be used for Bizum payments before attempting to process a payment. This helps provide a better user experience by preventing failed payment attempts for non-registered numbers. The response will indicate whether the phone number is valid for Bizum payments.\n * @summary Validate Phone\n * @param {ValidateBizumPhoneRequest} validateBizumPhoneRequest\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n validatePhone: async (\n validateBizumPhoneRequest: ValidateBizumPhoneRequest,\n options: RawAxiosRequestConfig = {}\n ): Promise<RequestArgs> => {\n // verify required parameter 'validateBizumPhoneRequest' is not null or undefined\n assertParamExists('validatePhone', 'validateBizumPhoneRequest', validateBizumPhoneRequest);\n const localVarPath = `/bizum/validate-phone`;\n // use dummy base URL string because the URL constructor only accepts absolute URLs.\n const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);\n let baseOptions;\n if (configuration) {\n baseOptions = configuration.baseOptions;\n }\n\n const localVarRequestOptions = {method: 'POST', ...baseOptions, ...options};\n const localVarHeaderParameter = {} as any;\n const localVarQueryParameter = {} as any;\n\n // authentication APIKey required\n await setApiKeyToObject(localVarHeaderParameter, 'Authorization', configuration);\n\n localVarHeaderParameter['Content-Type'] = 'application/json';\n\n setSearchParams(localVarUrlObj, localVarQueryParameter);\n let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};\n localVarRequestOptions.headers = {\n ...localVarHeaderParameter,\n ...headersFromBaseOptions,\n ...options.headers\n };\n localVarRequestOptions.data = serializeDataIfNeeded(\n validateBizumPhoneRequest,\n localVarRequestOptions,\n configuration\n );\n\n return {\n url: toPathString(localVarUrlObj),\n options: localVarRequestOptions\n };\n }\n };\n};\n\n/**\n * BizumApi - functional programming interface\n * @export\n */\nexport const BizumApiFp = function (configuration?: Configuration) {\n const localVarAxiosParamCreator = BizumApiAxiosParamCreator(configuration);\n return {\n /**\n * Validates if a phone number is registered with Bizum. Use this endpoint to check if a customer\\'s phone number can be used for Bizum payments before attempting to process a payment. This helps provide a better user experience by preventing failed payment attempts for non-registered numbers. The response will indicate whether the phone number is valid for Bizum payments.\n * @summary Validate Phone\n * @param {ValidateBizumPhoneRequest} validateBizumPhoneRequest\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n async validatePhone(\n validateBizumPhoneRequest: ValidateBizumPhoneRequest,\n options?: RawAxiosRequestConfig\n ): Promise<\n (axios?: AxiosInstance, basePath?: string) => AxiosPromise<BizumValidatePhone200Response>\n > {\n const localVarAxiosArgs = await localVarAxiosParamCreator.validatePhone(\n validateBizumPhoneRequest,\n options\n );\n const localVarOperationServerIndex = configuration?.serverIndex ?? 0;\n const localVarOperationServerBasePath =\n operationServerMap['BizumApi.validatePhone']?.[localVarOperationServerIndex]?.url;\n return (axios, basePath) =>\n createRequestFunction(\n localVarAxiosArgs,\n globalAxios,\n BASE_PATH,\n configuration\n )(axios, localVarOperationServerBasePath || basePath);\n }\n };\n};\n\n/**\n * BizumApi - factory interface\n * @export\n */\nexport const BizumApiFactory = function (\n configuration?: Configuration,\n basePath?: string,\n axios?: AxiosInstance\n) {\n const localVarFp = BizumApiFp(configuration);\n return {\n /**\n * Validates if a phone number is registered with Bizum. Use this endpoint to check if a customer\\'s phone number can be used for Bizum payments before attempting to process a payment. This helps provide a better user experience by preventing failed payment attempts for non-registered numbers. The response will indicate whether the phone number is valid for Bizum payments.\n * @summary Validate Phone\n * @param {ValidateBizumPhoneRequest} validateBizumPhoneRequest\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n validatePhone(\n validateBizumPhoneRequest: ValidateBizumPhoneRequest,\n options?: RawAxiosRequestConfig\n ): AxiosPromise<BizumValidatePhone200Response> {\n return localVarFp\n .validatePhone(validateBizumPhoneRequest, options)\n .then((request) => request(axios, basePath));\n }\n };\n};\n\n/**\n * BizumApi - object-oriented interface\n * @export\n * @class BizumApi\n * @extends {BaseAPI}\n */\nexport class BizumApi extends BaseAPI {\n /**\n * Validates if a phone number is registered with Bizum. Use this endpoint to check if a customer\\'s phone number can be used for Bizum payments before attempting to process a payment. This helps provide a better user experience by preventing failed payment attempts for non-registered numbers. The response will indicate whether the phone number is valid for Bizum payments.\n * @summary Validate Phone\n * @param {ValidateBizumPhoneRequest} validateBizumPhoneRequest\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof BizumApi\n */\n public validatePhone(\n validateBizumPhoneRequest: ValidateBizumPhoneRequest,\n options?: RawAxiosRequestConfig\n ) {\n return BizumApiFp(this.configuration)\n .validatePhone(validateBizumPhoneRequest, options)\n .then((request) => request(this.axios, this.basePath));\n }\n}\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * MONEI API v1\n * The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code.\n *\n * The version of the OpenAPI document: 1.7.3\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport type {Configuration} from '../configuration';\nimport type {AxiosPromise, AxiosInstance, RawAxiosRequestConfig} from '../axios';\nimport globalAxios from 'axios';\n// Some imports not used depending on template conditions\n// @ts-ignore\nimport {\n DUMMY_BASE_URL,\n assertParamExists,\n setApiKeyToObject,\n setBasicAuthToObject,\n setBearerAuthToObject,\n setOAuthToObject,\n setSearchParams,\n serializeDataIfNeeded,\n toPathString,\n createRequestFunction\n} from '../common';\n// @ts-ignore\nimport {\n BASE_PATH,\n COLLECTION_FORMATS,\n type RequestArgs,\n BaseAPI,\n RequiredError,\n operationServerMap\n} from '../base';\n// @ts-ignore\nimport type {BadRequestError} from '../model';\n// @ts-ignore\nimport type {InternalServerError} from '../model';\n// @ts-ignore\nimport type {NotFoundError} from '../model';\n// @ts-ignore\nimport type {PaymentMethods} from '../model';\n// @ts-ignore\nimport type {ServiceUnavailableError} from '../model';\n// @ts-ignore\nimport type {UnauthorizedError} from '../model';\n// @ts-ignore\nimport type {UnprocessableEntityError} from '../model';\n/**\n * PaymentMethodsApi - axios parameter creator\n * @export\n */\nexport const PaymentMethodsApiAxiosParamCreator = function (configuration?: Configuration) {\n return {\n /**\n * Retrieve available payment methods for an account or a specific payment. You can provide either an `accountId` or a `paymentId` as a query parameter to get the available payment methods. When providing a `paymentId`, the response will include additional payment-specific information such as amount and currency. This is useful when you want to show payment options that are specifically available for a particular transaction. When providing an `accountId`, the response will include all payment methods available for that account based on the merchant\\'s configuration and supported payment methods.\n * @summary Get Payment Methods\n * @param {string} [accountId] The ID of the account to get payment methods for\n * @param {string} [paymentId] The ID of the payment to get payment methods for\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n get: async (\n accountId?: string,\n paymentId?: string,\n options: RawAxiosRequestConfig = {}\n ): Promise<RequestArgs> => {\n const localVarPath = `/payment-methods`;\n // use dummy base URL string because the URL constructor only accepts absolute URLs.\n const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);\n let baseOptions;\n if (configuration) {\n baseOptions = configuration.baseOptions;\n }\n\n const localVarRequestOptions = {method: 'GET', ...baseOptions, ...options};\n const localVarHeaderParameter = {} as any;\n const localVarQueryParameter = {} as any;\n\n // authentication APIKey required\n await setApiKeyToObject(localVarHeaderParameter, 'Authorization', configuration);\n\n if (accountId !== undefined) {\n localVarQueryParameter['accountId'] = accountId;\n }\n\n if (paymentId !== undefined) {\n localVarQueryParameter['paymentId'] = paymentId;\n }\n\n setSearchParams(localVarUrlObj, localVarQueryParameter);\n let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};\n localVarRequestOptions.headers = {\n ...localVarHeaderParameter,\n ...headersFromBaseOptions,\n ...options.headers\n };\n\n return {\n url: toPathString(localVarUrlObj),\n options: localVarRequestOptions\n };\n }\n };\n};\n\n/**\n * PaymentMethodsApi - functional programming interface\n * @export\n */\nexport const PaymentMethodsApiFp = function (configuration?: Configuration) {\n const localVarAxiosParamCreator = PaymentMethodsApiAxiosParamCreator(configuration);\n return {\n /**\n * Retrieve available payment methods for an account or a specific payment. You can provide either an `accountId` or a `paymentId` as a query parameter to get the available payment methods. When providing a `paymentId`, the response will include additional payment-specific information such as amount and currency. This is useful when you want to show payment options that are specifically available for a particular transaction. When providing an `accountId`, the response will include all payment methods available for that account based on the merchant\\'s configuration and supported payment methods.\n * @summary Get Payment Methods\n * @param {string} [accountId] The ID of the account to get payment methods for\n * @param {string} [paymentId] The ID of the payment to get payment methods for\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n async get(\n accountId?: string,\n paymentId?: string,\n options?: RawAxiosRequestConfig\n ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaymentMethods>> {\n const localVarAxiosArgs = await localVarAxiosParamCreator.get(accountId, paymentId, options);\n const localVarOperationServerIndex = configuration?.serverIndex ?? 0;\n const localVarOperationServerBasePath =\n operationServerMap['PaymentMethodsApi.get']?.[localVarOperationServerIndex]?.url;\n return (axios, basePath) =>\n createRequestFunction(\n localVarAxiosArgs,\n globalAxios,\n BASE_PATH,\n configuration\n )(axios, localVarOperationServerBasePath || basePath);\n }\n };\n};\n\n/**\n * PaymentMethodsApi - factory interface\n * @export\n */\nexport const PaymentMethodsApiFactory = function (\n configuration?: Configuration,\n basePath?: string,\n axios?: AxiosInstance\n) {\n const localVarFp = PaymentMethodsApiFp(configuration);\n return {\n /**\n * Retrieve available payment methods for an account or a specific payment. You can provide either an `accountId` or a `paymentId` as a query parameter to get the available payment methods. When providing a `paymentId`, the response will include additional payment-specific information such as amount and currency. This is useful when you want to show payment options that are specifically available for a particular transaction. When providing an `accountId`, the response will include all payment methods available for that account based on the merchant\\'s configuration and supported payment methods.\n * @summary Get Payment Methods\n * @param {string} [accountId] The ID of the account to get payment methods for\n * @param {string} [paymentId] The ID of the payment to get payment methods for\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n get(\n accountId?: string,\n paymentId?: string,\n options?: RawAxiosRequestConfig\n ): AxiosPromise<PaymentMethods> {\n return localVarFp\n .get(accountId, paymentId, options)\n .then((request) => request(axios, basePath));\n }\n };\n};\n\n/**\n * PaymentMethodsApi - object-oriented interface\n * @export\n * @class PaymentMethodsApi\n * @extends {BaseAPI}\n */\nexport class PaymentMethodsApi extends BaseAPI {\n /**\n * Retrieve available payment methods for an account or a specific payment. You can provide either an `accountId` or a `paymentId` as a query parameter to get the available payment methods. When providing a `paymentId`, the response will include additional payment-specific information such as amount and currency. This is useful when you want to show payment options that are specifically available for a particular transaction. When providing an `accountId`, the response will include all payment methods available for that account based on the merchant\\'s configuration and supported payment methods.\n * @summary Get Payment Methods\n * @param {string} [accountId] The ID of the account to get payment methods for\n * @param {string} [paymentId] The ID of the payment to get payment methods for\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof PaymentMethodsApi\n */\n public get(accountId?: string, paymentId?: string, options?: RawAxiosRequestConfig) {\n return PaymentMethodsApiFp(this.configuration)\n .get(accountId, paymentId, options)\n .then((request) => request(this.axios, this.basePath));\n }\n}\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * MONEI API v1\n * The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code.\n *\n * The version of the OpenAPI document: 1.7.3\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport type {Configuration} from '../configuration';\nimport type {AxiosPromise, AxiosInstance, RawAxiosRequestConfig} from '../axios';\nimport globalAxios from 'axios';\n// Some imports not used depending on template conditions\n// @ts-ignore\nimport {\n DUMMY_BASE_URL,\n assertParamExists,\n setApiKeyToObject,\n setBasicAuthToObject,\n setBearerAuthToObject,\n setOAuthToObject,\n setSearchParams,\n serializeDataIfNeeded,\n toPathString,\n createRequestFunction\n} from '../common';\n// @ts-ignore\nimport {\n BASE_PATH,\n COLLECTION_FORMATS,\n type RequestArgs,\n BaseAPI,\n RequiredError,\n operationServerMap\n} from '../base';\n// @ts-ignore\nimport type {BadRequestError} from '../model';\n// @ts-ignore\nimport type {CancelPaymentRequest} from '../model';\n// @ts-ignore\nimport type {CapturePaymentRequest} from '../model';\n// @ts-ignore\nimport type {ConfirmPaymentRequest} from '../model';\n// @ts-ignore\nimport type {CreatePaymentRequest} from '../model';\n// @ts-ignore\nimport type {InternalServerError} from '../model';\n// @ts-ignore\nimport type {NotFoundError} from '../model';\n// @ts-ignore\nimport type {Payment} from '../model';\n// @ts-ignore\nimport type {RecurringPaymentRequest} from '../model';\n// @ts-ignore\nimport type {RefundPaymentRequest} from '../model';\n// @ts-ignore\nimport type {SendPaymentLinkRequest} from '../model';\n// @ts-ignore\nimport type {SendPaymentReceiptRequest} from '../model';\n// @ts-ignore\nimport type {SendPaymentRequestRequest} from '../model';\n// @ts-ignore\nimport type {ServiceUnavailableError} from '../model';\n// @ts-ignore\nimport type {UnauthorizedError} from '../model';\n// @ts-ignore\nimport type {UnprocessableEntityError} from '../model';\n/**\n * PaymentsApi - axios parameter creator\n * @export\n */\nexport const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) {\n return {\n /**\n * Releases reserved funds from a previously authorized payment. This endpoint can only be used with payments in `AUTHORIZED` status. This operation is part of the two-step authorization flow: 1. **Authorize**: Create a payment with `transactionType: AUTH` to reserve funds 2. **Cancel**: Release the reserved funds if you decide not to capture the payment Cancellation makes the reserved funds available to the customer again and prevents you from being able to capture those funds in the future. Once cancelled, an authorization cannot be reactivated.\n * @summary Cancel Payment\n * @param {string} id The payment ID\n * @param {CancelPaymentRequest} [cancelPaymentRequest]\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n cancel: async (\n id: string,\n cancelPaymentRequest?: CancelPaymentRequest,\n options: RawAxiosRequestConfig = {}\n ): Promise<RequestArgs> => {\n // verify required parameter 'id' is not null or undefined\n assertParamExists('cancel', 'id', id);\n const localVarPath = `/payments/{id}/cancel`.replace(\n `{${'id'}}`,\n encodeURIComponent(String(id))\n );\n // use dummy base URL string because the URL constructor only accepts absolute URLs.\n const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);\n let baseOptions;\n if (configuration) {\n baseOptions = configuration.baseOptions;\n }\n\n const localVarRequestOptions = {method: 'POST', ...baseOptions, ...options};\n const localVarHeaderParameter = {} as any;\n const localVarQueryParameter = {} as any;\n\n // authentication APIKey required\n await setApiKeyToObject(localVarHeaderParameter, 'Authorization', configuration);\n\n localVarHeaderParameter['Content-Type'] = 'application/json';\n\n setSearchParams(localVarUrlObj, localVarQueryParameter);\n let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};\n localVarRequestOptions.headers = {\n ...localVarHeaderParameter,\n ...headersFromBaseOptions,\n ...options.headers\n };\n localVarRequestOptions.data = serializeDataIfNeeded(\n cancelPaymentRequest,\n localVarRequestOptions,\n configuration\n );\n\n return {\n url: toPathString(localVarUrlObj),\n options: localVarRequestOptions\n };\n },\n /**\n * Captures funds from a previously authorized payment. This endpoint can only be used with payments in `AUTHORIZED` status. This operation completes the two-step authorization flow: 1. **Authorize**: Create a payment with `transactionType: AUTH` to reserve funds 2. **Capture**: Transfer the reserved funds to your account when ready to fulfill the order **Important**: Authorized payments expire after exactly seven days. After expiration, they will be marked as `EXPIRED` and can no longer be captured. Be sure to capture funds within this timeframe or communicate with your customer about a new payment.\n * @summary Capture Payment\n * @param {string} id The payment ID\n * @param {CapturePaymentRequest} [capturePaymentRequest]\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n capture: async (\n id: string,\n capturePaymentRequest?: CapturePaymentRequest,\n options: RawAxiosRequestConfig = {}\n ): Promise<RequestArgs> => {\n // verify required parameter 'id' is not null or undefined\n assertParamExists('capture', 'id', id);\n const localVarPath = `/payments/{id}/capture`.replace(\n `{${'id'}}`,\n encodeURIComponent(String(id))\n );\n // use dummy base URL string because the URL constructor only accepts absolute URLs.\n const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);\n let baseOptions;\n if (configuration) {\n baseOptions = configuration.baseOptions;\n }\n\n const localVarRequestOptions = {method: 'POST', ...baseOptions, ...options};\n const localVarHeaderParameter = {} as any;\n