From 771a97090759e9ddc17b8cf61c7157430fde1c39 Mon Sep 17 00:00:00 2001 From: bitbucket-pipelines Date: Tue, 5 Nov 2024 12:02:30 +0000 Subject: [PATCH] Generating Node SDK. --- api.ts | 15267 +++++++++++++++++++++++++++++++++++++------------ common.ts | 34 +- package.json | 2 +- 3 files changed, 11788 insertions(+), 3515 deletions(-) diff --git a/api.ts b/api.ts index 8cae77b..cff2d2d 100644 --- a/api.ts +++ b/api.ts @@ -18,7 +18,7 @@ import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import { assertParamExists, setApiKeyToObject, setApiKeyToObjectWithConfiguration, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; import type { RequestArgs } from './base'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; @@ -7427,10 +7427,10 @@ export interface TerminalEntity { 'terminal_status'?: string; /** * - * @type {string} + * @type {CreateTerminalRequestTerminalMeta} * @memberof TerminalEntity */ - 'terminal_meta'?: string; + 'terminal_meta'?: CreateTerminalRequestTerminalMeta; } /** * terminal payment entity full object @@ -7791,10 +7791,10 @@ export interface UpdateTerminalEntity { 'terminal_status'?: string; /** * - * @type {string} + * @type {CreateTerminalRequestTerminalMeta} * @memberof UpdateTerminalEntity */ - 'terminal_meta'?: string; + 'terminal_meta'?: CreateTerminalRequestTerminalMeta; } /** * Request body to update terminal details. @@ -8556,7 +8556,71 @@ const CustomersApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateCustomerRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGCreateCustomerWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateCustomerRequest: CreateCustomerRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGCreateCustomer', 'x_api_version', x_api_version) + // verify required parameter 'CreateCustomerRequest' is not null or undefined + assertParamExists('pGCreateCustomer', 'CreateCustomerRequest', CreateCustomerRequest) + const localVarPath = `/customers`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -8578,6 +8642,7 @@ const CustomersApiAxiosParamCreator = function (configuration?: Configuration) { options: localVarRequestOptions, }; }, + } }; @@ -8606,6 +8671,15 @@ const CustomersApiFp = function(configuration?: Configuration) { } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, + + async pGCreateCustomerWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateCustomerRequest: CreateCustomerRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCreateCustomerWithConfiguration(cashfreeConfiguration, x_api_version, CreateCustomerRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, } }; @@ -8678,7 +8752,7 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -8700,22 +8774,15 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { options: localVarRequestOptions, }; }, - /** - * Use this API to create a new vendor to your EasySplit account along with the KYC details. Provide KYC details such as account_type, business_type, gst, cin, pan, passport number and so on. - * @summary Create vendor - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {CreateVendorRequest} [CreateVendorRequest] Create Vendor Request Body. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * CreateVendorRequest?: CreateVendorRequest, - */ - pGESCreateVendors: async (x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateVendorRequest?: CreateVendorRequest, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGESCreateOnDemandTransferWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, AdjustVendorBalanceRequest?: AdjustVendorBalanceRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGESCreateVendors', 'x_api_version', x_api_version) - const localVarPath = `/easy-split/vendors`; + assertParamExists('pGESCreateOnDemandTransfer', 'x_api_version', x_api_version) + // verify required parameter 'vendor_id' is not null or undefined + assertParamExists('pGESCreateOnDemandTransfer', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendors/{vendor_id}/transfer` + .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -8732,25 +8799,25 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -8765,36 +8832,30 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreateVendorRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(AdjustVendorBalanceRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to download the uploaded KYC documents of that particular vendor. Provide the document type. Click the link from the sample request to download the KYC document. - * @summary Download Vendor Documents + * Use this API to create a new vendor to your EasySplit account along with the KYC details. Provide KYC details such as account_type, business_type, gst, cin, pan, passport number and so on. + * @summary Create vendor * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} doc_type Mention the document type that has to be downloaded. Only an uploaded document can be downloaded. - * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {CreateVendorRequest} [CreateVendorRequest] Create Vendor Request Body. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, + * CreateVendorRequest?: CreateVendorRequest, */ - pGESDownloadVendorsDocs: async (x_api_version: string, doc_type: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGESCreateVendors: async (x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateVendorRequest?: CreateVendorRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGESDownloadVendorsDocs', 'x_api_version', x_api_version) - // verify required parameter 'doc_type' is not null or undefined - assertParamExists('pGESDownloadVendorsDocs', 'doc_type', doc_type) - // verify required parameter 'vendor_id' is not null or undefined - assertParamExists('pGESDownloadVendorsDocs', 'vendor_id', vendor_id) - const localVarPath = `/easy-split/vendor-docs/{vendor_id}/download/{doc_type}` - .replace(`{${"doc_type"}}`, encodeURIComponent(String(doc_type))) - .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); + assertParamExists('pGESCreateVendors', 'x_api_version', x_api_version) + const localVarPath = `/easy-split/vendors`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -8806,7 +8867,7 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -8827,7 +8888,9 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -8842,31 +8905,19 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateVendorRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to get the details of a specific vendor associated with your Easy Split account. - * @summary Get Vendor All Details - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - pGESFetchVendors: async (x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGESCreateVendorsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateVendorRequest?: CreateVendorRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGESFetchVendors', 'x_api_version', x_api_version) - // verify required parameter 'vendor_id' is not null or undefined - assertParamExists('pGESFetchVendors', 'vendor_id', vendor_id) - const localVarPath = `/easy-split/vendors/{vendor_id}` - .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); + assertParamExists('pGESCreateVendors', 'x_api_version', x_api_version) + const localVarPath = `/easy-split/vendors`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -8878,28 +8929,30 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -8914,30 +8967,36 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateVendorRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * This API fetches the available amount with the merchant, vendor, and the unsettled amount for the merchant as well as the vendor. - * @summary Get On Demand Balance + * Use this API to download the uploaded KYC documents of that particular vendor. Provide the document type. Click the link from the sample request to download the KYC document. + * @summary Download Vendor Documents * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} doc_type Mention the document type that has to be downloaded. Only an uploaded document can be downloaded. * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_idempotency_key?: string, + * x_request_id?: string, */ - pGESGetVendorBalance: async (x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGESDownloadVendorsDocs: async (x_api_version: string, doc_type: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGESGetVendorBalance', 'x_api_version', x_api_version) + assertParamExists('pGESDownloadVendorsDocs', 'x_api_version', x_api_version) + // verify required parameter 'doc_type' is not null or undefined + assertParamExists('pGESDownloadVendorsDocs', 'doc_type', doc_type) // verify required parameter 'vendor_id' is not null or undefined - assertParamExists('pGESGetVendorBalance', 'vendor_id', vendor_id) - const localVarPath = `/easy-split/vendors/{vendor_id}/balances` + assertParamExists('pGESDownloadVendorsDocs', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendor-docs/{vendor_id}/download/{doc_type}` + .replace(`{${"doc_type"}}`, encodeURIComponent(String(doc_type))) .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; @@ -8971,7 +9030,7 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -8992,28 +9051,18 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { options: localVarRequestOptions, }; }, - /** - * This API returns the applicable service charge and service tax for a vendor balance transfer, based on the provided amount and rate type. - * @summary Get Vendor Balance Transfer Charges - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {number} amount Specify the amount for which you want to view the service charges and service taxes in the response. - * @param {string} rate_type Mention the type of rate for which you want to check the charges. Possible value: VENDOR_ON_DEMAND - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_request_id?: string, - */ - pGESGetVendorBalanceTransferCharges: async (x_api_version: string, amount: number, rate_type: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGESDownloadVendorsDocsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, doc_type: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGESGetVendorBalanceTransferCharges', 'x_api_version', x_api_version) - // verify required parameter 'amount' is not null or undefined - assertParamExists('pGESGetVendorBalanceTransferCharges', 'amount', amount) - // verify required parameter 'rate_type' is not null or undefined - assertParamExists('pGESGetVendorBalanceTransferCharges', 'rate_type', rate_type) - const localVarPath = `/easy-split/amount/{amount}/charges` - .replace(`{${"amount"}}`, encodeURIComponent(String(amount))); + assertParamExists('pGESDownloadVendorsDocs', 'x_api_version', x_api_version) + // verify required parameter 'doc_type' is not null or undefined + assertParamExists('pGESDownloadVendorsDocs', 'doc_type', doc_type) + // verify required parameter 'vendor_id' is not null or undefined + assertParamExists('pGESDownloadVendorsDocs', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendor-docs/{vendor_id}/download/{doc_type}` + .replace(`{${"doc_type"}}`, encodeURIComponent(String(doc_type))) + .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -9030,27 +9079,23 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - - if (rate_type !== undefined) { - localVarQueryParameter['rate_type'] = rate_type; - } + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -9071,9 +9116,10 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { options: localVarRequestOptions, }; }, + /** - * Use this API to fetch the details of all the KYC details of a particular vendor. - * @summary Get Vendor All Documents Status + * Use this API to get the details of a specific vendor associated with your Easy Split account. + * @summary Get Vendor All Details * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD * @param {string} vendor_id The id which uniquely identifies your vendor. @@ -9083,12 +9129,12 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { * @throws {RequiredError} * x_idempotency_key?: string, */ - pGESGetVendorsDocs: async (x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGESFetchVendors: async (x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGESGetVendorsDocs', 'x_api_version', x_api_version) + assertParamExists('pGESFetchVendors', 'x_api_version', x_api_version) // verify required parameter 'vendor_id' is not null or undefined - assertParamExists('pGESGetVendorsDocs', 'vendor_id', vendor_id) - const localVarPath = `/easy-split/vendor-docs/{vendor_id}` + assertParamExists('pGESFetchVendors', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendors/{vendor_id}` .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; @@ -9122,7 +9168,7 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -9143,22 +9189,15 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { options: localVarRequestOptions, }; }, - /** - * Use this API to get all the split details, settled and unsettled transactions details of each vendor who were part of a particular order by providing order Id or start date and end date. - * @summary Get Split and Settlement Details by OrderID v2.0 - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {ESOrderReconRequest} [ESOrderReconRequest] Get Split and Settlement Details by OrderID v2.0 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * ESOrderReconRequest?: ESOrderReconRequest, - */ - pGESOrderRecon: async (x_api_version: string, x_request_id?: string, x_idempotency_key?: string, ESOrderReconRequest?: ESOrderReconRequest, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGESFetchVendorsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGESOrderRecon', 'x_api_version', x_api_version) - const localVarPath = `/split/order/vendor/recon`; + assertParamExists('pGESFetchVendors', 'x_api_version', x_api_version) + // verify required parameter 'vendor_id' is not null or undefined + assertParamExists('pGESFetchVendors', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendors/{vendor_id}` + .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -9170,30 +9209,28 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -9208,32 +9245,31 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(ESOrderReconRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to edit the existing vendor details added to your EasySplit account. You can edit vendor details such as name, email, phone number, upi details, and any of the KYC details. - * @summary Update vendor Details + * This API fetches the available amount with the merchant, vendor, and the unsettled amount for the merchant as well as the vendor. + * @summary Get On Demand Balance * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {UpdateVendorRequest} [UpdateVendorRequest] Create Vendor Request Body. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_idempotency_key?: string, */ - pGESUpdateVendors: async (x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, UpdateVendorRequest?: UpdateVendorRequest, options: AxiosRequestConfig = {}): Promise => { + pGESGetVendorBalance: async (x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGESUpdateVendors', 'x_api_version', x_api_version) + assertParamExists('pGESGetVendorBalance', 'x_api_version', x_api_version) // verify required parameter 'vendor_id' is not null or undefined - assertParamExists('pGESUpdateVendors', 'vendor_id', vendor_id) - const localVarPath = `/easy-split/vendors/{vendor_id}` + assertParamExists('pGESGetVendorBalance', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendors/{vendor_id}/balances` .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; @@ -9246,7 +9282,7 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -9267,9 +9303,69 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGESGetVendorBalanceWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGESGetVendorBalance', 'x_api_version', x_api_version) + // verify required parameter 'vendor_id' is not null or undefined + assertParamExists('pGESGetVendorBalance', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendors/{vendor_id}/balances` + .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -9284,35 +9380,35 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(UpdateVendorRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to upload KYC documents of a specific vendor. - * @summary Upload Vendor Docs + * This API returns the applicable service charge and service tax for a vendor balance transfer, based on the provided amount and rate type. + * @summary Get Vendor Balance Transfer Charges * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {number} amount Specify the amount for which you want to view the service charges and service taxes in the response. + * @param {string} rate_type Mention the type of rate for which you want to check the charges. Possible value: VENDOR_ON_DEMAND * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [doc_type] Mention the type of the document you are uploading. Possible values: UIDAI_FRONT, UIDAI_BACK, UIDAI_NUMBER, DL, DL_NUMBER, PASSPORT_FRONT, PASSPORT_BACK, PASSPORT_NUMBER, VOTER_ID, VOTER_ID_NUMBER, PAN, PAN_NUMBER, GST, GSTIN_NUMBER, CIN, CIN_NUMBER, NBFC_CERTIFICATE. If the doc type ends with a number you should add the doc value else upload the doc file. - * @param {string} [doc_value] Enter the display name of the uploaded file. - * @param {File} [file] Select the document that should be uploaded or provide the path of that file. You cannot upload a file that is more than 2MB in size. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_idempotency_key?: string, + * x_request_id?: string, */ - pGESUploadVendorsDocs: async (x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, doc_type?: string, doc_value?: string, file?: File, options: AxiosRequestConfig = {}): Promise => { + pGESGetVendorBalanceTransferCharges: async (x_api_version: string, amount: number, rate_type: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGESUploadVendorsDocs', 'x_api_version', x_api_version) - // verify required parameter 'vendor_id' is not null or undefined - assertParamExists('pGESUploadVendorsDocs', 'vendor_id', vendor_id) - const localVarPath = `/easy-split/vendor-docs/{vendor_id}` - .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); + assertParamExists('pGESGetVendorBalanceTransferCharges', 'x_api_version', x_api_version) + // verify required parameter 'amount' is not null or undefined + assertParamExists('pGESGetVendorBalanceTransferCharges', 'amount', amount) + // verify required parameter 'rate_type' is not null or undefined + assertParamExists('pGESGetVendorBalanceTransferCharges', 'rate_type', rate_type) + const localVarPath = `/easy-split/amount/{amount}/charges` + .replace(`{${"amount"}}`, encodeURIComponent(String(amount))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -9324,10 +9420,9 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); // authentication XPartnerAPIKey required await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") @@ -9344,23 +9439,81 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { // authentication XClientSignatureHeader required await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - - if (doc_type !== undefined) { - localVarFormParams.append('doc_type', doc_type as any); + if (rate_type !== undefined) { + localVarQueryParameter['rate_type'] = rate_type; } + + - if (doc_value !== undefined) { - localVarFormParams.append('doc_value', doc_value as any); + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; } - - if (file !== undefined) { - localVarFormParams.append('file', file as any); + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGESGetVendorBalanceTransferChargesWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, amount: number, rate_type: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGESGetVendorBalanceTransferCharges', 'x_api_version', x_api_version) + // verify required parameter 'amount' is not null or undefined + assertParamExists('pGESGetVendorBalanceTransferCharges', 'amount', amount) + // verify required parameter 'rate_type' is not null or undefined + assertParamExists('pGESGetVendorBalanceTransferCharges', 'rate_type', rate_type) + const localVarPath = `/easy-split/amount/{amount}/charges` + .replace(`{${"amount"}}`, encodeURIComponent(String(amount))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + if (rate_type !== undefined) { + localVarQueryParameter['rate_type'] = rate_type; + } + + - - localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -9375,33 +9528,32 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = localVarFormParams; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Split After Payment API splits the payments to vendors after successful payment from the customers. - * @summary Split After Payment + * Use this API to fetch the details of all the KYC details of a particular vendor. + * @summary Get Vendor All Documents Status * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order + * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {SplitAfterPaymentRequest} [SplitAfterPaymentRequest] Request Body to Create Split for an order. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_idempotency_key?: string, */ - pGOrderSplitAfterPayment: async (x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, SplitAfterPaymentRequest?: SplitAfterPaymentRequest, options: AxiosRequestConfig = {}): Promise => { + pGESGetVendorsDocs: async (x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGOrderSplitAfterPayment', 'x_api_version', x_api_version) - // verify required parameter 'order_id' is not null or undefined - assertParamExists('pGOrderSplitAfterPayment', 'order_id', order_id) - const localVarPath = `/easy-split/orders/{order_id}/split` - .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); + assertParamExists('pGESGetVendorsDocs', 'x_api_version', x_api_version) + // verify required parameter 'vendor_id' is not null or undefined + assertParamExists('pGESGetVendorsDocs', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendor-docs/{vendor_id}` + .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -9413,7 +9565,7 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -9434,9 +9586,7 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -9451,29 +9601,21 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(SplitAfterPaymentRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * This API will create a static split scheme wherein you can define the split type and the vendor-wise split percentage. - * @summary Create Static Split Configuration - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {StaticSplitRequest} [StaticSplitRequest] Static Split - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * StaticSplitRequest?: StaticSplitRequest, - */ - pGOrderStaticSplit: async (x_api_version: string, x_request_id?: string, x_idempotency_key?: string, StaticSplitRequest?: StaticSplitRequest, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGESGetVendorsDocsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGOrderStaticSplit', 'x_api_version', x_api_version) - const localVarPath = `/easy-split/static-split`; + assertParamExists('pGESGetVendorsDocs', 'x_api_version', x_api_version) + // verify required parameter 'vendor_id' is not null or undefined + assertParamExists('pGESGetVendorsDocs', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendor-docs/{vendor_id}` + .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -9485,30 +9627,28 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -9523,283 +9663,29 @@ const EasySplitApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(StaticSplitRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - } -}; -/** - * EasySplitApi - functional programming interface - * @export - */ -const EasySplitApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = EasySplitApiAxiosParamCreator(configuration) - return { /** - * The Create On Demand Transfer API will create a new on-demand request either from to the merchant or from to the vendor. - * @summary Create On Demand Transfer + * Use this API to get all the split details, settled and unsettled transactions details of each vendor who were part of a particular order by providing order Id or start date and end date. + * @summary Get Split and Settlement Details by OrderID v2.0 + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {AdjustVendorBalanceRequest} [AdjustVendorBalanceRequest] Adjust Vendor Balance Request Body. + * @param {ESOrderReconRequest} [ESOrderReconRequest] Get Split and Settlement Details by OrderID v2.0 * @param {*} [options] Override http request option. * @throws {RequiredError} + * ESOrderReconRequest?: ESOrderReconRequest, */ - async pGESCreateOnDemandTransfer(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, AdjustVendorBalanceRequest?: AdjustVendorBalanceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGESCreateOnDemandTransfer(x_api_version, vendor_id, x_request_id, x_idempotency_key, AdjustVendorBalanceRequest, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to create a new vendor to your EasySplit account along with the KYC details. Provide KYC details such as account_type, business_type, gst, cin, pan, passport number and so on. - * @summary Create vendor - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {CreateVendorRequest} [CreateVendorRequest] Create Vendor Request Body. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGESCreateVendors(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateVendorRequest?: CreateVendorRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGESCreateVendors(x_api_version, x_request_id, x_idempotency_key, CreateVendorRequest, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to download the uploaded KYC documents of that particular vendor. Provide the document type. Click the link from the sample request to download the KYC document. - * @summary Download Vendor Documents - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} doc_type Mention the document type that has to be downloaded. Only an uploaded document can be downloaded. - * @param {string} vendor_id The id which uniquely identifies your vendor. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGESDownloadVendorsDocs(x_api_version: string, doc_type: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGESDownloadVendorsDocs(x_api_version, doc_type, vendor_id, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to get the details of a specific vendor associated with your Easy Split account. - * @summary Get Vendor All Details - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGESFetchVendors(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGESFetchVendors(x_api_version, vendor_id, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * This API fetches the available amount with the merchant, vendor, and the unsettled amount for the merchant as well as the vendor. - * @summary Get On Demand Balance - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGESGetVendorBalance(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGESGetVendorBalance(x_api_version, vendor_id, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * This API returns the applicable service charge and service tax for a vendor balance transfer, based on the provided amount and rate type. - * @summary Get Vendor Balance Transfer Charges - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {number} amount Specify the amount for which you want to view the service charges and service taxes in the response. - * @param {string} rate_type Mention the type of rate for which you want to check the charges. Possible value: VENDOR_ON_DEMAND - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGESGetVendorBalanceTransferCharges(x_api_version: string, amount: number, rate_type: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGESGetVendorBalanceTransferCharges(x_api_version, amount, rate_type, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to fetch the details of all the KYC details of a particular vendor. - * @summary Get Vendor All Documents Status - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGESGetVendorsDocs(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGESGetVendorsDocs(x_api_version, vendor_id, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to get all the split details, settled and unsettled transactions details of each vendor who were part of a particular order by providing order Id or start date and end date. - * @summary Get Split and Settlement Details by OrderID v2.0 - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {ESOrderReconRequest} [ESOrderReconRequest] Get Split and Settlement Details by OrderID v2.0 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGESOrderRecon(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, ESOrderReconRequest?: ESOrderReconRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGESOrderRecon(x_api_version, x_request_id, x_idempotency_key, ESOrderReconRequest, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to edit the existing vendor details added to your EasySplit account. You can edit vendor details such as name, email, phone number, upi details, and any of the KYC details. - * @summary Update vendor Details - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {UpdateVendorRequest} [UpdateVendorRequest] Create Vendor Request Body. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGESUpdateVendors(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, UpdateVendorRequest?: UpdateVendorRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGESUpdateVendors(x_api_version, vendor_id, x_request_id, x_idempotency_key, UpdateVendorRequest, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to upload KYC documents of a specific vendor. - * @summary Upload Vendor Docs - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [doc_type] Mention the type of the document you are uploading. Possible values: UIDAI_FRONT, UIDAI_BACK, UIDAI_NUMBER, DL, DL_NUMBER, PASSPORT_FRONT, PASSPORT_BACK, PASSPORT_NUMBER, VOTER_ID, VOTER_ID_NUMBER, PAN, PAN_NUMBER, GST, GSTIN_NUMBER, CIN, CIN_NUMBER, NBFC_CERTIFICATE. If the doc type ends with a number you should add the doc value else upload the doc file. - * @param {string} [doc_value] Enter the display name of the uploaded file. - * @param {File} [file] Select the document that should be uploaded or provide the path of that file. You cannot upload a file that is more than 2MB in size. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGESUploadVendorsDocs(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, doc_type?: string, doc_value?: string, file?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGESUploadVendorsDocs(x_api_version, vendor_id, x_request_id, x_idempotency_key, doc_type, doc_value, file, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Split After Payment API splits the payments to vendors after successful payment from the customers. - * @summary Split After Payment - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {SplitAfterPaymentRequest} [SplitAfterPaymentRequest] Request Body to Create Split for an order. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGOrderSplitAfterPayment(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, SplitAfterPaymentRequest?: SplitAfterPaymentRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderSplitAfterPayment(x_api_version, order_id, x_request_id, x_idempotency_key, SplitAfterPaymentRequest, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * This API will create a static split scheme wherein you can define the split type and the vendor-wise split percentage. - * @summary Create Static Split Configuration - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {StaticSplitRequest} [StaticSplitRequest] Static Split - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGOrderStaticSplit(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, StaticSplitRequest?: StaticSplitRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderStaticSplit(x_api_version, x_request_id, x_idempotency_key, StaticSplitRequest, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - } -}; - -/** - * EasySplitApi - object-oriented interface - * @export - * @class EasySplitApi - * @extends {BaseAPI} - */ - - - -/** - * EligibilityApi - axios parameter creator - * @export - */ -const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number. - * @summary Get Eligible Cardless EMI Payment Methods for a customer on an order - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchCardlessEMIRequest} EligibilityFetchCardlessEMIRequest Request Body to get eligible cardless emi options for a customer and order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - pGEligibilityFetchCardlessEMI: async (x_api_version: string, EligibilityFetchCardlessEMIRequest: EligibilityFetchCardlessEMIRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGESOrderRecon: async (x_api_version: string, x_request_id?: string, x_idempotency_key?: string, ESOrderReconRequest?: ESOrderReconRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGEligibilityFetchCardlessEMI', 'x_api_version', x_api_version) - // verify required parameter 'EligibilityFetchCardlessEMIRequest' is not null or undefined - assertParamExists('pGEligibilityFetchCardlessEMI', 'EligibilityFetchCardlessEMIRequest', EligibilityFetchCardlessEMIRequest) - const localVarPath = `/eligibility/cardlessemi`; + assertParamExists('pGESOrderRecon', 'x_api_version', x_api_version) + const localVarPath = `/split/order/vendor/recon`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -9834,7 +9720,7 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -9849,31 +9735,19 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchCardlessEMIRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(ESOrderReconRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to get eligible offers for an order_id or order amount. - * @summary Get Eligible Offers for an Order - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchOffersRequest} EligibilityFetchOffersRequest Request Body to get eligible offers for a customer and order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - pGEligibilityFetchOffers: async (x_api_version: string, EligibilityFetchOffersRequest: EligibilityFetchOffersRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGESOrderReconWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, ESOrderReconRequest?: ESOrderReconRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGEligibilityFetchOffers', 'x_api_version', x_api_version) - // verify required parameter 'EligibilityFetchOffersRequest' is not null or undefined - assertParamExists('pGEligibilityFetchOffers', 'EligibilityFetchOffersRequest', EligibilityFetchOffersRequest) - const localVarPath = `/eligibility/offers`; + assertParamExists('pGESOrderRecon', 'x_api_version', x_api_version) + const localVarPath = `/split/order/vendor/recon`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -9890,25 +9764,25 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -9923,31 +9797,34 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchOffersRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(ESOrderReconRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to get eligible Paylater Payment Methods for a customer on an order. - * @summary Get Eligible Paylater for a customer on an order + * Use this API to edit the existing vendor details added to your EasySplit account. You can edit vendor details such as name, email, phone number, upi details, and any of the KYC details. + * @summary Update vendor Details * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchPaylaterRequest} EligibilityFetchPaylaterRequest Request Body to get eligible paylater options for a customer and order + * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {UpdateVendorRequest} [UpdateVendorRequest] Create Vendor Request Body. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_idempotency_key?: string, */ - pGEligibilityFetchPaylater: async (x_api_version: string, EligibilityFetchPaylaterRequest: EligibilityFetchPaylaterRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGESUpdateVendors: async (x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, UpdateVendorRequest?: UpdateVendorRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGEligibilityFetchPaylater', 'x_api_version', x_api_version) - // verify required parameter 'EligibilityFetchPaylaterRequest' is not null or undefined - assertParamExists('pGEligibilityFetchPaylater', 'EligibilityFetchPaylaterRequest', EligibilityFetchPaylaterRequest) - const localVarPath = `/eligibility/paylater`; + assertParamExists('pGESUpdateVendors', 'x_api_version', x_api_version) + // verify required parameter 'vendor_id' is not null or undefined + assertParamExists('pGESUpdateVendors', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendors/{vendor_id}` + .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -9959,7 +9836,7 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -9982,7 +9859,7 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -9997,31 +9874,22 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchPaylaterRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(UpdateVendorRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to get eligible Payment Methods - * @summary Get eligible Payment Methods - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchPaymentMethodsRequest} EligibilityFetchPaymentMethodsRequest Request Body to get eligible payment methods for an account and order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - pGEligibilityFetchPaymentMethods: async (x_api_version: string, EligibilityFetchPaymentMethodsRequest: EligibilityFetchPaymentMethodsRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGESUpdateVendorsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, UpdateVendorRequest?: UpdateVendorRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGEligibilityFetchPaymentMethods', 'x_api_version', x_api_version) - // verify required parameter 'EligibilityFetchPaymentMethodsRequest' is not null or undefined - assertParamExists('pGEligibilityFetchPaymentMethods', 'EligibilityFetchPaymentMethodsRequest', EligibilityFetchPaymentMethodsRequest) - const localVarPath = `/eligibility/payment_methods`; + assertParamExists('pGESUpdateVendors', 'x_api_version', x_api_version) + // verify required parameter 'vendor_id' is not null or undefined + assertParamExists('pGESUpdateVendors', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendors/{vendor_id}` + .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -10033,30 +9901,30 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -10071,131 +9939,36 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchPaymentMethodsRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(UpdateVendorRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - } -}; - -/** - * EligibilityApi - functional programming interface - * @export - */ -const EligibilityApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = EligibilityApiAxiosParamCreator(configuration) - return { - /** - * Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number. - * @summary Get Eligible Cardless EMI Payment Methods for a customer on an order - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchCardlessEMIRequest} EligibilityFetchCardlessEMIRequest Request Body to get eligible cardless emi options for a customer and order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGEligibilityFetchCardlessEMI(x_api_version: string, EligibilityFetchCardlessEMIRequest: EligibilityFetchCardlessEMIRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchCardlessEMI(x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to get eligible offers for an order_id or order amount. - * @summary Get Eligible Offers for an Order - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchOffersRequest} EligibilityFetchOffersRequest Request Body to get eligible offers for a customer and order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGEligibilityFetchOffers(x_api_version: string, EligibilityFetchOffersRequest: EligibilityFetchOffersRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchOffers(x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to get eligible Paylater Payment Methods for a customer on an order. - * @summary Get Eligible Paylater for a customer on an order - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchPaylaterRequest} EligibilityFetchPaylaterRequest Request Body to get eligible paylater options for a customer and order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGEligibilityFetchPaylater(x_api_version: string, EligibilityFetchPaylaterRequest: EligibilityFetchPaylaterRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchPaylater(x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to get eligible Payment Methods - * @summary Get eligible Payment Methods - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchPaymentMethodsRequest} EligibilityFetchPaymentMethodsRequest Request Body to get eligible payment methods for an account and order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGEligibilityFetchPaymentMethods(x_api_version: string, EligibilityFetchPaymentMethodsRequest: EligibilityFetchPaymentMethodsRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchPaymentMethods(x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - } -}; - -/** - * EligibilityApi - object-oriented interface - * @export - * @class EligibilityApi - * @extends {BaseAPI} - */ - - -/** - * OffersApi - axios parameter creator - * @export - */ -const OffersApiAxiosParamCreator = function (configuration?: Configuration) { - return { /** - * Use this API to create offers with Cashfree from your backend - * @summary Create Offer + * Use this API to upload KYC documents of a specific vendor. + * @summary Upload Vendor Docs * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateOfferRequest} CreateOfferRequest Request body to create an offer at Cashfree + * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [doc_type] Mention the type of the document you are uploading. Possible values: UIDAI_FRONT, UIDAI_BACK, UIDAI_NUMBER, DL, DL_NUMBER, PASSPORT_FRONT, PASSPORT_BACK, PASSPORT_NUMBER, VOTER_ID, VOTER_ID_NUMBER, PAN, PAN_NUMBER, GST, GSTIN_NUMBER, CIN, CIN_NUMBER, NBFC_CERTIFICATE. If the doc type ends with a number you should add the doc value else upload the doc file. + * @param {string} [doc_value] Enter the display name of the uploaded file. + * @param {File} [file] Select the document that should be uploaded or provide the path of that file. You cannot upload a file that is more than 2MB in size. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_idempotency_key?: string, */ - pGCreateOffer: async (x_api_version: string, CreateOfferRequest: CreateOfferRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGESUploadVendorsDocs: async (x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, doc_type?: string, doc_value?: string, file?: File, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGCreateOffer', 'x_api_version', x_api_version) - // verify required parameter 'CreateOfferRequest' is not null or undefined - assertParamExists('pGCreateOffer', 'CreateOfferRequest', CreateOfferRequest) - const localVarPath = `/offers`; + assertParamExists('pGESUploadVendorsDocs', 'x_api_version', x_api_version) + // verify required parameter 'vendor_id' is not null or undefined + assertParamExists('pGESUploadVendorsDocs', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendor-docs/{vendor_id}` + .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -10210,6 +9983,7 @@ const OffersApiAxiosParamCreator = function (configuration?: Configuration) { const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); // authentication XPartnerAPIKey required await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") @@ -10227,10 +10001,22 @@ const OffersApiAxiosParamCreator = function (configuration?: Configuration) { await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + if (doc_type !== undefined) { + localVarFormParams.append('doc_type', doc_type as any); + } - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + if (doc_value !== undefined) { + localVarFormParams.append('doc_value', doc_value as any); + } + + if (file !== undefined) { + localVarFormParams.append('file', file as any); + } + + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -10245,32 +10031,22 @@ const OffersApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreateOfferRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = localVarFormParams; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to get offer by offer_id - * @summary Get Offer by ID - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} offer_id The offer ID for which you want to view the offer details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - pGFetchOffer: async (x_api_version: string, offer_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGESUploadVendorsDocsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, doc_type?: string, doc_value?: string, file?: File, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGFetchOffer', 'x_api_version', x_api_version) - // verify required parameter 'offer_id' is not null or undefined - assertParamExists('pGFetchOffer', 'offer_id', offer_id) - const localVarPath = `/offers/{offer_id}` - .replace(`{${"offer_id"}}`, encodeURIComponent(String(offer_id))); + assertParamExists('pGESUploadVendorsDocs', 'x_api_version', x_api_version) + // verify required parameter 'vendor_id' is not null or undefined + assertParamExists('pGESUploadVendorsDocs', 'vendor_id', vendor_id) + const localVarPath = `/easy-split/vendor-docs/{vendor_id}` + .replace(`{${"vendor_id"}}`, encodeURIComponent(String(vendor_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -10282,34 +10058,49 @@ const OffersApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + if (doc_type !== undefined) { + localVarFormParams.append('doc_type', doc_type as any); + } - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; - if (x_api_version != null && x_api_version != undefined) { - localVarHeaderParameter['x-api-version'] = x_api_version; + if (doc_value !== undefined) { + localVarFormParams.append('doc_value', doc_value as any); } - - if (x_request_id != null && x_request_id != undefined) { - localVarHeaderParameter['x-request-id'] = x_request_id; + + if (file !== undefined) { + localVarFormParams.append('file', file as any); + } + + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; } if (x_idempotency_key != null && x_idempotency_key != undefined) { @@ -10318,94 +10109,34 @@ const OffersApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = localVarFormParams; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - } -}; - -/** - * OffersApi - functional programming interface - * @export - */ -const OffersApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = OffersApiAxiosParamCreator(configuration) - return { - /** - * Use this API to create offers with Cashfree from your backend - * @summary Create Offer - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateOfferRequest} CreateOfferRequest Request body to create an offer at Cashfree - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGCreateOffer(x_api_version: string, CreateOfferRequest: CreateOfferRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGCreateOffer(x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to get offer by offer_id - * @summary Get Offer by ID - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} offer_id The offer ID for which you want to view the offer details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGFetchOffer(x_api_version: string, offer_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchOffer(x_api_version, offer_id, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - } -}; - -/** - * OffersApi - object-oriented interface - * @export - * @class OffersApi - * @extends {BaseAPI} - */ - - -/** - * OrdersApi - axios parameter creator - * @export - */ -const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { - return { /** - * ### Order An order is an entity which has a amount and currency associated with it. It is something for which you want to collect payment for. Use this API to create orders with Cashfree from your backend to get a `payment_sessions_id`. You can use the `payment_sessions_id` to create a transaction for the order. - * @summary Create Order + * Split After Payment API splits the payments to vendors after successful payment from the customers. + * @summary Split After Payment * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateOrderRequest} CreateOrderRequest Request body to create an order at cashfree + * @param {string} order_id The id which uniquely identifies your order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {SplitAfterPaymentRequest} [SplitAfterPaymentRequest] Request Body to Create Split for an order. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_idempotency_key?: string, */ - pGCreateOrder: async (x_api_version: string, CreateOrderRequest: CreateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGOrderSplitAfterPayment: async (x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, SplitAfterPaymentRequest?: SplitAfterPaymentRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGCreateOrder', 'x_api_version', x_api_version) - // verify required parameter 'CreateOrderRequest' is not null or undefined - assertParamExists('pGCreateOrder', 'CreateOrderRequest', CreateOrderRequest) - const localVarPath = `/orders`; + assertParamExists('pGOrderSplitAfterPayment', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderSplitAfterPayment', 'order_id', order_id) + const localVarPath = `/easy-split/orders/{order_id}/split` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -10440,7 +10171,7 @@ const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -10455,31 +10186,21 @@ const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreateOrderRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(SplitAfterPaymentRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to fetch the order that was created at Cashfree\'s using the `order_id`. ## When to use this API - To check the status of your order - Once the order is PAID - Once your customer returns to `return_url` - * @summary Get Order - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - pGFetchOrder: async (x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGOrderSplitAfterPaymentWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, SplitAfterPaymentRequest?: SplitAfterPaymentRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGFetchOrder', 'x_api_version', x_api_version) + assertParamExists('pGOrderSplitAfterPayment', 'x_api_version', x_api_version) // verify required parameter 'order_id' is not null or undefined - assertParamExists('pGFetchOrder', 'order_id', order_id) - const localVarPath = `/orders/{order_id}` + assertParamExists('pGOrderSplitAfterPayment', 'order_id', order_id) + const localVarPath = `/easy-split/orders/{order_id}/split` .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; @@ -10492,28 +10213,30 @@ const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -10528,34 +10251,30 @@ const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(SplitAfterPaymentRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to terminate the order that was created at Cashfree\'s using the `order_id`. - * @summary Terminate Order + * This API will create a static split scheme wherein you can define the split type and the vendor-wise split percentage. + * @summary Create Static Split Configuration * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {TerminateOrderRequest} TerminateOrderRequest Request body to terminate an order at cashfree * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {StaticSplitRequest} [StaticSplitRequest] Static Split * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, + * StaticSplitRequest?: StaticSplitRequest, */ - pGTerminateOrder: async (x_api_version: string, order_id: string, TerminateOrderRequest: TerminateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGOrderStaticSplit: async (x_api_version: string, x_request_id?: string, x_idempotency_key?: string, StaticSplitRequest?: StaticSplitRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGTerminateOrder', 'x_api_version', x_api_version) - // verify required parameter 'order_id' is not null or undefined - assertParamExists('pGTerminateOrder', 'order_id', order_id) - // verify required parameter 'TerminateOrderRequest' is not null or undefined - assertParamExists('pGTerminateOrder', 'TerminateOrderRequest', TerminateOrderRequest) - const localVarPath = `/orders/{order_id}` - .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); + assertParamExists('pGOrderStaticSplit', 'x_api_version', x_api_version) + const localVarPath = `/easy-split/static-split`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -10567,7 +10286,7 @@ const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -10590,7 +10309,7 @@ const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -10605,53 +10324,108 @@ const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(TerminateOrderRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(StaticSplitRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGOrderStaticSplitWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, StaticSplitRequest?: StaticSplitRequest, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGOrderStaticSplit', 'x_api_version', x_api_version) + const localVarPath = `/easy-split/static-split`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(StaticSplitRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + } }; /** - * OrdersApi - functional programming interface + * EasySplitApi - functional programming interface * @export */ -const OrdersApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = OrdersApiAxiosParamCreator(configuration) +const EasySplitApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = EasySplitApiAxiosParamCreator(configuration) return { /** - * ### Order An order is an entity which has a amount and currency associated with it. It is something for which you want to collect payment for. Use this API to create orders with Cashfree from your backend to get a `payment_sessions_id`. You can use the `payment_sessions_id` to create a transaction for the order. - * @summary Create Order + * The Create On Demand Transfer API will create a new on-demand request either from to the merchant or from to the vendor. + * @summary Create On Demand Transfer * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateOrderRequest} CreateOrderRequest Request body to create an order at cashfree + * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {AdjustVendorBalanceRequest} [AdjustVendorBalanceRequest] Adjust Vendor Balance Request Body. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGCreateOrder(x_api_version: string, CreateOrderRequest: CreateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGCreateOrder(x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options); + async pGESCreateOnDemandTransfer(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, AdjustVendorBalanceRequest?: AdjustVendorBalanceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESCreateOnDemandTransfer(x_api_version, vendor_id, x_request_id, x_idempotency_key, AdjustVendorBalanceRequest, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - /** - * Use this API to fetch the order that was created at Cashfree\'s using the `order_id`. ## When to use this API - To check the status of your order - Once the order is PAID - Once your customer returns to `return_url` - * @summary Get Order - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGFetchOrder(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchOrder(x_api_version, order_id, x_request_id, x_idempotency_key, options); + + async pGESCreateOnDemandTransferWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, AdjustVendorBalanceRequest?: AdjustVendorBalanceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESCreateOnDemandTransferWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, AdjustVendorBalanceRequest, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -10659,331 +10433,345 @@ const OrdersApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API to terminate the order that was created at Cashfree\'s using the `order_id`. - * @summary Terminate Order + * Use this API to create a new vendor to your EasySplit account along with the KYC details. Provide KYC details such as account_type, business_type, gst, cin, pan, passport number and so on. + * @summary Create vendor * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {TerminateOrderRequest} TerminateOrderRequest Request body to terminate an order at cashfree * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {CreateVendorRequest} [CreateVendorRequest] Create Vendor Request Body. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGTerminateOrder(x_api_version: string, order_id: string, TerminateOrderRequest: TerminateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGTerminateOrder(x_api_version, order_id, TerminateOrderRequest, x_request_id, x_idempotency_key, options); + async pGESCreateVendors(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateVendorRequest?: CreateVendorRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESCreateVendors(x_api_version, x_request_id, x_idempotency_key, CreateVendorRequest, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - } -}; - -/** - * OrdersApi - object-oriented interface - * @export - * @class OrdersApi - * @extends {BaseAPI} - */ - - -/** - * PGReconciliationApi - axios parameter creator - * @export - */ -const PGReconciliationApiAxiosParamCreator = function (configuration?: Configuration) { - return { + async pGESCreateVendorsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateVendorRequest?: CreateVendorRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESCreateVendorsWithConfiguration(cashfreeConfiguration, x_api_version, x_request_id, x_idempotency_key, CreateVendorRequest, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, /** - * - Use this API to get the payment gateway reconciliation details with date range. - It will have events for your payment account - * @summary PG Reconciliation - + * Use this API to download the uploaded KYC documents of that particular vendor. Provide the document type. Click the link from the sample request to download the KYC document. + * @summary Download Vendor Documents * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {FetchReconRequest} FetchReconRequest Request Body for the reconciliation - * @param {string} [Content_Type] application/json + * @param {string} doc_type Mention the document type that has to be downloaded. Only an uploaded document can be downloaded. + * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [Accept] application/json * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, */ - pGFetchRecon: async (x_api_version: string, FetchReconRequest: FetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGFetchRecon', 'x_api_version', x_api_version) - // verify required parameter 'FetchReconRequest' is not null or undefined - assertParamExists('pGFetchRecon', 'FetchReconRequest', FetchReconRequest) - const localVarPath = `/recon`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - const localVarUrlObj = new URL(localVarPath, url); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") - - // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") - - // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") - - // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") - - // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; - if (x_api_version != null && x_api_version != undefined) { - localVarHeaderParameter['x-api-version'] = x_api_version; - } - - if (x_request_id != null && x_request_id != undefined) { - localVarHeaderParameter['x-request-id'] = x_request_id; - } - - if (x_idempotency_key != null && x_idempotency_key != undefined) { - localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(FetchReconRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + async pGESDownloadVendorsDocs(x_api_version: string, doc_type: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESDownloadVendorsDocs(x_api_version, doc_type, vendor_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - } -}; -/** - * PGReconciliationApi - functional programming interface - * @export - */ -const PGReconciliationApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = PGReconciliationApiAxiosParamCreator(configuration) - return { + async pGESDownloadVendorsDocsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, doc_type: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESDownloadVendorsDocsWithConfiguration(cashfreeConfiguration, x_api_version, doc_type, vendor_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, /** - * - Use this API to get the payment gateway reconciliation details with date range. - It will have events for your payment account - * @summary PG Reconciliation + * Use this API to get the details of a specific vendor associated with your Easy Split account. + * @summary Get Vendor All Details * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {FetchReconRequest} FetchReconRequest Request Body for the reconciliation - * @param {string} [Content_Type] application/json + * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [Accept] application/json * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGFetchRecon(x_api_version: string, FetchReconRequest: FetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchRecon(x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options); + async pGESFetchVendors(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESFetchVendors(x_api_version, vendor_id, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - } -}; - -/** - * PGReconciliationApi - object-oriented interface - * @export - * @class PGReconciliationApi - * @extends {BaseAPI} - */ - - -/** - * PaymentLinksApi - axios parameter creator - * @export - */ -const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration) { - return { + async pGESFetchVendorsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESFetchVendorsWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, /** - * Use this API to cancel a payment link. No further payments can be done against a cancelled link. Only a link in ACTIVE status can be cancelled. - * @summary Cancel Payment Link - + * This API fetches the available amount with the merchant, vendor, and the unsettled amount for the merchant as well as the vendor. + * @summary Get On Demand Balance * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} link_id The payment link ID for which you want to view the details. + * @param {string} vendor_id The id which uniquely identifies your vendor. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_idempotency_key?: string, */ - pGCancelLink: async (x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGCancelLink', 'x_api_version', x_api_version) - // verify required parameter 'link_id' is not null or undefined - assertParamExists('pGCancelLink', 'link_id', link_id) - const localVarPath = `/links/{link_id}/cancel` - .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - const localVarUrlObj = new URL(localVarPath, url); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") - - // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") - - // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") - - // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") - - // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - - - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; - if (x_api_version != null && x_api_version != undefined) { - localVarHeaderParameter['x-api-version'] = x_api_version; - } - - if (x_request_id != null && x_request_id != undefined) { - localVarHeaderParameter['x-request-id'] = x_request_id; - } - - if (x_idempotency_key != null && x_idempotency_key != undefined) { - localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + async pGESGetVendorBalance(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESGetVendorBalance(x_api_version, vendor_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + async pGESGetVendorBalanceWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESGetVendorBalanceWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url. - * @summary Create Payment Link - + * This API returns the applicable service charge and service tax for a vendor balance transfer, based on the provided amount and rate type. + * @summary Get Vendor Balance Transfer Charges * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateLinkRequest} CreateLinkRequest Request Body to Create Payment Links + * @param {number} amount Specify the amount for which you want to view the service charges and service taxes in the response. + * @param {string} rate_type Mention the type of rate for which you want to check the charges. Possible value: VENDOR_ON_DEMAND * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_idempotency_key?: string, */ - pGCreateLink: async (x_api_version: string, CreateLinkRequest: CreateLinkRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGCreateLink', 'x_api_version', x_api_version) - // verify required parameter 'CreateLinkRequest' is not null or undefined - assertParamExists('pGCreateLink', 'CreateLinkRequest', CreateLinkRequest) - const localVarPath = `/links`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - const localVarUrlObj = new URL(localVarPath, url); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + async pGESGetVendorBalanceTransferCharges(x_api_version: string, amount: number, rate_type: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESGetVendorBalanceTransferCharges(x_api_version, amount, rate_type, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, - // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + async pGESGetVendorBalanceTransferChargesWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, amount: number, rate_type: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESGetVendorBalanceTransferChargesWithConfiguration(cashfreeConfiguration, x_api_version, amount, rate_type, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to fetch the details of all the KYC details of a particular vendor. + * @summary Get Vendor All Documents Status + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGESGetVendorsDocs(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESGetVendorsDocs(x_api_version, vendor_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, - // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + async pGESGetVendorsDocsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESGetVendorsDocsWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to get all the split details, settled and unsettled transactions details of each vendor who were part of a particular order by providing order Id or start date and end date. + * @summary Get Split and Settlement Details by OrderID v2.0 + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {ESOrderReconRequest} [ESOrderReconRequest] Get Split and Settlement Details by OrderID v2.0 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGESOrderRecon(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, ESOrderReconRequest?: ESOrderReconRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESOrderRecon(x_api_version, x_request_id, x_idempotency_key, ESOrderReconRequest, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, - // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + async pGESOrderReconWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, ESOrderReconRequest?: ESOrderReconRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESOrderReconWithConfiguration(cashfreeConfiguration, x_api_version, x_request_id, x_idempotency_key, ESOrderReconRequest, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to edit the existing vendor details added to your EasySplit account. You can edit vendor details such as name, email, phone number, upi details, and any of the KYC details. + * @summary Update vendor Details + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {UpdateVendorRequest} [UpdateVendorRequest] Create Vendor Request Body. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGESUpdateVendors(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, UpdateVendorRequest?: UpdateVendorRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESUpdateVendors(x_api_version, vendor_id, x_request_id, x_idempotency_key, UpdateVendorRequest, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, - // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + async pGESUpdateVendorsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, UpdateVendorRequest?: UpdateVendorRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESUpdateVendorsWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, UpdateVendorRequest, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to upload KYC documents of a specific vendor. + * @summary Upload Vendor Docs + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [doc_type] Mention the type of the document you are uploading. Possible values: UIDAI_FRONT, UIDAI_BACK, UIDAI_NUMBER, DL, DL_NUMBER, PASSPORT_FRONT, PASSPORT_BACK, PASSPORT_NUMBER, VOTER_ID, VOTER_ID_NUMBER, PAN, PAN_NUMBER, GST, GSTIN_NUMBER, CIN, CIN_NUMBER, NBFC_CERTIFICATE. If the doc type ends with a number you should add the doc value else upload the doc file. + * @param {string} [doc_value] Enter the display name of the uploaded file. + * @param {File} [file] Select the document that should be uploaded or provide the path of that file. You cannot upload a file that is more than 2MB in size. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGESUploadVendorsDocs(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, doc_type?: string, doc_value?: string, file?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESUploadVendorsDocs(x_api_version, vendor_id, x_request_id, x_idempotency_key, doc_type, doc_value, file, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, - // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + async pGESUploadVendorsDocsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, doc_type?: string, doc_value?: string, file?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGESUploadVendorsDocsWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, doc_type, doc_value, file, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Split After Payment API splits the payments to vendors after successful payment from the customers. + * @summary Split After Payment + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {SplitAfterPaymentRequest} [SplitAfterPaymentRequest] Request Body to Create Split for an order. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGOrderSplitAfterPayment(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, SplitAfterPaymentRequest?: SplitAfterPaymentRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderSplitAfterPayment(x_api_version, order_id, x_request_id, x_idempotency_key, SplitAfterPaymentRequest, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + async pGOrderSplitAfterPaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, SplitAfterPaymentRequest?: SplitAfterPaymentRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderSplitAfterPaymentWithConfiguration(cashfreeConfiguration, x_api_version, order_id, x_request_id, x_idempotency_key, SplitAfterPaymentRequest, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * This API will create a static split scheme wherein you can define the split type and the vendor-wise split percentage. + * @summary Create Static Split Configuration + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {StaticSplitRequest} [StaticSplitRequest] Static Split + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGOrderStaticSplit(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, StaticSplitRequest?: StaticSplitRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderStaticSplit(x_api_version, x_request_id, x_idempotency_key, StaticSplitRequest, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, - - localVarHeaderParameter['Content-Type'] = 'application/json'; + async pGOrderStaticSplitWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, StaticSplitRequest?: StaticSplitRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderStaticSplitWithConfiguration(cashfreeConfiguration, x_api_version, x_request_id, x_idempotency_key, StaticSplitRequest, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + } +}; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; - if (x_api_version != null && x_api_version != undefined) { - localVarHeaderParameter['x-api-version'] = x_api_version; - } +/** + * EasySplitApi - object-oriented interface + * @export + * @class EasySplitApi + * @extends {BaseAPI} + */ - if (x_request_id != null && x_request_id != undefined) { - localVarHeaderParameter['x-request-id'] = x_request_id; - } - if (x_idempotency_key != null && x_idempotency_key != undefined) { - localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreateLinkRequest, localVarRequestOptions, configuration) - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, +/** + * EligibilityApi - axios parameter creator + * @export + */ +const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) { + return { /** - * Use this API to view all details and status of a payment link. - * @summary Fetch Payment Link Details + * Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number. + * @summary Get Eligible Cardless EMI Payment Methods for a customer on an order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} link_id The payment link ID for which you want to view the details. + * @param {EligibilityFetchCardlessEMIRequest} EligibilityFetchCardlessEMIRequest Request Body to get eligible cardless emi options for a customer and order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_idempotency_key?: string, */ - pGFetchLink: async (x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGEligibilityFetchCardlessEMI: async (x_api_version: string, EligibilityFetchCardlessEMIRequest: EligibilityFetchCardlessEMIRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGFetchLink', 'x_api_version', x_api_version) - // verify required parameter 'link_id' is not null or undefined - assertParamExists('pGFetchLink', 'link_id', link_id) - const localVarPath = `/links/{link_id}` - .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id))); + assertParamExists('pGEligibilityFetchCardlessEMI', 'x_api_version', x_api_version) + // verify required parameter 'EligibilityFetchCardlessEMIRequest' is not null or undefined + assertParamExists('pGEligibilityFetchCardlessEMI', 'EligibilityFetchCardlessEMIRequest', EligibilityFetchCardlessEMIRequest) + const localVarPath = `/eligibility/cardlessemi`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -10995,7 +10783,7 @@ const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -11016,7 +10804,9 @@ const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -11031,32 +10821,21 @@ const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchCardlessEMIRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to view all order details for a payment link. - * @summary Get Orders for a Payment Link - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} link_id The payment link ID for which you want to view the details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [status] Mention What is status of orders you want to fetch, default is PAID. Possible value: ALL, PAID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - pGLinkFetchOrders: async (x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, status?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGEligibilityFetchCardlessEMIWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchCardlessEMIRequest: EligibilityFetchCardlessEMIRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGLinkFetchOrders', 'x_api_version', x_api_version) - // verify required parameter 'link_id' is not null or undefined - assertParamExists('pGLinkFetchOrders', 'link_id', link_id) - const localVarPath = `/links/{link_id}/orders` - .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id))); + assertParamExists('pGEligibilityFetchCardlessEMI', 'x_api_version', x_api_version) + // verify required parameter 'EligibilityFetchCardlessEMIRequest' is not null or undefined + assertParamExists('pGEligibilityFetchCardlessEMI', 'EligibilityFetchCardlessEMIRequest', EligibilityFetchCardlessEMIRequest) + const localVarPath = `/eligibility/cardlessemi`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -11068,32 +10847,30 @@ const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - - if (status !== undefined) { - localVarQueryParameter['status'] = status; - } + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -11108,135 +10885,32 @@ const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchCardlessEMIRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - } -}; - -/** - * PaymentLinksApi - functional programming interface - * @export - */ -const PaymentLinksApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = PaymentLinksApiAxiosParamCreator(configuration) - return { - /** - * Use this API to cancel a payment link. No further payments can be done against a cancelled link. Only a link in ACTIVE status can be cancelled. - * @summary Cancel Payment Link - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} link_id The payment link ID for which you want to view the details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGCancelLink(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGCancelLink(x_api_version, link_id, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url. - * @summary Create Payment Link - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateLinkRequest} CreateLinkRequest Request Body to Create Payment Links - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGCreateLink(x_api_version: string, CreateLinkRequest: CreateLinkRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGCreateLink(x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to view all details and status of a payment link. - * @summary Fetch Payment Link Details - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} link_id The payment link ID for which you want to view the details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGFetchLink(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchLink(x_api_version, link_id, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to view all order details for a payment link. - * @summary Get Orders for a Payment Link - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} link_id The payment link ID for which you want to view the details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [status] Mention What is status of orders you want to fetch, default is PAID. Possible value: ALL, PAID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGLinkFetchOrders(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, status?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGLinkFetchOrders(x_api_version, link_id, x_request_id, x_idempotency_key, status, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - } -}; - -/** - * PaymentLinksApi - object-oriented interface - * @export - * @class PaymentLinksApi - * @extends {BaseAPI} - */ - - -/** - * PaymentsApi - axios parameter creator - * @export - */ -const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { - return { /** - * Use this API to capture or void a preauthorized payment - * @summary Preauthorization + * Use this API to get eligible offers for an order_id or order amount. + * @summary Get Eligible Offers for an Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {AuthorizeOrderRequest} AuthorizeOrderRequest Request to Capture or Void Transactions + * @param {EligibilityFetchOffersRequest} EligibilityFetchOffersRequest Request Body to get eligible offers for a customer and order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, + * x_idempotency_key?: string, */ - pGAuthorizeOrder: async (x_api_version: string, order_id: string, AuthorizeOrderRequest: AuthorizeOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGEligibilityFetchOffers: async (x_api_version: string, EligibilityFetchOffersRequest: EligibilityFetchOffersRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGAuthorizeOrder', 'x_api_version', x_api_version) - // verify required parameter 'order_id' is not null or undefined - assertParamExists('pGAuthorizeOrder', 'order_id', order_id) - // verify required parameter 'AuthorizeOrderRequest' is not null or undefined - assertParamExists('pGAuthorizeOrder', 'AuthorizeOrderRequest', AuthorizeOrderRequest) - const localVarPath = `/orders/{order_id}/authorization` - .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); + assertParamExists('pGEligibilityFetchOffers', 'x_api_version', x_api_version) + // verify required parameter 'EligibilityFetchOffersRequest' is not null or undefined + assertParamExists('pGEligibilityFetchOffers', 'EligibilityFetchOffersRequest', EligibilityFetchOffersRequest) + const localVarPath = `/eligibility/offers`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -11271,7 +10945,7 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -11286,35 +10960,21 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(AuthorizeOrderRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchOffersRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * If you accept OTP on your own page, you can use the below API to send OTP to Cashfree. - * @summary Submit or Resend OTP - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_payment_id The Cashfree payment or transaction ID. - * @param {OrderAuthenticatePaymentRequest} OrderAuthenticatePaymentRequest Request body to submit/resend headless OTP. To use this API make sure you have headless OTP enabled for your account - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_request_id?: string, - */ - pGOrderAuthenticatePayment: async (x_api_version: string, cf_payment_id: string, OrderAuthenticatePaymentRequest: OrderAuthenticatePaymentRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGEligibilityFetchOffersWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchOffersRequest: EligibilityFetchOffersRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGOrderAuthenticatePayment', 'x_api_version', x_api_version) - // verify required parameter 'cf_payment_id' is not null or undefined - assertParamExists('pGOrderAuthenticatePayment', 'cf_payment_id', cf_payment_id) - // verify required parameter 'OrderAuthenticatePaymentRequest' is not null or undefined - assertParamExists('pGOrderAuthenticatePayment', 'OrderAuthenticatePaymentRequest', OrderAuthenticatePaymentRequest) - const localVarPath = `/orders/pay/authenticate/{cf_payment_id}` - .replace(`{${"cf_payment_id"}}`, encodeURIComponent(String(cf_payment_id))); + assertParamExists('pGEligibilityFetchOffers', 'x_api_version', x_api_version) + // verify required parameter 'EligibilityFetchOffersRequest' is not null or undefined + assertParamExists('pGEligibilityFetchOffers', 'EligibilityFetchOffersRequest', EligibilityFetchOffersRequest) + const localVarPath = `/eligibility/offers`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -11330,11 +10990,26 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -11349,36 +11024,32 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(OrderAuthenticatePaymentRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchOffersRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to view payment details of an order for a payment ID. - * @summary Get Payment by ID + * Use this API to get eligible Paylater Payment Methods for a customer on an order. + * @summary Get Eligible Paylater for a customer on an order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} cf_payment_id The Cashfree payment or transaction ID. + * @param {EligibilityFetchPaylaterRequest} EligibilityFetchPaylaterRequest Request Body to get eligible paylater options for a customer and order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, + * x_idempotency_key?: string, */ - pGOrderFetchPayment: async (x_api_version: string, order_id: string, cf_payment_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGEligibilityFetchPaylater: async (x_api_version: string, EligibilityFetchPaylaterRequest: EligibilityFetchPaylaterRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGOrderFetchPayment', 'x_api_version', x_api_version) - // verify required parameter 'order_id' is not null or undefined - assertParamExists('pGOrderFetchPayment', 'order_id', order_id) - // verify required parameter 'cf_payment_id' is not null or undefined - assertParamExists('pGOrderFetchPayment', 'cf_payment_id', cf_payment_id) - const localVarPath = `/orders/{order_id}/payments/{cf_payment_id}` - .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))) - .replace(`{${"cf_payment_id"}}`, encodeURIComponent(String(cf_payment_id))); + assertParamExists('pGEligibilityFetchPaylater', 'x_api_version', x_api_version) + // verify required parameter 'EligibilityFetchPaylaterRequest' is not null or undefined + assertParamExists('pGEligibilityFetchPaylater', 'EligibilityFetchPaylaterRequest', EligibilityFetchPaylaterRequest) + const localVarPath = `/eligibility/paylater`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -11390,7 +11061,7 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -11411,7 +11082,9 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -11426,31 +11099,21 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchPaylaterRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to view all payment details for an order. - * @summary Get Payments for an Order - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - pGOrderFetchPayments: async (x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGEligibilityFetchPaylaterWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchPaylaterRequest: EligibilityFetchPaylaterRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGOrderFetchPayments', 'x_api_version', x_api_version) - // verify required parameter 'order_id' is not null or undefined - assertParamExists('pGOrderFetchPayments', 'order_id', order_id) - const localVarPath = `/orders/{order_id}/payments` - .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); + assertParamExists('pGEligibilityFetchPaylater', 'x_api_version', x_api_version) + // verify required parameter 'EligibilityFetchPaylaterRequest' is not null or undefined + assertParamExists('pGEligibilityFetchPaylater', 'EligibilityFetchPaylaterRequest', EligibilityFetchPaylaterRequest) + const localVarPath = `/eligibility/paylater`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -11462,28 +11125,30 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -11498,30 +11163,32 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchPaylaterRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API when you have already created the orders and want Cashfree to process the payment. To use this API S2S flag needs to be enabled from the backend. In case you want to use the cards payment option the PCI DSS flag is required, for more information send an email to \"care@cashfree.com\". - * @summary Order Pay + * Use this API to get eligible Payment Methods + * @summary Get eligible Payment Methods * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {PayOrderRequest} PayOrderRequest Request body to create a transaction at cashfree using `payment_session_id` + * @param {EligibilityFetchPaymentMethodsRequest} EligibilityFetchPaymentMethodsRequest Request Body to get eligible payment methods for an account and order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_idempotency_key?: string, */ - pGPayOrder: async (x_api_version: string, PayOrderRequest: PayOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGEligibilityFetchPaymentMethods: async (x_api_version: string, EligibilityFetchPaymentMethodsRequest: EligibilityFetchPaymentMethodsRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGPayOrder', 'x_api_version', x_api_version) - // verify required parameter 'PayOrderRequest' is not null or undefined - assertParamExists('pGPayOrder', 'PayOrderRequest', PayOrderRequest) - const localVarPath = `/orders/sessions`; + assertParamExists('pGEligibilityFetchPaymentMethods', 'x_api_version', x_api_version) + // verify required parameter 'EligibilityFetchPaymentMethodsRequest' is not null or undefined + assertParamExists('pGEligibilityFetchPaymentMethods', 'EligibilityFetchPaymentMethodsRequest', EligibilityFetchPaymentMethodsRequest) + const localVarPath = `/eligibility/payment_methods`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -11537,16 +11204,31 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") - - localVarHeaderParameter['Content-Type'] = 'application/json'; + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; - if (x_api_version != null && x_api_version != undefined) { - localVarHeaderParameter['x-api-version'] = x_api_version; - } + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") - if (x_request_id != null && x_request_id != undefined) { + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { localVarHeaderParameter['x-request-id'] = x_request_id; } @@ -11556,55 +11238,109 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(PayOrderRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchPaymentMethodsRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGEligibilityFetchPaymentMethodsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchPaymentMethodsRequest: EligibilityFetchPaymentMethodsRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGEligibilityFetchPaymentMethods', 'x_api_version', x_api_version) + // verify required parameter 'EligibilityFetchPaymentMethodsRequest' is not null or undefined + assertParamExists('pGEligibilityFetchPaymentMethods', 'EligibilityFetchPaymentMethodsRequest', EligibilityFetchPaymentMethodsRequest) + const localVarPath = `/eligibility/payment_methods`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchPaymentMethodsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + } }; /** - * PaymentsApi - functional programming interface + * EligibilityApi - functional programming interface * @export */ -const PaymentsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = PaymentsApiAxiosParamCreator(configuration) +const EligibilityApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = EligibilityApiAxiosParamCreator(configuration) return { /** - * Use this API to capture or void a preauthorized payment - * @summary Preauthorization + * Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number. + * @summary Get Eligible Cardless EMI Payment Methods for a customer on an order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {AuthorizeOrderRequest} AuthorizeOrderRequest Request to Capture or Void Transactions + * @param {EligibilityFetchCardlessEMIRequest} EligibilityFetchCardlessEMIRequest Request Body to get eligible cardless emi options for a customer and order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGAuthorizeOrder(x_api_version: string, order_id: string, AuthorizeOrderRequest: AuthorizeOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGAuthorizeOrder(x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options); + async pGEligibilityFetchCardlessEMI(x_api_version: string, EligibilityFetchCardlessEMIRequest: EligibilityFetchCardlessEMIRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchCardlessEMI(x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - /** - * If you accept OTP on your own page, you can use the below API to send OTP to Cashfree. - * @summary Submit or Resend OTP - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_payment_id The Cashfree payment or transaction ID. - * @param {OrderAuthenticatePaymentRequest} OrderAuthenticatePaymentRequest Request body to submit/resend headless OTP. To use this API make sure you have headless OTP enabled for your account - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGOrderAuthenticatePayment(x_api_version: string, cf_payment_id: string, OrderAuthenticatePaymentRequest: OrderAuthenticatePaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderAuthenticatePayment(x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options); + + async pGEligibilityFetchCardlessEMIWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchCardlessEMIRequest: EligibilityFetchCardlessEMIRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchCardlessEMIWithConfiguration(cashfreeConfiguration, x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -11612,18 +11348,26 @@ const PaymentsApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API to view payment details of an order for a payment ID. - * @summary Get Payment by ID + * Use this API to get eligible offers for an order_id or order amount. + * @summary Get Eligible Offers for an Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} cf_payment_id The Cashfree payment or transaction ID. + * @param {EligibilityFetchOffersRequest} EligibilityFetchOffersRequest Request Body to get eligible offers for a customer and order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGOrderFetchPayment(x_api_version: string, order_id: string, cf_payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchPayment(x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options); + async pGEligibilityFetchOffers(x_api_version: string, EligibilityFetchOffersRequest: EligibilityFetchOffersRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchOffers(x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGEligibilityFetchOffersWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchOffersRequest: EligibilityFetchOffersRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchOffersWithConfiguration(cashfreeConfiguration, x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -11631,17 +11375,26 @@ const PaymentsApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API to view all payment details for an order. - * @summary Get Payments for an Order + * Use this API to get eligible Paylater Payment Methods for a customer on an order. + * @summary Get Eligible Paylater for a customer on an order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order + * @param {EligibilityFetchPaylaterRequest} EligibilityFetchPaylaterRequest Request Body to get eligible paylater options for a customer and order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGOrderFetchPayments(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchPayments(x_api_version, order_id, x_request_id, x_idempotency_key, options); + async pGEligibilityFetchPaylater(x_api_version: string, EligibilityFetchPaylaterRequest: EligibilityFetchPaylaterRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchPaylater(x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGEligibilityFetchPaylaterWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchPaylaterRequest: EligibilityFetchPaylaterRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchPaylaterWithConfiguration(cashfreeConfiguration, x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -11649,17 +11402,26 @@ const PaymentsApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API when you have already created the orders and want Cashfree to process the payment. To use this API S2S flag needs to be enabled from the backend. In case you want to use the cards payment option the PCI DSS flag is required, for more information send an email to \"care@cashfree.com\". - * @summary Order Pay + * Use this API to get eligible Payment Methods + * @summary Get eligible Payment Methods * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {PayOrderRequest} PayOrderRequest Request body to create a transaction at cashfree using `payment_session_id` + * @param {EligibilityFetchPaymentMethodsRequest} EligibilityFetchPaymentMethodsRequest Request Body to get eligible payment methods for an account and order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGPayOrder(x_api_version: string, PayOrderRequest: PayOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGPayOrder(x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options); + async pGEligibilityFetchPaymentMethods(x_api_version: string, EligibilityFetchPaymentMethodsRequest: EligibilityFetchPaymentMethodsRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchPaymentMethods(x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGEligibilityFetchPaymentMethodsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchPaymentMethodsRequest: EligibilityFetchPaymentMethodsRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGEligibilityFetchPaymentMethodsWithConfiguration(cashfreeConfiguration, x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -11670,42 +11432,38 @@ const PaymentsApiFp = function(configuration?: Configuration) { }; /** - * PaymentsApi - object-oriented interface + * EligibilityApi - object-oriented interface * @export - * @class PaymentsApi + * @class EligibilityApi * @extends {BaseAPI} */ /** - * RefundsApi - axios parameter creator + * OffersApi - axios parameter creator * @export */ -const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { +const OffersApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Use this API to initiate refunds. - * @summary Create Refund + * Use this API to create offers with Cashfree from your backend + * @summary Create Offer * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {OrderCreateRefundRequest} OrderCreateRefundRequest Request Body to Create Refunds + * @param {CreateOfferRequest} CreateOfferRequest Request body to create an offer at Cashfree * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, + * x_idempotency_key?: string, */ - pGOrderCreateRefund: async (x_api_version: string, order_id: string, OrderCreateRefundRequest: OrderCreateRefundRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGCreateOffer: async (x_api_version: string, CreateOfferRequest: CreateOfferRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGOrderCreateRefund', 'x_api_version', x_api_version) - // verify required parameter 'order_id' is not null or undefined - assertParamExists('pGOrderCreateRefund', 'order_id', order_id) - // verify required parameter 'OrderCreateRefundRequest' is not null or undefined - assertParamExists('pGOrderCreateRefund', 'OrderCreateRefundRequest', OrderCreateRefundRequest) - const localVarPath = `/orders/{order_id}/refunds` - .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); + assertParamExists('pGCreateOffer', 'x_api_version', x_api_version) + // verify required parameter 'CreateOfferRequest' is not null or undefined + assertParamExists('pGCreateOffer', 'CreateOfferRequest', CreateOfferRequest) + const localVarPath = `/offers`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -11740,7 +11498,7 @@ const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -11755,36 +11513,21 @@ const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(OrderCreateRefundRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(CreateOfferRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to fetch a specific refund processed on your Cashfree Account. - * @summary Get Refund - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} refund_id Refund Id of the refund you want to fetch. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_request_id?: string, - */ - pGOrderFetchRefund: async (x_api_version: string, order_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGCreateOfferWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateOfferRequest: CreateOfferRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGOrderFetchRefund', 'x_api_version', x_api_version) - // verify required parameter 'order_id' is not null or undefined - assertParamExists('pGOrderFetchRefund', 'order_id', order_id) - // verify required parameter 'refund_id' is not null or undefined - assertParamExists('pGOrderFetchRefund', 'refund_id', refund_id) - const localVarPath = `/orders/{order_id}/refunds/{refund_id}` - .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))) - .replace(`{${"refund_id"}}`, encodeURIComponent(String(refund_id))); + assertParamExists('pGCreateOffer', 'x_api_version', x_api_version) + // verify required parameter 'CreateOfferRequest' is not null or undefined + assertParamExists('pGCreateOffer', 'CreateOfferRequest', CreateOfferRequest) + const localVarPath = `/offers`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -11796,28 +11539,30 @@ const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -11832,31 +11577,33 @@ const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateOfferRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to fetch all refunds processed against an order. - * @summary Get All Refunds for an Order + * Use this API to get offer by offer_id + * @summary Get Offer by ID * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order + * @param {string} offer_id The offer ID for which you want to view the offer details. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_idempotency_key?: string, */ - pGOrderFetchRefunds: async (x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGFetchOffer: async (x_api_version: string, offer_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGOrderFetchRefunds', 'x_api_version', x_api_version) - // verify required parameter 'order_id' is not null or undefined - assertParamExists('pGOrderFetchRefunds', 'order_id', order_id) - const localVarPath = `/orders/{order_id}/refunds` - .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); + assertParamExists('pGFetchOffer', 'x_api_version', x_api_version) + // verify required parameter 'offer_id' is not null or undefined + assertParamExists('pGFetchOffer', 'offer_id', offer_id) + const localVarPath = `/offers/{offer_id}` + .replace(`{${"offer_id"}}`, encodeURIComponent(String(offer_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -11889,7 +11636,7 @@ const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -11910,48 +11657,100 @@ const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { options: localVarRequestOptions, }; }, - } -}; -/** - * RefundsApi - functional programming interface - * @export - */ -const RefundsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = RefundsApiAxiosParamCreator(configuration) - return { - /** - * Use this API to initiate refunds. - * @summary Create Refund + // With Configuration + pGFetchOfferWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, offer_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGFetchOffer', 'x_api_version', x_api_version) + // verify required parameter 'offer_id' is not null or undefined + assertParamExists('pGFetchOffer', 'offer_id', offer_id) + const localVarPath = `/offers/{offer_id}` + .replace(`{${"offer_id"}}`, encodeURIComponent(String(offer_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + } +}; + +/** + * OffersApi - functional programming interface + * @export + */ +const OffersApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = OffersApiAxiosParamCreator(configuration) + return { + /** + * Use this API to create offers with Cashfree from your backend + * @summary Create Offer * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {OrderCreateRefundRequest} OrderCreateRefundRequest Request Body to Create Refunds + * @param {CreateOfferRequest} CreateOfferRequest Request body to create an offer at Cashfree * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGOrderCreateRefund(x_api_version: string, order_id: string, OrderCreateRefundRequest: OrderCreateRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderCreateRefund(x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options); + async pGCreateOffer(x_api_version: string, CreateOfferRequest: CreateOfferRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCreateOffer(x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - /** - * Use this API to fetch a specific refund processed on your Cashfree Account. - * @summary Get Refund - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} refund_id Refund Id of the refund you want to fetch. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGOrderFetchRefund(x_api_version: string, order_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchRefund(x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options); + + async pGCreateOfferWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateOfferRequest: CreateOfferRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCreateOfferWithConfiguration(cashfreeConfiguration, x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -11959,17 +11758,26 @@ const RefundsApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API to fetch all refunds processed against an order. - * @summary Get All Refunds for an Order + * Use this API to get offer by offer_id + * @summary Get Offer by ID * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order + * @param {string} offer_id The offer ID for which you want to view the offer details. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGOrderFetchRefunds(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchRefunds(x_api_version, order_id, x_request_id, x_idempotency_key, options); + async pGFetchOffer(x_api_version: string, offer_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchOffer(x_api_version, offer_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGFetchOfferWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, offer_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchOfferWithConfiguration(cashfreeConfiguration, x_api_version, offer_id, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -11980,40 +11788,38 @@ const RefundsApiFp = function(configuration?: Configuration) { }; /** - * RefundsApi - object-oriented interface + * OffersApi - object-oriented interface * @export - * @class RefundsApi + * @class OffersApi * @extends {BaseAPI} */ /** - * SettlementReconciliationApi - axios parameter creator + * OrdersApi - axios parameter creator * @export */ -const SettlementReconciliationApiAxiosParamCreator = function (configuration?: Configuration) { +const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range. - * @summary Get All Settlements + * ### Order An order is an entity which has a amount and currency associated with it. It is something for which you want to collect payment for. Use this API to create orders with Cashfree from your backend to get a `payment_sessions_id`. You can use the `payment_sessions_id` to create a transaction for the order. + * @summary Create Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {FetchSettlementsRequest} FetchSettlementsRequest Request Body to get the settlements - * @param {string} [Content_Type] application/json + * @param {CreateOrderRequest} CreateOrderRequest Request body to create an order at cashfree * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [Accept] application/json * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, + * x_idempotency_key?: string, */ - pGFetchSettlements: async (x_api_version: string, FetchSettlementsRequest: FetchSettlementsRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options: AxiosRequestConfig = {}): Promise => { + pGCreateOrder: async (x_api_version: string, CreateOrderRequest: CreateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGFetchSettlements', 'x_api_version', x_api_version) - // verify required parameter 'FetchSettlementsRequest' is not null or undefined - assertParamExists('pGFetchSettlements', 'FetchSettlementsRequest', FetchSettlementsRequest) - const localVarPath = `/settlements`; + assertParamExists('pGCreateOrder', 'x_api_version', x_api_version) + // verify required parameter 'CreateOrderRequest' is not null or undefined + assertParamExists('pGCreateOrder', 'CreateOrderRequest', CreateOrderRequest) + const localVarPath = `/orders`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -12048,7 +11854,7 @@ const SettlementReconciliationApiAxiosParamCreator = function (configuration?: C localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -12063,33 +11869,21 @@ const SettlementReconciliationApiAxiosParamCreator = function (configuration?: C setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(FetchSettlementsRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(CreateOrderRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * - Use this API to get settlement reconciliation details using Settlement ID, settlement UTR or date range. - This API will return events for the settlement IDs you want - * @summary Settlement Reconciliation - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {SettlementFetchReconRequest} SettlementFetchReconRequest Request Body for the settlement reconciliation - * @param {string} [Content_Type] application/json - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [Accept] application/json - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_request_id?: string, - */ - pGSettlementFetchRecon: async (x_api_version: string, SettlementFetchReconRequest: SettlementFetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGCreateOrderWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateOrderRequest: CreateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGSettlementFetchRecon', 'x_api_version', x_api_version) - // verify required parameter 'SettlementFetchReconRequest' is not null or undefined - assertParamExists('pGSettlementFetchRecon', 'SettlementFetchReconRequest', SettlementFetchReconRequest) - const localVarPath = `/settlement/recon`; + assertParamExists('pGCreateOrder', 'x_api_version', x_api_version) + // verify required parameter 'CreateOrderRequest' is not null or undefined + assertParamExists('pGCreateOrder', 'CreateOrderRequest', CreateOrderRequest) + const localVarPath = `/orders`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -12106,25 +11900,25 @@ const SettlementReconciliationApiAxiosParamCreator = function (configuration?: C const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -12139,97 +11933,33 @@ const SettlementReconciliationApiAxiosParamCreator = function (configuration?: C setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(SettlementFetchReconRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(CreateOrderRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - } -}; - -/** - * SettlementReconciliationApi - functional programming interface - * @export - */ -const SettlementReconciliationApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = SettlementReconciliationApiAxiosParamCreator(configuration) - return { - /** - * Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range. - * @summary Get All Settlements - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {FetchSettlementsRequest} FetchSettlementsRequest Request Body to get the settlements - * @param {string} [Content_Type] application/json - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [Accept] application/json - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGFetchSettlements(x_api_version: string, FetchSettlementsRequest: FetchSettlementsRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchSettlements(x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * - Use this API to get settlement reconciliation details using Settlement ID, settlement UTR or date range. - This API will return events for the settlement IDs you want - * @summary Settlement Reconciliation - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {SettlementFetchReconRequest} SettlementFetchReconRequest Request Body for the settlement reconciliation - * @param {string} [Content_Type] application/json - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [Accept] application/json - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGSettlementFetchRecon(x_api_version: string, SettlementFetchReconRequest: SettlementFetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGSettlementFetchRecon(x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - } -}; - -/** - * SettlementReconciliationApi - object-oriented interface - * @export - * @class SettlementReconciliationApi - * @extends {BaseAPI} - */ - - -/** - * SettlementsApi - axios parameter creator - * @export - */ -const SettlementsApiAxiosParamCreator = function (configuration?: Configuration) { - return { /** - * Use this API to pass the CBRICS ID to Cashfree and mark an order for settlement. - * @summary Mark Order For Settlement + * Use this API to fetch the order that was created at Cashfree\'s using the `order_id`. ## When to use this API - To check the status of your order - Once the order is PAID - Once your customer returns to `return_url` + * @summary Get Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {CreateOrderSettlementRequestBody} [CreateOrderSettlementRequestBody] Create Order Settlement Request Body. * @param {*} [options] Override http request option. * @throws {RequiredError} - * CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, + * x_idempotency_key?: string, */ - markForSettlement: async (x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, options: AxiosRequestConfig = {}): Promise => { + pGFetchOrder: async (x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('markForSettlement', 'x_api_version', x_api_version) - const localVarPath = `/orders/settlements`; + assertParamExists('pGFetchOrder', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGFetchOrder', 'order_id', order_id) + const localVarPath = `/orders/{order_id}` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -12241,7 +11971,7 @@ const SettlementsApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -12262,9 +11992,7 @@ const SettlementsApiAxiosParamCreator = function (configuration?: Configuration) - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -12279,31 +12007,20 @@ const SettlementsApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreateOrderSettlementRequestBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to view all the settlements of a particular order. - * @summary Get Settlements by Order ID - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - pGOrderFetchSettlement: async (x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGFetchOrderWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGOrderFetchSettlement', 'x_api_version', x_api_version) + assertParamExists('pGFetchOrder', 'x_api_version', x_api_version) // verify required parameter 'order_id' is not null or undefined - assertParamExists('pGOrderFetchSettlement', 'order_id', order_id) - const localVarPath = `/orders/{order_id}/settlements` + assertParamExists('pGFetchOrder', 'order_id', order_id) + const localVarPath = `/orders/{order_id}` .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; @@ -12321,23 +12038,23 @@ const SettlementsApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -12358,89 +12075,29 @@ const SettlementsApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, - } -}; - -/** - * SettlementsApi - functional programming interface - * @export - */ -const SettlementsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = SettlementsApiAxiosParamCreator(configuration) - return { - /** - * Use this API to pass the CBRICS ID to Cashfree and mark an order for settlement. - * @summary Mark Order For Settlement - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {CreateOrderSettlementRequestBody} [CreateOrderSettlementRequestBody] Create Order Settlement Request Body. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async markForSettlement(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.markForSettlement(x_api_version, x_request_id, x_idempotency_key, CreateOrderSettlementRequestBody, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to view all the settlements of a particular order. - * @summary Get Settlements by Order ID - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGOrderFetchSettlement(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchSettlement(x_api_version, order_id, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - } -}; - -/** - * SettlementsApi - object-oriented interface - * @export - * @class SettlementsApi - * @extends {BaseAPI} - */ - - -/** - * SimulationApi - axios parameter creator - * @export - */ -const SimulationApiAxiosParamCreator = function (configuration?: Configuration) { - return { /** - * Use this API to fetch simulated payment details. - * @summary Fetch Simulation + * Use this API to terminate the order that was created at Cashfree\'s using the `order_id`. + * @summary Terminate Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} simulation_id Provide the SimulationId for which the details have to be fetched. + * @param {string} order_id The id which uniquely identifies your order + * @param {TerminateOrderRequest} TerminateOrderRequest Request body to terminate an order at cashfree * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_idempotency_key?: string, + * x_request_id?: string, */ - pGFetchSimulation: async (x_api_version: string, simulation_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGTerminateOrder: async (x_api_version: string, order_id: string, TerminateOrderRequest: TerminateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGFetchSimulation', 'x_api_version', x_api_version) - // verify required parameter 'simulation_id' is not null or undefined - assertParamExists('pGFetchSimulation', 'simulation_id', simulation_id) - const localVarPath = `/simulate/{simulation_id}` - .replace(`{${"simulation_id"}}`, encodeURIComponent(String(simulation_id))); + assertParamExists('pGTerminateOrder', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGTerminateOrder', 'order_id', order_id) + // verify required parameter 'TerminateOrderRequest' is not null or undefined + assertParamExists('pGTerminateOrder', 'TerminateOrderRequest', TerminateOrderRequest) + const localVarPath = `/orders/{order_id}` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -12452,7 +12109,7 @@ const SimulationApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -12473,7 +12130,9 @@ const SimulationApiAxiosParamCreator = function (configuration?: Configuration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -12488,30 +12147,24 @@ const SimulationApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(TerminateOrderRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to simulate payment. To use this API you should first create an order using the Create Order API. Also, you need to create a payment with the same order. - * @summary Simulate Payment - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {SimulateRequest} SimulateRequest Request Body to Make Simulation - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - pGSimulatePayment: async (x_api_version: string, SimulateRequest: SimulateRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGTerminateOrderWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, TerminateOrderRequest: TerminateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGSimulatePayment', 'x_api_version', x_api_version) - // verify required parameter 'SimulateRequest' is not null or undefined - assertParamExists('pGSimulatePayment', 'SimulateRequest', SimulateRequest) - const localVarPath = `/simulate`; + assertParamExists('pGTerminateOrder', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGTerminateOrder', 'order_id', order_id) + // verify required parameter 'TerminateOrderRequest' is not null or undefined + assertParamExists('pGTerminateOrder', 'TerminateOrderRequest', TerminateOrderRequest) + const localVarPath = `/orders/{order_id}` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -12523,30 +12176,30 @@ const SimulationApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -12561,35 +12214,45 @@ const SimulationApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(SimulateRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(TerminateOrderRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + } }; /** - * SimulationApi - functional programming interface + * OrdersApi - functional programming interface * @export */ -const SimulationApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = SimulationApiAxiosParamCreator(configuration) +const OrdersApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = OrdersApiAxiosParamCreator(configuration) return { /** - * Use this API to fetch simulated payment details. - * @summary Fetch Simulation + * ### Order An order is an entity which has a amount and currency associated with it. It is something for which you want to collect payment for. Use this API to create orders with Cashfree from your backend to get a `payment_sessions_id`. You can use the `payment_sessions_id` to create a transaction for the order. + * @summary Create Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} simulation_id Provide the SimulationId for which the details have to be fetched. + * @param {CreateOrderRequest} CreateOrderRequest Request body to create an order at cashfree * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGFetchSimulation(x_api_version: string, simulation_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchSimulation(x_api_version, simulation_id, x_request_id, x_idempotency_key, options); + async pGCreateOrder(x_api_version: string, CreateOrderRequest: CreateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCreateOrder(x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGCreateOrderWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateOrderRequest: CreateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCreateOrderWithConfiguration(cashfreeConfiguration, x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -12597,17 +12260,54 @@ const SimulationApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API to simulate payment. To use this API you should first create an order using the Create Order API. Also, you need to create a payment with the same order. - * @summary Simulate Payment + * Use this API to fetch the order that was created at Cashfree\'s using the `order_id`. ## When to use this API - To check the status of your order - Once the order is PAID - Once your customer returns to `return_url` + * @summary Get Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {SimulateRequest} SimulateRequest Request Body to Make Simulation + * @param {string} order_id The id which uniquely identifies your order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGSimulatePayment(x_api_version: string, SimulateRequest: SimulateRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGSimulatePayment(x_api_version, SimulateRequest, x_request_id, x_idempotency_key, options); + async pGFetchOrder(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchOrder(x_api_version, order_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGFetchOrderWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchOrderWithConfiguration(cashfreeConfiguration, x_api_version, order_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to terminate the order that was created at Cashfree\'s using the `order_id`. + * @summary Terminate Order + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {TerminateOrderRequest} TerminateOrderRequest Request body to terminate an order at cashfree + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGTerminateOrder(x_api_version: string, order_id: string, TerminateOrderRequest: TerminateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGTerminateOrder(x_api_version, order_id, TerminateOrderRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGTerminateOrderWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, TerminateOrderRequest: TerminateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGTerminateOrderWithConfiguration(cashfreeConfiguration, x_api_version, order_id, TerminateOrderRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -12618,38 +12318,40 @@ const SimulationApiFp = function(configuration?: Configuration) { }; /** - * SimulationApi - object-oriented interface + * OrdersApi - object-oriented interface * @export - * @class SimulationApi + * @class OrdersApi * @extends {BaseAPI} */ /** - * SoftPOSApi - axios parameter creator + * PGReconciliationApi - axios parameter creator * @export */ -const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { +const PGReconciliationApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Use this API to create new terminals to use softPOS. - * @summary Create Terminal + * - Use this API to get the payment gateway reconciliation details with date range. - It will have events for your payment account + * @summary PG Reconciliation * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateTerminalRequest} CreateTerminalRequest Request Body to Create Terminal for SPOS + * @param {FetchReconRequest} FetchReconRequest Request Body for the reconciliation + * @param {string} [Content_Type] application/json * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [Accept] application/json * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_idempotency_key?: string, + * x_request_id?: string, */ - sposCreateTerminal: async (x_api_version: string, CreateTerminalRequest: CreateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGFetchRecon: async (x_api_version: string, FetchReconRequest: FetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('sposCreateTerminal', 'x_api_version', x_api_version) - // verify required parameter 'CreateTerminalRequest' is not null or undefined - assertParamExists('sposCreateTerminal', 'CreateTerminalRequest', CreateTerminalRequest) - const localVarPath = `/terminal`; + assertParamExists('pGFetchRecon', 'x_api_version', x_api_version) + // verify required parameter 'FetchReconRequest' is not null or undefined + assertParamExists('pGFetchRecon', 'FetchReconRequest', FetchReconRequest) + const localVarPath = `/recon`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -12684,7 +12386,7 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -12699,31 +12401,21 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreateTerminalRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(FetchReconRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to create a new terminal transaction. To use this API you should first create an order using the Create Order API. Also, you need to enter the terminal details while creating the order and pass the same terminal information while creating a transaction using the below mentioned API. - * @summary Create Terminal Transaction - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateTerminalTransactionRequest} CreateTerminalTransactionRequest Request body to create a terminal transaction - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - sposCreateTerminalTransaction: async (x_api_version: string, CreateTerminalTransactionRequest: CreateTerminalTransactionRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGFetchReconWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, FetchReconRequest: FetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('sposCreateTerminalTransaction', 'x_api_version', x_api_version) - // verify required parameter 'CreateTerminalTransactionRequest' is not null or undefined - assertParamExists('sposCreateTerminalTransaction', 'CreateTerminalTransactionRequest', CreateTerminalTransactionRequest) - const localVarPath = `/terminal/transactions`; + assertParamExists('pGFetchRecon', 'x_api_version', x_api_version) + // verify required parameter 'FetchReconRequest' is not null or undefined + assertParamExists('pGFetchRecon', 'FetchReconRequest', FetchReconRequest) + const localVarPath = `/recon`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -12740,25 +12432,25 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -12773,32 +12465,90 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreateTerminalTransactionRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(FetchReconRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + + } +}; + +/** + * PGReconciliationApi - functional programming interface + * @export + */ +const PGReconciliationApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PGReconciliationApiAxiosParamCreator(configuration) + return { /** - * Use this API to view all details of a terminal. - * @summary Get Terminal Status using Phone Number + * - Use this API to get the payment gateway reconciliation details with date range. - It will have events for your payment account + * @summary PG Reconciliation + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {FetchReconRequest} FetchReconRequest Request Body for the reconciliation + * @param {string} [Content_Type] application/json + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [Accept] application/json + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGFetchRecon(x_api_version: string, FetchReconRequest: FetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchRecon(x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGFetchReconWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, FetchReconRequest: FetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchReconWithConfiguration(cashfreeConfiguration, x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + } +}; + +/** + * PGReconciliationApi - object-oriented interface + * @export + * @class PGReconciliationApi + * @extends {BaseAPI} + */ + + + +/** + * PaymentLinksApi - axios parameter creator + * @export + */ +const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Use this API to cancel a payment link. No further payments can be done against a cancelled link. Only a link in ACTIVE status can be cancelled. + * @summary Cancel Payment Link * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} terminal_phone_no The terminal for which you want to view the order details. + * @param {string} link_id The payment link ID for which you want to view the details. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_idempotency_key?: string, */ - sposFetchTerminal: async (x_api_version: string, terminal_phone_no: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGCancelLink: async (x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('sposFetchTerminal', 'x_api_version', x_api_version) - // verify required parameter 'terminal_phone_no' is not null or undefined - assertParamExists('sposFetchTerminal', 'terminal_phone_no', terminal_phone_no) - const localVarPath = `/terminal/{terminal_phone_no}` - .replace(`{${"terminal_phone_no"}}`, encodeURIComponent(String(terminal_phone_no))); + assertParamExists('pGCancelLink', 'x_api_version', x_api_version) + // verify required parameter 'link_id' is not null or undefined + assertParamExists('pGCancelLink', 'link_id', link_id) + const localVarPath = `/links/{link_id}/cancel` + .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -12810,7 +12560,7 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -12831,7 +12581,7 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -12852,27 +12602,15 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { options: localVarRequestOptions, }; }, - /** - * You can fetch all the StaticQRs corresponding to given terminal id or phone number. Provide either the terminal_phone_no or terminal_id in the request. - * @summary Fetch Terminal QR Codes - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} terminal_phone_no Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request. - * @param {string} cf_terminal_id Cashfree terminal id for which you want to get staticQRs. Required if you are not providing the terminal_phone_number in the request. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_request_id?: string, - */ - sposFetchTerminalQRCodes: async (x_api_version: string, terminal_phone_no: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGCancelLinkWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('sposFetchTerminalQRCodes', 'x_api_version', x_api_version) - // verify required parameter 'terminal_phone_no' is not null or undefined - assertParamExists('sposFetchTerminalQRCodes', 'terminal_phone_no', terminal_phone_no) - // verify required parameter 'cf_terminal_id' is not null or undefined - assertParamExists('sposFetchTerminalQRCodes', 'cf_terminal_id', cf_terminal_id) - const localVarPath = `/terminal/qrcodes`; + assertParamExists('pGCancelLink', 'x_api_version', x_api_version) + // verify required parameter 'link_id' is not null or undefined + assertParamExists('pGCancelLink', 'link_id', link_id) + const localVarPath = `/links/{link_id}/cancel` + .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -12884,36 +12622,28 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - - if (terminal_phone_no !== undefined) { - localVarQueryParameter['terminal_phone_no'] = terminal_phone_no; - } - - if (cf_terminal_id !== undefined) { - localVarQueryParameter['cf_terminal_id'] = cf_terminal_id; - } + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -12934,28 +12664,25 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { options: localVarRequestOptions, }; }, + /** - * Use this API to get terminal transaction. - * @summary Get Terminal Transaction + * Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url. + * @summary Create Payment Link * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} utr Utr of the transaction. - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {CreateLinkRequest} CreateLinkRequest Request Body to Create Payment Links * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, + * x_idempotency_key?: string, */ - sposFetchTerminalTransaction: async (x_api_version: string, utr: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGCreateLink: async (x_api_version: string, CreateLinkRequest: CreateLinkRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('sposFetchTerminalTransaction', 'x_api_version', x_api_version) - // verify required parameter 'utr' is not null or undefined - assertParamExists('sposFetchTerminalTransaction', 'utr', utr) - // verify required parameter 'cf_terminal_id' is not null or undefined - assertParamExists('sposFetchTerminalTransaction', 'cf_terminal_id', cf_terminal_id) - const localVarPath = `/terminal/{cf_terminal_id}/payments` - .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + assertParamExists('pGCreateLink', 'x_api_version', x_api_version) + // verify required parameter 'CreateLinkRequest' is not null or undefined + assertParamExists('pGCreateLink', 'CreateLinkRequest', CreateLinkRequest) + const localVarPath = `/links`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -12967,7 +12694,7 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -12986,13 +12713,11 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { // authentication XClientSignatureHeader required await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - if (utr !== undefined) { - localVarQueryParameter['utr'] = utr; - } - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13007,34 +12732,21 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateLinkRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to update the terminal details. Email, Phone Number, and Terminal Meta are updatable for \"Storefront\". Only account status change is possible in case of \"Agent\". - * @summary Update Terminal - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {UpdateTerminalRequest} UpdateTerminalRequest Request Body to update terminal for SPOS. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_request_id?: string, - */ - sposUpdateTerminal: async (x_api_version: string, cf_terminal_id: string, UpdateTerminalRequest: UpdateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGCreateLinkWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateLinkRequest: CreateLinkRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('sposUpdateTerminal', 'x_api_version', x_api_version) - // verify required parameter 'cf_terminal_id' is not null or undefined - assertParamExists('sposUpdateTerminal', 'cf_terminal_id', cf_terminal_id) - // verify required parameter 'UpdateTerminalRequest' is not null or undefined - assertParamExists('sposUpdateTerminal', 'UpdateTerminalRequest', UpdateTerminalRequest) - const localVarPath = `/terminal/{cf_terminal_id}` - .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + assertParamExists('pGCreateLink', 'x_api_version', x_api_version) + // verify required parameter 'CreateLinkRequest' is not null or undefined + assertParamExists('pGCreateLink', 'CreateLinkRequest', CreateLinkRequest) + const localVarPath = `/links`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -13046,30 +12758,30 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13084,35 +12796,33 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(UpdateTerminalRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(CreateLinkRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to update the terminal status. - * @summary Update Terminal Status + * Use this API to view all details and status of a payment link. + * @summary Fetch Payment Link Details * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {UpdateTerminalStatusRequest} UpdateTerminalStatusRequest Request Body to update terminal status for SPOS. + * @param {string} link_id The payment link ID for which you want to view the details. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, + * x_idempotency_key?: string, */ - sposUpdateTerminalStatus: async (x_api_version: string, cf_terminal_id: string, UpdateTerminalStatusRequest: UpdateTerminalStatusRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGFetchLink: async (x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('sposUpdateTerminalStatus', 'x_api_version', x_api_version) - // verify required parameter 'cf_terminal_id' is not null or undefined - assertParamExists('sposUpdateTerminalStatus', 'cf_terminal_id', cf_terminal_id) - // verify required parameter 'UpdateTerminalStatusRequest' is not null or undefined - assertParamExists('sposUpdateTerminalStatus', 'UpdateTerminalStatusRequest', UpdateTerminalStatusRequest) - const localVarPath = `/terminal/{cf_terminal_id}/status` - .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + assertParamExists('pGFetchLink', 'x_api_version', x_api_version) + // verify required parameter 'link_id' is not null or undefined + assertParamExists('pGFetchLink', 'link_id', link_id) + const localVarPath = `/links/{link_id}` + .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -13124,7 +12834,7 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -13145,9 +12855,7 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13162,36 +12870,22 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(UpdateTerminalStatusRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to upload the terminal documents. - * @summary Upload Terminal Docs - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {UploadTerminalDocs} UploadTerminalDocs Request Body to update terminal documents for SPOS. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_request_id?: string, - */ - sposUploadTerminalDocs: async (x_api_version: string, cf_terminal_id: string, UploadTerminalDocs: UploadTerminalDocs, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGFetchLinkWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('sposUploadTerminalDocs', 'x_api_version', x_api_version) - // verify required parameter 'cf_terminal_id' is not null or undefined - assertParamExists('sposUploadTerminalDocs', 'cf_terminal_id', cf_terminal_id) - // verify required parameter 'UploadTerminalDocs' is not null or undefined - assertParamExists('sposUploadTerminalDocs', 'UploadTerminalDocs', UploadTerminalDocs) - const localVarPath = `/terminal/{cf_terminal_id}/docs` - .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. + assertParamExists('pGFetchLink', 'x_api_version', x_api_version) + // verify required parameter 'link_id' is not null or undefined + assertParamExists('pGFetchLink', 'link_id', link_id) + const localVarPath = `/links/{link_id}` + .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -13202,30 +12896,28 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13240,208 +12932,33 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(UploadTerminalDocs, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - } -}; - -/** - * SoftPOSApi - functional programming interface - * @export - */ -const SoftPOSApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = SoftPOSApiAxiosParamCreator(configuration) - return { - /** - * Use this API to create new terminals to use softPOS. - * @summary Create Terminal - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateTerminalRequest} CreateTerminalRequest Request Body to Create Terminal for SPOS - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async sposCreateTerminal(x_api_version: string, CreateTerminalRequest: CreateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sposCreateTerminal(x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to create a new terminal transaction. To use this API you should first create an order using the Create Order API. Also, you need to enter the terminal details while creating the order and pass the same terminal information while creating a transaction using the below mentioned API. - * @summary Create Terminal Transaction - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateTerminalTransactionRequest} CreateTerminalTransactionRequest Request body to create a terminal transaction - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async sposCreateTerminalTransaction(x_api_version: string, CreateTerminalTransactionRequest: CreateTerminalTransactionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sposCreateTerminalTransaction(x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to view all details of a terminal. - * @summary Get Terminal Status using Phone Number - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} terminal_phone_no The terminal for which you want to view the order details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async sposFetchTerminal(x_api_version: string, terminal_phone_no: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sposFetchTerminal(x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * You can fetch all the StaticQRs corresponding to given terminal id or phone number. Provide either the terminal_phone_no or terminal_id in the request. - * @summary Fetch Terminal QR Codes - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} terminal_phone_no Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request. - * @param {string} cf_terminal_id Cashfree terminal id for which you want to get staticQRs. Required if you are not providing the terminal_phone_number in the request. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async sposFetchTerminalQRCodes(x_api_version: string, terminal_phone_no: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sposFetchTerminalQRCodes(x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to get terminal transaction. - * @summary Get Terminal Transaction - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} utr Utr of the transaction. - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async sposFetchTerminalTransaction(x_api_version: string, utr: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sposFetchTerminalTransaction(x_api_version, utr, cf_terminal_id, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to update the terminal details. Email, Phone Number, and Terminal Meta are updatable for \"Storefront\". Only account status change is possible in case of \"Agent\". - * @summary Update Terminal - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {UpdateTerminalRequest} UpdateTerminalRequest Request Body to update terminal for SPOS. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async sposUpdateTerminal(x_api_version: string, cf_terminal_id: string, UpdateTerminalRequest: UpdateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sposUpdateTerminal(x_api_version, cf_terminal_id, UpdateTerminalRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to update the terminal status. - * @summary Update Terminal Status - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {UpdateTerminalStatusRequest} UpdateTerminalStatusRequest Request Body to update terminal status for SPOS. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async sposUpdateTerminalStatus(x_api_version: string, cf_terminal_id: string, UpdateTerminalStatusRequest: UpdateTerminalStatusRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sposUpdateTerminalStatus(x_api_version, cf_terminal_id, UpdateTerminalStatusRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to upload the terminal documents. - * @summary Upload Terminal Docs - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {UploadTerminalDocs} UploadTerminalDocs Request Body to update terminal documents for SPOS. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async sposUploadTerminalDocs(x_api_version: string, cf_terminal_id: string, UploadTerminalDocs: UploadTerminalDocs, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sposUploadTerminalDocs(x_api_version, cf_terminal_id, UploadTerminalDocs, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - } -}; - -/** - * SoftPOSApi - object-oriented interface - * @export - * @class SoftPOSApi - * @extends {BaseAPI} - */ - - -/** - * SubscriptionApi - axios parameter creator - * @export - */ -const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration) { - return { /** - * Use this API to create an auth or to raise a charge . - * @summary Raise a charge or create an auth. + * Use this API to view all order details for a payment link. + * @summary Get Orders for a Payment Link * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateSubscriptionPaymentRequest} CreateSubscriptionPaymentRequest Request body to create a subscription payment. + * @param {string} link_id The payment link ID for which you want to view the details. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [status] Mention What is status of orders you want to fetch, default is PAID. Possible value: ALL, PAID * @param {*} [options] Override http request option. * @throws {RequiredError} * x_idempotency_key?: string, */ - subsCreatePayment: async (x_api_version: string, CreateSubscriptionPaymentRequest: CreateSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGLinkFetchOrders: async (x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, status?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsCreatePayment', 'x_api_version', x_api_version) - // verify required parameter 'CreateSubscriptionPaymentRequest' is not null or undefined - assertParamExists('subsCreatePayment', 'CreateSubscriptionPaymentRequest', CreateSubscriptionPaymentRequest) - const localVarPath = `/subscriptions/pay`; + assertParamExists('pGLinkFetchOrders', 'x_api_version', x_api_version) + // verify required parameter 'link_id' is not null or undefined + assertParamExists('pGLinkFetchOrders', 'link_id', link_id) + const localVarPath = `/links/{link_id}/orders` + .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -13453,7 +12970,7 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -13472,11 +12989,13 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration // authentication XClientSignatureHeader required await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + if (status !== undefined) { + localVarQueryParameter['status'] = status; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13491,31 +13010,21 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreateSubscriptionPaymentRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * A plan allows your customer to identify the features you offer along with your pricing. You can create plans as per the pricing you support for your services. For each plan, you can set a pre-decided frequency and amount with which they’ll be charged. Example: Netflix Plans - Premium, Basic, Standard, Mobile. Each plan differs and caters for a particular set of audiences. - * @summary Create a plan. - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreatePlanRequest} CreatePlanRequest Request body to create a plan. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - subsCreatePlan: async (x_api_version: string, CreatePlanRequest: CreatePlanRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGLinkFetchOrdersWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, status?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsCreatePlan', 'x_api_version', x_api_version) - // verify required parameter 'CreatePlanRequest' is not null or undefined - assertParamExists('subsCreatePlan', 'CreatePlanRequest', CreatePlanRequest) - const localVarPath = `/plans`; + assertParamExists('pGLinkFetchOrders', 'x_api_version', x_api_version) + // verify required parameter 'link_id' is not null or undefined + assertParamExists('pGLinkFetchOrders', 'link_id', link_id) + const localVarPath = `/links/{link_id}/orders` + .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -13527,30 +13036,32 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + if (status !== undefined) { + localVarQueryParameter['status'] = status; + } - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13565,35 +13076,172 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreatePlanRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + + } +}; + +/** + * PaymentLinksApi - functional programming interface + * @export + */ +const PaymentLinksApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PaymentLinksApiAxiosParamCreator(configuration) + return { /** - * This API allows you to create refund on a successful payment. Refund amount can be partial or the full amount of the payment. - * @summary Create a refund. + * Use this API to cancel a payment link. No further payments can be done against a cancelled link. Only a link in ACTIVE status can be cancelled. + * @summary Cancel Payment Link + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} link_id The payment link ID for which you want to view the details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGCancelLink(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCancelLink(x_api_version, link_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGCancelLinkWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCancelLinkWithConfiguration(cashfreeConfiguration, x_api_version, link_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url. + * @summary Create Payment Link + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateLinkRequest} CreateLinkRequest Request Body to Create Payment Links + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGCreateLink(x_api_version: string, CreateLinkRequest: CreateLinkRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCreateLink(x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGCreateLinkWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateLinkRequest: CreateLinkRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCreateLinkWithConfiguration(cashfreeConfiguration, x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to view all details and status of a payment link. + * @summary Fetch Payment Link Details + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} link_id The payment link ID for which you want to view the details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGFetchLink(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchLink(x_api_version, link_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGFetchLinkWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchLinkWithConfiguration(cashfreeConfiguration, x_api_version, link_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to view all order details for a payment link. + * @summary Get Orders for a Payment Link + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} link_id The payment link ID for which you want to view the details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [status] Mention What is status of orders you want to fetch, default is PAID. Possible value: ALL, PAID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGLinkFetchOrders(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, status?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGLinkFetchOrders(x_api_version, link_id, x_request_id, x_idempotency_key, status, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGLinkFetchOrdersWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, status?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGLinkFetchOrdersWithConfiguration(cashfreeConfiguration, x_api_version, link_id, x_request_id, x_idempotency_key, status, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + } +}; + +/** + * PaymentLinksApi - object-oriented interface + * @export + * @class PaymentLinksApi + * @extends {BaseAPI} + */ + + + +/** + * PaymentsApi - axios parameter creator + * @export + */ +const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Use this API to capture or void a preauthorized payment + * @summary Preauthorization * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {CreateSubscriptionRefundRequest} CreateSubscriptionRefundRequest Request body to create a subscription refund. + * @param {string} order_id The id which uniquely identifies your order + * @param {AuthorizeOrderRequest} AuthorizeOrderRequest Request to Capture or Void Transactions * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_request_id?: string, */ - subsCreateRefund: async (x_api_version: string, subscription_id: string, CreateSubscriptionRefundRequest: CreateSubscriptionRefundRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGAuthorizeOrder: async (x_api_version: string, order_id: string, AuthorizeOrderRequest: AuthorizeOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsCreateRefund', 'x_api_version', x_api_version) - // verify required parameter 'subscription_id' is not null or undefined - assertParamExists('subsCreateRefund', 'subscription_id', subscription_id) - // verify required parameter 'CreateSubscriptionRefundRequest' is not null or undefined - assertParamExists('subsCreateRefund', 'CreateSubscriptionRefundRequest', CreateSubscriptionRefundRequest) - const localVarPath = `/subscriptions/{subscription_id}/refunds` - .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + assertParamExists('pGAuthorizeOrder', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGAuthorizeOrder', 'order_id', order_id) + // verify required parameter 'AuthorizeOrderRequest' is not null or undefined + assertParamExists('pGAuthorizeOrder', 'AuthorizeOrderRequest', AuthorizeOrderRequest) + const localVarPath = `/orders/{order_id}/authorization` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -13628,7 +13276,7 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13643,31 +13291,24 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreateSubscriptionRefundRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(AuthorizeOrderRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to create a new subscription. - * @summary Create Subscription - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateSubscriptionRequest} CreateSubscriptionRequest Request body to create a subscription. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - subsCreateSubscription: async (x_api_version: string, CreateSubscriptionRequest: CreateSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGAuthorizeOrderWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, AuthorizeOrderRequest: AuthorizeOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsCreateSubscription', 'x_api_version', x_api_version) - // verify required parameter 'CreateSubscriptionRequest' is not null or undefined - assertParamExists('subsCreateSubscription', 'CreateSubscriptionRequest', CreateSubscriptionRequest) - const localVarPath = `/subscriptions`; + assertParamExists('pGAuthorizeOrder', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGAuthorizeOrder', 'order_id', order_id) + // verify required parameter 'AuthorizeOrderRequest' is not null or undefined + assertParamExists('pGAuthorizeOrder', 'AuthorizeOrderRequest', AuthorizeOrderRequest) + const localVarPath = `/orders/{order_id}/authorization` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -13684,25 +13325,25 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13717,32 +13358,36 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(CreateSubscriptionRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(AuthorizeOrderRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to fetch plan details. - * @summary Fetch Plan + * If you accept OTP on your own page, you can use the below API to send OTP to Cashfree. + * @summary Submit or Resend OTP * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} plan_id Provide the PlanId for which the details have to be fetched. + * @param {string} cf_payment_id The Cashfree payment or transaction ID. + * @param {OrderAuthenticatePaymentRequest} OrderAuthenticatePaymentRequest Request body to submit/resend headless OTP. To use this API make sure you have headless OTP enabled for your account * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_idempotency_key?: string, + * x_request_id?: string, */ - subsFetchPlan: async (x_api_version: string, plan_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGOrderAuthenticatePayment: async (x_api_version: string, cf_payment_id: string, OrderAuthenticatePaymentRequest: OrderAuthenticatePaymentRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsFetchPlan', 'x_api_version', x_api_version) - // verify required parameter 'plan_id' is not null or undefined - assertParamExists('subsFetchPlan', 'plan_id', plan_id) - const localVarPath = `/plans/{plan_id}` - .replace(`{${"plan_id"}}`, encodeURIComponent(String(plan_id))); + assertParamExists('pGOrderAuthenticatePayment', 'x_api_version', x_api_version) + // verify required parameter 'cf_payment_id' is not null or undefined + assertParamExists('pGOrderAuthenticatePayment', 'cf_payment_id', cf_payment_id) + // verify required parameter 'OrderAuthenticatePaymentRequest' is not null or undefined + assertParamExists('pGOrderAuthenticatePayment', 'OrderAuthenticatePaymentRequest', OrderAuthenticatePaymentRequest) + const localVarPath = `/orders/pay/authenticate/{cf_payment_id}` + .replace(`{${"cf_payment_id"}}`, encodeURIComponent(String(cf_payment_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -13754,28 +13399,15 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") - - // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") - - // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") - - // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") - - // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13790,64 +13422,44 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(OrderAuthenticatePaymentRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to fetch subscription details. - * @summary Fetch Subscription - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - subsFetchSubscription: async (x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGOrderAuthenticatePaymentWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_payment_id: string, OrderAuthenticatePaymentRequest: OrderAuthenticatePaymentRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsFetchSubscription', 'x_api_version', x_api_version) - // verify required parameter 'subscription_id' is not null or undefined - assertParamExists('subsFetchSubscription', 'subscription_id', subscription_id) - const localVarPath = `/subscriptions/{subscription_id}` - .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } + assertParamExists('pGOrderAuthenticatePayment', 'x_api_version', x_api_version) + // verify required parameter 'cf_payment_id' is not null or undefined + assertParamExists('pGOrderAuthenticatePayment', 'cf_payment_id', cf_payment_id) + // verify required parameter 'OrderAuthenticatePaymentRequest' is not null or undefined + assertParamExists('pGOrderAuthenticatePayment', 'OrderAuthenticatePaymentRequest', OrderAuthenticatePaymentRequest) + const localVarPath = `/orders/pay/authenticate/{cf_payment_id}` + .replace(`{${"cf_payment_id"}}`, encodeURIComponent(String(cf_payment_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } const localVarUrlObj = new URL(localVarPath, url); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") - - // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") - - // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") - - // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") - - // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13862,35 +13474,37 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(OrderAuthenticatePaymentRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to fetch details of a single payment of a subscription. - * @summary Fetch details of a single payment. + * Use this API to view payment details of an order for a payment ID. + * @summary Get Payment by ID * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} payment_id Provide the PaymentId using which the payment was created. + * @param {string} order_id The id which uniquely identifies your order + * @param {string} cf_payment_id The Cashfree payment or transaction ID. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_request_id?: string, */ - subsFetchSubscriptionPayment: async (x_api_version: string, subscription_id: string, payment_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGOrderFetchPayment: async (x_api_version: string, order_id: string, cf_payment_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsFetchSubscriptionPayment', 'x_api_version', x_api_version) - // verify required parameter 'subscription_id' is not null or undefined - assertParamExists('subsFetchSubscriptionPayment', 'subscription_id', subscription_id) - // verify required parameter 'payment_id' is not null or undefined - assertParamExists('subsFetchSubscriptionPayment', 'payment_id', payment_id) - const localVarPath = `/subscriptions/{subscription_id}/payments/{payment_id}` - .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))) - .replace(`{${"payment_id"}}`, encodeURIComponent(String(payment_id))); + assertParamExists('pGOrderFetchPayment', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderFetchPayment', 'order_id', order_id) + // verify required parameter 'cf_payment_id' is not null or undefined + assertParamExists('pGOrderFetchPayment', 'cf_payment_id', cf_payment_id) + const localVarPath = `/orders/{order_id}/payments/{cf_payment_id}` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))) + .replace(`{${"cf_payment_id"}}`, encodeURIComponent(String(cf_payment_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -13923,7 +13537,7 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -13944,25 +13558,18 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, - /** - * Use this API to fetch all payments of a subscription. - * @summary Fetch details of all payments of a subscription. - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - subsFetchSubscriptionPayments: async (x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGOrderFetchPaymentWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, cf_payment_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsFetchSubscriptionPayments', 'x_api_version', x_api_version) - // verify required parameter 'subscription_id' is not null or undefined - assertParamExists('subsFetchSubscriptionPayments', 'subscription_id', subscription_id) - const localVarPath = `/subscriptions/{subscription_id}/payments` - .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + assertParamExists('pGOrderFetchPayment', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderFetchPayment', 'order_id', order_id) + // verify required parameter 'cf_payment_id' is not null or undefined + assertParamExists('pGOrderFetchPayment', 'cf_payment_id', cf_payment_id) + const localVarPath = `/orders/{order_id}/payments/{cf_payment_id}` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))) + .replace(`{${"cf_payment_id"}}`, encodeURIComponent(String(cf_payment_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -13979,23 +13586,23 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -14016,29 +13623,26 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, + /** - * Use this API to fetch details of a refund of a subscription payment. - * @summary Fetch details of a refund. + * Use this API to view all payment details for an order. + * @summary Get Payments for an Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} refund_id Provide the PaymentId for which the details have to be fetched. + * @param {string} order_id The id which uniquely identifies your order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, + * x_idempotency_key?: string, */ - subsFetchSubscriptionRefund: async (x_api_version: string, subscription_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGOrderFetchPayments: async (x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsFetchSubscriptionRefund', 'x_api_version', x_api_version) - // verify required parameter 'subscription_id' is not null or undefined - assertParamExists('subsFetchSubscriptionRefund', 'subscription_id', subscription_id) - // verify required parameter 'refund_id' is not null or undefined - assertParamExists('subsFetchSubscriptionRefund', 'refund_id', refund_id) - const localVarPath = `/subscriptions/{subscription_id}/refunds/{refund_id}` - .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))) - .replace(`{${"refund_id"}}`, encodeURIComponent(String(refund_id))); + assertParamExists('pGOrderFetchPayments', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderFetchPayments', 'order_id', order_id) + const localVarPath = `/orders/{order_id}/payments` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -14071,7 +13675,7 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -14092,28 +13696,15 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, - /** - * Use this API to manage a subscription. You can cancel, pause, activate or change the plan of a subscription. - * @summary Manage a subscription. - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {ManageSubscriptionRequest} ManageSubscriptionRequest Request body to manage a subscription. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_request_id?: string, - */ - subsManageSubscription: async (x_api_version: string, subscription_id: string, ManageSubscriptionRequest: ManageSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGOrderFetchPaymentsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsManageSubscription', 'x_api_version', x_api_version) - // verify required parameter 'subscription_id' is not null or undefined - assertParamExists('subsManageSubscription', 'subscription_id', subscription_id) - // verify required parameter 'ManageSubscriptionRequest' is not null or undefined - assertParamExists('subsManageSubscription', 'ManageSubscriptionRequest', ManageSubscriptionRequest) - const localVarPath = `/subscriptions/{subscription_id}/manage` - .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + assertParamExists('pGOrderFetchPayments', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderFetchPayments', 'order_id', order_id) + const localVarPath = `/orders/{order_id}/payments` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -14125,30 +13716,28 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -14163,39 +13752,31 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(ManageSubscriptionRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to manage a payment of a subscription. A payment can be cancelled or retried with this API. - * @summary Manage a single payment. + * Use this API when you have already created the orders and want Cashfree to process the payment. To use this API S2S flag needs to be enabled from the backend. In case you want to use the cards payment option the PCI DSS flag is required, for more information send an email to \"care@cashfree.com\". + * @summary Order Pay * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} payment_id Provide the PaymentId using which the payment was created. - * @param {ManageSubscriptionPaymentRequest} ManageSubscriptionPaymentRequest Request body to manage a subscription payment. + * @param {PayOrderRequest} PayOrderRequest Request body to create a transaction at cashfree using `payment_session_id` * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, + * x_idempotency_key?: string, */ - subsManageSubscriptionPayment: async (x_api_version: string, subscription_id: string, payment_id: string, ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGPayOrder: async (x_api_version: string, PayOrderRequest: PayOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subsManageSubscriptionPayment', 'x_api_version', x_api_version) - // verify required parameter 'subscription_id' is not null or undefined - assertParamExists('subsManageSubscriptionPayment', 'subscription_id', subscription_id) - // verify required parameter 'payment_id' is not null or undefined - assertParamExists('subsManageSubscriptionPayment', 'payment_id', payment_id) - // verify required parameter 'ManageSubscriptionPaymentRequest' is not null or undefined - assertParamExists('subsManageSubscriptionPayment', 'ManageSubscriptionPaymentRequest', ManageSubscriptionPaymentRequest) - const localVarPath = `/subscriptions/{subscription_id}/payments/{payment_id}/manage` - .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))) - .replace(`{${"payment_id"}}`, encodeURIComponent(String(payment_id))); + assertParamExists('pGPayOrder', 'x_api_version', x_api_version) + // verify required parameter 'PayOrderRequest' is not null or undefined + assertParamExists('pGPayOrder', 'PayOrderRequest', PayOrderRequest) + const localVarPath = `/orders/sessions`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -14211,26 +13792,11 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") - - // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") - - // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") - - // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") - - // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -14245,41 +13811,21 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(ManageSubscriptionPaymentRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(PayOrderRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to upload Physical Nach for Physical Nach Authorization. - * @summary API to upload Physical Nach for Physical Nach Authorization. - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} payment_id Provide the PaymentId using which the payment was created. - * @param {File} file Select the .jpg file that should be uploaded or provide the path of that file. You cannot upload a file that is more than 1MB in size. - * @param {string} payment_id2 Authorization Payment Id for physical nach authorization - * @param {string} action Action to be performed on the file. Can be SUBMIT_DOCUMENT - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * payment_id2: string, - */ - subscriptionDocumentUpload: async (x_api_version: string, payment_id: string, file: File, payment_id2: string, action: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGPayOrderWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, PayOrderRequest: PayOrderRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subscriptionDocumentUpload', 'x_api_version', x_api_version) - // verify required parameter 'payment_id' is not null or undefined - assertParamExists('subscriptionDocumentUpload', 'payment_id', payment_id) - // verify required parameter 'file' is not null or undefined - assertParamExists('subscriptionDocumentUpload', 'file', file) - // verify required parameter 'payment_id2' is not null or undefined - assertParamExists('subscriptionDocumentUpload', 'payment_id2', payment_id2) - // verify required parameter 'action' is not null or undefined - assertParamExists('subscriptionDocumentUpload', 'action', action) - const localVarPath = `/subscriptions/pay/documents/{payment_id}` - .replace(`{${"payment_id"}}`, encodeURIComponent(String(payment_id))); + assertParamExists('pGPayOrder', 'x_api_version', x_api_version) + // verify required parameter 'PayOrderRequest' is not null or undefined + assertParamExists('pGPayOrder', 'PayOrderRequest', PayOrderRequest) + const localVarPath = `/orders/sessions`; // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -14294,175 +13840,66 @@ const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); - - // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") - - // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") - // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") - // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + localVarHeaderParameter['Content-Type'] = 'application/json'; - // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } - if (file !== undefined) { - localVarFormParams.append('file', file as any); - } - - if (payment_id2 !== undefined) { - localVarFormParams.append('payment_id', payment_id2 as any); - } - - if (action !== undefined) { - localVarFormParams.append('action', action as any); - } - - - localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; - if (x_api_version != null && x_api_version != undefined) { - localVarHeaderParameter['x-api-version'] = x_api_version; - } - - if (x_request_id != null && x_request_id != undefined) { - localVarHeaderParameter['x-request-id'] = x_request_id; - } - - if (x_idempotency_key != null && x_idempotency_key != undefined) { - localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = localVarFormParams; + localVarRequestOptions.data = serializeDataIfNeeded(PayOrderRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to check if a payment method is enabled for your account. - * @summary API to get all the payment method details available for subscription payments. - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {SubscriptionEligibilityRequest} SubscriptionEligibilityRequest Request body to fetch subscription eligibile payment method details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_idempotency_key?: string, - */ - subscriptionEligibility: async (x_api_version: string, SubscriptionEligibilityRequest: SubscriptionEligibilityRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('subscriptionEligibility', 'x_api_version', x_api_version) - // verify required parameter 'SubscriptionEligibilityRequest' is not null or undefined - assertParamExists('subscriptionEligibility', 'SubscriptionEligibilityRequest', SubscriptionEligibilityRequest) - const localVarPath = `/subscriptions/eligibility/payment_methods`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - const localVarUrlObj = new URL(localVarPath, url); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") - - // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") - - // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") - // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") - - // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; - if (x_api_version != null && x_api_version != undefined) { - localVarHeaderParameter['x-api-version'] = x_api_version; - } - - if (x_request_id != null && x_request_id != undefined) { - localVarHeaderParameter['x-request-id'] = x_request_id; - } - - if (x_idempotency_key != null && x_idempotency_key != undefined) { - localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(SubscriptionEligibilityRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, } }; /** - * SubscriptionApi - functional programming interface + * PaymentsApi - functional programming interface * @export */ -const SubscriptionApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = SubscriptionApiAxiosParamCreator(configuration) +const PaymentsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PaymentsApiAxiosParamCreator(configuration) return { /** - * Use this API to create an auth or to raise a charge . - * @summary Raise a charge or create an auth. + * Use this API to capture or void a preauthorized payment + * @summary Preauthorization * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateSubscriptionPaymentRequest} CreateSubscriptionPaymentRequest Request body to create a subscription payment. + * @param {string} order_id The id which uniquely identifies your order + * @param {AuthorizeOrderRequest} AuthorizeOrderRequest Request to Capture or Void Transactions * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async subsCreatePayment(x_api_version: string, CreateSubscriptionPaymentRequest: CreateSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreatePayment(x_api_version, CreateSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options); + async pGAuthorizeOrder(x_api_version: string, order_id: string, AuthorizeOrderRequest: AuthorizeOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGAuthorizeOrder(x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - /** - * A plan allows your customer to identify the features you offer along with your pricing. You can create plans as per the pricing you support for your services. For each plan, you can set a pre-decided frequency and amount with which they’ll be charged. Example: Netflix Plans - Premium, Basic, Standard, Mobile. Each plan differs and caters for a particular set of audiences. - * @summary Create a plan. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreatePlanRequest} CreatePlanRequest Request body to create a plan. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async subsCreatePlan(x_api_version: string, CreatePlanRequest: CreatePlanRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreatePlan(x_api_version, CreatePlanRequest, x_request_id, x_idempotency_key, options); + + async pGAuthorizeOrderWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, AuthorizeOrderRequest: AuthorizeOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGAuthorizeOrderWithConfiguration(cashfreeConfiguration, x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -14470,36 +13907,27 @@ const SubscriptionApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * This API allows you to create refund on a successful payment. Refund amount can be partial or the full amount of the payment. - * @summary Create a refund. + * If you accept OTP on your own page, you can use the below API to send OTP to Cashfree. + * @summary Submit or Resend OTP * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {CreateSubscriptionRefundRequest} CreateSubscriptionRefundRequest Request body to create a subscription refund. + * @param {string} cf_payment_id The Cashfree payment or transaction ID. + * @param {OrderAuthenticatePaymentRequest} OrderAuthenticatePaymentRequest Request body to submit/resend headless OTP. To use this API make sure you have headless OTP enabled for your account * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async subsCreateRefund(x_api_version: string, subscription_id: string, CreateSubscriptionRefundRequest: CreateSubscriptionRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreateRefund(x_api_version, subscription_id, CreateSubscriptionRefundRequest, x_request_id, x_idempotency_key, options); + async pGOrderAuthenticatePayment(x_api_version: string, cf_payment_id: string, OrderAuthenticatePaymentRequest: OrderAuthenticatePaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderAuthenticatePayment(x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - /** - * Use this API to create a new subscription. - * @summary Create Subscription - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateSubscriptionRequest} CreateSubscriptionRequest Request body to create a subscription. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async subsCreateSubscription(x_api_version: string, CreateSubscriptionRequest: CreateSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreateSubscription(x_api_version, CreateSubscriptionRequest, x_request_id, x_idempotency_key, options); + + async pGOrderAuthenticatePaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_payment_id: string, OrderAuthenticatePaymentRequest: OrderAuthenticatePaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderAuthenticatePaymentWithConfiguration(cashfreeConfiguration, x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -14507,35 +13935,27 @@ const SubscriptionApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API to fetch plan details. - * @summary Fetch Plan + * Use this API to view payment details of an order for a payment ID. + * @summary Get Payment by ID * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} plan_id Provide the PlanId for which the details have to be fetched. + * @param {string} order_id The id which uniquely identifies your order + * @param {string} cf_payment_id The Cashfree payment or transaction ID. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async subsFetchPlan(x_api_version: string, plan_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchPlan(x_api_version, plan_id, x_request_id, x_idempotency_key, options); + async pGOrderFetchPayment(x_api_version: string, order_id: string, cf_payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchPayment(x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - /** - * Use this API to fetch subscription details. - * @summary Fetch Subscription - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async subsFetchSubscription(x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscription(x_api_version, subscription_id, x_request_id, x_idempotency_key, options); + + async pGOrderFetchPaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, cf_payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchPaymentWithConfiguration(cashfreeConfiguration, x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -14543,36 +13963,26 @@ const SubscriptionApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API to fetch details of a single payment of a subscription. - * @summary Fetch details of a single payment. + * Use this API to view all payment details for an order. + * @summary Get Payments for an Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} payment_id Provide the PaymentId using which the payment was created. + * @param {string} order_id The id which uniquely identifies your order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async subsFetchSubscriptionPayment(x_api_version: string, subscription_id: string, payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscriptionPayment(x_api_version, subscription_id, payment_id, x_request_id, x_idempotency_key, options); + async pGOrderFetchPayments(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchPayments(x_api_version, order_id, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - /** - * Use this API to fetch all payments of a subscription. - * @summary Fetch details of all payments of a subscription. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async subsFetchSubscriptionPayments(x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscriptionPayments(x_api_version, subscription_id, x_request_id, x_idempotency_key, options); + + async pGOrderFetchPaymentsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchPaymentsWithConfiguration(cashfreeConfiguration, x_api_version, order_id, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -14580,143 +13990,72 @@ const SubscriptionApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API to fetch details of a refund of a subscription payment. - * @summary Fetch details of a refund. + * Use this API when you have already created the orders and want Cashfree to process the payment. To use this API S2S flag needs to be enabled from the backend. In case you want to use the cards payment option the PCI DSS flag is required, for more information send an email to \"care@cashfree.com\". + * @summary Order Pay * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} refund_id Provide the PaymentId for which the details have to be fetched. + * @param {PayOrderRequest} PayOrderRequest Request body to create a transaction at cashfree using `payment_session_id` * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async subsFetchSubscriptionRefund(x_api_version: string, subscription_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscriptionRefund(x_api_version, subscription_id, refund_id, x_request_id, x_idempotency_key, options); + async pGPayOrder(x_api_version: string, PayOrderRequest: PayOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGPayOrder(x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - /** - * Use this API to manage a subscription. You can cancel, pause, activate or change the plan of a subscription. - * @summary Manage a subscription. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {ManageSubscriptionRequest} ManageSubscriptionRequest Request body to manage a subscription. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async subsManageSubscription(x_api_version: string, subscription_id: string, ManageSubscriptionRequest: ManageSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsManageSubscription(x_api_version, subscription_id, ManageSubscriptionRequest, x_request_id, x_idempotency_key, options); + + async pGPayOrderWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, PayOrderRequest: PayOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGPayOrderWithConfiguration(cashfreeConfiguration, x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, + } +}; + +/** + * PaymentsApi - object-oriented interface + * @export + * @class PaymentsApi + * @extends {BaseAPI} + */ + + + +/** + * RefundsApi - axios parameter creator + * @export + */ +const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { + return { /** - * Use this API to manage a payment of a subscription. A payment can be cancelled or retried with this API. - * @summary Manage a single payment. + * Use this API to initiate refunds. + * @summary Create Refund + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} payment_id Provide the PaymentId using which the payment was created. - * @param {ManageSubscriptionPaymentRequest} ManageSubscriptionPaymentRequest Request body to manage a subscription payment. + * @param {string} order_id The id which uniquely identifies your order + * @param {OrderCreateRefundRequest} OrderCreateRefundRequest Request Body to Create Refunds * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} + * x_request_id?: string, */ - async subsManageSubscriptionPayment(x_api_version: string, subscription_id: string, payment_id: string, ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subsManageSubscriptionPayment(x_api_version, subscription_id, payment_id, ManageSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to upload Physical Nach for Physical Nach Authorization. - * @summary API to upload Physical Nach for Physical Nach Authorization. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} payment_id Provide the PaymentId using which the payment was created. - * @param {File} file Select the .jpg file that should be uploaded or provide the path of that file. You cannot upload a file that is more than 1MB in size. - * @param {string} payment_id2 Authorization Payment Id for physical nach authorization - * @param {string} action Action to be performed on the file. Can be SUBMIT_DOCUMENT - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async subscriptionDocumentUpload(x_api_version: string, payment_id: string, file: File, payment_id2: string, action: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subscriptionDocumentUpload(x_api_version, payment_id, file, payment_id2, action, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - /** - * Use this API to check if a payment method is enabled for your account. - * @summary API to get all the payment method details available for subscription payments. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {SubscriptionEligibilityRequest} SubscriptionEligibilityRequest Request body to fetch subscription eligibile payment method details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async subscriptionEligibility(x_api_version: string, SubscriptionEligibilityRequest: SubscriptionEligibilityRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subscriptionEligibility(x_api_version, SubscriptionEligibilityRequest, x_request_id, x_idempotency_key, options); - var url = "https://sandbox.cashfree.com/pg"; - if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { - url = "https://api.cashfree.com/pg" - } - return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); - }, - } -}; - -/** - * SubscriptionApi - object-oriented interface - * @export - * @class SubscriptionApi - * @extends {BaseAPI} - */ - - - -/** - * TokenVaultApi - axios parameter creator - * @export - */ -const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Use this API to delete a saved card instrument for a customer_id and instrument_id - * @summary Delete Saved Card Instrument - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {string} instrument_id The instrument_id which needs to be deleted - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_request_id?: string, - */ - pGCustomerDeleteInstrument: async (x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGOrderCreateRefund: async (x_api_version: string, order_id: string, OrderCreateRefundRequest: OrderCreateRefundRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGCustomerDeleteInstrument', 'x_api_version', x_api_version) - // verify required parameter 'customer_id' is not null or undefined - assertParamExists('pGCustomerDeleteInstrument', 'customer_id', customer_id) - // verify required parameter 'instrument_id' is not null or undefined - assertParamExists('pGCustomerDeleteInstrument', 'instrument_id', instrument_id) - const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}` - .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))) - .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id))); + assertParamExists('pGOrderCreateRefund', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderCreateRefund', 'order_id', order_id) + // verify required parameter 'OrderCreateRefundRequest' is not null or undefined + assertParamExists('pGOrderCreateRefund', 'OrderCreateRefundRequest', OrderCreateRefundRequest) + const localVarPath = `/orders/{order_id}/refunds` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -14728,7 +14067,7 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -14749,7 +14088,9 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -14764,35 +14105,24 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(OrderCreateRefundRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Use this API to fetch a single specific saved card for a customer_id by it\'s instrument_id - * @summary Fetch Specific Saved Card Instrument - - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {string} instrument_id The instrument_id of the saved instrument which needs to be queried - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * x_request_id?: string, - */ - pGCustomerFetchInstrument: async (x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + + // With Configuration + pGOrderCreateRefundWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, OrderCreateRefundRequest: OrderCreateRefundRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGCustomerFetchInstrument', 'x_api_version', x_api_version) - // verify required parameter 'customer_id' is not null or undefined - assertParamExists('pGCustomerFetchInstrument', 'customer_id', customer_id) - // verify required parameter 'instrument_id' is not null or undefined - assertParamExists('pGCustomerFetchInstrument', 'instrument_id', instrument_id) - const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}` - .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))) - .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id))); + assertParamExists('pGOrderCreateRefund', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderCreateRefund', 'order_id', order_id) + // verify required parameter 'OrderCreateRefundRequest' is not null or undefined + assertParamExists('pGOrderCreateRefund', 'OrderCreateRefundRequest', OrderCreateRefundRequest) + const localVarPath = `/orders/{order_id}/refunds` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -14804,28 +14134,30 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication XPartnerAPIKey required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) // authentication XClientSecret required - await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) // authentication XPartnerMerchantID required - await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) // authentication XClientID required - await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) // authentication XClientSignatureHeader required - await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -14840,34 +14172,37 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(OrderCreateRefundRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + /** - * Use this API to fetch saved cards for a customer_id - * @summary Fetch All Saved Card Instrument + * Use this API to fetch a specific refund processed on your Cashfree Account. + * @summary Get Refund * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {PGCustomerFetchInstrumentsInstrumentTypeEnum} instrument_type Payment mode or type of saved instrument + * @param {string} order_id The id which uniquely identifies your order + * @param {string} refund_id Refund Id of the refund you want to fetch. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * x_request_id?: string, */ - pGCustomerFetchInstruments: async (x_api_version: string, customer_id: string, instrument_type: PGCustomerFetchInstrumentsInstrumentTypeEnum, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGOrderFetchRefund: async (x_api_version: string, order_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGCustomerFetchInstruments', 'x_api_version', x_api_version) - // verify required parameter 'customer_id' is not null or undefined - assertParamExists('pGCustomerFetchInstruments', 'customer_id', customer_id) - // verify required parameter 'instrument_type' is not null or undefined - assertParamExists('pGCustomerFetchInstruments', 'instrument_type', instrument_type) - const localVarPath = `/customers/{customer_id}/instruments` - .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))); + assertParamExists('pGOrderFetchRefund', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderFetchRefund', 'order_id', order_id) + // verify required parameter 'refund_id' is not null or undefined + assertParamExists('pGOrderFetchRefund', 'refund_id', refund_id) + const localVarPath = `/orders/{order_id}/refunds/{refund_id}` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))) + .replace(`{${"refund_id"}}`, encodeURIComponent(String(refund_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -14898,13 +14233,74 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) // authentication XClientSignatureHeader required await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") - if (instrument_type !== undefined) { - localVarQueryParameter['instrument_type'] = instrument_type; + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGOrderFetchRefundWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGOrderFetchRefund', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderFetchRefund', 'order_id', order_id) + // verify required parameter 'refund_id' is not null or undefined + assertParamExists('pGOrderFetchRefund', 'refund_id', refund_id) + const localVarPath = `/orders/{order_id}/refunds/{refund_id}` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))) + .replace(`{${"refund_id"}}`, encodeURIComponent(String(refund_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -14925,29 +14321,26 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, + /** - * Use this API To get the card network token, token expiry and cryptogram for a saved card instrument using instrument id - * @summary Fetch cryptogram for a saved card instrument + * Use this API to fetch all refunds processed against an order. + * @summary Get All Refunds for an Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {string} instrument_id The instrument_id of the saved card instrument which needs to be queried + * @param {string} order_id The id which uniquely identifies your order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * x_request_id?: string, + * x_idempotency_key?: string, */ - pGCustomerInstrumentsFetchCryptogram: async (x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + pGOrderFetchRefunds: async (x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'x_api_version' is not null or undefined - assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'x_api_version', x_api_version) - // verify required parameter 'customer_id' is not null or undefined - assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'customer_id', customer_id) - // verify required parameter 'instrument_id' is not null or undefined - assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'instrument_id', instrument_id) - const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}/cryptogram` - .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))) - .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id))); + assertParamExists('pGOrderFetchRefunds', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderFetchRefunds', 'order_id', order_id) + const localVarPath = `/orders/{order_id}/refunds` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -14980,7 +14373,7 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.2.3'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -15001,48 +14394,101 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, - } -}; -/** - * TokenVaultApi - functional programming interface - * @export - */ -const TokenVaultApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = TokenVaultApiAxiosParamCreator(configuration) - return { - /** - * Use this API to delete a saved card instrument for a customer_id and instrument_id - * @summary Delete Saved Card Instrument + // With Configuration + pGOrderFetchRefundsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGOrderFetchRefunds', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderFetchRefunds', 'order_id', order_id) + const localVarPath = `/orders/{order_id}/refunds` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + } +}; + +/** + * RefundsApi - functional programming interface + * @export + */ +const RefundsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = RefundsApiAxiosParamCreator(configuration) + return { + /** + * Use this API to initiate refunds. + * @summary Create Refund * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {string} instrument_id The instrument_id which needs to be deleted + * @param {string} order_id The id which uniquely identifies your order + * @param {OrderCreateRefundRequest} OrderCreateRefundRequest Request Body to Create Refunds * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGCustomerDeleteInstrument(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerDeleteInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options); + async pGOrderCreateRefund(x_api_version: string, order_id: string, OrderCreateRefundRequest: OrderCreateRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderCreateRefund(x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" } return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, - /** - * Use this API to fetch a single specific saved card for a customer_id by it\'s instrument_id - * @summary Fetch Specific Saved Card Instrument - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {string} instrument_id The instrument_id of the saved instrument which needs to be queried - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pGCustomerFetchInstrument(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerFetchInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options); + + async pGOrderCreateRefundWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, OrderCreateRefundRequest: OrderCreateRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderCreateRefundWithConfiguration(cashfreeConfiguration, x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -15050,18 +14496,27 @@ const TokenVaultApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API to fetch saved cards for a customer_id - * @summary Fetch All Saved Card Instrument + * Use this API to fetch a specific refund processed on your Cashfree Account. + * @summary Get Refund * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {PGCustomerFetchInstrumentsInstrumentTypeEnum} instrument_type Payment mode or type of saved instrument + * @param {string} order_id The id which uniquely identifies your order + * @param {string} refund_id Refund Id of the refund you want to fetch. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGCustomerFetchInstruments(x_api_version: string, customer_id: string, instrument_type: PGCustomerFetchInstrumentsInstrumentTypeEnum, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerFetchInstruments(x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options); + async pGOrderFetchRefund(x_api_version: string, order_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchRefund(x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGOrderFetchRefundWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchRefundWithConfiguration(cashfreeConfiguration, x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -15069,18 +14524,26 @@ const TokenVaultApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); }, /** - * Use this API To get the card network token, token expiry and cryptogram for a saved card instrument using instrument id - * @summary Fetch cryptogram for a saved card instrument + * Use this API to fetch all refunds processed against an order. + * @summary Get All Refunds for an Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {string} instrument_id The instrument_id of the saved card instrument which needs to be queried + * @param {string} order_id The id which uniquely identifies your order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async pGCustomerInstrumentsFetchCryptogram(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerInstrumentsFetchCryptogram(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options); + async pGOrderFetchRefunds(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchRefunds(x_api_version, order_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGOrderFetchRefundsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchRefundsWithConfiguration(cashfreeConfiguration, x_api_version, order_id, x_request_id, x_idempotency_key, options); var url = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { url = "https://api.cashfree.com/pg" @@ -15091,88 +14554,9102 @@ const TokenVaultApiFp = function(configuration?: Configuration) { }; /** - * TokenVaultApi - object-oriented interface + * RefundsApi - object-oriented interface * @export - * @class TokenVaultApi + * @class RefundsApi * @extends {BaseAPI} */ + + /** + * SettlementReconciliationApi - axios parameter creator * @export */ -export const PGCustomerFetchInstrumentsInstrumentTypeEnum = { - CARD: 'card', - UNKNOWN_DEFAULT_OPEN_API: '11184809' -} as const; -export type PGCustomerFetchInstrumentsInstrumentTypeEnum = typeof PGCustomerFetchInstrumentsInstrumentTypeEnum[keyof typeof PGCustomerFetchInstrumentsInstrumentTypeEnum]; +const SettlementReconciliationApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range. + * @summary Get All Settlements + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {FetchSettlementsRequest} FetchSettlementsRequest Request Body to get the settlements + * @param {string} [Content_Type] application/json + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [Accept] application/json + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + pGFetchSettlements: async (x_api_version: string, FetchSettlementsRequest: FetchSettlementsRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGFetchSettlements', 'x_api_version', x_api_version) + // verify required parameter 'FetchSettlementsRequest' is not null or undefined + assertParamExists('pGFetchSettlements', 'FetchSettlementsRequest', FetchSettlementsRequest) + const localVarPath = `/settlements`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") -class Environment { - public PRODUCTION = CFEnvironment.PRODUCTION; - public SANDBOX = CFEnvironment.SANDBOX; -} + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") -export class PGWebhookEvent { + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") - type: string; - raw: string; - object: any; + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") - constructor(type: string, rawBody: string, object: any) { - this.type = type; - this.raw = rawBody - this.object = object; - } -} + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") -export class Cashfree { - static axios: AxiosInstance; - static basePath: string; - static XClientId?: string; - static XClientSecret?: string; - static XPartnerKey?: string; - static XClientSignature?: string; - static XPartnerMerchantId?: string; - static XEnvironment: CFEnvironment; - static XEnableErrorAnalytics: boolean = true; - static XApiVersion: string = "2023-08-01"; + + localVarHeaderParameter['Content-Type'] = 'application/json'; - static Environment = new Environment(); + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } - /** - * Use this API to verify your webhook signature once you receive from Cashfree's server. - * @summary Verify Webhook Signatures - * @param {string} signature that is present in the header of the webhook ("x-webhook-signature") - * @param {string} rawBody is the entire body sent to the server in string format - * @param {string} timestamp that is present in the header of the webhook ("x-webhook-timestamp") - * @throws {Error} - */ - public static PGVerifyWebhookSignature(signature: string, rawBody: string, timestamp: string) { - const body = timestamp + rawBody - const secretKey = Cashfree.XClientSecret; - let generatedSignature = crypto.createHmac('sha256', secretKey).update(body).digest("base64"); - if(generatedSignature === signature) { - let jsonObject = JSON.parse(rawBody) - return new PGWebhookEvent(jsonObject.type, rawBody, jsonObject); + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(FetchSettlementsRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGFetchSettlementsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, FetchSettlementsRequest: FetchSettlementsRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGFetchSettlements', 'x_api_version', x_api_version) + // verify required parameter 'FetchSettlementsRequest' is not null or undefined + assertParamExists('pGFetchSettlements', 'FetchSettlementsRequest', FetchSettlementsRequest) + const localVarPath = `/settlements`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(FetchSettlementsRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * - Use this API to get settlement reconciliation details using Settlement ID, settlement UTR or date range. - This API will return events for the settlement IDs you want + * @summary Settlement Reconciliation + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {SettlementFetchReconRequest} SettlementFetchReconRequest Request Body for the settlement reconciliation + * @param {string} [Content_Type] application/json + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [Accept] application/json + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + pGSettlementFetchRecon: async (x_api_version: string, SettlementFetchReconRequest: SettlementFetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGSettlementFetchRecon', 'x_api_version', x_api_version) + // verify required parameter 'SettlementFetchReconRequest' is not null or undefined + assertParamExists('pGSettlementFetchRecon', 'SettlementFetchReconRequest', SettlementFetchReconRequest) + const localVarPath = `/settlement/recon`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(SettlementFetchReconRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGSettlementFetchReconWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, SettlementFetchReconRequest: SettlementFetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGSettlementFetchRecon', 'x_api_version', x_api_version) + // verify required parameter 'SettlementFetchReconRequest' is not null or undefined + assertParamExists('pGSettlementFetchRecon', 'SettlementFetchReconRequest', SettlementFetchReconRequest) + const localVarPath = `/settlement/recon`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(SettlementFetchReconRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + } +}; + +/** + * SettlementReconciliationApi - functional programming interface + * @export + */ +const SettlementReconciliationApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = SettlementReconciliationApiAxiosParamCreator(configuration) + return { + /** + * Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range. + * @summary Get All Settlements + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {FetchSettlementsRequest} FetchSettlementsRequest Request Body to get the settlements + * @param {string} [Content_Type] application/json + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [Accept] application/json + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGFetchSettlements(x_api_version: string, FetchSettlementsRequest: FetchSettlementsRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchSettlements(x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGFetchSettlementsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, FetchSettlementsRequest: FetchSettlementsRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchSettlementsWithConfiguration(cashfreeConfiguration, x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * - Use this API to get settlement reconciliation details using Settlement ID, settlement UTR or date range. - This API will return events for the settlement IDs you want + * @summary Settlement Reconciliation + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {SettlementFetchReconRequest} SettlementFetchReconRequest Request Body for the settlement reconciliation + * @param {string} [Content_Type] application/json + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [Accept] application/json + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGSettlementFetchRecon(x_api_version: string, SettlementFetchReconRequest: SettlementFetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGSettlementFetchRecon(x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGSettlementFetchReconWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, SettlementFetchReconRequest: SettlementFetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGSettlementFetchReconWithConfiguration(cashfreeConfiguration, x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + } +}; + +/** + * SettlementReconciliationApi - object-oriented interface + * @export + * @class SettlementReconciliationApi + * @extends {BaseAPI} + */ + + + +/** + * SettlementsApi - axios parameter creator + * @export + */ +const SettlementsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Use this API to pass the CBRICS ID to Cashfree and mark an order for settlement. + * @summary Mark Order For Settlement + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {CreateOrderSettlementRequestBody} [CreateOrderSettlementRequestBody] Create Order Settlement Request Body. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, + */ + markForSettlement: async (x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('markForSettlement', 'x_api_version', x_api_version) + const localVarPath = `/orders/settlements`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateOrderSettlementRequestBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + markForSettlementWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('markForSettlement', 'x_api_version', x_api_version) + const localVarPath = `/orders/settlements`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateOrderSettlementRequestBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to view all the settlements of a particular order. + * @summary Get Settlements by Order ID + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + pGOrderFetchSettlement: async (x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGOrderFetchSettlement', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderFetchSettlement', 'order_id', order_id) + const localVarPath = `/orders/{order_id}/settlements` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGOrderFetchSettlementWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGOrderFetchSettlement', 'x_api_version', x_api_version) + // verify required parameter 'order_id' is not null or undefined + assertParamExists('pGOrderFetchSettlement', 'order_id', order_id) + const localVarPath = `/orders/{order_id}/settlements` + .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + } +}; + +/** + * SettlementsApi - functional programming interface + * @export + */ +const SettlementsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = SettlementsApiAxiosParamCreator(configuration) + return { + /** + * Use this API to pass the CBRICS ID to Cashfree and mark an order for settlement. + * @summary Mark Order For Settlement + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {CreateOrderSettlementRequestBody} [CreateOrderSettlementRequestBody] Create Order Settlement Request Body. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async markForSettlement(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.markForSettlement(x_api_version, x_request_id, x_idempotency_key, CreateOrderSettlementRequestBody, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async markForSettlementWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.markForSettlementWithConfiguration(cashfreeConfiguration, x_api_version, x_request_id, x_idempotency_key, CreateOrderSettlementRequestBody, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to view all the settlements of a particular order. + * @summary Get Settlements by Order ID + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGOrderFetchSettlement(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchSettlement(x_api_version, order_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGOrderFetchSettlementWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGOrderFetchSettlementWithConfiguration(cashfreeConfiguration, x_api_version, order_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + } +}; + +/** + * SettlementsApi - object-oriented interface + * @export + * @class SettlementsApi + * @extends {BaseAPI} + */ + + + +/** + * SimulationApi - axios parameter creator + * @export + */ +const SimulationApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Use this API to fetch simulated payment details. + * @summary Fetch Simulation + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} simulation_id Provide the SimulationId for which the details have to be fetched. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + pGFetchSimulation: async (x_api_version: string, simulation_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGFetchSimulation', 'x_api_version', x_api_version) + // verify required parameter 'simulation_id' is not null or undefined + assertParamExists('pGFetchSimulation', 'simulation_id', simulation_id) + const localVarPath = `/simulate/{simulation_id}` + .replace(`{${"simulation_id"}}`, encodeURIComponent(String(simulation_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGFetchSimulationWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, simulation_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGFetchSimulation', 'x_api_version', x_api_version) + // verify required parameter 'simulation_id' is not null or undefined + assertParamExists('pGFetchSimulation', 'simulation_id', simulation_id) + const localVarPath = `/simulate/{simulation_id}` + .replace(`{${"simulation_id"}}`, encodeURIComponent(String(simulation_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to simulate payment. To use this API you should first create an order using the Create Order API. Also, you need to create a payment with the same order. + * @summary Simulate Payment + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {SimulateRequest} SimulateRequest Request Body to Make Simulation + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + pGSimulatePayment: async (x_api_version: string, SimulateRequest: SimulateRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGSimulatePayment', 'x_api_version', x_api_version) + // verify required parameter 'SimulateRequest' is not null or undefined + assertParamExists('pGSimulatePayment', 'SimulateRequest', SimulateRequest) + const localVarPath = `/simulate`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(SimulateRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGSimulatePaymentWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, SimulateRequest: SimulateRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGSimulatePayment', 'x_api_version', x_api_version) + // verify required parameter 'SimulateRequest' is not null or undefined + assertParamExists('pGSimulatePayment', 'SimulateRequest', SimulateRequest) + const localVarPath = `/simulate`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(SimulateRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + } +}; + +/** + * SimulationApi - functional programming interface + * @export + */ +const SimulationApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = SimulationApiAxiosParamCreator(configuration) + return { + /** + * Use this API to fetch simulated payment details. + * @summary Fetch Simulation + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} simulation_id Provide the SimulationId for which the details have to be fetched. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGFetchSimulation(x_api_version: string, simulation_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchSimulation(x_api_version, simulation_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGFetchSimulationWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, simulation_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGFetchSimulationWithConfiguration(cashfreeConfiguration, x_api_version, simulation_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to simulate payment. To use this API you should first create an order using the Create Order API. Also, you need to create a payment with the same order. + * @summary Simulate Payment + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {SimulateRequest} SimulateRequest Request Body to Make Simulation + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGSimulatePayment(x_api_version: string, SimulateRequest: SimulateRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGSimulatePayment(x_api_version, SimulateRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGSimulatePaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, SimulateRequest: SimulateRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGSimulatePaymentWithConfiguration(cashfreeConfiguration, x_api_version, SimulateRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + } +}; + +/** + * SimulationApi - object-oriented interface + * @export + * @class SimulationApi + * @extends {BaseAPI} + */ + + + +/** + * SoftPOSApi - axios parameter creator + * @export + */ +const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Use this API to create new terminals to use softPOS. + * @summary Create Terminal + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateTerminalRequest} CreateTerminalRequest Request Body to Create Terminal for SPOS + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + sposCreateTerminal: async (x_api_version: string, CreateTerminalRequest: CreateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposCreateTerminal', 'x_api_version', x_api_version) + // verify required parameter 'CreateTerminalRequest' is not null or undefined + assertParamExists('sposCreateTerminal', 'CreateTerminalRequest', CreateTerminalRequest) + const localVarPath = `/terminal`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateTerminalRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + sposCreateTerminalWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateTerminalRequest: CreateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposCreateTerminal', 'x_api_version', x_api_version) + // verify required parameter 'CreateTerminalRequest' is not null or undefined + assertParamExists('sposCreateTerminal', 'CreateTerminalRequest', CreateTerminalRequest) + const localVarPath = `/terminal`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateTerminalRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to create a new terminal transaction. To use this API you should first create an order using the Create Order API. Also, you need to enter the terminal details while creating the order and pass the same terminal information while creating a transaction using the below mentioned API. + * @summary Create Terminal Transaction + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateTerminalTransactionRequest} CreateTerminalTransactionRequest Request body to create a terminal transaction + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + sposCreateTerminalTransaction: async (x_api_version: string, CreateTerminalTransactionRequest: CreateTerminalTransactionRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposCreateTerminalTransaction', 'x_api_version', x_api_version) + // verify required parameter 'CreateTerminalTransactionRequest' is not null or undefined + assertParamExists('sposCreateTerminalTransaction', 'CreateTerminalTransactionRequest', CreateTerminalTransactionRequest) + const localVarPath = `/terminal/transactions`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateTerminalTransactionRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + sposCreateTerminalTransactionWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateTerminalTransactionRequest: CreateTerminalTransactionRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposCreateTerminalTransaction', 'x_api_version', x_api_version) + // verify required parameter 'CreateTerminalTransactionRequest' is not null or undefined + assertParamExists('sposCreateTerminalTransaction', 'CreateTerminalTransactionRequest', CreateTerminalTransactionRequest) + const localVarPath = `/terminal/transactions`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateTerminalTransactionRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to view all details of a terminal. + * @summary Get Terminal Status using Phone Number + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} terminal_phone_no The terminal for which you want to view the order details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + sposFetchTerminal: async (x_api_version: string, terminal_phone_no: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposFetchTerminal', 'x_api_version', x_api_version) + // verify required parameter 'terminal_phone_no' is not null or undefined + assertParamExists('sposFetchTerminal', 'terminal_phone_no', terminal_phone_no) + const localVarPath = `/terminal/{terminal_phone_no}` + .replace(`{${"terminal_phone_no"}}`, encodeURIComponent(String(terminal_phone_no))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + sposFetchTerminalWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, terminal_phone_no: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposFetchTerminal', 'x_api_version', x_api_version) + // verify required parameter 'terminal_phone_no' is not null or undefined + assertParamExists('sposFetchTerminal', 'terminal_phone_no', terminal_phone_no) + const localVarPath = `/terminal/{terminal_phone_no}` + .replace(`{${"terminal_phone_no"}}`, encodeURIComponent(String(terminal_phone_no))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * You can fetch all the StaticQRs corresponding to given terminal id or phone number. Provide either the terminal_phone_no or terminal_id in the request. + * @summary Fetch Terminal QR Codes + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} terminal_phone_no Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request. + * @param {string} cf_terminal_id Cashfree terminal id for which you want to get staticQRs. Required if you are not providing the terminal_phone_number in the request. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + sposFetchTerminalQRCodes: async (x_api_version: string, terminal_phone_no: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposFetchTerminalQRCodes', 'x_api_version', x_api_version) + // verify required parameter 'terminal_phone_no' is not null or undefined + assertParamExists('sposFetchTerminalQRCodes', 'terminal_phone_no', terminal_phone_no) + // verify required parameter 'cf_terminal_id' is not null or undefined + assertParamExists('sposFetchTerminalQRCodes', 'cf_terminal_id', cf_terminal_id) + const localVarPath = `/terminal/qrcodes`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + if (terminal_phone_no !== undefined) { + localVarQueryParameter['terminal_phone_no'] = terminal_phone_no; + } + + if (cf_terminal_id !== undefined) { + localVarQueryParameter['cf_terminal_id'] = cf_terminal_id; + } + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + sposFetchTerminalQRCodesWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, terminal_phone_no: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposFetchTerminalQRCodes', 'x_api_version', x_api_version) + // verify required parameter 'terminal_phone_no' is not null or undefined + assertParamExists('sposFetchTerminalQRCodes', 'terminal_phone_no', terminal_phone_no) + // verify required parameter 'cf_terminal_id' is not null or undefined + assertParamExists('sposFetchTerminalQRCodes', 'cf_terminal_id', cf_terminal_id) + const localVarPath = `/terminal/qrcodes`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + if (terminal_phone_no !== undefined) { + localVarQueryParameter['terminal_phone_no'] = terminal_phone_no; + } + + if (cf_terminal_id !== undefined) { + localVarQueryParameter['cf_terminal_id'] = cf_terminal_id; + } + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to get terminal transaction. + * @summary Get Terminal Transaction + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} utr Utr of the transaction. + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + sposFetchTerminalTransaction: async (x_api_version: string, utr: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposFetchTerminalTransaction', 'x_api_version', x_api_version) + // verify required parameter 'utr' is not null or undefined + assertParamExists('sposFetchTerminalTransaction', 'utr', utr) + // verify required parameter 'cf_terminal_id' is not null or undefined + assertParamExists('sposFetchTerminalTransaction', 'cf_terminal_id', cf_terminal_id) + const localVarPath = `/terminal/{cf_terminal_id}/payments` + .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + if (utr !== undefined) { + localVarQueryParameter['utr'] = utr; + } + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + sposFetchTerminalTransactionWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, utr: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposFetchTerminalTransaction', 'x_api_version', x_api_version) + // verify required parameter 'utr' is not null or undefined + assertParamExists('sposFetchTerminalTransaction', 'utr', utr) + // verify required parameter 'cf_terminal_id' is not null or undefined + assertParamExists('sposFetchTerminalTransaction', 'cf_terminal_id', cf_terminal_id) + const localVarPath = `/terminal/{cf_terminal_id}/payments` + .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + if (utr !== undefined) { + localVarQueryParameter['utr'] = utr; + } + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to update the terminal details. Email, Phone Number, and Terminal Meta are updatable for \"Storefront\". Only account status change is possible in case of \"Agent\". + * @summary Update Terminal + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {UpdateTerminalRequest} UpdateTerminalRequest Request Body to update terminal for SPOS. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + sposUpdateTerminal: async (x_api_version: string, cf_terminal_id: string, UpdateTerminalRequest: UpdateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposUpdateTerminal', 'x_api_version', x_api_version) + // verify required parameter 'cf_terminal_id' is not null or undefined + assertParamExists('sposUpdateTerminal', 'cf_terminal_id', cf_terminal_id) + // verify required parameter 'UpdateTerminalRequest' is not null or undefined + assertParamExists('sposUpdateTerminal', 'UpdateTerminalRequest', UpdateTerminalRequest) + const localVarPath = `/terminal/{cf_terminal_id}` + .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateTerminalRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + sposUpdateTerminalWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_terminal_id: string, UpdateTerminalRequest: UpdateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposUpdateTerminal', 'x_api_version', x_api_version) + // verify required parameter 'cf_terminal_id' is not null or undefined + assertParamExists('sposUpdateTerminal', 'cf_terminal_id', cf_terminal_id) + // verify required parameter 'UpdateTerminalRequest' is not null or undefined + assertParamExists('sposUpdateTerminal', 'UpdateTerminalRequest', UpdateTerminalRequest) + const localVarPath = `/terminal/{cf_terminal_id}` + .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateTerminalRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to update the terminal status. + * @summary Update Terminal Status + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {UpdateTerminalStatusRequest} UpdateTerminalStatusRequest Request Body to update terminal status for SPOS. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + sposUpdateTerminalStatus: async (x_api_version: string, cf_terminal_id: string, UpdateTerminalStatusRequest: UpdateTerminalStatusRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposUpdateTerminalStatus', 'x_api_version', x_api_version) + // verify required parameter 'cf_terminal_id' is not null or undefined + assertParamExists('sposUpdateTerminalStatus', 'cf_terminal_id', cf_terminal_id) + // verify required parameter 'UpdateTerminalStatusRequest' is not null or undefined + assertParamExists('sposUpdateTerminalStatus', 'UpdateTerminalStatusRequest', UpdateTerminalStatusRequest) + const localVarPath = `/terminal/{cf_terminal_id}/status` + .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateTerminalStatusRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + sposUpdateTerminalStatusWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_terminal_id: string, UpdateTerminalStatusRequest: UpdateTerminalStatusRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposUpdateTerminalStatus', 'x_api_version', x_api_version) + // verify required parameter 'cf_terminal_id' is not null or undefined + assertParamExists('sposUpdateTerminalStatus', 'cf_terminal_id', cf_terminal_id) + // verify required parameter 'UpdateTerminalStatusRequest' is not null or undefined + assertParamExists('sposUpdateTerminalStatus', 'UpdateTerminalStatusRequest', UpdateTerminalStatusRequest) + const localVarPath = `/terminal/{cf_terminal_id}/status` + .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateTerminalStatusRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to upload the terminal documents. + * @summary Upload Terminal Docs + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {UploadTerminalDocs} UploadTerminalDocs Request Body to update terminal documents for SPOS. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + sposUploadTerminalDocs: async (x_api_version: string, cf_terminal_id: string, UploadTerminalDocs: UploadTerminalDocs, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposUploadTerminalDocs', 'x_api_version', x_api_version) + // verify required parameter 'cf_terminal_id' is not null or undefined + assertParamExists('sposUploadTerminalDocs', 'cf_terminal_id', cf_terminal_id) + // verify required parameter 'UploadTerminalDocs' is not null or undefined + assertParamExists('sposUploadTerminalDocs', 'UploadTerminalDocs', UploadTerminalDocs) + const localVarPath = `/terminal/{cf_terminal_id}/docs` + .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(UploadTerminalDocs, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + sposUploadTerminalDocsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_terminal_id: string, UploadTerminalDocs: UploadTerminalDocs, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('sposUploadTerminalDocs', 'x_api_version', x_api_version) + // verify required parameter 'cf_terminal_id' is not null or undefined + assertParamExists('sposUploadTerminalDocs', 'cf_terminal_id', cf_terminal_id) + // verify required parameter 'UploadTerminalDocs' is not null or undefined + assertParamExists('sposUploadTerminalDocs', 'UploadTerminalDocs', UploadTerminalDocs) + const localVarPath = `/terminal/{cf_terminal_id}/docs` + .replace(`{${"cf_terminal_id"}}`, encodeURIComponent(String(cf_terminal_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(UploadTerminalDocs, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + } +}; + +/** + * SoftPOSApi - functional programming interface + * @export + */ +const SoftPOSApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = SoftPOSApiAxiosParamCreator(configuration) + return { + /** + * Use this API to create new terminals to use softPOS. + * @summary Create Terminal + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateTerminalRequest} CreateTerminalRequest Request Body to Create Terminal for SPOS + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sposCreateTerminal(x_api_version: string, CreateTerminalRequest: CreateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposCreateTerminal(x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async sposCreateTerminalWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateTerminalRequest: CreateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposCreateTerminalWithConfiguration(cashfreeConfiguration, x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to create a new terminal transaction. To use this API you should first create an order using the Create Order API. Also, you need to enter the terminal details while creating the order and pass the same terminal information while creating a transaction using the below mentioned API. + * @summary Create Terminal Transaction + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateTerminalTransactionRequest} CreateTerminalTransactionRequest Request body to create a terminal transaction + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sposCreateTerminalTransaction(x_api_version: string, CreateTerminalTransactionRequest: CreateTerminalTransactionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposCreateTerminalTransaction(x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async sposCreateTerminalTransactionWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateTerminalTransactionRequest: CreateTerminalTransactionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposCreateTerminalTransactionWithConfiguration(cashfreeConfiguration, x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to view all details of a terminal. + * @summary Get Terminal Status using Phone Number + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} terminal_phone_no The terminal for which you want to view the order details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sposFetchTerminal(x_api_version: string, terminal_phone_no: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposFetchTerminal(x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async sposFetchTerminalWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, terminal_phone_no: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposFetchTerminalWithConfiguration(cashfreeConfiguration, x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * You can fetch all the StaticQRs corresponding to given terminal id or phone number. Provide either the terminal_phone_no or terminal_id in the request. + * @summary Fetch Terminal QR Codes + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} terminal_phone_no Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request. + * @param {string} cf_terminal_id Cashfree terminal id for which you want to get staticQRs. Required if you are not providing the terminal_phone_number in the request. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sposFetchTerminalQRCodes(x_api_version: string, terminal_phone_no: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposFetchTerminalQRCodes(x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async sposFetchTerminalQRCodesWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, terminal_phone_no: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposFetchTerminalQRCodesWithConfiguration(cashfreeConfiguration, x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to get terminal transaction. + * @summary Get Terminal Transaction + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} utr Utr of the transaction. + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sposFetchTerminalTransaction(x_api_version: string, utr: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposFetchTerminalTransaction(x_api_version, utr, cf_terminal_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async sposFetchTerminalTransactionWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, utr: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposFetchTerminalTransactionWithConfiguration(cashfreeConfiguration, x_api_version, utr, cf_terminal_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to update the terminal details. Email, Phone Number, and Terminal Meta are updatable for \"Storefront\". Only account status change is possible in case of \"Agent\". + * @summary Update Terminal + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {UpdateTerminalRequest} UpdateTerminalRequest Request Body to update terminal for SPOS. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sposUpdateTerminal(x_api_version: string, cf_terminal_id: string, UpdateTerminalRequest: UpdateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposUpdateTerminal(x_api_version, cf_terminal_id, UpdateTerminalRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async sposUpdateTerminalWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_terminal_id: string, UpdateTerminalRequest: UpdateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposUpdateTerminalWithConfiguration(cashfreeConfiguration, x_api_version, cf_terminal_id, UpdateTerminalRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to update the terminal status. + * @summary Update Terminal Status + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {UpdateTerminalStatusRequest} UpdateTerminalStatusRequest Request Body to update terminal status for SPOS. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sposUpdateTerminalStatus(x_api_version: string, cf_terminal_id: string, UpdateTerminalStatusRequest: UpdateTerminalStatusRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposUpdateTerminalStatus(x_api_version, cf_terminal_id, UpdateTerminalStatusRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async sposUpdateTerminalStatusWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_terminal_id: string, UpdateTerminalStatusRequest: UpdateTerminalStatusRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposUpdateTerminalStatusWithConfiguration(cashfreeConfiguration, x_api_version, cf_terminal_id, UpdateTerminalStatusRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to upload the terminal documents. + * @summary Upload Terminal Docs + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {UploadTerminalDocs} UploadTerminalDocs Request Body to update terminal documents for SPOS. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sposUploadTerminalDocs(x_api_version: string, cf_terminal_id: string, UploadTerminalDocs: UploadTerminalDocs, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposUploadTerminalDocs(x_api_version, cf_terminal_id, UploadTerminalDocs, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async sposUploadTerminalDocsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_terminal_id: string, UploadTerminalDocs: UploadTerminalDocs, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sposUploadTerminalDocsWithConfiguration(cashfreeConfiguration, x_api_version, cf_terminal_id, UploadTerminalDocs, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + } +}; + +/** + * SoftPOSApi - object-oriented interface + * @export + * @class SoftPOSApi + * @extends {BaseAPI} + */ + + + +/** + * SubscriptionApi - axios parameter creator + * @export + */ +const SubscriptionApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Use this API to create an auth or to raise a charge . + * @summary Raise a charge or create an auth. + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateSubscriptionPaymentRequest} CreateSubscriptionPaymentRequest Request body to create a subscription payment. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + subsCreatePayment: async (x_api_version: string, CreateSubscriptionPaymentRequest: CreateSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsCreatePayment', 'x_api_version', x_api_version) + // verify required parameter 'CreateSubscriptionPaymentRequest' is not null or undefined + assertParamExists('subsCreatePayment', 'CreateSubscriptionPaymentRequest', CreateSubscriptionPaymentRequest) + const localVarPath = `/subscriptions/pay`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateSubscriptionPaymentRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsCreatePaymentWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateSubscriptionPaymentRequest: CreateSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsCreatePayment', 'x_api_version', x_api_version) + // verify required parameter 'CreateSubscriptionPaymentRequest' is not null or undefined + assertParamExists('subsCreatePayment', 'CreateSubscriptionPaymentRequest', CreateSubscriptionPaymentRequest) + const localVarPath = `/subscriptions/pay`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateSubscriptionPaymentRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * A plan allows your customer to identify the features you offer along with your pricing. You can create plans as per the pricing you support for your services. For each plan, you can set a pre-decided frequency and amount with which they’ll be charged. Example: Netflix Plans - Premium, Basic, Standard, Mobile. Each plan differs and caters for a particular set of audiences. + * @summary Create a plan. + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreatePlanRequest} CreatePlanRequest Request body to create a plan. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + subsCreatePlan: async (x_api_version: string, CreatePlanRequest: CreatePlanRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsCreatePlan', 'x_api_version', x_api_version) + // verify required parameter 'CreatePlanRequest' is not null or undefined + assertParamExists('subsCreatePlan', 'CreatePlanRequest', CreatePlanRequest) + const localVarPath = `/plans`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreatePlanRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsCreatePlanWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreatePlanRequest: CreatePlanRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsCreatePlan', 'x_api_version', x_api_version) + // verify required parameter 'CreatePlanRequest' is not null or undefined + assertParamExists('subsCreatePlan', 'CreatePlanRequest', CreatePlanRequest) + const localVarPath = `/plans`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreatePlanRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * This API allows you to create refund on a successful payment. Refund amount can be partial or the full amount of the payment. + * @summary Create a refund. + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {CreateSubscriptionRefundRequest} CreateSubscriptionRefundRequest Request body to create a subscription refund. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + subsCreateRefund: async (x_api_version: string, subscription_id: string, CreateSubscriptionRefundRequest: CreateSubscriptionRefundRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsCreateRefund', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsCreateRefund', 'subscription_id', subscription_id) + // verify required parameter 'CreateSubscriptionRefundRequest' is not null or undefined + assertParamExists('subsCreateRefund', 'CreateSubscriptionRefundRequest', CreateSubscriptionRefundRequest) + const localVarPath = `/subscriptions/{subscription_id}/refunds` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateSubscriptionRefundRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsCreateRefundWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, CreateSubscriptionRefundRequest: CreateSubscriptionRefundRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsCreateRefund', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsCreateRefund', 'subscription_id', subscription_id) + // verify required parameter 'CreateSubscriptionRefundRequest' is not null or undefined + assertParamExists('subsCreateRefund', 'CreateSubscriptionRefundRequest', CreateSubscriptionRefundRequest) + const localVarPath = `/subscriptions/{subscription_id}/refunds` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateSubscriptionRefundRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to create a new subscription. + * @summary Create Subscription + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateSubscriptionRequest} CreateSubscriptionRequest Request body to create a subscription. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + subsCreateSubscription: async (x_api_version: string, CreateSubscriptionRequest: CreateSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsCreateSubscription', 'x_api_version', x_api_version) + // verify required parameter 'CreateSubscriptionRequest' is not null or undefined + assertParamExists('subsCreateSubscription', 'CreateSubscriptionRequest', CreateSubscriptionRequest) + const localVarPath = `/subscriptions`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateSubscriptionRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsCreateSubscriptionWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateSubscriptionRequest: CreateSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsCreateSubscription', 'x_api_version', x_api_version) + // verify required parameter 'CreateSubscriptionRequest' is not null or undefined + assertParamExists('subsCreateSubscription', 'CreateSubscriptionRequest', CreateSubscriptionRequest) + const localVarPath = `/subscriptions`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(CreateSubscriptionRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to fetch plan details. + * @summary Fetch Plan + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} plan_id Provide the PlanId for which the details have to be fetched. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + subsFetchPlan: async (x_api_version: string, plan_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsFetchPlan', 'x_api_version', x_api_version) + // verify required parameter 'plan_id' is not null or undefined + assertParamExists('subsFetchPlan', 'plan_id', plan_id) + const localVarPath = `/plans/{plan_id}` + .replace(`{${"plan_id"}}`, encodeURIComponent(String(plan_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsFetchPlanWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, plan_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsFetchPlan', 'x_api_version', x_api_version) + // verify required parameter 'plan_id' is not null or undefined + assertParamExists('subsFetchPlan', 'plan_id', plan_id) + const localVarPath = `/plans/{plan_id}` + .replace(`{${"plan_id"}}`, encodeURIComponent(String(plan_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to fetch subscription details. + * @summary Fetch Subscription + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + subsFetchSubscription: async (x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsFetchSubscription', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsFetchSubscription', 'subscription_id', subscription_id) + const localVarPath = `/subscriptions/{subscription_id}` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsFetchSubscriptionWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsFetchSubscription', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsFetchSubscription', 'subscription_id', subscription_id) + const localVarPath = `/subscriptions/{subscription_id}` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to fetch details of a single payment of a subscription. + * @summary Fetch details of a single payment. + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} payment_id Provide the PaymentId using which the payment was created. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + subsFetchSubscriptionPayment: async (x_api_version: string, subscription_id: string, payment_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsFetchSubscriptionPayment', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsFetchSubscriptionPayment', 'subscription_id', subscription_id) + // verify required parameter 'payment_id' is not null or undefined + assertParamExists('subsFetchSubscriptionPayment', 'payment_id', payment_id) + const localVarPath = `/subscriptions/{subscription_id}/payments/{payment_id}` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))) + .replace(`{${"payment_id"}}`, encodeURIComponent(String(payment_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsFetchSubscriptionPaymentWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, payment_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsFetchSubscriptionPayment', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsFetchSubscriptionPayment', 'subscription_id', subscription_id) + // verify required parameter 'payment_id' is not null or undefined + assertParamExists('subsFetchSubscriptionPayment', 'payment_id', payment_id) + const localVarPath = `/subscriptions/{subscription_id}/payments/{payment_id}` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))) + .replace(`{${"payment_id"}}`, encodeURIComponent(String(payment_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to fetch all payments of a subscription. + * @summary Fetch details of all payments of a subscription. + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + subsFetchSubscriptionPayments: async (x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsFetchSubscriptionPayments', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsFetchSubscriptionPayments', 'subscription_id', subscription_id) + const localVarPath = `/subscriptions/{subscription_id}/payments` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsFetchSubscriptionPaymentsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsFetchSubscriptionPayments', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsFetchSubscriptionPayments', 'subscription_id', subscription_id) + const localVarPath = `/subscriptions/{subscription_id}/payments` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to fetch details of a refund of a subscription payment. + * @summary Fetch details of a refund. + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} refund_id Provide the PaymentId for which the details have to be fetched. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + subsFetchSubscriptionRefund: async (x_api_version: string, subscription_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsFetchSubscriptionRefund', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsFetchSubscriptionRefund', 'subscription_id', subscription_id) + // verify required parameter 'refund_id' is not null or undefined + assertParamExists('subsFetchSubscriptionRefund', 'refund_id', refund_id) + const localVarPath = `/subscriptions/{subscription_id}/refunds/{refund_id}` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))) + .replace(`{${"refund_id"}}`, encodeURIComponent(String(refund_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsFetchSubscriptionRefundWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsFetchSubscriptionRefund', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsFetchSubscriptionRefund', 'subscription_id', subscription_id) + // verify required parameter 'refund_id' is not null or undefined + assertParamExists('subsFetchSubscriptionRefund', 'refund_id', refund_id) + const localVarPath = `/subscriptions/{subscription_id}/refunds/{refund_id}` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))) + .replace(`{${"refund_id"}}`, encodeURIComponent(String(refund_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to manage a subscription. You can cancel, pause, activate or change the plan of a subscription. + * @summary Manage a subscription. + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {ManageSubscriptionRequest} ManageSubscriptionRequest Request body to manage a subscription. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + subsManageSubscription: async (x_api_version: string, subscription_id: string, ManageSubscriptionRequest: ManageSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsManageSubscription', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsManageSubscription', 'subscription_id', subscription_id) + // verify required parameter 'ManageSubscriptionRequest' is not null or undefined + assertParamExists('subsManageSubscription', 'ManageSubscriptionRequest', ManageSubscriptionRequest) + const localVarPath = `/subscriptions/{subscription_id}/manage` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(ManageSubscriptionRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsManageSubscriptionWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, ManageSubscriptionRequest: ManageSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsManageSubscription', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsManageSubscription', 'subscription_id', subscription_id) + // verify required parameter 'ManageSubscriptionRequest' is not null or undefined + assertParamExists('subsManageSubscription', 'ManageSubscriptionRequest', ManageSubscriptionRequest) + const localVarPath = `/subscriptions/{subscription_id}/manage` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(ManageSubscriptionRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to manage a payment of a subscription. A payment can be cancelled or retried with this API. + * @summary Manage a single payment. + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} payment_id Provide the PaymentId using which the payment was created. + * @param {ManageSubscriptionPaymentRequest} ManageSubscriptionPaymentRequest Request body to manage a subscription payment. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, + */ + subsManageSubscriptionPayment: async (x_api_version: string, subscription_id: string, payment_id: string, ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsManageSubscriptionPayment', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsManageSubscriptionPayment', 'subscription_id', subscription_id) + // verify required parameter 'payment_id' is not null or undefined + assertParamExists('subsManageSubscriptionPayment', 'payment_id', payment_id) + // verify required parameter 'ManageSubscriptionPaymentRequest' is not null or undefined + assertParamExists('subsManageSubscriptionPayment', 'ManageSubscriptionPaymentRequest', ManageSubscriptionPaymentRequest) + const localVarPath = `/subscriptions/{subscription_id}/payments/{payment_id}/manage` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))) + .replace(`{${"payment_id"}}`, encodeURIComponent(String(payment_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(ManageSubscriptionPaymentRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subsManageSubscriptionPaymentWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, payment_id: string, ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subsManageSubscriptionPayment', 'x_api_version', x_api_version) + // verify required parameter 'subscription_id' is not null or undefined + assertParamExists('subsManageSubscriptionPayment', 'subscription_id', subscription_id) + // verify required parameter 'payment_id' is not null or undefined + assertParamExists('subsManageSubscriptionPayment', 'payment_id', payment_id) + // verify required parameter 'ManageSubscriptionPaymentRequest' is not null or undefined + assertParamExists('subsManageSubscriptionPayment', 'ManageSubscriptionPaymentRequest', ManageSubscriptionPaymentRequest) + const localVarPath = `/subscriptions/{subscription_id}/payments/{payment_id}/manage` + .replace(`{${"subscription_id"}}`, encodeURIComponent(String(subscription_id))) + .replace(`{${"payment_id"}}`, encodeURIComponent(String(payment_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(ManageSubscriptionPaymentRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to upload Physical Nach for Physical Nach Authorization. + * @summary API to upload Physical Nach for Physical Nach Authorization. + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} payment_id Provide the PaymentId using which the payment was created. + * @param {File} file Select the .jpg file that should be uploaded or provide the path of that file. You cannot upload a file that is more than 1MB in size. + * @param {string} payment_id2 Authorization Payment Id for physical nach authorization + * @param {string} action Action to be performed on the file. Can be SUBMIT_DOCUMENT + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * payment_id2: string, + */ + subscriptionDocumentUpload: async (x_api_version: string, payment_id: string, file: File, payment_id2: string, action: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subscriptionDocumentUpload', 'x_api_version', x_api_version) + // verify required parameter 'payment_id' is not null or undefined + assertParamExists('subscriptionDocumentUpload', 'payment_id', payment_id) + // verify required parameter 'file' is not null or undefined + assertParamExists('subscriptionDocumentUpload', 'file', file) + // verify required parameter 'payment_id2' is not null or undefined + assertParamExists('subscriptionDocumentUpload', 'payment_id2', payment_id2) + // verify required parameter 'action' is not null or undefined + assertParamExists('subscriptionDocumentUpload', 'action', action) + const localVarPath = `/subscriptions/pay/documents/{payment_id}` + .replace(`{${"payment_id"}}`, encodeURIComponent(String(payment_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + if (file !== undefined) { + localVarFormParams.append('file', file as any); + } + + if (payment_id2 !== undefined) { + localVarFormParams.append('payment_id', payment_id2 as any); + } + + if (action !== undefined) { + localVarFormParams.append('action', action as any); + } + + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = localVarFormParams; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subscriptionDocumentUploadWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, payment_id: string, file: File, payment_id2: string, action: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subscriptionDocumentUpload', 'x_api_version', x_api_version) + // verify required parameter 'payment_id' is not null or undefined + assertParamExists('subscriptionDocumentUpload', 'payment_id', payment_id) + // verify required parameter 'file' is not null or undefined + assertParamExists('subscriptionDocumentUpload', 'file', file) + // verify required parameter 'payment_id2' is not null or undefined + assertParamExists('subscriptionDocumentUpload', 'payment_id2', payment_id2) + // verify required parameter 'action' is not null or undefined + assertParamExists('subscriptionDocumentUpload', 'action', action) + const localVarPath = `/subscriptions/pay/documents/{payment_id}` + .replace(`{${"payment_id"}}`, encodeURIComponent(String(payment_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + if (file !== undefined) { + localVarFormParams.append('file', file as any); + } + + if (payment_id2 !== undefined) { + localVarFormParams.append('payment_id', payment_id2 as any); + } + + if (action !== undefined) { + localVarFormParams.append('action', action as any); + } + + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = localVarFormParams; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to check if a payment method is enabled for your account. + * @summary API to get all the payment method details available for subscription payments. + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {SubscriptionEligibilityRequest} SubscriptionEligibilityRequest Request body to fetch subscription eligibile payment method details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_idempotency_key?: string, + */ + subscriptionEligibility: async (x_api_version: string, SubscriptionEligibilityRequest: SubscriptionEligibilityRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subscriptionEligibility', 'x_api_version', x_api_version) + // verify required parameter 'SubscriptionEligibilityRequest' is not null or undefined + assertParamExists('subscriptionEligibility', 'SubscriptionEligibilityRequest', SubscriptionEligibilityRequest) + const localVarPath = `/subscriptions/eligibility/payment_methods`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(SubscriptionEligibilityRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + subscriptionEligibilityWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, SubscriptionEligibilityRequest: SubscriptionEligibilityRequest, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('subscriptionEligibility', 'x_api_version', x_api_version) + // verify required parameter 'SubscriptionEligibilityRequest' is not null or undefined + assertParamExists('subscriptionEligibility', 'SubscriptionEligibilityRequest', SubscriptionEligibilityRequest) + const localVarPath = `/subscriptions/eligibility/payment_methods`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(SubscriptionEligibilityRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + } +}; + +/** + * SubscriptionApi - functional programming interface + * @export + */ +const SubscriptionApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = SubscriptionApiAxiosParamCreator(configuration) + return { + /** + * Use this API to create an auth or to raise a charge . + * @summary Raise a charge or create an auth. + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateSubscriptionPaymentRequest} CreateSubscriptionPaymentRequest Request body to create a subscription payment. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsCreatePayment(x_api_version: string, CreateSubscriptionPaymentRequest: CreateSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreatePayment(x_api_version, CreateSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsCreatePaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateSubscriptionPaymentRequest: CreateSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreatePaymentWithConfiguration(cashfreeConfiguration, x_api_version, CreateSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * A plan allows your customer to identify the features you offer along with your pricing. You can create plans as per the pricing you support for your services. For each plan, you can set a pre-decided frequency and amount with which they’ll be charged. Example: Netflix Plans - Premium, Basic, Standard, Mobile. Each plan differs and caters for a particular set of audiences. + * @summary Create a plan. + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreatePlanRequest} CreatePlanRequest Request body to create a plan. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsCreatePlan(x_api_version: string, CreatePlanRequest: CreatePlanRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreatePlan(x_api_version, CreatePlanRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsCreatePlanWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreatePlanRequest: CreatePlanRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreatePlanWithConfiguration(cashfreeConfiguration, x_api_version, CreatePlanRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * This API allows you to create refund on a successful payment. Refund amount can be partial or the full amount of the payment. + * @summary Create a refund. + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {CreateSubscriptionRefundRequest} CreateSubscriptionRefundRequest Request body to create a subscription refund. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsCreateRefund(x_api_version: string, subscription_id: string, CreateSubscriptionRefundRequest: CreateSubscriptionRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreateRefund(x_api_version, subscription_id, CreateSubscriptionRefundRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsCreateRefundWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, CreateSubscriptionRefundRequest: CreateSubscriptionRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreateRefundWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, CreateSubscriptionRefundRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to create a new subscription. + * @summary Create Subscription + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateSubscriptionRequest} CreateSubscriptionRequest Request body to create a subscription. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsCreateSubscription(x_api_version: string, CreateSubscriptionRequest: CreateSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreateSubscription(x_api_version, CreateSubscriptionRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsCreateSubscriptionWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateSubscriptionRequest: CreateSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsCreateSubscriptionWithConfiguration(cashfreeConfiguration, x_api_version, CreateSubscriptionRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to fetch plan details. + * @summary Fetch Plan + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} plan_id Provide the PlanId for which the details have to be fetched. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsFetchPlan(x_api_version: string, plan_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchPlan(x_api_version, plan_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsFetchPlanWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, plan_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchPlanWithConfiguration(cashfreeConfiguration, x_api_version, plan_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to fetch subscription details. + * @summary Fetch Subscription + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsFetchSubscription(x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscription(x_api_version, subscription_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsFetchSubscriptionWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscriptionWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to fetch details of a single payment of a subscription. + * @summary Fetch details of a single payment. + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} payment_id Provide the PaymentId using which the payment was created. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsFetchSubscriptionPayment(x_api_version: string, subscription_id: string, payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscriptionPayment(x_api_version, subscription_id, payment_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsFetchSubscriptionPaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscriptionPaymentWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, payment_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to fetch all payments of a subscription. + * @summary Fetch details of all payments of a subscription. + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsFetchSubscriptionPayments(x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscriptionPayments(x_api_version, subscription_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsFetchSubscriptionPaymentsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscriptionPaymentsWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to fetch details of a refund of a subscription payment. + * @summary Fetch details of a refund. + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} refund_id Provide the PaymentId for which the details have to be fetched. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsFetchSubscriptionRefund(x_api_version: string, subscription_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscriptionRefund(x_api_version, subscription_id, refund_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsFetchSubscriptionRefundWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsFetchSubscriptionRefundWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, refund_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to manage a subscription. You can cancel, pause, activate or change the plan of a subscription. + * @summary Manage a subscription. + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {ManageSubscriptionRequest} ManageSubscriptionRequest Request body to manage a subscription. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsManageSubscription(x_api_version: string, subscription_id: string, ManageSubscriptionRequest: ManageSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsManageSubscription(x_api_version, subscription_id, ManageSubscriptionRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsManageSubscriptionWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, ManageSubscriptionRequest: ManageSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsManageSubscriptionWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, ManageSubscriptionRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to manage a payment of a subscription. A payment can be cancelled or retried with this API. + * @summary Manage a single payment. + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} payment_id Provide the PaymentId using which the payment was created. + * @param {ManageSubscriptionPaymentRequest} ManageSubscriptionPaymentRequest Request body to manage a subscription payment. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subsManageSubscriptionPayment(x_api_version: string, subscription_id: string, payment_id: string, ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsManageSubscriptionPayment(x_api_version, subscription_id, payment_id, ManageSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subsManageSubscriptionPaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, payment_id: string, ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subsManageSubscriptionPaymentWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, payment_id, ManageSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to upload Physical Nach for Physical Nach Authorization. + * @summary API to upload Physical Nach for Physical Nach Authorization. + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} payment_id Provide the PaymentId using which the payment was created. + * @param {File} file Select the .jpg file that should be uploaded or provide the path of that file. You cannot upload a file that is more than 1MB in size. + * @param {string} payment_id2 Authorization Payment Id for physical nach authorization + * @param {string} action Action to be performed on the file. Can be SUBMIT_DOCUMENT + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subscriptionDocumentUpload(x_api_version: string, payment_id: string, file: File, payment_id2: string, action: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subscriptionDocumentUpload(x_api_version, payment_id, file, payment_id2, action, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subscriptionDocumentUploadWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, payment_id: string, file: File, payment_id2: string, action: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subscriptionDocumentUploadWithConfiguration(cashfreeConfiguration, x_api_version, payment_id, file, payment_id2, action, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to check if a payment method is enabled for your account. + * @summary API to get all the payment method details available for subscription payments. + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {SubscriptionEligibilityRequest} SubscriptionEligibilityRequest Request body to fetch subscription eligibile payment method details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async subscriptionEligibility(x_api_version: string, SubscriptionEligibilityRequest: SubscriptionEligibilityRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subscriptionEligibility(x_api_version, SubscriptionEligibilityRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async subscriptionEligibilityWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, SubscriptionEligibilityRequest: SubscriptionEligibilityRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.subscriptionEligibilityWithConfiguration(cashfreeConfiguration, x_api_version, SubscriptionEligibilityRequest, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + } +}; + +/** + * SubscriptionApi - object-oriented interface + * @export + * @class SubscriptionApi + * @extends {BaseAPI} + */ + + + +/** + * TokenVaultApi - axios parameter creator + * @export + */ +const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Use this API to delete a saved card instrument for a customer_id and instrument_id + * @summary Delete Saved Card Instrument + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` + * @param {string} instrument_id The instrument_id which needs to be deleted + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + pGCustomerDeleteInstrument: async (x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGCustomerDeleteInstrument', 'x_api_version', x_api_version) + // verify required parameter 'customer_id' is not null or undefined + assertParamExists('pGCustomerDeleteInstrument', 'customer_id', customer_id) + // verify required parameter 'instrument_id' is not null or undefined + assertParamExists('pGCustomerDeleteInstrument', 'instrument_id', instrument_id) + const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}` + .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))) + .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGCustomerDeleteInstrumentWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGCustomerDeleteInstrument', 'x_api_version', x_api_version) + // verify required parameter 'customer_id' is not null or undefined + assertParamExists('pGCustomerDeleteInstrument', 'customer_id', customer_id) + // verify required parameter 'instrument_id' is not null or undefined + assertParamExists('pGCustomerDeleteInstrument', 'instrument_id', instrument_id) + const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}` + .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))) + .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to fetch a single specific saved card for a customer_id by it\'s instrument_id + * @summary Fetch Specific Saved Card Instrument + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` + * @param {string} instrument_id The instrument_id of the saved instrument which needs to be queried + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + pGCustomerFetchInstrument: async (x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGCustomerFetchInstrument', 'x_api_version', x_api_version) + // verify required parameter 'customer_id' is not null or undefined + assertParamExists('pGCustomerFetchInstrument', 'customer_id', customer_id) + // verify required parameter 'instrument_id' is not null or undefined + assertParamExists('pGCustomerFetchInstrument', 'instrument_id', instrument_id) + const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}` + .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))) + .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGCustomerFetchInstrumentWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGCustomerFetchInstrument', 'x_api_version', x_api_version) + // verify required parameter 'customer_id' is not null or undefined + assertParamExists('pGCustomerFetchInstrument', 'customer_id', customer_id) + // verify required parameter 'instrument_id' is not null or undefined + assertParamExists('pGCustomerFetchInstrument', 'instrument_id', instrument_id) + const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}` + .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))) + .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API to fetch saved cards for a customer_id + * @summary Fetch All Saved Card Instrument + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` + * @param {PGCustomerFetchInstrumentsInstrumentTypeEnum} instrument_type Payment mode or type of saved instrument + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + pGCustomerFetchInstruments: async (x_api_version: string, customer_id: string, instrument_type: PGCustomerFetchInstrumentsInstrumentTypeEnum, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGCustomerFetchInstruments', 'x_api_version', x_api_version) + // verify required parameter 'customer_id' is not null or undefined + assertParamExists('pGCustomerFetchInstruments', 'customer_id', customer_id) + // verify required parameter 'instrument_type' is not null or undefined + assertParamExists('pGCustomerFetchInstruments', 'instrument_type', instrument_type) + const localVarPath = `/customers/{customer_id}/instruments` + .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + if (instrument_type !== undefined) { + localVarQueryParameter['instrument_type'] = instrument_type; + } + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGCustomerFetchInstrumentsWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_type: PGCustomerFetchInstrumentsInstrumentTypeEnum, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGCustomerFetchInstruments', 'x_api_version', x_api_version) + // verify required parameter 'customer_id' is not null or undefined + assertParamExists('pGCustomerFetchInstruments', 'customer_id', customer_id) + // verify required parameter 'instrument_type' is not null or undefined + assertParamExists('pGCustomerFetchInstruments', 'instrument_type', instrument_type) + const localVarPath = `/customers/{customer_id}/instruments` + .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + if (instrument_type !== undefined) { + localVarQueryParameter['instrument_type'] = instrument_type; + } + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + /** + * Use this API To get the card network token, token expiry and cryptogram for a saved card instrument using instrument id + * @summary Fetch cryptogram for a saved card instrument + + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` + * @param {string} instrument_id The instrument_id of the saved card instrument which needs to be queried + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * x_request_id?: string, + */ + pGCustomerInstrumentsFetchCryptogram: async (x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'x_api_version', x_api_version) + // verify required parameter 'customer_id' is not null or undefined + assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'customer_id', customer_id) + // verify required parameter 'instrument_id' is not null or undefined + assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'instrument_id', instrument_id) + const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}/cryptogram` + .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))) + .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey") + + // authentication XClientSecret required + await setApiKeyToObject(localVarHeaderParameter, "x-client-secret") + + // authentication XPartnerMerchantID required + await setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid") + + // authentication XClientID required + await setApiKeyToObject(localVarHeaderParameter, "x-client-id") + + // authentication XClientSignatureHeader required + await setApiKeyToObject(localVarHeaderParameter, "x-client-signature") + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + // With Configuration + pGCustomerInstrumentsFetchCryptogramWithConfiguration: async (cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'x_api_version' is not null or undefined + assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'x_api_version', x_api_version) + // verify required parameter 'customer_id' is not null or undefined + assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'customer_id', customer_id) + // verify required parameter 'instrument_id' is not null or undefined + assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'instrument_id', instrument_id) + const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}/cryptogram` + .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id))) + .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + const localVarUrlObj = new URL(localVarPath, url); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication XPartnerAPIKey required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-apikey", cashfreeConfiguration) + + // authentication XClientSecret required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-secret", cashfreeConfiguration) + + // authentication XPartnerMerchantID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-partner-merchantid", cashfreeConfiguration) + + // authentication XClientID required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-id", cashfreeConfiguration) + + // authentication XClientSignatureHeader required + await setApiKeyToObjectWithConfiguration(localVarHeaderParameter, "x-client-signature", cashfreeConfiguration) + + + + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-4.3.0'; + if (x_api_version != null && x_api_version != undefined) { + localVarHeaderParameter['x-api-version'] = x_api_version; + } + + if (x_request_id != null && x_request_id != undefined) { + localVarHeaderParameter['x-request-id'] = x_request_id; + } + + if (x_idempotency_key != null && x_idempotency_key != undefined) { + localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + + } +}; + +/** + * TokenVaultApi - functional programming interface + * @export + */ +const TokenVaultApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = TokenVaultApiAxiosParamCreator(configuration) + return { + /** + * Use this API to delete a saved card instrument for a customer_id and instrument_id + * @summary Delete Saved Card Instrument + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` + * @param {string} instrument_id The instrument_id which needs to be deleted + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGCustomerDeleteInstrument(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerDeleteInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGCustomerDeleteInstrumentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerDeleteInstrumentWithConfiguration(cashfreeConfiguration, x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to fetch a single specific saved card for a customer_id by it\'s instrument_id + * @summary Fetch Specific Saved Card Instrument + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` + * @param {string} instrument_id The instrument_id of the saved instrument which needs to be queried + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGCustomerFetchInstrument(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerFetchInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGCustomerFetchInstrumentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerFetchInstrumentWithConfiguration(cashfreeConfiguration, x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API to fetch saved cards for a customer_id + * @summary Fetch All Saved Card Instrument + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` + * @param {PGCustomerFetchInstrumentsInstrumentTypeEnum} instrument_type Payment mode or type of saved instrument + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGCustomerFetchInstruments(x_api_version: string, customer_id: string, instrument_type: PGCustomerFetchInstrumentsInstrumentTypeEnum, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerFetchInstruments(x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGCustomerFetchInstrumentsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_type: PGCustomerFetchInstrumentsInstrumentTypeEnum, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerFetchInstrumentsWithConfiguration(cashfreeConfiguration, x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + /** + * Use this API To get the card network token, token expiry and cryptogram for a saved card instrument using instrument id + * @summary Fetch cryptogram for a saved card instrument + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` + * @param {string} instrument_id The instrument_id of the saved card instrument which needs to be queried + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pGCustomerInstrumentsFetchCryptogram(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerInstrumentsFetchCryptogram(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + + async pGCustomerInstrumentsFetchCryptogramWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pGCustomerInstrumentsFetchCryptogramWithConfiguration(cashfreeConfiguration, x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options); + var url = "https://sandbox.cashfree.com/pg"; + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + url = "https://api.cashfree.com/pg" + } + return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration); + }, + } +}; + +/** + * TokenVaultApi - object-oriented interface + * @export + * @class TokenVaultApi + * @extends {BaseAPI} + */ + +/** + * @export + */ +export const PGCustomerFetchInstrumentsInstrumentTypeEnum = { + CARD: 'card', + UNKNOWN_DEFAULT_OPEN_API: '11184809' +} as const; +export type PGCustomerFetchInstrumentsInstrumentTypeEnum = typeof PGCustomerFetchInstrumentsInstrumentTypeEnum[keyof typeof PGCustomerFetchInstrumentsInstrumentTypeEnum]; + + + +class Environment { + public PRODUCTION = CFEnvironment.PRODUCTION; + public SANDBOX = CFEnvironment.SANDBOX; +} + +export class PGWebhookEvent { + + type: string; + raw: string; + object: any; + + constructor(type: string, rawBody: string, object: any) { + this.type = type; + this.raw = rawBody + this.object = object; + } +} + +export class CashfreeConfiguration { + XClientId?: string; + XClientSecret?: string; + XPartnerKey?: string; + XClientSignature?: string; + XPartnerMerchantId?: string; + + constructor(XClientId: string, XClientSecret: string, XPartnerKey: string, XClientSignature: string, XPartnerMerchantId: string) { + if(XClientId !== "") { + this.XClientId = XClientId; + } + if(XClientSecret !== "") { + this.XClientSecret = XClientSecret + } + if(XPartnerKey !== "") { + this.XPartnerKey = XPartnerKey; + } + if(XClientSignature !== "") { + this.XClientSignature = XClientSignature; + } + if(XPartnerMerchantId !== "") { + this.XPartnerMerchantId = XPartnerMerchantId; + } + } +} + +export class Cashfree { + static axios: AxiosInstance; + static basePath: string; + + static XClientId?: string; + static XClientSecret?: string; + static XPartnerKey?: string; + static XClientSignature?: string; + static XPartnerMerchantId?: string; + static XEnvironment: CFEnvironment; + static XEnableErrorAnalytics: boolean = true; + static XApiVersion: string = "2023-08-01"; + + static Environment = new Environment(); + + /** + * Use this API to verify your webhook signature once you receive from Cashfree's server. + * @summary Verify Webhook Signatures + * @param {string} signature that is present in the header of the webhook ("x-webhook-signature") + * @param {string} rawBody is the entire body sent to the server in string format + * @param {string} timestamp that is present in the header of the webhook ("x-webhook-timestamp") + * @throws {Error} + */ + public static PGVerifyWebhookSignature(signature: string, rawBody: string, timestamp: string) { + const body = timestamp + rawBody + const secretKey = Cashfree.XClientSecret; + let generatedSignature = crypto.createHmac('sha256', secretKey).update(body).digest("base64"); + if(generatedSignature === signature) { + let jsonObject = JSON.parse(rawBody) + return new PGWebhookEvent(jsonObject.type, rawBody, jsonObject); + } + throw new Error("Generated signature and received signature did not match."); + } + + + /** + * Create Customer at Cashfree + * @summary Create Customer at Cashfree + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateCustomerRequest} CreateCustomerRequest Request to create a new customer at Cashfree + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CustomersApi + */ + public static PGCreateCustomer(x_api_version: string, CreateCustomerRequest: CreateCustomerRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return CustomersApiFp().pGCreateCustomer(x_api_version, CreateCustomerRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGCreateCustomerWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateCustomerRequest: CreateCustomerRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return CustomersApiFp().pGCreateCustomerWithConfiguration(cashfreeConfiguration, x_api_version, CreateCustomerRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * The Create On Demand Transfer API will create a new on-demand request either from to the merchant or from to the vendor. + * @summary Create On Demand Transfer + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {AdjustVendorBalanceRequest} [AdjustVendorBalanceRequest] Adjust Vendor Balance Request Body. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGESCreateOnDemandTransfer(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, AdjustVendorBalanceRequest?: AdjustVendorBalanceRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESCreateOnDemandTransfer(x_api_version, vendor_id, x_request_id, x_idempotency_key, AdjustVendorBalanceRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGESCreateOnDemandTransferWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, AdjustVendorBalanceRequest?: AdjustVendorBalanceRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESCreateOnDemandTransferWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, AdjustVendorBalanceRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to create a new vendor to your EasySplit account along with the KYC details. Provide KYC details such as account_type, business_type, gst, cin, pan, passport number and so on. + * @summary Create vendor + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {CreateVendorRequest} [CreateVendorRequest] Create Vendor Request Body. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGESCreateVendors(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateVendorRequest?: CreateVendorRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESCreateVendors(x_api_version, x_request_id, x_idempotency_key, CreateVendorRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGESCreateVendorsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateVendorRequest?: CreateVendorRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESCreateVendorsWithConfiguration(cashfreeConfiguration, x_api_version, x_request_id, x_idempotency_key, CreateVendorRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to download the uploaded KYC documents of that particular vendor. Provide the document type. Click the link from the sample request to download the KYC document. + * @summary Download Vendor Documents + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} doc_type Mention the document type that has to be downloaded. Only an uploaded document can be downloaded. + * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGESDownloadVendorsDocs(x_api_version: string, doc_type: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESDownloadVendorsDocs(x_api_version, doc_type, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGESDownloadVendorsDocsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, doc_type: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESDownloadVendorsDocsWithConfiguration(cashfreeConfiguration, x_api_version, doc_type, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to get the details of a specific vendor associated with your Easy Split account. + * @summary Get Vendor All Details + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGESFetchVendors(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESFetchVendors(x_api_version, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGESFetchVendorsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESFetchVendorsWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * This API fetches the available amount with the merchant, vendor, and the unsettled amount for the merchant as well as the vendor. + * @summary Get On Demand Balance + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGESGetVendorBalance(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESGetVendorBalance(x_api_version, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGESGetVendorBalanceWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESGetVendorBalanceWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * This API returns the applicable service charge and service tax for a vendor balance transfer, based on the provided amount and rate type. + * @summary Get Vendor Balance Transfer Charges + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {number} amount Specify the amount for which you want to view the service charges and service taxes in the response. + * @param {string} rate_type Mention the type of rate for which you want to check the charges. Possible value: VENDOR_ON_DEMAND + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGESGetVendorBalanceTransferCharges(x_api_version: string, amount: number, rate_type: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESGetVendorBalanceTransferCharges(x_api_version, amount, rate_type, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGESGetVendorBalanceTransferChargesWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, amount: number, rate_type: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESGetVendorBalanceTransferChargesWithConfiguration(cashfreeConfiguration, x_api_version, amount, rate_type, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to fetch the details of all the KYC details of a particular vendor. + * @summary Get Vendor All Documents Status + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGESGetVendorsDocs(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESGetVendorsDocs(x_api_version, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGESGetVendorsDocsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESGetVendorsDocsWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to get all the split details, settled and unsettled transactions details of each vendor who were part of a particular order by providing order Id or start date and end date. + * @summary Get Split and Settlement Details by OrderID v2.0 + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {ESOrderReconRequest} [ESOrderReconRequest] Get Split and Settlement Details by OrderID v2.0 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGESOrderRecon(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, ESOrderReconRequest?: ESOrderReconRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESOrderRecon(x_api_version, x_request_id, x_idempotency_key, ESOrderReconRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGESOrderReconWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, ESOrderReconRequest?: ESOrderReconRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESOrderReconWithConfiguration(cashfreeConfiguration, x_api_version, x_request_id, x_idempotency_key, ESOrderReconRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to edit the existing vendor details added to your EasySplit account. You can edit vendor details such as name, email, phone number, upi details, and any of the KYC details. + * @summary Update vendor Details + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {UpdateVendorRequest} [UpdateVendorRequest] Create Vendor Request Body. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGESUpdateVendors(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, UpdateVendorRequest?: UpdateVendorRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESUpdateVendors(x_api_version, vendor_id, x_request_id, x_idempotency_key, UpdateVendorRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGESUpdateVendorsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, UpdateVendorRequest?: UpdateVendorRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESUpdateVendorsWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, UpdateVendorRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to upload KYC documents of a specific vendor. + * @summary Upload Vendor Docs + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [doc_type] Mention the type of the document you are uploading. Possible values: UIDAI_FRONT, UIDAI_BACK, UIDAI_NUMBER, DL, DL_NUMBER, PASSPORT_FRONT, PASSPORT_BACK, PASSPORT_NUMBER, VOTER_ID, VOTER_ID_NUMBER, PAN, PAN_NUMBER, GST, GSTIN_NUMBER, CIN, CIN_NUMBER, NBFC_CERTIFICATE. If the doc type ends with a number you should add the doc value else upload the doc file. + * @param {string} [doc_value] Enter the display name of the uploaded file. + * @param {File} [file] Select the document that should be uploaded or provide the path of that file. You cannot upload a file that is more than 2MB in size. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGESUploadVendorsDocs(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, doc_type?: string, doc_value?: string, file?: File, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESUploadVendorsDocs(x_api_version, vendor_id, x_request_id, x_idempotency_key, doc_type, doc_value, file, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGESUploadVendorsDocsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, doc_type?: string, doc_value?: string, file?: File, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGESUploadVendorsDocsWithConfiguration(cashfreeConfiguration, x_api_version, vendor_id, x_request_id, x_idempotency_key, doc_type, doc_value, file, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Split After Payment API splits the payments to vendors after successful payment from the customers. + * @summary Split After Payment + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {SplitAfterPaymentRequest} [SplitAfterPaymentRequest] Request Body to Create Split for an order. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGOrderSplitAfterPayment(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, SplitAfterPaymentRequest?: SplitAfterPaymentRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGOrderSplitAfterPayment(x_api_version, order_id, x_request_id, x_idempotency_key, SplitAfterPaymentRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGOrderSplitAfterPaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, SplitAfterPaymentRequest?: SplitAfterPaymentRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGOrderSplitAfterPaymentWithConfiguration(cashfreeConfiguration, x_api_version, order_id, x_request_id, x_idempotency_key, SplitAfterPaymentRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * This API will create a static split scheme wherein you can define the split type and the vendor-wise split percentage. + * @summary Create Static Split Configuration + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {StaticSplitRequest} [StaticSplitRequest] Static Split + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EasySplitApi + */ + public static PGOrderStaticSplit(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, StaticSplitRequest?: StaticSplitRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGOrderStaticSplit(x_api_version, x_request_id, x_idempotency_key, StaticSplitRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGOrderStaticSplitWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, StaticSplitRequest?: StaticSplitRequest, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EasySplitApiFp().pGOrderStaticSplitWithConfiguration(cashfreeConfiguration, x_api_version, x_request_id, x_idempotency_key, StaticSplitRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number. + * @summary Get Eligible Cardless EMI Payment Methods for a customer on an order + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {EligibilityFetchCardlessEMIRequest} EligibilityFetchCardlessEMIRequest Request Body to get eligible cardless emi options for a customer and order + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EligibilityApi + */ + public static PGEligibilityFetchCardlessEMI(x_api_version: string, EligibilityFetchCardlessEMIRequest: EligibilityFetchCardlessEMIRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EligibilityApiFp().pGEligibilityFetchCardlessEMI(x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGEligibilityFetchCardlessEMIWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchCardlessEMIRequest: EligibilityFetchCardlessEMIRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EligibilityApiFp().pGEligibilityFetchCardlessEMIWithConfiguration(cashfreeConfiguration, x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to get eligible offers for an order_id or order amount. + * @summary Get Eligible Offers for an Order + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {EligibilityFetchOffersRequest} EligibilityFetchOffersRequest Request Body to get eligible offers for a customer and order + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EligibilityApi + */ + public static PGEligibilityFetchOffers(x_api_version: string, EligibilityFetchOffersRequest: EligibilityFetchOffersRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EligibilityApiFp().pGEligibilityFetchOffers(x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGEligibilityFetchOffersWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchOffersRequest: EligibilityFetchOffersRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EligibilityApiFp().pGEligibilityFetchOffersWithConfiguration(cashfreeConfiguration, x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to get eligible Paylater Payment Methods for a customer on an order. + * @summary Get Eligible Paylater for a customer on an order + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {EligibilityFetchPaylaterRequest} EligibilityFetchPaylaterRequest Request Body to get eligible paylater options for a customer and order + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EligibilityApi + */ + public static PGEligibilityFetchPaylater(x_api_version: string, EligibilityFetchPaylaterRequest: EligibilityFetchPaylaterRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EligibilityApiFp().pGEligibilityFetchPaylater(x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGEligibilityFetchPaylaterWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchPaylaterRequest: EligibilityFetchPaylaterRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EligibilityApiFp().pGEligibilityFetchPaylaterWithConfiguration(cashfreeConfiguration, x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to get eligible Payment Methods + * @summary Get eligible Payment Methods + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {EligibilityFetchPaymentMethodsRequest} EligibilityFetchPaymentMethodsRequest Request Body to get eligible payment methods for an account and order + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EligibilityApi + */ + public static PGEligibilityFetchPaymentMethods(x_api_version: string, EligibilityFetchPaymentMethodsRequest: EligibilityFetchPaymentMethodsRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EligibilityApiFp().pGEligibilityFetchPaymentMethods(x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGEligibilityFetchPaymentMethodsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, EligibilityFetchPaymentMethodsRequest: EligibilityFetchPaymentMethodsRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return EligibilityApiFp().pGEligibilityFetchPaymentMethodsWithConfiguration(cashfreeConfiguration, x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to create offers with Cashfree from your backend + * @summary Create Offer + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateOfferRequest} CreateOfferRequest Request body to create an offer at Cashfree + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OffersApi + */ + public static PGCreateOffer(x_api_version: string, CreateOfferRequest: CreateOfferRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return OffersApiFp().pGCreateOffer(x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGCreateOfferWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateOfferRequest: CreateOfferRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return OffersApiFp().pGCreateOfferWithConfiguration(cashfreeConfiguration, x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to get offer by offer_id + * @summary Get Offer by ID + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} offer_id The offer ID for which you want to view the offer details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OffersApi + */ + public static PGFetchOffer(x_api_version: string, offer_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return OffersApiFp().pGFetchOffer(x_api_version, offer_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGFetchOfferWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, offer_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return OffersApiFp().pGFetchOfferWithConfiguration(cashfreeConfiguration, x_api_version, offer_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * ### Order An order is an entity which has a amount and currency associated with it. It is something for which you want to collect payment for. Use this API to create orders with Cashfree from your backend to get a `payment_sessions_id`. You can use the `payment_sessions_id` to create a transaction for the order. + * @summary Create Order + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateOrderRequest} CreateOrderRequest Request body to create an order at cashfree + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrdersApi + */ + public static PGCreateOrder(x_api_version: string, CreateOrderRequest: CreateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return OrdersApiFp().pGCreateOrder(x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGCreateOrderWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateOrderRequest: CreateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return OrdersApiFp().pGCreateOrderWithConfiguration(cashfreeConfiguration, x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to fetch the order that was created at Cashfree\'s using the `order_id`. ## When to use this API - To check the status of your order - Once the order is PAID - Once your customer returns to `return_url` + * @summary Get Order + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrdersApi + */ + public static PGFetchOrder(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return OrdersApiFp().pGFetchOrder(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGFetchOrderWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return OrdersApiFp().pGFetchOrderWithConfiguration(cashfreeConfiguration, x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to terminate the order that was created at Cashfree\'s using the `order_id`. + * @summary Terminate Order + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {TerminateOrderRequest} TerminateOrderRequest Request body to terminate an order at cashfree + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrdersApi + */ + public static PGTerminateOrder(x_api_version: string, order_id: string, TerminateOrderRequest: TerminateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return OrdersApiFp().pGTerminateOrder(x_api_version, order_id, TerminateOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGTerminateOrderWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, TerminateOrderRequest: TerminateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return OrdersApiFp().pGTerminateOrderWithConfiguration(cashfreeConfiguration, x_api_version, order_id, TerminateOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * - Use this API to get the payment gateway reconciliation details with date range. - It will have events for your payment account + * @summary PG Reconciliation + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {FetchReconRequest} FetchReconRequest Request Body for the reconciliation + * @param {string} [Content_Type] application/json + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [Accept] application/json + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PGReconciliationApi + */ + public static PGFetchRecon(x_api_version: string, FetchReconRequest: FetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PGReconciliationApiFp().pGFetchRecon(x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGFetchReconWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, FetchReconRequest: FetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PGReconciliationApiFp().pGFetchReconWithConfiguration(cashfreeConfiguration, x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to cancel a payment link. No further payments can be done against a cancelled link. Only a link in ACTIVE status can be cancelled. + * @summary Cancel Payment Link + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} link_id The payment link ID for which you want to view the details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentLinksApi + */ + public static PGCancelLink(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentLinksApiFp().pGCancelLink(x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGCancelLinkWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentLinksApiFp().pGCancelLinkWithConfiguration(cashfreeConfiguration, x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url. + * @summary Create Payment Link + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {CreateLinkRequest} CreateLinkRequest Request Body to Create Payment Links + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentLinksApi + */ + public static PGCreateLink(x_api_version: string, CreateLinkRequest: CreateLinkRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentLinksApiFp().pGCreateLink(x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGCreateLinkWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateLinkRequest: CreateLinkRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentLinksApiFp().pGCreateLinkWithConfiguration(cashfreeConfiguration, x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to view all details and status of a payment link. + * @summary Fetch Payment Link Details + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} link_id The payment link ID for which you want to view the details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentLinksApi + */ + public static PGFetchLink(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentLinksApiFp().pGFetchLink(x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGFetchLinkWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentLinksApiFp().pGFetchLinkWithConfiguration(cashfreeConfiguration, x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to view all order details for a payment link. + * @summary Get Orders for a Payment Link + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} link_id The payment link ID for which you want to view the details. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [status] Mention What is status of orders you want to fetch, default is PAID. Possible value: ALL, PAID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentLinksApi + */ + public static PGLinkFetchOrders(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, status?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentLinksApiFp().pGLinkFetchOrders(x_api_version, link_id, x_request_id, x_idempotency_key, status, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGLinkFetchOrdersWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, status?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentLinksApiFp().pGLinkFetchOrdersWithConfiguration(cashfreeConfiguration, x_api_version, link_id, x_request_id, x_idempotency_key, status, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to capture or void a preauthorized payment + * @summary Preauthorization + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {AuthorizeOrderRequest} AuthorizeOrderRequest Request to Capture or Void Transactions + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public static PGAuthorizeOrder(x_api_version: string, order_id: string, AuthorizeOrderRequest: AuthorizeOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentsApiFp().pGAuthorizeOrder(x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGAuthorizeOrderWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, AuthorizeOrderRequest: AuthorizeOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentsApiFp().pGAuthorizeOrderWithConfiguration(cashfreeConfiguration, x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * If you accept OTP on your own page, you can use the below API to send OTP to Cashfree. + * @summary Submit or Resend OTP + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} cf_payment_id The Cashfree payment or transaction ID. + * @param {OrderAuthenticatePaymentRequest} OrderAuthenticatePaymentRequest Request body to submit/resend headless OTP. To use this API make sure you have headless OTP enabled for your account + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public static PGOrderAuthenticatePayment(x_api_version: string, cf_payment_id: string, OrderAuthenticatePaymentRequest: OrderAuthenticatePaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentsApiFp().pGOrderAuthenticatePayment(x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGOrderAuthenticatePaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_payment_id: string, OrderAuthenticatePaymentRequest: OrderAuthenticatePaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentsApiFp().pGOrderAuthenticatePaymentWithConfiguration(cashfreeConfiguration, x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to view payment details of an order for a payment ID. + * @summary Get Payment by ID + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {string} cf_payment_id The Cashfree payment or transaction ID. + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public static PGOrderFetchPayment(x_api_version: string, order_id: string, cf_payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentsApiFp().pGOrderFetchPayment(x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGOrderFetchPaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, cf_payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentsApiFp().pGOrderFetchPaymentWithConfiguration(cashfreeConfiguration, x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API to view all payment details for an order. + * @summary Get Payments for an Order + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public static PGOrderFetchPayments(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentsApiFp().pGOrderFetchPayments(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGOrderFetchPaymentsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentsApiFp().pGOrderFetchPaymentsWithConfiguration(cashfreeConfiguration, x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + /** + * Use this API when you have already created the orders and want Cashfree to process the payment. To use this API S2S flag needs to be enabled from the backend. In case you want to use the cards payment option the PCI DSS flag is required, for more information send an email to \"care@cashfree.com\". + * @summary Order Pay + * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {PayOrderRequest} PayOrderRequest Request body to create a transaction at cashfree using `payment_session_id` + * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public static PGPayOrder(x_api_version: string, PayOrderRequest: PayOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentsApiFp().pGPayOrder(x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + + // With Configuration + public static PGPayOrderWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, PayOrderRequest: PayOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return PaymentsApiFp().pGPayOrderWithConfiguration(cashfreeConfiguration, x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; } - throw new Error("Generated signature and received signature did not match."); } - /** - * Create Customer at Cashfree - * @summary Create Customer at Cashfree + * Use this API to initiate refunds. + * @summary Create Refund * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateCustomerRequest} CreateCustomerRequest Request to create a new customer at Cashfree + * @param {string} order_id The id which uniquely identifies your order + * @param {OrderCreateRefundRequest} OrderCreateRefundRequest Request Body to Create Refunds * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof CustomersApi + * @memberof RefundsApi */ - public static PGCreateCustomer(x_api_version: string, CreateCustomerRequest: CreateCustomerRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static PGOrderCreateRefund(x_api_version: string, order_id: string, OrderCreateRefundRequest: OrderCreateRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15208,11 +23685,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return CustomersApiFp().pGCreateCustomer(x_api_version, CreateCustomerRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return RefundsApiFp().pGOrderCreateRefund(x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15220,20 +23697,9 @@ export class Cashfree { throw error; } } - - /** - * The Create On Demand Transfer API will create a new on-demand request either from to the merchant or from to the vendor. - * @summary Create On Demand Transfer - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {AdjustVendorBalanceRequest} [AdjustVendorBalanceRequest] Adjust Vendor Balance Request Body. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EasySplitApi - */ - public static PGESCreateOnDemandTransfer(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, AdjustVendorBalanceRequest?: AdjustVendorBalanceRequest, options?: AxiosRequestConfig) { + + // With Configuration + public static PGOrderCreateRefundWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, OrderCreateRefundRequest: OrderCreateRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15269,11 +23735,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGESCreateOnDemandTransfer(x_api_version, vendor_id, x_request_id, x_idempotency_key, AdjustVendorBalanceRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return RefundsApiFp().pGOrderCreateRefundWithConfiguration(cashfreeConfiguration, x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15283,17 +23749,18 @@ export class Cashfree { } /** - * Use this API to create a new vendor to your EasySplit account along with the KYC details. Provide KYC details such as account_type, business_type, gst, cin, pan, passport number and so on. - * @summary Create vendor + * Use this API to fetch a specific refund processed on your Cashfree Account. + * @summary Get Refund * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} order_id The id which uniquely identifies your order + * @param {string} refund_id Refund Id of the refund you want to fetch. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {CreateVendorRequest} [CreateVendorRequest] Create Vendor Request Body. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof EasySplitApi + * @memberof RefundsApi */ - public static PGESCreateVendors(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateVendorRequest?: CreateVendorRequest, options?: AxiosRequestConfig) { + public static PGOrderFetchRefund(x_api_version: string, order_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15329,11 +23796,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGESCreateVendors(x_api_version, x_request_id, x_idempotency_key, CreateVendorRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return RefundsApiFp().pGOrderFetchRefund(x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15342,19 +23809,8 @@ export class Cashfree { } } - /** - * Use this API to download the uploaded KYC documents of that particular vendor. Provide the document type. Click the link from the sample request to download the KYC document. - * @summary Download Vendor Documents - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} doc_type Mention the document type that has to be downloaded. Only an uploaded document can be downloaded. - * @param {string} vendor_id The id which uniquely identifies your vendor. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EasySplitApi - */ - public static PGESDownloadVendorsDocs(x_api_version: string, doc_type: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static PGOrderFetchRefundWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15390,11 +23846,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGESDownloadVendorsDocs(x_api_version, doc_type, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return RefundsApiFp().pGOrderFetchRefundWithConfiguration(cashfreeConfiguration, x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15404,17 +23860,17 @@ export class Cashfree { } /** - * Use this API to get the details of a specific vendor associated with your Easy Split account. - * @summary Get Vendor All Details + * Use this API to fetch all refunds processed against an order. + * @summary Get All Refunds for an Order * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} order_id The id which uniquely identifies your order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof EasySplitApi + * @memberof RefundsApi */ - public static PGESFetchVendors(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static PGOrderFetchRefunds(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15450,11 +23906,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGESFetchVendors(x_api_version, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return RefundsApiFp().pGOrderFetchRefunds(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15463,18 +23919,70 @@ export class Cashfree { } } + // With Configuration + public static PGOrderFetchRefundsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return RefundsApiFp().pGOrderFetchRefundsWithConfiguration(cashfreeConfiguration, x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + /** - * This API fetches the available amount with the merchant, vendor, and the unsettled amount for the merchant as well as the vendor. - * @summary Get On Demand Balance + * Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range. + * @summary Get All Settlements * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {FetchSettlementsRequest} FetchSettlementsRequest Request Body to get the settlements + * @param {string} [Content_Type] application/json * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [Accept] application/json * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof EasySplitApi + * @memberof SettlementReconciliationApi */ - public static PGESGetVendorBalance(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static PGFetchSettlements(x_api_version: string, FetchSettlementsRequest: FetchSettlementsRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15510,11 +24018,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGESGetVendorBalance(x_api_version, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SettlementReconciliationApiFp().pGFetchSettlements(x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15523,19 +24031,8 @@ export class Cashfree { } } - /** - * This API returns the applicable service charge and service tax for a vendor balance transfer, based on the provided amount and rate type. - * @summary Get Vendor Balance Transfer Charges - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {number} amount Specify the amount for which you want to view the service charges and service taxes in the response. - * @param {string} rate_type Mention the type of rate for which you want to check the charges. Possible value: VENDOR_ON_DEMAND - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EasySplitApi - */ - public static PGESGetVendorBalanceTransferCharges(x_api_version: string, amount: number, rate_type: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static PGFetchSettlementsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, FetchSettlementsRequest: FetchSettlementsRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15571,11 +24068,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGESGetVendorBalanceTransferCharges(x_api_version, amount, rate_type, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SettlementReconciliationApiFp().pGFetchSettlementsWithConfiguration(cashfreeConfiguration, x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15585,17 +24082,19 @@ export class Cashfree { } /** - * Use this API to fetch the details of all the KYC details of a particular vendor. - * @summary Get Vendor All Documents Status + * - Use this API to get settlement reconciliation details using Settlement ID, settlement UTR or date range. - This API will return events for the settlement IDs you want + * @summary Settlement Reconciliation * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {SettlementFetchReconRequest} SettlementFetchReconRequest Request Body for the settlement reconciliation + * @param {string} [Content_Type] application/json * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + * @param {string} [Accept] application/json * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof EasySplitApi + * @memberof SettlementReconciliationApi */ - public static PGESGetVendorsDocs(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static PGSettlementFetchRecon(x_api_version: string, SettlementFetchReconRequest: SettlementFetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15631,11 +24130,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGESGetVendorsDocs(x_api_version, vendor_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SettlementReconciliationApiFp().pGSettlementFetchRecon(x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15644,18 +24143,68 @@ export class Cashfree { } } + // With Configuration + public static PGSettlementFetchReconWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, SettlementFetchReconRequest: SettlementFetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.init({ + dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! + // Set sampling rate for profiling - this is relative to tracesSampleRate + profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!, + attachStacktrace: true, + enableTracing: true, + beforeSend: (event) => { + delete event.contexts.os; + delete event.contexts.device; + delete event.server_name; + if (event.exception && event.exception.values && event.exception.values.length && event.exception.values[0].stacktrace) { + const stackTrace = event.exception.values[0].stacktrace; + if (stackTrace && stackTrace.frames) { + + const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); + if (filteredDomains && filteredDomains.length > 0 && filteredDomains[0].includes("cashfree-pg")) { + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; + } + } + } + return null; + }, + }); + Sentry.configureScope((scope) => { + if(Cashfree.XEnvironment == CFEnvironment.SANDBOX) { + scope.setExtra('environment', 'sandbox'); + } else { + scope.setExtra('environment', 'production'); + } + scope.setExtra('release', "4.3.0"); + }); + } + try { + return SettlementReconciliationApiFp().pGSettlementFetchReconWithConfiguration(cashfreeConfiguration, x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + } catch (error) { + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } + throw error; + } + } + /** - * Use this API to get all the split details, settled and unsettled transactions details of each vendor who were part of a particular order by providing order Id or start date and end date. - * @summary Get Split and Settlement Details by OrderID v2.0 + * Use this API to pass the CBRICS ID to Cashfree and mark an order for settlement. + * @summary Mark Order For Settlement * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {ESOrderReconRequest} [ESOrderReconRequest] Get Split and Settlement Details by OrderID v2.0 + * @param {CreateOrderSettlementRequestBody} [CreateOrderSettlementRequestBody] Create Order Settlement Request Body. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof EasySplitApi + * @memberof SettlementsApi */ - public static PGESOrderRecon(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, ESOrderReconRequest?: ESOrderReconRequest, options?: AxiosRequestConfig) { + public static MarkForSettlement(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15691,11 +24240,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGESOrderRecon(x_api_version, x_request_id, x_idempotency_key, ESOrderReconRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SettlementsApiFp().markForSettlement(x_api_version, x_request_id, x_idempotency_key, CreateOrderSettlementRequestBody, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15704,19 +24253,8 @@ export class Cashfree { } } - /** - * Use this API to edit the existing vendor details added to your EasySplit account. You can edit vendor details such as name, email, phone number, upi details, and any of the KYC details. - * @summary Update vendor Details - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {UpdateVendorRequest} [UpdateVendorRequest] Create Vendor Request Body. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EasySplitApi - */ - public static PGESUpdateVendors(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, UpdateVendorRequest?: UpdateVendorRequest, options?: AxiosRequestConfig) { + // With Configuration + public static MarkForSettlementWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15752,11 +24290,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGESUpdateVendors(x_api_version, vendor_id, x_request_id, x_idempotency_key, UpdateVendorRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SettlementsApiFp().markForSettlementWithConfiguration(cashfreeConfiguration, x_api_version, x_request_id, x_idempotency_key, CreateOrderSettlementRequestBody, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15766,20 +24304,17 @@ export class Cashfree { } /** - * Use this API to upload KYC documents of a specific vendor. - * @summary Upload Vendor Docs + * Use this API to view all the settlements of a particular order. + * @summary Get Settlements by Order ID * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} vendor_id The id which uniquely identifies your vendor. + * @param {string} order_id The id which uniquely identifies your order * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [doc_type] Mention the type of the document you are uploading. Possible values: UIDAI_FRONT, UIDAI_BACK, UIDAI_NUMBER, DL, DL_NUMBER, PASSPORT_FRONT, PASSPORT_BACK, PASSPORT_NUMBER, VOTER_ID, VOTER_ID_NUMBER, PAN, PAN_NUMBER, GST, GSTIN_NUMBER, CIN, CIN_NUMBER, NBFC_CERTIFICATE. If the doc type ends with a number you should add the doc value else upload the doc file. - * @param {string} [doc_value] Enter the display name of the uploaded file. - * @param {File} [file] Select the document that should be uploaded or provide the path of that file. You cannot upload a file that is more than 2MB in size. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof EasySplitApi + * @memberof SettlementsApi */ - public static PGESUploadVendorsDocs(x_api_version: string, vendor_id: string, x_request_id?: string, x_idempotency_key?: string, doc_type?: string, doc_value?: string, file?: File, options?: AxiosRequestConfig) { + public static PGOrderFetchSettlement(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15815,11 +24350,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGESUploadVendorsDocs(x_api_version, vendor_id, x_request_id, x_idempotency_key, doc_type, doc_value, file, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SettlementsApiFp().pGOrderFetchSettlement(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15828,19 +24363,8 @@ export class Cashfree { } } - /** - * Split After Payment API splits the payments to vendors after successful payment from the customers. - * @summary Split After Payment - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {SplitAfterPaymentRequest} [SplitAfterPaymentRequest] Request Body to Create Split for an order. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EasySplitApi - */ - public static PGOrderSplitAfterPayment(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, SplitAfterPaymentRequest?: SplitAfterPaymentRequest, options?: AxiosRequestConfig) { + // With Configuration + public static PGOrderFetchSettlementWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15876,11 +24400,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGOrderSplitAfterPayment(x_api_version, order_id, x_request_id, x_idempotency_key, SplitAfterPaymentRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SettlementsApiFp().pGOrderFetchSettlementWithConfiguration(cashfreeConfiguration, x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15888,19 +24412,19 @@ export class Cashfree { throw error; } } - + /** - * This API will create a static split scheme wherein you can define the split type and the vendor-wise split percentage. - * @summary Create Static Split Configuration + * Use this API to fetch simulated payment details. + * @summary Fetch Simulation * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD + * @param {string} simulation_id Provide the SimulationId for which the details have to be fetched. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {StaticSplitRequest} [StaticSplitRequest] Static Split * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof EasySplitApi + * @memberof SimulationApi */ - public static PGOrderStaticSplit(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, StaticSplitRequest?: StaticSplitRequest, options?: AxiosRequestConfig) { + public static PGFetchSimulation(x_api_version: string, simulation_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15936,11 +24460,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EasySplitApiFp().pGOrderStaticSplit(x_api_version, x_request_id, x_idempotency_key, StaticSplitRequest, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SimulationApiFp().pGFetchSimulation(x_api_version, simulation_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -15948,19 +24472,9 @@ export class Cashfree { throw error; } } - - /** - * Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number. - * @summary Get Eligible Cardless EMI Payment Methods for a customer on an order - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchCardlessEMIRequest} EligibilityFetchCardlessEMIRequest Request Body to get eligible cardless emi options for a customer and order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EligibilityApi - */ - public static PGEligibilityFetchCardlessEMI(x_api_version: string, EligibilityFetchCardlessEMIRequest: EligibilityFetchCardlessEMIRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + + // With Configuration + public static PGFetchSimulationWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, simulation_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -15996,11 +24510,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EligibilityApiFp().pGEligibilityFetchCardlessEMI(x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SimulationApiFp().pGFetchSimulationWithConfiguration(cashfreeConfiguration, x_api_version, simulation_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16010,17 +24524,17 @@ export class Cashfree { } /** - * Use this API to get eligible offers for an order_id or order amount. - * @summary Get Eligible Offers for an Order + * Use this API to simulate payment. To use this API you should first create an order using the Create Order API. Also, you need to create a payment with the same order. + * @summary Simulate Payment * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchOffersRequest} EligibilityFetchOffersRequest Request Body to get eligible offers for a customer and order + * @param {SimulateRequest} SimulateRequest Request Body to Make Simulation * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof EligibilityApi + * @memberof SimulationApi */ - public static PGEligibilityFetchOffers(x_api_version: string, EligibilityFetchOffersRequest: EligibilityFetchOffersRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static PGSimulatePayment(x_api_version: string, SimulateRequest: SimulateRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16056,11 +24570,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EligibilityApiFp().pGEligibilityFetchOffers(x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SimulationApiFp().pGSimulatePayment(x_api_version, SimulateRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16069,18 +24583,8 @@ export class Cashfree { } } - /** - * Use this API to get eligible Paylater Payment Methods for a customer on an order. - * @summary Get Eligible Paylater for a customer on an order - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchPaylaterRequest} EligibilityFetchPaylaterRequest Request Body to get eligible paylater options for a customer and order - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EligibilityApi - */ - public static PGEligibilityFetchPaylater(x_api_version: string, EligibilityFetchPaylaterRequest: EligibilityFetchPaylaterRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static PGSimulatePaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, SimulateRequest: SimulateRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16116,11 +24620,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EligibilityApiFp().pGEligibilityFetchPaylater(x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SimulationApiFp().pGSimulatePaymentWithConfiguration(cashfreeConfiguration, x_api_version, SimulateRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16128,19 +24632,19 @@ export class Cashfree { throw error; } } - + /** - * Use this API to get eligible Payment Methods - * @summary Get eligible Payment Methods + * Use this API to create new terminals to use softPOS. + * @summary Create Terminal * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {EligibilityFetchPaymentMethodsRequest} EligibilityFetchPaymentMethodsRequest Request Body to get eligible payment methods for an account and order + * @param {CreateTerminalRequest} CreateTerminalRequest Request Body to Create Terminal for SPOS * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof EligibilityApi + * @memberof SoftPOSApi */ - public static PGEligibilityFetchPaymentMethods(x_api_version: string, EligibilityFetchPaymentMethodsRequest: EligibilityFetchPaymentMethodsRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SposCreateTerminal(x_api_version: string, CreateTerminalRequest: CreateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16176,11 +24680,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return EligibilityApiFp().pGEligibilityFetchPaymentMethods(x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposCreateTerminal(x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16188,19 +24692,9 @@ export class Cashfree { throw error; } } - - /** - * Use this API to create offers with Cashfree from your backend - * @summary Create Offer - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateOfferRequest} CreateOfferRequest Request body to create an offer at Cashfree - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof OffersApi - */ - public static PGCreateOffer(x_api_version: string, CreateOfferRequest: CreateOfferRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + + // With Configuration + public static SposCreateTerminalWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateTerminalRequest: CreateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16236,11 +24730,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return OffersApiFp().pGCreateOffer(x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposCreateTerminalWithConfiguration(cashfreeConfiguration, x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16250,17 +24744,17 @@ export class Cashfree { } /** - * Use this API to get offer by offer_id - * @summary Get Offer by ID + * Use this API to create a new terminal transaction. To use this API you should first create an order using the Create Order API. Also, you need to enter the terminal details while creating the order and pass the same terminal information while creating a transaction using the below mentioned API. + * @summary Create Terminal Transaction * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} offer_id The offer ID for which you want to view the offer details. + * @param {CreateTerminalTransactionRequest} CreateTerminalTransactionRequest Request body to create a terminal transaction * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof OffersApi + * @memberof SoftPOSApi */ - public static PGFetchOffer(x_api_version: string, offer_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SposCreateTerminalTransaction(x_api_version: string, CreateTerminalTransactionRequest: CreateTerminalTransactionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16296,11 +24790,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return OffersApiFp().pGFetchOffer(x_api_version, offer_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposCreateTerminalTransaction(x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16308,19 +24802,9 @@ export class Cashfree { throw error; } } - - /** - * ### Order An order is an entity which has a amount and currency associated with it. It is something for which you want to collect payment for. Use this API to create orders with Cashfree from your backend to get a `payment_sessions_id`. You can use the `payment_sessions_id` to create a transaction for the order. - * @summary Create Order - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateOrderRequest} CreateOrderRequest Request body to create an order at cashfree - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof OrdersApi - */ - public static PGCreateOrder(x_api_version: string, CreateOrderRequest: CreateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + + // With Configuration + public static SposCreateTerminalTransactionWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateTerminalTransactionRequest: CreateTerminalTransactionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16356,11 +24840,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return OrdersApiFp().pGCreateOrder(x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposCreateTerminalTransactionWithConfiguration(cashfreeConfiguration, x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16370,17 +24854,17 @@ export class Cashfree { } /** - * Use this API to fetch the order that was created at Cashfree\'s using the `order_id`. ## When to use this API - To check the status of your order - Once the order is PAID - Once your customer returns to `return_url` - * @summary Get Order + * Use this API to view all details of a terminal. + * @summary Get Terminal Status using Phone Number * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order + * @param {string} terminal_phone_no The terminal for which you want to view the order details. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof OrdersApi + * @memberof SoftPOSApi */ - public static PGFetchOrder(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SposFetchTerminal(x_api_version: string, terminal_phone_no: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16416,11 +24900,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return OrdersApiFp().pGFetchOrder(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposFetchTerminal(x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16429,19 +24913,8 @@ export class Cashfree { } } - /** - * Use this API to terminate the order that was created at Cashfree\'s using the `order_id`. - * @summary Terminate Order - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {TerminateOrderRequest} TerminateOrderRequest Request body to terminate an order at cashfree - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof OrdersApi - */ - public static PGTerminateOrder(x_api_version: string, order_id: string, TerminateOrderRequest: TerminateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SposFetchTerminalWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, terminal_phone_no: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16477,11 +24950,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return OrdersApiFp().pGTerminateOrder(x_api_version, order_id, TerminateOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposFetchTerminalWithConfiguration(cashfreeConfiguration, x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16489,21 +24962,20 @@ export class Cashfree { throw error; } } - + /** - * - Use this API to get the payment gateway reconciliation details with date range. - It will have events for your payment account - * @summary PG Reconciliation + * You can fetch all the StaticQRs corresponding to given terminal id or phone number. Provide either the terminal_phone_no or terminal_id in the request. + * @summary Fetch Terminal QR Codes * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {FetchReconRequest} FetchReconRequest Request Body for the reconciliation - * @param {string} [Content_Type] application/json + * @param {string} terminal_phone_no Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request. + * @param {string} cf_terminal_id Cashfree terminal id for which you want to get staticQRs. Required if you are not providing the terminal_phone_number in the request. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [Accept] application/json * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof PGReconciliationApi + * @memberof SoftPOSApi */ - public static PGFetchRecon(x_api_version: string, FetchReconRequest: FetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { + public static SposFetchTerminalQRCodes(x_api_version: string, terminal_phone_no: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16539,11 +25011,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return PGReconciliationApiFp().pGFetchRecon(x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposFetchTerminalQRCodes(x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16551,19 +25023,9 @@ export class Cashfree { throw error; } } - - /** - * Use this API to cancel a payment link. No further payments can be done against a cancelled link. Only a link in ACTIVE status can be cancelled. - * @summary Cancel Payment Link - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} link_id The payment link ID for which you want to view the details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentLinksApi - */ - public static PGCancelLink(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + + // With Configuration + public static SposFetchTerminalQRCodesWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, terminal_phone_no: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16599,11 +25061,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return PaymentLinksApiFp().pGCancelLink(x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposFetchTerminalQRCodesWithConfiguration(cashfreeConfiguration, x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16613,17 +25075,18 @@ export class Cashfree { } /** - * Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url. - * @summary Create Payment Link + * Use this API to get terminal transaction. + * @summary Get Terminal Transaction * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateLinkRequest} CreateLinkRequest Request Body to Create Payment Links + * @param {string} utr Utr of the transaction. + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof PaymentLinksApi + * @memberof SoftPOSApi */ - public static PGCreateLink(x_api_version: string, CreateLinkRequest: CreateLinkRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SposFetchTerminalTransaction(x_api_version: string, utr: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16659,11 +25122,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return PaymentLinksApiFp().pGCreateLink(x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposFetchTerminalTransaction(x_api_version, utr, cf_terminal_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16672,18 +25135,8 @@ export class Cashfree { } } - /** - * Use this API to view all details and status of a payment link. - * @summary Fetch Payment Link Details - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} link_id The payment link ID for which you want to view the details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentLinksApi - */ - public static PGFetchLink(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SposFetchTerminalTransactionWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, utr: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16719,11 +25172,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return PaymentLinksApiFp().pGFetchLink(x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposFetchTerminalTransactionWithConfiguration(cashfreeConfiguration, x_api_version, utr, cf_terminal_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16733,18 +25186,18 @@ export class Cashfree { } /** - * Use this API to view all order details for a payment link. - * @summary Get Orders for a Payment Link + * Use this API to update the terminal details. Email, Phone Number, and Terminal Meta are updatable for \"Storefront\". Only account status change is possible in case of \"Agent\". + * @summary Update Terminal * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} link_id The payment link ID for which you want to view the details. + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {UpdateTerminalRequest} UpdateTerminalRequest Request Body to update terminal for SPOS. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [status] Mention What is status of orders you want to fetch, default is PAID. Possible value: ALL, PAID * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof PaymentLinksApi + * @memberof SoftPOSApi */ - public static PGLinkFetchOrders(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, status?: string, options?: AxiosRequestConfig) { + public static SposUpdateTerminal(x_api_version: string, cf_terminal_id: string, UpdateTerminalRequest: UpdateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16780,11 +25233,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return PaymentLinksApiFp().pGLinkFetchOrders(x_api_version, link_id, x_request_id, x_idempotency_key, status, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposUpdateTerminal(x_api_version, cf_terminal_id, UpdateTerminalRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16792,20 +25245,9 @@ export class Cashfree { throw error; } } - - /** - * Use this API to capture or void a preauthorized payment - * @summary Preauthorization - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {AuthorizeOrderRequest} AuthorizeOrderRequest Request to Capture or Void Transactions - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public static PGAuthorizeOrder(x_api_version: string, order_id: string, AuthorizeOrderRequest: AuthorizeOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + + // With Configuration + public static SposUpdateTerminalWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_terminal_id: string, UpdateTerminalRequest: UpdateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16841,11 +25283,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return PaymentsApiFp().pGAuthorizeOrder(x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposUpdateTerminalWithConfiguration(cashfreeConfiguration, x_api_version, cf_terminal_id, UpdateTerminalRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16855,18 +25297,18 @@ export class Cashfree { } /** - * If you accept OTP on your own page, you can use the below API to send OTP to Cashfree. - * @summary Submit or Resend OTP + * Use this API to update the terminal status. + * @summary Update Terminal Status * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_payment_id The Cashfree payment or transaction ID. - * @param {OrderAuthenticatePaymentRequest} OrderAuthenticatePaymentRequest Request body to submit/resend headless OTP. To use this API make sure you have headless OTP enabled for your account + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {UpdateTerminalStatusRequest} UpdateTerminalStatusRequest Request Body to update terminal status for SPOS. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof PaymentsApi + * @memberof SoftPOSApi */ - public static PGOrderAuthenticatePayment(x_api_version: string, cf_payment_id: string, OrderAuthenticatePaymentRequest: OrderAuthenticatePaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SposUpdateTerminalStatus(x_api_version: string, cf_terminal_id: string, UpdateTerminalStatusRequest: UpdateTerminalStatusRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16902,11 +25344,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return PaymentsApiFp().pGOrderAuthenticatePayment(x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposUpdateTerminalStatus(x_api_version, cf_terminal_id, UpdateTerminalStatusRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16915,19 +25357,8 @@ export class Cashfree { } } - /** - * Use this API to view payment details of an order for a payment ID. - * @summary Get Payment by ID - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} cf_payment_id The Cashfree payment or transaction ID. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public static PGOrderFetchPayment(x_api_version: string, order_id: string, cf_payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SposUpdateTerminalStatusWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_terminal_id: string, UpdateTerminalStatusRequest: UpdateTerminalStatusRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -16963,11 +25394,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return PaymentsApiFp().pGOrderFetchPayment(x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposUpdateTerminalStatusWithConfiguration(cashfreeConfiguration, x_api_version, cf_terminal_id, UpdateTerminalStatusRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -16977,17 +25408,18 @@ export class Cashfree { } /** - * Use this API to view all payment details for an order. - * @summary Get Payments for an Order + * Use this API to upload the terminal documents. + * @summary Upload Terminal Docs * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order + * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. + * @param {UploadTerminalDocs} UploadTerminalDocs Request Body to update terminal documents for SPOS. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof PaymentsApi + * @memberof SoftPOSApi */ - public static PGOrderFetchPayments(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SposUploadTerminalDocs(x_api_version: string, cf_terminal_id: string, UploadTerminalDocs: UploadTerminalDocs, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17023,11 +25455,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return PaymentsApiFp().pGOrderFetchPayments(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposUploadTerminalDocs(x_api_version, cf_terminal_id, UploadTerminalDocs, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17036,18 +25468,8 @@ export class Cashfree { } } - /** - * Use this API when you have already created the orders and want Cashfree to process the payment. To use this API S2S flag needs to be enabled from the backend. In case you want to use the cards payment option the PCI DSS flag is required, for more information send an email to \"care@cashfree.com\". - * @summary Order Pay - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {PayOrderRequest} PayOrderRequest Request body to create a transaction at cashfree using `payment_session_id` - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public static PGPayOrder(x_api_version: string, PayOrderRequest: PayOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SposUploadTerminalDocsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, cf_terminal_id: string, UploadTerminalDocs: UploadTerminalDocs, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17083,11 +25505,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return PaymentsApiFp().pGPayOrder(x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SoftPOSApiFp().sposUploadTerminalDocsWithConfiguration(cashfreeConfiguration, x_api_version, cf_terminal_id, UploadTerminalDocs, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17097,18 +25519,17 @@ export class Cashfree { } /** - * Use this API to initiate refunds. - * @summary Create Refund + * Use this API to create an auth or to raise a charge . + * @summary Raise a charge or create an auth. * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {OrderCreateRefundRequest} OrderCreateRefundRequest Request Body to Create Refunds + * @param {CreateSubscriptionPaymentRequest} CreateSubscriptionPaymentRequest Request body to create a subscription payment. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof RefundsApi + * @memberof SubscriptionApi */ - public static PGOrderCreateRefund(x_api_version: string, order_id: string, OrderCreateRefundRequest: OrderCreateRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubsCreatePayment(x_api_version: string, CreateSubscriptionPaymentRequest: CreateSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17144,11 +25565,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return RefundsApiFp().pGOrderCreateRefund(x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsCreatePayment(x_api_version, CreateSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17157,19 +25578,8 @@ export class Cashfree { } } - /** - * Use this API to fetch a specific refund processed on your Cashfree Account. - * @summary Get Refund - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order - * @param {string} refund_id Refund Id of the refund you want to fetch. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RefundsApi - */ - public static PGOrderFetchRefund(x_api_version: string, order_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SubsCreatePaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateSubscriptionPaymentRequest: CreateSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17205,11 +25615,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return RefundsApiFp().pGOrderFetchRefund(x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsCreatePaymentWithConfiguration(cashfreeConfiguration, x_api_version, CreateSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17219,17 +25629,17 @@ export class Cashfree { } /** - * Use this API to fetch all refunds processed against an order. - * @summary Get All Refunds for an Order + * A plan allows your customer to identify the features you offer along with your pricing. You can create plans as per the pricing you support for your services. For each plan, you can set a pre-decided frequency and amount with which they’ll be charged. Example: Netflix Plans - Premium, Basic, Standard, Mobile. Each plan differs and caters for a particular set of audiences. + * @summary Create a plan. * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order + * @param {CreatePlanRequest} CreatePlanRequest Request body to create a plan. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof RefundsApi + * @memberof SubscriptionApi */ - public static PGOrderFetchRefunds(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubsCreatePlan(x_api_version: string, CreatePlanRequest: CreatePlanRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17265,11 +25675,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return RefundsApiFp().pGOrderFetchRefunds(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsCreatePlan(x_api_version, CreatePlanRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17277,21 +25687,9 @@ export class Cashfree { throw error; } } - - /** - * Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range. - * @summary Get All Settlements - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {FetchSettlementsRequest} FetchSettlementsRequest Request Body to get the settlements - * @param {string} [Content_Type] application/json - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [Accept] application/json - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SettlementReconciliationApi - */ - public static PGFetchSettlements(x_api_version: string, FetchSettlementsRequest: FetchSettlementsRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { + + // With Configuration + public static SubsCreatePlanWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreatePlanRequest: CreatePlanRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17327,11 +25725,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SettlementReconciliationApiFp().pGFetchSettlements(x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsCreatePlanWithConfiguration(cashfreeConfiguration, x_api_version, CreatePlanRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17341,19 +25739,18 @@ export class Cashfree { } /** - * - Use this API to get settlement reconciliation details using Settlement ID, settlement UTR or date range. - This API will return events for the settlement IDs you want - * @summary Settlement Reconciliation + * This API allows you to create refund on a successful payment. Refund amount can be partial or the full amount of the payment. + * @summary Create a refund. * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {SettlementFetchReconRequest} SettlementFetchReconRequest Request Body for the settlement reconciliation - * @param {string} [Content_Type] application/json + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {CreateSubscriptionRefundRequest} CreateSubscriptionRefundRequest Request body to create a subscription refund. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {string} [Accept] application/json * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof SettlementReconciliationApi + * @memberof SubscriptionApi */ - public static PGSettlementFetchRecon(x_api_version: string, SettlementFetchReconRequest: SettlementFetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { + public static SubsCreateRefund(x_api_version: string, subscription_id: string, CreateSubscriptionRefundRequest: CreateSubscriptionRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17389,11 +25786,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SettlementReconciliationApiFp().pGSettlementFetchRecon(x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsCreateRefund(x_api_version, subscription_id, CreateSubscriptionRefundRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17401,19 +25798,9 @@ export class Cashfree { throw error; } } - - /** - * Use this API to pass the CBRICS ID to Cashfree and mark an order for settlement. - * @summary Mark Order For Settlement - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {CreateOrderSettlementRequestBody} [CreateOrderSettlementRequestBody] Create Order Settlement Request Body. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SettlementsApi - */ - public static MarkForSettlement(x_api_version: string, x_request_id?: string, x_idempotency_key?: string, CreateOrderSettlementRequestBody?: CreateOrderSettlementRequestBody, options?: AxiosRequestConfig) { + + // With Configuration + public static SubsCreateRefundWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, CreateSubscriptionRefundRequest: CreateSubscriptionRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17449,11 +25836,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SettlementsApiFp().markForSettlement(x_api_version, x_request_id, x_idempotency_key, CreateOrderSettlementRequestBody, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsCreateRefundWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, CreateSubscriptionRefundRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17463,17 +25850,17 @@ export class Cashfree { } /** - * Use this API to view all the settlements of a particular order. - * @summary Get Settlements by Order ID + * Use this API to create a new subscription. + * @summary Create Subscription * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} order_id The id which uniquely identifies your order + * @param {CreateSubscriptionRequest} CreateSubscriptionRequest Request body to create a subscription. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof SettlementsApi + * @memberof SubscriptionApi */ - public static PGOrderFetchSettlement(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubsCreateSubscription(x_api_version: string, CreateSubscriptionRequest: CreateSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17509,11 +25896,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SettlementsApiFp().pGOrderFetchSettlement(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsCreateSubscription(x_api_version, CreateSubscriptionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17521,19 +25908,9 @@ export class Cashfree { throw error; } } - - /** - * Use this API to fetch simulated payment details. - * @summary Fetch Simulation - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} simulation_id Provide the SimulationId for which the details have to be fetched. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SimulationApi - */ - public static PGFetchSimulation(x_api_version: string, simulation_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + + // With Configuration + public static SubsCreateSubscriptionWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, CreateSubscriptionRequest: CreateSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17569,11 +25946,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SimulationApiFp().pGFetchSimulation(x_api_version, simulation_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsCreateSubscriptionWithConfiguration(cashfreeConfiguration, x_api_version, CreateSubscriptionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17583,17 +25960,17 @@ export class Cashfree { } /** - * Use this API to simulate payment. To use this API you should first create an order using the Create Order API. Also, you need to create a payment with the same order. - * @summary Simulate Payment + * Use this API to fetch plan details. + * @summary Fetch Plan * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {SimulateRequest} SimulateRequest Request Body to Make Simulation + * @param {string} plan_id Provide the PlanId for which the details have to be fetched. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof SimulationApi + * @memberof SubscriptionApi */ - public static PGSimulatePayment(x_api_version: string, SimulateRequest: SimulateRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubsFetchPlan(x_api_version: string, plan_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17629,11 +26006,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SimulationApiFp().pGSimulatePayment(x_api_version, SimulateRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsFetchPlan(x_api_version, plan_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17641,19 +26018,9 @@ export class Cashfree { throw error; } } - - /** - * Use this API to create new terminals to use softPOS. - * @summary Create Terminal - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateTerminalRequest} CreateTerminalRequest Request Body to Create Terminal for SPOS - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SoftPOSApi - */ - public static SposCreateTerminal(x_api_version: string, CreateTerminalRequest: CreateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + + // With Configuration + public static SubsFetchPlanWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, plan_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17689,11 +26056,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SoftPOSApiFp().sposCreateTerminal(x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsFetchPlanWithConfiguration(cashfreeConfiguration, x_api_version, plan_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17703,17 +26070,17 @@ export class Cashfree { } /** - * Use this API to create a new terminal transaction. To use this API you should first create an order using the Create Order API. Also, you need to enter the terminal details while creating the order and pass the same terminal information while creating a transaction using the below mentioned API. - * @summary Create Terminal Transaction + * Use this API to fetch subscription details. + * @summary Fetch Subscription * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateTerminalTransactionRequest} CreateTerminalTransactionRequest Request body to create a terminal transaction + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof SoftPOSApi + * @memberof SubscriptionApi */ - public static SposCreateTerminalTransaction(x_api_version: string, CreateTerminalTransactionRequest: CreateTerminalTransactionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubsFetchSubscription(x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17749,11 +26116,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SoftPOSApiFp().sposCreateTerminalTransaction(x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsFetchSubscription(x_api_version, subscription_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17762,18 +26129,8 @@ export class Cashfree { } } - /** - * Use this API to view all details of a terminal. - * @summary Get Terminal Status using Phone Number - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} terminal_phone_no The terminal for which you want to view the order details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SoftPOSApi - */ - public static SposFetchTerminal(x_api_version: string, terminal_phone_no: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SubsFetchSubscriptionWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17809,11 +26166,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SoftPOSApiFp().sposFetchTerminal(x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsFetchSubscriptionWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17823,18 +26180,18 @@ export class Cashfree { } /** - * You can fetch all the StaticQRs corresponding to given terminal id or phone number. Provide either the terminal_phone_no or terminal_id in the request. - * @summary Fetch Terminal QR Codes + * Use this API to fetch details of a single payment of a subscription. + * @summary Fetch details of a single payment. * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} terminal_phone_no Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request. - * @param {string} cf_terminal_id Cashfree terminal id for which you want to get staticQRs. Required if you are not providing the terminal_phone_number in the request. + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} payment_id Provide the PaymentId using which the payment was created. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof SoftPOSApi + * @memberof SubscriptionApi */ - public static SposFetchTerminalQRCodes(x_api_version: string, terminal_phone_no: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubsFetchSubscriptionPayment(x_api_version: string, subscription_id: string, payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17870,11 +26227,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SoftPOSApiFp().sposFetchTerminalQRCodes(x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsFetchSubscriptionPayment(x_api_version, subscription_id, payment_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17883,19 +26240,8 @@ export class Cashfree { } } - /** - * Use this API to get terminal transaction. - * @summary Get Terminal Transaction - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} utr Utr of the transaction. - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SoftPOSApi - */ - public static SposFetchTerminalTransaction(x_api_version: string, utr: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SubsFetchSubscriptionPaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17931,11 +26277,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SoftPOSApiFp().sposFetchTerminalTransaction(x_api_version, utr, cf_terminal_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsFetchSubscriptionPaymentWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, payment_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -17945,18 +26291,17 @@ export class Cashfree { } /** - * Use this API to update the terminal details. Email, Phone Number, and Terminal Meta are updatable for \"Storefront\". Only account status change is possible in case of \"Agent\". - * @summary Update Terminal + * Use this API to fetch all payments of a subscription. + * @summary Fetch details of all payments of a subscription. * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {UpdateTerminalRequest} UpdateTerminalRequest Request Body to update terminal for SPOS. + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof SoftPOSApi + * @memberof SubscriptionApi */ - public static SposUpdateTerminal(x_api_version: string, cf_terminal_id: string, UpdateTerminalRequest: UpdateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubsFetchSubscriptionPayments(x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -17992,11 +26337,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SoftPOSApiFp().sposUpdateTerminal(x_api_version, cf_terminal_id, UpdateTerminalRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsFetchSubscriptionPayments(x_api_version, subscription_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18005,19 +26350,8 @@ export class Cashfree { } } - /** - * Use this API to update the terminal status. - * @summary Update Terminal Status - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {UpdateTerminalStatusRequest} UpdateTerminalStatusRequest Request Body to update terminal status for SPOS. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SoftPOSApi - */ - public static SposUpdateTerminalStatus(x_api_version: string, cf_terminal_id: string, UpdateTerminalStatusRequest: UpdateTerminalStatusRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SubsFetchSubscriptionPaymentsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18053,11 +26387,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SoftPOSApiFp().sposUpdateTerminalStatus(x_api_version, cf_terminal_id, UpdateTerminalStatusRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsFetchSubscriptionPaymentsWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18067,18 +26401,18 @@ export class Cashfree { } /** - * Use this API to upload the terminal documents. - * @summary Upload Terminal Docs + * Use this API to fetch details of a refund of a subscription payment. + * @summary Fetch details of a refund. * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} cf_terminal_id Provide the Cashfree terminal ID for which the details have to be updated. - * @param {UploadTerminalDocs} UploadTerminalDocs Request Body to update terminal documents for SPOS. + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} refund_id Provide the PaymentId for which the details have to be fetched. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof SoftPOSApi + * @memberof SubscriptionApi */ - public static SposUploadTerminalDocs(x_api_version: string, cf_terminal_id: string, UploadTerminalDocs: UploadTerminalDocs, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubsFetchSubscriptionRefund(x_api_version: string, subscription_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18114,11 +26448,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SoftPOSApiFp().sposUploadTerminalDocs(x_api_version, cf_terminal_id, UploadTerminalDocs, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsFetchSubscriptionRefund(x_api_version, subscription_id, refund_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18126,19 +26460,9 @@ export class Cashfree { throw error; } } - - /** - * Use this API to create an auth or to raise a charge . - * @summary Raise a charge or create an auth. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateSubscriptionPaymentRequest} CreateSubscriptionPaymentRequest Request body to create a subscription payment. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SubscriptionApi - */ - public static SubsCreatePayment(x_api_version: string, CreateSubscriptionPaymentRequest: CreateSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + + // With Configuration + public static SubsFetchSubscriptionRefundWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18174,11 +26498,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsCreatePayment(x_api_version, CreateSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsFetchSubscriptionRefundWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, refund_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18188,17 +26512,18 @@ export class Cashfree { } /** - * A plan allows your customer to identify the features you offer along with your pricing. You can create plans as per the pricing you support for your services. For each plan, you can set a pre-decided frequency and amount with which they’ll be charged. Example: Netflix Plans - Premium, Basic, Standard, Mobile. Each plan differs and caters for a particular set of audiences. - * @summary Create a plan. + * Use this API to manage a subscription. You can cancel, pause, activate or change the plan of a subscription. + * @summary Manage a subscription. * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreatePlanRequest} CreatePlanRequest Request body to create a plan. + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {ManageSubscriptionRequest} ManageSubscriptionRequest Request body to manage a subscription. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SubscriptionApi */ - public static SubsCreatePlan(x_api_version: string, CreatePlanRequest: CreatePlanRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubsManageSubscription(x_api_version: string, subscription_id: string, ManageSubscriptionRequest: ManageSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18234,11 +26559,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsCreatePlan(x_api_version, CreatePlanRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsManageSubscription(x_api_version, subscription_id, ManageSubscriptionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18247,19 +26572,8 @@ export class Cashfree { } } - /** - * This API allows you to create refund on a successful payment. Refund amount can be partial or the full amount of the payment. - * @summary Create a refund. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {CreateSubscriptionRefundRequest} CreateSubscriptionRefundRequest Request body to create a subscription refund. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SubscriptionApi - */ - public static SubsCreateRefund(x_api_version: string, subscription_id: string, CreateSubscriptionRefundRequest: CreateSubscriptionRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SubsManageSubscriptionWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, ManageSubscriptionRequest: ManageSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18295,11 +26609,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsCreateRefund(x_api_version, subscription_id, CreateSubscriptionRefundRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsManageSubscriptionWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, ManageSubscriptionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18309,17 +26623,19 @@ export class Cashfree { } /** - * Use this API to create a new subscription. - * @summary Create Subscription + * Use this API to manage a payment of a subscription. A payment can be cancelled or retried with this API. + * @summary Manage a single payment. * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {CreateSubscriptionRequest} CreateSubscriptionRequest Request body to create a subscription. + * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} payment_id Provide the PaymentId using which the payment was created. + * @param {ManageSubscriptionPaymentRequest} ManageSubscriptionPaymentRequest Request body to manage a subscription payment. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SubscriptionApi */ - public static SubsCreateSubscription(x_api_version: string, CreateSubscriptionRequest: CreateSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubsManageSubscriptionPayment(x_api_version: string, subscription_id: string, payment_id: string, ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18355,11 +26671,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsCreateSubscription(x_api_version, CreateSubscriptionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsManageSubscriptionPayment(x_api_version, subscription_id, payment_id, ManageSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18368,18 +26684,8 @@ export class Cashfree { } } - /** - * Use this API to fetch plan details. - * @summary Fetch Plan - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} plan_id Provide the PlanId for which the details have to be fetched. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SubscriptionApi - */ - public static SubsFetchPlan(x_api_version: string, plan_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SubsManageSubscriptionPaymentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, subscription_id: string, payment_id: string, ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18415,11 +26721,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsFetchPlan(x_api_version, plan_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subsManageSubscriptionPaymentWithConfiguration(cashfreeConfiguration, x_api_version, subscription_id, payment_id, ManageSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18429,17 +26735,20 @@ export class Cashfree { } /** - * Use this API to fetch subscription details. - * @summary Fetch Subscription + * Use this API to upload Physical Nach for Physical Nach Authorization. + * @summary API to upload Physical Nach for Physical Nach Authorization. * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {string} payment_id Provide the PaymentId using which the payment was created. + * @param {File} file Select the .jpg file that should be uploaded or provide the path of that file. You cannot upload a file that is more than 1MB in size. + * @param {string} payment_id2 Authorization Payment Id for physical nach authorization + * @param {string} action Action to be performed on the file. Can be SUBMIT_DOCUMENT * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SubscriptionApi */ - public static SubsFetchSubscription(x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubscriptionDocumentUpload(x_api_version: string, payment_id: string, file: File, payment_id2: string, action: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18475,11 +26784,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsFetchSubscription(x_api_version, subscription_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subscriptionDocumentUpload(x_api_version, payment_id, file, payment_id2, action, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18488,19 +26797,8 @@ export class Cashfree { } } - /** - * Use this API to fetch details of a single payment of a subscription. - * @summary Fetch details of a single payment. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} payment_id Provide the PaymentId using which the payment was created. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SubscriptionApi - */ - public static SubsFetchSubscriptionPayment(x_api_version: string, subscription_id: string, payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SubscriptionDocumentUploadWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, payment_id: string, file: File, payment_id2: string, action: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18536,11 +26834,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsFetchSubscriptionPayment(x_api_version, subscription_id, payment_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subscriptionDocumentUploadWithConfiguration(cashfreeConfiguration, x_api_version, payment_id, file, payment_id2, action, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18550,17 +26848,17 @@ export class Cashfree { } /** - * Use this API to fetch all payments of a subscription. - * @summary Fetch details of all payments of a subscription. + * Use this API to check if a payment method is enabled for your account. + * @summary API to get all the payment method details available for subscription payments. * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. + * @param {SubscriptionEligibilityRequest} SubscriptionEligibilityRequest Request body to fetch subscription eligibile payment method details. * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SubscriptionApi */ - public static SubsFetchSubscriptionPayments(x_api_version: string, subscription_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static SubscriptionEligibility(x_api_version: string, SubscriptionEligibilityRequest: SubscriptionEligibilityRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18596,11 +26894,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsFetchSubscriptionPayments(x_api_version, subscription_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subscriptionEligibility(x_api_version, SubscriptionEligibilityRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18609,19 +26907,8 @@ export class Cashfree { } } - /** - * Use this API to fetch details of a refund of a subscription payment. - * @summary Fetch details of a refund. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} refund_id Provide the PaymentId for which the details have to be fetched. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SubscriptionApi - */ - public static SubsFetchSubscriptionRefund(x_api_version: string, subscription_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static SubscriptionEligibilityWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, SubscriptionEligibilityRequest: SubscriptionEligibilityRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18657,11 +26944,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsFetchSubscriptionRefund(x_api_version, subscription_id, refund_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return SubscriptionApiFp().subscriptionEligibilityWithConfiguration(cashfreeConfiguration, x_api_version, SubscriptionEligibilityRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18669,20 +26956,20 @@ export class Cashfree { throw error; } } - + /** - * Use this API to manage a subscription. You can cancel, pause, activate or change the plan of a subscription. - * @summary Manage a subscription. + * Use this API to delete a saved card instrument for a customer_id and instrument_id + * @summary Delete Saved Card Instrument * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {ManageSubscriptionRequest} ManageSubscriptionRequest Request body to manage a subscription. + * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` + * @param {string} instrument_id The instrument_id which needs to be deleted * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof SubscriptionApi + * @memberof TokenVaultApi */ - public static SubsManageSubscription(x_api_version: string, subscription_id: string, ManageSubscriptionRequest: ManageSubscriptionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static PGCustomerDeleteInstrument(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18718,11 +27005,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsManageSubscription(x_api_version, subscription_id, ManageSubscriptionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return TokenVaultApiFp().pGCustomerDeleteInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18731,20 +27018,8 @@ export class Cashfree { } } - /** - * Use this API to manage a payment of a subscription. A payment can be cancelled or retried with this API. - * @summary Manage a single payment. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} subscription_id Provide the SubscriptionId using which the subscription was created. - * @param {string} payment_id Provide the PaymentId using which the payment was created. - * @param {ManageSubscriptionPaymentRequest} ManageSubscriptionPaymentRequest Request body to manage a subscription payment. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SubscriptionApi - */ - public static SubsManageSubscriptionPayment(x_api_version: string, subscription_id: string, payment_id: string, ManageSubscriptionPaymentRequest: ManageSubscriptionPaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static PGCustomerDeleteInstrumentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18780,11 +27055,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subsManageSubscriptionPayment(x_api_version, subscription_id, payment_id, ManageSubscriptionPaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return TokenVaultApiFp().pGCustomerDeleteInstrumentWithConfiguration(cashfreeConfiguration, x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18794,20 +27069,18 @@ export class Cashfree { } /** - * Use this API to upload Physical Nach for Physical Nach Authorization. - * @summary API to upload Physical Nach for Physical Nach Authorization. + * Use this API to fetch a single specific saved card for a customer_id by it\'s instrument_id + * @summary Fetch Specific Saved Card Instrument * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} payment_id Provide the PaymentId using which the payment was created. - * @param {File} file Select the .jpg file that should be uploaded or provide the path of that file. You cannot upload a file that is more than 1MB in size. - * @param {string} payment_id2 Authorization Payment Id for physical nach authorization - * @param {string} action Action to be performed on the file. Can be SUBMIT_DOCUMENT + * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` + * @param {string} instrument_id The instrument_id of the saved instrument which needs to be queried * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof SubscriptionApi + * @memberof TokenVaultApi */ - public static SubscriptionDocumentUpload(x_api_version: string, payment_id: string, file: File, payment_id2: string, action: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static PGCustomerFetchInstrument(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18843,11 +27116,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subscriptionDocumentUpload(x_api_version, payment_id, file, payment_id2, action, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return TokenVaultApiFp().pGCustomerFetchInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18856,18 +27129,8 @@ export class Cashfree { } } - /** - * Use this API to check if a payment method is enabled for your account. - * @summary API to get all the payment method details available for subscription payments. - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {SubscriptionEligibilityRequest} SubscriptionEligibilityRequest Request body to fetch subscription eligibile payment method details. - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SubscriptionApi - */ - public static SubscriptionEligibility(x_api_version: string, SubscriptionEligibilityRequest: SubscriptionEligibilityRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static PGCustomerFetchInstrumentWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18903,11 +27166,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return SubscriptionApiFp().subscriptionEligibility(x_api_version, SubscriptionEligibilityRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return TokenVaultApiFp().pGCustomerFetchInstrumentWithConfiguration(cashfreeConfiguration, x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18915,20 +27178,20 @@ export class Cashfree { throw error; } } - + /** - * Use this API to delete a saved card instrument for a customer_id and instrument_id - * @summary Delete Saved Card Instrument + * Use this API to fetch saved cards for a customer_id + * @summary Fetch All Saved Card Instrument * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {string} instrument_id The instrument_id which needs to be deleted + * @param {PGCustomerFetchInstrumentsInstrumentTypeEnum} instrument_type Payment mode or type of saved instrument * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TokenVaultApi */ - public static PGCustomerDeleteInstrument(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static PGCustomerFetchInstruments(x_api_version: string, customer_id: string, instrument_type: PGCustomerFetchInstrumentsInstrumentTypeEnum, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -18964,11 +27227,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return TokenVaultApiFp().pGCustomerDeleteInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return TokenVaultApiFp().pGCustomerFetchInstruments(x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -18977,19 +27240,8 @@ export class Cashfree { } } - /** - * Use this API to fetch a single specific saved card for a customer_id by it\'s instrument_id - * @summary Fetch Specific Saved Card Instrument - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {string} instrument_id The instrument_id of the saved instrument which needs to be queried - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof TokenVaultApi - */ - public static PGCustomerFetchInstrument(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static PGCustomerFetchInstrumentsWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_type: PGCustomerFetchInstrumentsInstrumentTypeEnum, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -19025,11 +27277,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return TokenVaultApiFp().pGCustomerFetchInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return TokenVaultApiFp().pGCustomerFetchInstrumentsWithConfiguration(cashfreeConfiguration, x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -19039,18 +27291,18 @@ export class Cashfree { } /** - * Use this API to fetch saved cards for a customer_id - * @summary Fetch All Saved Card Instrument + * Use this API To get the card network token, token expiry and cryptogram for a saved card instrument using instrument id + * @summary Fetch cryptogram for a saved card instrument * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {PGCustomerFetchInstrumentsInstrumentTypeEnum} instrument_type Payment mode or type of saved instrument + * @param {string} instrument_id The instrument_id of the saved card instrument which needs to be queried * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TokenVaultApi */ - public static PGCustomerFetchInstruments(x_api_version: string, customer_id: string, instrument_type: PGCustomerFetchInstrumentsInstrumentTypeEnum, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + public static PGCustomerInstrumentsFetchCryptogram(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -19086,11 +27338,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return TokenVaultApiFp().pGCustomerFetchInstruments(x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return TokenVaultApiFp().pGCustomerInstrumentsFetchCryptogram(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); @@ -19099,19 +27351,8 @@ export class Cashfree { } } - /** - * Use this API To get the card network token, token expiry and cryptogram for a saved card instrument using instrument id - * @summary Fetch cryptogram for a saved card instrument - * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD - * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders` - * @param {string} instrument_id The instrument_id of the saved card instrument which needs to be queried - * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree - * @param {string} [x_idempotency_key] An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof TokenVaultApi - */ - public static PGCustomerInstrumentsFetchCryptogram(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + // With Configuration + public static PGCustomerInstrumentsFetchCryptogramWithConfiguration(cashfreeConfiguration: CashfreeConfiguration, x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://748d9dcfc4286488867c59651cb6121a@o330525.ingest.sentry.io/4506692796350464', @@ -19147,11 +27388,11 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "4.2.3"); + scope.setExtra('release', "4.3.0"); }); } try { - return TokenVaultApiFp().pGCustomerInstrumentsFetchCryptogram(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); + return TokenVaultApiFp().pGCustomerInstrumentsFetchCryptogramWithConfiguration(cashfreeConfiguration, x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { if(Cashfree.XEnableErrorAnalytics) { Sentry.captureException(error); diff --git a/common.ts b/common.ts index c0ff14b..55e04fa 100644 --- a/common.ts +++ b/common.ts @@ -18,7 +18,7 @@ import type { RequestArgs } from "./base"; import { CFEnvironment } from './configuration'; import type { AxiosInstance, AxiosResponse } from 'axios'; import { RequiredError } from "./base"; -import { Cashfree } from "./api"; +import { Cashfree, CashfreeConfiguration } from "./api"; /** * @@ -68,6 +68,38 @@ export const setApiKeyToObject = async function (object: any, keyParamName: stri } } +/** + * + * @export + */ +export const setApiKeyToObjectWithConfiguration = async function (object: any, keyParamName: string, cashfreeConfiguration: CashfreeConfiguration) { + if(keyParamName == "x-client-id") { + if(cashfreeConfiguration.XClientId != null && cashfreeConfiguration.XClientId != undefined) { + object[keyParamName] = cashfreeConfiguration.XClientId; + } + } + if(keyParamName == "x-client-secret") { + if(cashfreeConfiguration.XClientSecret != null && cashfreeConfiguration.XClientSecret != undefined) { + object[keyParamName] = cashfreeConfiguration.XClientSecret; + } + } + if(keyParamName == "x-partner-apikey") { + if(cashfreeConfiguration.XPartnerKey != null && cashfreeConfiguration.XPartnerKey != undefined) { + object[keyParamName] = cashfreeConfiguration.XPartnerKey; + } + } + if(keyParamName == "x-partner-merchantid") { + if(cashfreeConfiguration.XPartnerMerchantId != null && cashfreeConfiguration.XPartnerMerchantId != undefined) { + object[keyParamName] = cashfreeConfiguration.XPartnerMerchantId; + } + } + if(keyParamName == "x-client-signature") { + if(cashfreeConfiguration.XClientSignature != null && cashfreeConfiguration.XClientSignature != undefined) { + object[keyParamName] = cashfreeConfiguration.XClientSignature; + } + } +} + /** * * @export diff --git a/package.json b/package.json index 246d827..f2d88fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cashfree-pg", - "version": "4.2.3", + "version": "4.3.0", "description": "Cashfree client for cashfree-pg", "author": "Cashfree Payments", "repository": {