cashfree-pg 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4581 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Cashfree Payment Gateway APIs
5
+ * Cashfree\'s Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
6
+ *
7
+ * The version of the OpenAPI document: 2022-09-01
8
+ * Contact: developers@cashfree.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import globalAxios from 'axios';
24
+ // Some imports not used depending on template conditions
25
+ // @ts-ignore
26
+ import { assertParamExists, setApiKeyToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
27
+ import { CFEnvironment } from './configuration';
28
+ import * as Sentry from "@sentry/node";
29
+ export const ApiErrorTypeEnum = {
30
+ API_ERROR: 'api_error',
31
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
32
+ };
33
+ export const ApiError404TypeEnum = {
34
+ INVALID_REQUEST_ERROR: 'invalid_request_error',
35
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
36
+ };
37
+ export const ApiError409TypeEnum = {
38
+ INVALID_REQUEST_ERROR: 'invalid_request_error',
39
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
40
+ };
41
+ export const ApiError502TypeEnum = {
42
+ API_ERROR: 'api_error',
43
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
44
+ };
45
+ export const AppProviderEnum = {
46
+ GPAY: 'gpay',
47
+ PHONEPE: 'phonepe',
48
+ OLA: 'ola',
49
+ PAYTM: 'paytm',
50
+ AMAZON: 'amazon',
51
+ AIRTEL: 'airtel',
52
+ FREECHARGE: 'freecharge',
53
+ MOBIKWIK: 'mobikwik',
54
+ JIO: 'jio',
55
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
56
+ };
57
+ export const AuthorizationInPaymentsEntityActionEnum = {
58
+ CAPTURE: 'CAPTURE',
59
+ VOID: 'VOID',
60
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
61
+ };
62
+ export const AuthorizationInPaymentsEntityStatusEnum = {
63
+ SUCCESS: 'SUCCESS',
64
+ PENDING: 'PENDING',
65
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
66
+ };
67
+ export const AuthorizeOrderRequestActionEnum = {
68
+ CAPTURE: 'CAPTURE',
69
+ VOID: 'VOID',
70
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
71
+ };
72
+ export const BadRequestErrorTypeEnum = {
73
+ INVALID_REQUEST_ERROR: 'invalid_request_error',
74
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
75
+ };
76
+ export const CardChannelEnum = {
77
+ LINK: 'link',
78
+ POST: 'post',
79
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
80
+ };
81
+ export const CardTokenTypeEnum = {
82
+ ISSUER_TOKEN: 'ISSUER_TOKEN',
83
+ NETWORK_GC_TOKEN: 'NETWORK_GC_TOKEN',
84
+ ISSUER_GC_TOKEN: 'ISSUER_GC_TOKEN',
85
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
86
+ };
87
+ export const CardCardBankNameEnum = {
88
+ KOTAK: 'Kotak',
89
+ ICICI: 'ICICI',
90
+ RBL: 'RBL',
91
+ BOB: 'BOB',
92
+ STANDARD_CHARTERED: 'Standard Chartered',
93
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
94
+ };
95
+ export const CardEMICardBankNameEnum = {
96
+ HDFC: 'hdfc',
97
+ KOTAK: 'kotak',
98
+ ICICI: 'icici',
99
+ RBL: 'rbl',
100
+ BOB: 'bob',
101
+ STANDARD_CHARTERED: 'standard chartered',
102
+ AXIS: 'axis',
103
+ AU: 'au',
104
+ YES: 'yes',
105
+ SBI: 'sbi',
106
+ FED: 'fed',
107
+ HSBC: 'hsbc',
108
+ CITI: 'citi',
109
+ AMEX: 'amex',
110
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
111
+ };
112
+ export const CardlessEMIProviderEnum = {
113
+ FLEXMONEY: 'flexmoney',
114
+ ZESTMONEY: 'zestmoney',
115
+ HDFC: 'hdfc',
116
+ ICICI: 'icici',
117
+ CASHE: 'cashe',
118
+ IDFC: 'idfc',
119
+ KOTAK: 'kotak',
120
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
121
+ };
122
+ export const CashbackDetailsCashbackTypeEnum = {
123
+ FLAT: 'flat',
124
+ PERCENTAGE: 'percentage',
125
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
126
+ };
127
+ export const DiscountDetailsDiscountTypeEnum = {
128
+ FLAT: 'flat',
129
+ PERCENTAGE: 'percentage',
130
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
131
+ };
132
+ export const IdempotencyErrorTypeEnum = {
133
+ IDEMPOTENCY_ERROR: 'idempotency_error',
134
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
135
+ };
136
+ export const InstrumentEntityInstrumentTypeEnum = {
137
+ CARD: 'card',
138
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
139
+ };
140
+ export const InstrumentEntityInstrumentStatusEnum = {
141
+ ACTIVE: 'ACTIVE',
142
+ INACTIVE: 'INACTIVE',
143
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
144
+ };
145
+ export const OfferDetailsOfferTypeEnum = {
146
+ DISCOUNT: 'DISCOUNT',
147
+ CASHBACK: 'CASHBACK',
148
+ DISCOUNT_AND_CASHBACK: 'DISCOUNT_AND_CASHBACK',
149
+ NO_COST_EMI: 'NO_COST_EMI',
150
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
151
+ };
152
+ export const OfferTncOfferTncTypeEnum = {
153
+ TEXT: 'text',
154
+ LINK: 'link',
155
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
156
+ };
157
+ /**
158
+ * Offer Type Object
159
+ * @export
160
+ * @enum {string}
161
+ */
162
+ export const OfferType = {
163
+ DISCOUNT: 'DISCOUNT',
164
+ CASHBACK: 'CASHBACK',
165
+ DISCOUNT_AND_CASHBACK: 'DISCOUNT_AND_CASHBACK',
166
+ NO_COST_EMI: 'NO_COST_EMI',
167
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
168
+ };
169
+ export const OrderAuthenticateEntityActionEnum = {
170
+ SUBMIT_OTP: 'SUBMIT_OTP',
171
+ RESEND_OTP: 'RESEND_OTP',
172
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
173
+ };
174
+ export const OrderAuthenticateEntityAuthenticateStatusEnum = {
175
+ FAILED: 'FAILED',
176
+ SUCCESS: 'SUCCESS',
177
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
178
+ };
179
+ export const OrderAuthenticatePaymentRequestActionEnum = {
180
+ SUBMIT_OTP: 'SUBMIT_OTP',
181
+ RESEND_OTP: 'RESEND_OTP',
182
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
183
+ };
184
+ export const OrderCreateRefundRequestRefundSpeedEnum = {
185
+ STANDARD: 'STANDARD',
186
+ INSTANT: 'INSTANT',
187
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
188
+ };
189
+ export const PayOrderEntityPaymentMethodEnum = {
190
+ NETBANKING: 'netbanking',
191
+ CARD: 'card',
192
+ UPI: 'upi',
193
+ APP: 'app',
194
+ CARDLESS_EMI: 'cardless_emi',
195
+ PAYLATER: 'paylater',
196
+ BANKTRANSFER: 'banktransfer',
197
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
198
+ };
199
+ export const PayOrderEntityChannelEnum = {
200
+ LINK: 'link',
201
+ COLLECT: 'collect',
202
+ QRCODE: 'qrcode',
203
+ POST: 'post',
204
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
205
+ };
206
+ export const PayOrderEntityActionEnum = {
207
+ LINK: 'link',
208
+ CUSTOM: 'custom',
209
+ FORM: 'form',
210
+ POST: 'post',
211
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
212
+ };
213
+ export const PaylaterProviderEnum = {
214
+ KOTAK: 'kotak',
215
+ FLEXIPAY: 'flexipay',
216
+ ZESTMONEY: 'zestmoney',
217
+ LAZYPAY: 'lazypay',
218
+ OLAPOSTPAID: 'olapostpaid',
219
+ SIMPL: 'simpl',
220
+ FREECHARGEPAYLATER: 'freechargepaylater',
221
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
222
+ };
223
+ export const PaymentEntityPaymentStatusEnum = {
224
+ SUCCESS: 'SUCCESS',
225
+ NOT_ATTEMPTED: 'NOT_ATTEMPTED',
226
+ FAILED: 'FAILED',
227
+ USER_DROPPED: 'USER_DROPPED',
228
+ VOID: 'VOID',
229
+ CANCELLED: 'CANCELLED',
230
+ PENDING: 'PENDING',
231
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
232
+ };
233
+ export const RateLimitErrorTypeEnum = {
234
+ RATE_LIMIT_ERROR: 'rate_limit_error',
235
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
236
+ };
237
+ export const RefundEntityEntityEnum = {
238
+ REFUND: 'refund',
239
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
240
+ };
241
+ export const RefundEntityRefundStatusEnum = {
242
+ SUCCESS: 'SUCCESS',
243
+ PENDING: 'PENDING',
244
+ CANCELLED: 'CANCELLED',
245
+ ONHOLD: 'ONHOLD',
246
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
247
+ };
248
+ export const RefundEntityRefundTypeEnum = {
249
+ PAYMENT_AUTO_REFUND: 'PAYMENT_AUTO_REFUND',
250
+ MERCHANT_INITIATED: 'MERCHANT_INITIATED',
251
+ UNRECONCILED_AUTO_REFUND: 'UNRECONCILED_AUTO_REFUND',
252
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
253
+ };
254
+ export const RefundEntityRefundModeEnum = {
255
+ STANDARD: 'STANDARD',
256
+ INSTANT: 'INSTANT',
257
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
258
+ };
259
+ export const UpiChannelEnum = {
260
+ LINK: 'link',
261
+ COLLECT: 'collect',
262
+ QRCODE: 'qrcode',
263
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
264
+ };
265
+ /**
266
+ * EligibilityApi - axios parameter creator
267
+ * @export
268
+ */
269
+ const EligibilityApiAxiosParamCreator = function (configuration) {
270
+ return {
271
+ /**
272
+ * Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number.
273
+ * @summary Get Eligible Cardless EMI Payment Methods for a customer on an order
274
+
275
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
276
+ * @param {EligibilityFetchCardlessEMIRequest} EligibilityFetchCardlessEMIRequest Request Body to get eligible cardless emi options for a customer and order
277
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
278
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
279
+ * @param {*} [options] Override http request option.
280
+ * @throws {RequiredError}
281
+ * x_idempotency_key?: string,
282
+ */
283
+ pGEligibilityFetchCardlessEMI: (x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
284
+ // verify required parameter 'x_api_version' is not null or undefined
285
+ assertParamExists('pGEligibilityFetchCardlessEMI', 'x_api_version', x_api_version);
286
+ // verify required parameter 'EligibilityFetchCardlessEMIRequest' is not null or undefined
287
+ assertParamExists('pGEligibilityFetchCardlessEMI', 'EligibilityFetchCardlessEMIRequest', EligibilityFetchCardlessEMIRequest);
288
+ const localVarPath = `/eligibility/cardlessemi`;
289
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
290
+ var url = "https://sandbox.cashfree.com/pg";
291
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
292
+ url = "https://api.cashfree.com/pg";
293
+ }
294
+ const localVarUrlObj = new URL(localVarPath, url);
295
+ let baseOptions;
296
+ if (configuration) {
297
+ baseOptions = configuration.baseOptions;
298
+ }
299
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
300
+ const localVarHeaderParameter = {};
301
+ const localVarQueryParameter = {};
302
+ // authentication XPartnerAPIKey required
303
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
304
+ // authentication XClientSecret required
305
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
306
+ // authentication XPartnerMerchantID required
307
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
308
+ // authentication XClientID required
309
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
310
+ // authentication XClientSignatureHeader required
311
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
312
+ localVarHeaderParameter['Content-Type'] = 'application/json';
313
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
314
+ if (x_api_version != null && x_api_version != undefined) {
315
+ localVarHeaderParameter['x-api-version'] = x_api_version;
316
+ }
317
+ if (x_request_id != null && x_request_id != undefined) {
318
+ localVarHeaderParameter['x-request-id'] = x_request_id;
319
+ }
320
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
321
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
322
+ }
323
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
324
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
325
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
326
+ localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchCardlessEMIRequest, localVarRequestOptions, configuration);
327
+ return {
328
+ url: toPathString(localVarUrlObj),
329
+ options: localVarRequestOptions,
330
+ };
331
+ }),
332
+ /**
333
+ * Use this API to get eligible offers for an order_id or order amount.
334
+ * @summary Get Eligible Offers for an Order
335
+
336
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
337
+ * @param {EligibilityFetchOffersRequest} EligibilityFetchOffersRequest Request Body to get eligible offers for a customer and order
338
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
339
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
340
+ * @param {*} [options] Override http request option.
341
+ * @throws {RequiredError}
342
+ * x_idempotency_key?: string,
343
+ */
344
+ pGEligibilityFetchOffers: (x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
345
+ // verify required parameter 'x_api_version' is not null or undefined
346
+ assertParamExists('pGEligibilityFetchOffers', 'x_api_version', x_api_version);
347
+ // verify required parameter 'EligibilityFetchOffersRequest' is not null or undefined
348
+ assertParamExists('pGEligibilityFetchOffers', 'EligibilityFetchOffersRequest', EligibilityFetchOffersRequest);
349
+ const localVarPath = `/eligibility/offers`;
350
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
351
+ var url = "https://sandbox.cashfree.com/pg";
352
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
353
+ url = "https://api.cashfree.com/pg";
354
+ }
355
+ const localVarUrlObj = new URL(localVarPath, url);
356
+ let baseOptions;
357
+ if (configuration) {
358
+ baseOptions = configuration.baseOptions;
359
+ }
360
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
361
+ const localVarHeaderParameter = {};
362
+ const localVarQueryParameter = {};
363
+ // authentication XPartnerAPIKey required
364
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
365
+ // authentication XClientSecret required
366
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
367
+ // authentication XPartnerMerchantID required
368
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
369
+ // authentication XClientID required
370
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
371
+ // authentication XClientSignatureHeader required
372
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
373
+ localVarHeaderParameter['Content-Type'] = 'application/json';
374
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
375
+ if (x_api_version != null && x_api_version != undefined) {
376
+ localVarHeaderParameter['x-api-version'] = x_api_version;
377
+ }
378
+ if (x_request_id != null && x_request_id != undefined) {
379
+ localVarHeaderParameter['x-request-id'] = x_request_id;
380
+ }
381
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
382
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
383
+ }
384
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
385
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
386
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
387
+ localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchOffersRequest, localVarRequestOptions, configuration);
388
+ return {
389
+ url: toPathString(localVarUrlObj),
390
+ options: localVarRequestOptions,
391
+ };
392
+ }),
393
+ /**
394
+ * Use this API to get eligible Paylater Payment Methods for a customer on an order.
395
+ * @summary Get Eligible Paylater for a customer on an order
396
+
397
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
398
+ * @param {EligibilityFetchPaylaterRequest} EligibilityFetchPaylaterRequest Request Body to get eligible paylater options for a customer and order
399
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
400
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
401
+ * @param {*} [options] Override http request option.
402
+ * @throws {RequiredError}
403
+ * x_idempotency_key?: string,
404
+ */
405
+ pGEligibilityFetchPaylater: (x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
406
+ // verify required parameter 'x_api_version' is not null or undefined
407
+ assertParamExists('pGEligibilityFetchPaylater', 'x_api_version', x_api_version);
408
+ // verify required parameter 'EligibilityFetchPaylaterRequest' is not null or undefined
409
+ assertParamExists('pGEligibilityFetchPaylater', 'EligibilityFetchPaylaterRequest', EligibilityFetchPaylaterRequest);
410
+ const localVarPath = `/eligibility/paylater`;
411
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
412
+ var url = "https://sandbox.cashfree.com/pg";
413
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
414
+ url = "https://api.cashfree.com/pg";
415
+ }
416
+ const localVarUrlObj = new URL(localVarPath, url);
417
+ let baseOptions;
418
+ if (configuration) {
419
+ baseOptions = configuration.baseOptions;
420
+ }
421
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
422
+ const localVarHeaderParameter = {};
423
+ const localVarQueryParameter = {};
424
+ // authentication XPartnerAPIKey required
425
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
426
+ // authentication XClientSecret required
427
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
428
+ // authentication XPartnerMerchantID required
429
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
430
+ // authentication XClientID required
431
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
432
+ // authentication XClientSignatureHeader required
433
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
434
+ localVarHeaderParameter['Content-Type'] = 'application/json';
435
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
436
+ if (x_api_version != null && x_api_version != undefined) {
437
+ localVarHeaderParameter['x-api-version'] = x_api_version;
438
+ }
439
+ if (x_request_id != null && x_request_id != undefined) {
440
+ localVarHeaderParameter['x-request-id'] = x_request_id;
441
+ }
442
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
443
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
444
+ }
445
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
446
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
447
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
448
+ localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchPaylaterRequest, localVarRequestOptions, configuration);
449
+ return {
450
+ url: toPathString(localVarUrlObj),
451
+ options: localVarRequestOptions,
452
+ };
453
+ }),
454
+ /**
455
+ * Use this API to get eligible Payment Methods
456
+ * @summary Get eligible Payment Methods
457
+
458
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
459
+ * @param {EligibilityFetchPaymentMethodsRequest} EligibilityFetchPaymentMethodsRequest Request Body to get eligible payment methods for an account and order
460
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
461
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
462
+ * @param {*} [options] Override http request option.
463
+ * @throws {RequiredError}
464
+ * x_idempotency_key?: string,
465
+ */
466
+ pGEligibilityFetchPaymentMethods: (x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
467
+ // verify required parameter 'x_api_version' is not null or undefined
468
+ assertParamExists('pGEligibilityFetchPaymentMethods', 'x_api_version', x_api_version);
469
+ // verify required parameter 'EligibilityFetchPaymentMethodsRequest' is not null or undefined
470
+ assertParamExists('pGEligibilityFetchPaymentMethods', 'EligibilityFetchPaymentMethodsRequest', EligibilityFetchPaymentMethodsRequest);
471
+ const localVarPath = `/eligibility/payment_methods`;
472
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
473
+ var url = "https://sandbox.cashfree.com/pg";
474
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
475
+ url = "https://api.cashfree.com/pg";
476
+ }
477
+ const localVarUrlObj = new URL(localVarPath, url);
478
+ let baseOptions;
479
+ if (configuration) {
480
+ baseOptions = configuration.baseOptions;
481
+ }
482
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
483
+ const localVarHeaderParameter = {};
484
+ const localVarQueryParameter = {};
485
+ // authentication XPartnerAPIKey required
486
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
487
+ // authentication XClientSecret required
488
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
489
+ // authentication XPartnerMerchantID required
490
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
491
+ // authentication XClientID required
492
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
493
+ // authentication XClientSignatureHeader required
494
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
495
+ localVarHeaderParameter['Content-Type'] = 'application/json';
496
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
497
+ if (x_api_version != null && x_api_version != undefined) {
498
+ localVarHeaderParameter['x-api-version'] = x_api_version;
499
+ }
500
+ if (x_request_id != null && x_request_id != undefined) {
501
+ localVarHeaderParameter['x-request-id'] = x_request_id;
502
+ }
503
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
504
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
505
+ }
506
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
507
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
508
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
509
+ localVarRequestOptions.data = serializeDataIfNeeded(EligibilityFetchPaymentMethodsRequest, localVarRequestOptions, configuration);
510
+ return {
511
+ url: toPathString(localVarUrlObj),
512
+ options: localVarRequestOptions,
513
+ };
514
+ }),
515
+ };
516
+ };
517
+ /**
518
+ * EligibilityApi - functional programming interface
519
+ * @export
520
+ */
521
+ const EligibilityApiFp = function (configuration) {
522
+ const localVarAxiosParamCreator = EligibilityApiAxiosParamCreator(configuration);
523
+ return {
524
+ /**
525
+ * Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number.
526
+ * @summary Get Eligible Cardless EMI Payment Methods for a customer on an order
527
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
528
+ * @param {EligibilityFetchCardlessEMIRequest} EligibilityFetchCardlessEMIRequest Request Body to get eligible cardless emi options for a customer and order
529
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
530
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
531
+ * @param {*} [options] Override http request option.
532
+ * @throws {RequiredError}
533
+ */
534
+ pGEligibilityFetchCardlessEMI(x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options) {
535
+ return __awaiter(this, void 0, void 0, function* () {
536
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGEligibilityFetchCardlessEMI(x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options);
537
+ var url = "https://sandbox.cashfree.com/pg";
538
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
539
+ url = "https://api.cashfree.com/pg";
540
+ }
541
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
542
+ });
543
+ },
544
+ /**
545
+ * Use this API to get eligible offers for an order_id or order amount.
546
+ * @summary Get Eligible Offers for an Order
547
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
548
+ * @param {EligibilityFetchOffersRequest} EligibilityFetchOffersRequest Request Body to get eligible offers for a customer and order
549
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
550
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
551
+ * @param {*} [options] Override http request option.
552
+ * @throws {RequiredError}
553
+ */
554
+ pGEligibilityFetchOffers(x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options) {
555
+ return __awaiter(this, void 0, void 0, function* () {
556
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGEligibilityFetchOffers(x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options);
557
+ var url = "https://sandbox.cashfree.com/pg";
558
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
559
+ url = "https://api.cashfree.com/pg";
560
+ }
561
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
562
+ });
563
+ },
564
+ /**
565
+ * Use this API to get eligible Paylater Payment Methods for a customer on an order.
566
+ * @summary Get Eligible Paylater for a customer on an order
567
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
568
+ * @param {EligibilityFetchPaylaterRequest} EligibilityFetchPaylaterRequest Request Body to get eligible paylater options for a customer and order
569
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
570
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
571
+ * @param {*} [options] Override http request option.
572
+ * @throws {RequiredError}
573
+ */
574
+ pGEligibilityFetchPaylater(x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options) {
575
+ return __awaiter(this, void 0, void 0, function* () {
576
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGEligibilityFetchPaylater(x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options);
577
+ var url = "https://sandbox.cashfree.com/pg";
578
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
579
+ url = "https://api.cashfree.com/pg";
580
+ }
581
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
582
+ });
583
+ },
584
+ /**
585
+ * Use this API to get eligible Payment Methods
586
+ * @summary Get eligible Payment Methods
587
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
588
+ * @param {EligibilityFetchPaymentMethodsRequest} EligibilityFetchPaymentMethodsRequest Request Body to get eligible payment methods for an account and order
589
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
590
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
591
+ * @param {*} [options] Override http request option.
592
+ * @throws {RequiredError}
593
+ */
594
+ pGEligibilityFetchPaymentMethods(x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options) {
595
+ return __awaiter(this, void 0, void 0, function* () {
596
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGEligibilityFetchPaymentMethods(x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options);
597
+ var url = "https://sandbox.cashfree.com/pg";
598
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
599
+ url = "https://api.cashfree.com/pg";
600
+ }
601
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
602
+ });
603
+ },
604
+ };
605
+ };
606
+ /**
607
+ * EligibilityApi - object-oriented interface
608
+ * @export
609
+ * @class EligibilityApi
610
+ * @extends {BaseAPI}
611
+ */
612
+ /**
613
+ * OffersApi - axios parameter creator
614
+ * @export
615
+ */
616
+ const OffersApiAxiosParamCreator = function (configuration) {
617
+ return {
618
+ /**
619
+ * Use this API to create offers with Cashfree from your backend
620
+ * @summary Create Offer
621
+
622
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
623
+ * @param {CreateOfferRequest} CreateOfferRequest Request body to create an offer at Cashfree
624
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
625
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
626
+ * @param {*} [options] Override http request option.
627
+ * @throws {RequiredError}
628
+ * x_idempotency_key?: string,
629
+ */
630
+ pGCreateOffer: (x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
631
+ // verify required parameter 'x_api_version' is not null or undefined
632
+ assertParamExists('pGCreateOffer', 'x_api_version', x_api_version);
633
+ // verify required parameter 'CreateOfferRequest' is not null or undefined
634
+ assertParamExists('pGCreateOffer', 'CreateOfferRequest', CreateOfferRequest);
635
+ const localVarPath = `/offers`;
636
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
637
+ var url = "https://sandbox.cashfree.com/pg";
638
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
639
+ url = "https://api.cashfree.com/pg";
640
+ }
641
+ const localVarUrlObj = new URL(localVarPath, url);
642
+ let baseOptions;
643
+ if (configuration) {
644
+ baseOptions = configuration.baseOptions;
645
+ }
646
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
647
+ const localVarHeaderParameter = {};
648
+ const localVarQueryParameter = {};
649
+ // authentication XPartnerAPIKey required
650
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
651
+ // authentication XClientSecret required
652
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
653
+ // authentication XPartnerMerchantID required
654
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
655
+ // authentication XClientID required
656
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
657
+ // authentication XClientSignatureHeader required
658
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
659
+ localVarHeaderParameter['Content-Type'] = 'application/json';
660
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
661
+ if (x_api_version != null && x_api_version != undefined) {
662
+ localVarHeaderParameter['x-api-version'] = x_api_version;
663
+ }
664
+ if (x_request_id != null && x_request_id != undefined) {
665
+ localVarHeaderParameter['x-request-id'] = x_request_id;
666
+ }
667
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
668
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
669
+ }
670
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
671
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
672
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
673
+ localVarRequestOptions.data = serializeDataIfNeeded(CreateOfferRequest, localVarRequestOptions, configuration);
674
+ return {
675
+ url: toPathString(localVarUrlObj),
676
+ options: localVarRequestOptions,
677
+ };
678
+ }),
679
+ /**
680
+ * Use this API to get offer by offer_id
681
+ * @summary Get Offer by ID
682
+
683
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
684
+ * @param {string} offer_id The offer ID for which you want to view the offer details.
685
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
686
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
687
+ * @param {*} [options] Override http request option.
688
+ * @throws {RequiredError}
689
+ * x_idempotency_key?: string,
690
+ */
691
+ pGFetchOffer: (x_api_version, offer_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
692
+ // verify required parameter 'x_api_version' is not null or undefined
693
+ assertParamExists('pGFetchOffer', 'x_api_version', x_api_version);
694
+ // verify required parameter 'offer_id' is not null or undefined
695
+ assertParamExists('pGFetchOffer', 'offer_id', offer_id);
696
+ const localVarPath = `/offers/{offer_id}`
697
+ .replace(`{${"offer_id"}}`, encodeURIComponent(String(offer_id)));
698
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
699
+ var url = "https://sandbox.cashfree.com/pg";
700
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
701
+ url = "https://api.cashfree.com/pg";
702
+ }
703
+ const localVarUrlObj = new URL(localVarPath, url);
704
+ let baseOptions;
705
+ if (configuration) {
706
+ baseOptions = configuration.baseOptions;
707
+ }
708
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
709
+ const localVarHeaderParameter = {};
710
+ const localVarQueryParameter = {};
711
+ // authentication XPartnerAPIKey required
712
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
713
+ // authentication XClientSecret required
714
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
715
+ // authentication XPartnerMerchantID required
716
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
717
+ // authentication XClientID required
718
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
719
+ // authentication XClientSignatureHeader required
720
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
721
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
722
+ if (x_api_version != null && x_api_version != undefined) {
723
+ localVarHeaderParameter['x-api-version'] = x_api_version;
724
+ }
725
+ if (x_request_id != null && x_request_id != undefined) {
726
+ localVarHeaderParameter['x-request-id'] = x_request_id;
727
+ }
728
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
729
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
730
+ }
731
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
732
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
733
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
734
+ return {
735
+ url: toPathString(localVarUrlObj),
736
+ options: localVarRequestOptions,
737
+ };
738
+ }),
739
+ };
740
+ };
741
+ /**
742
+ * OffersApi - functional programming interface
743
+ * @export
744
+ */
745
+ const OffersApiFp = function (configuration) {
746
+ const localVarAxiosParamCreator = OffersApiAxiosParamCreator(configuration);
747
+ return {
748
+ /**
749
+ * Use this API to create offers with Cashfree from your backend
750
+ * @summary Create Offer
751
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
752
+ * @param {CreateOfferRequest} CreateOfferRequest Request body to create an offer at Cashfree
753
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
754
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
755
+ * @param {*} [options] Override http request option.
756
+ * @throws {RequiredError}
757
+ */
758
+ pGCreateOffer(x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options) {
759
+ return __awaiter(this, void 0, void 0, function* () {
760
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGCreateOffer(x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options);
761
+ var url = "https://sandbox.cashfree.com/pg";
762
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
763
+ url = "https://api.cashfree.com/pg";
764
+ }
765
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
766
+ });
767
+ },
768
+ /**
769
+ * Use this API to get offer by offer_id
770
+ * @summary Get Offer by ID
771
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
772
+ * @param {string} offer_id The offer ID for which you want to view the offer details.
773
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
774
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
775
+ * @param {*} [options] Override http request option.
776
+ * @throws {RequiredError}
777
+ */
778
+ pGFetchOffer(x_api_version, offer_id, x_request_id, x_idempotency_key, options) {
779
+ return __awaiter(this, void 0, void 0, function* () {
780
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGFetchOffer(x_api_version, offer_id, x_request_id, x_idempotency_key, options);
781
+ var url = "https://sandbox.cashfree.com/pg";
782
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
783
+ url = "https://api.cashfree.com/pg";
784
+ }
785
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
786
+ });
787
+ },
788
+ };
789
+ };
790
+ /**
791
+ * OffersApi - object-oriented interface
792
+ * @export
793
+ * @class OffersApi
794
+ * @extends {BaseAPI}
795
+ */
796
+ /**
797
+ * OrdersApi - axios parameter creator
798
+ * @export
799
+ */
800
+ const OrdersApiAxiosParamCreator = function (configuration) {
801
+ return {
802
+ /**
803
+ * ### 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.
804
+ * @summary Create Order
805
+
806
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
807
+ * @param {CreateOrderRequest} CreateOrderRequest Request body to create an order at cashfree
808
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
809
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
810
+ * @param {*} [options] Override http request option.
811
+ * @throws {RequiredError}
812
+ * x_idempotency_key?: string,
813
+ */
814
+ pGCreateOrder: (x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
815
+ // verify required parameter 'x_api_version' is not null or undefined
816
+ assertParamExists('pGCreateOrder', 'x_api_version', x_api_version);
817
+ // verify required parameter 'CreateOrderRequest' is not null or undefined
818
+ assertParamExists('pGCreateOrder', 'CreateOrderRequest', CreateOrderRequest);
819
+ const localVarPath = `/orders`;
820
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
821
+ var url = "https://sandbox.cashfree.com/pg";
822
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
823
+ url = "https://api.cashfree.com/pg";
824
+ }
825
+ const localVarUrlObj = new URL(localVarPath, url);
826
+ let baseOptions;
827
+ if (configuration) {
828
+ baseOptions = configuration.baseOptions;
829
+ }
830
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
831
+ const localVarHeaderParameter = {};
832
+ const localVarQueryParameter = {};
833
+ // authentication XPartnerAPIKey required
834
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
835
+ // authentication XClientSecret required
836
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
837
+ // authentication XPartnerMerchantID required
838
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
839
+ // authentication XClientID required
840
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
841
+ // authentication XClientSignatureHeader required
842
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
843
+ localVarHeaderParameter['Content-Type'] = 'application/json';
844
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
845
+ if (x_api_version != null && x_api_version != undefined) {
846
+ localVarHeaderParameter['x-api-version'] = x_api_version;
847
+ }
848
+ if (x_request_id != null && x_request_id != undefined) {
849
+ localVarHeaderParameter['x-request-id'] = x_request_id;
850
+ }
851
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
852
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
853
+ }
854
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
855
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
856
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
857
+ localVarRequestOptions.data = serializeDataIfNeeded(CreateOrderRequest, localVarRequestOptions, configuration);
858
+ return {
859
+ url: toPathString(localVarUrlObj),
860
+ options: localVarRequestOptions,
861
+ };
862
+ }),
863
+ /**
864
+ * 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`
865
+ * @summary Get Order
866
+
867
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
868
+ * @param {string} order_id The id which uniquely identifies your order
869
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
870
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
871
+ * @param {*} [options] Override http request option.
872
+ * @throws {RequiredError}
873
+ * x_idempotency_key?: string,
874
+ */
875
+ pGFetchOrder: (x_api_version, order_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
876
+ // verify required parameter 'x_api_version' is not null or undefined
877
+ assertParamExists('pGFetchOrder', 'x_api_version', x_api_version);
878
+ // verify required parameter 'order_id' is not null or undefined
879
+ assertParamExists('pGFetchOrder', 'order_id', order_id);
880
+ const localVarPath = `/orders/{order_id}`
881
+ .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id)));
882
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
883
+ var url = "https://sandbox.cashfree.com/pg";
884
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
885
+ url = "https://api.cashfree.com/pg";
886
+ }
887
+ const localVarUrlObj = new URL(localVarPath, url);
888
+ let baseOptions;
889
+ if (configuration) {
890
+ baseOptions = configuration.baseOptions;
891
+ }
892
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
893
+ const localVarHeaderParameter = {};
894
+ const localVarQueryParameter = {};
895
+ // authentication XPartnerAPIKey required
896
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
897
+ // authentication XClientSecret required
898
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
899
+ // authentication XPartnerMerchantID required
900
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
901
+ // authentication XClientID required
902
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
903
+ // authentication XClientSignatureHeader required
904
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
905
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
906
+ if (x_api_version != null && x_api_version != undefined) {
907
+ localVarHeaderParameter['x-api-version'] = x_api_version;
908
+ }
909
+ if (x_request_id != null && x_request_id != undefined) {
910
+ localVarHeaderParameter['x-request-id'] = x_request_id;
911
+ }
912
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
913
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
914
+ }
915
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
916
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
917
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
918
+ return {
919
+ url: toPathString(localVarUrlObj),
920
+ options: localVarRequestOptions,
921
+ };
922
+ }),
923
+ };
924
+ };
925
+ /**
926
+ * OrdersApi - functional programming interface
927
+ * @export
928
+ */
929
+ const OrdersApiFp = function (configuration) {
930
+ const localVarAxiosParamCreator = OrdersApiAxiosParamCreator(configuration);
931
+ return {
932
+ /**
933
+ * ### 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.
934
+ * @summary Create Order
935
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
936
+ * @param {CreateOrderRequest} CreateOrderRequest Request body to create an order at cashfree
937
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
938
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
939
+ * @param {*} [options] Override http request option.
940
+ * @throws {RequiredError}
941
+ */
942
+ pGCreateOrder(x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options) {
943
+ return __awaiter(this, void 0, void 0, function* () {
944
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGCreateOrder(x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options);
945
+ var url = "https://sandbox.cashfree.com/pg";
946
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
947
+ url = "https://api.cashfree.com/pg";
948
+ }
949
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
950
+ });
951
+ },
952
+ /**
953
+ * 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`
954
+ * @summary Get Order
955
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
956
+ * @param {string} order_id The id which uniquely identifies your order
957
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
958
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
959
+ * @param {*} [options] Override http request option.
960
+ * @throws {RequiredError}
961
+ */
962
+ pGFetchOrder(x_api_version, order_id, x_request_id, x_idempotency_key, options) {
963
+ return __awaiter(this, void 0, void 0, function* () {
964
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGFetchOrder(x_api_version, order_id, x_request_id, x_idempotency_key, options);
965
+ var url = "https://sandbox.cashfree.com/pg";
966
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
967
+ url = "https://api.cashfree.com/pg";
968
+ }
969
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
970
+ });
971
+ },
972
+ };
973
+ };
974
+ /**
975
+ * OrdersApi - object-oriented interface
976
+ * @export
977
+ * @class OrdersApi
978
+ * @extends {BaseAPI}
979
+ */
980
+ /**
981
+ * PGReconciliationApi - axios parameter creator
982
+ * @export
983
+ */
984
+ const PGReconciliationApiAxiosParamCreator = function (configuration) {
985
+ return {
986
+ /**
987
+ * - Use this API to get the payment gateway reconciliation details with date range. - It will have events for your payment account
988
+ * @summary PG Reconciliation
989
+
990
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
991
+ * @param {FetchReconRequest} FetchReconRequest Request Body for the reconciliation
992
+ * @param {string} [Content_Type] application/json
993
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
994
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
995
+ * @param {string} [Accept] application/json
996
+ * @param {*} [options] Override http request option.
997
+ * @throws {RequiredError}
998
+ * x_request_id?: string,
999
+ */
1000
+ pGFetchRecon: (x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options = {}) => __awaiter(this, void 0, void 0, function* () {
1001
+ // verify required parameter 'x_api_version' is not null or undefined
1002
+ assertParamExists('pGFetchRecon', 'x_api_version', x_api_version);
1003
+ // verify required parameter 'FetchReconRequest' is not null or undefined
1004
+ assertParamExists('pGFetchRecon', 'FetchReconRequest', FetchReconRequest);
1005
+ const localVarPath = `/recon`;
1006
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1007
+ var url = "https://sandbox.cashfree.com/pg";
1008
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1009
+ url = "https://api.cashfree.com/pg";
1010
+ }
1011
+ const localVarUrlObj = new URL(localVarPath, url);
1012
+ let baseOptions;
1013
+ if (configuration) {
1014
+ baseOptions = configuration.baseOptions;
1015
+ }
1016
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1017
+ const localVarHeaderParameter = {};
1018
+ const localVarQueryParameter = {};
1019
+ // authentication XPartnerAPIKey required
1020
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
1021
+ // authentication XClientSecret required
1022
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
1023
+ // authentication XPartnerMerchantID required
1024
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
1025
+ // authentication XClientID required
1026
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
1027
+ // authentication XClientSignatureHeader required
1028
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
1029
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1030
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1031
+ if (x_api_version != null && x_api_version != undefined) {
1032
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1033
+ }
1034
+ if (x_request_id != null && x_request_id != undefined) {
1035
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1036
+ }
1037
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1038
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1039
+ }
1040
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1041
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1042
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1043
+ localVarRequestOptions.data = serializeDataIfNeeded(FetchReconRequest, localVarRequestOptions, configuration);
1044
+ return {
1045
+ url: toPathString(localVarUrlObj),
1046
+ options: localVarRequestOptions,
1047
+ };
1048
+ }),
1049
+ };
1050
+ };
1051
+ /**
1052
+ * PGReconciliationApi - functional programming interface
1053
+ * @export
1054
+ */
1055
+ const PGReconciliationApiFp = function (configuration) {
1056
+ const localVarAxiosParamCreator = PGReconciliationApiAxiosParamCreator(configuration);
1057
+ return {
1058
+ /**
1059
+ * - Use this API to get the payment gateway reconciliation details with date range. - It will have events for your payment account
1060
+ * @summary PG Reconciliation
1061
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1062
+ * @param {FetchReconRequest} FetchReconRequest Request Body for the reconciliation
1063
+ * @param {string} [Content_Type] application/json
1064
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1065
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1066
+ * @param {string} [Accept] application/json
1067
+ * @param {*} [options] Override http request option.
1068
+ * @throws {RequiredError}
1069
+ */
1070
+ pGFetchRecon(x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options) {
1071
+ return __awaiter(this, void 0, void 0, function* () {
1072
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGFetchRecon(x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options);
1073
+ var url = "https://sandbox.cashfree.com/pg";
1074
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1075
+ url = "https://api.cashfree.com/pg";
1076
+ }
1077
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
1078
+ });
1079
+ },
1080
+ };
1081
+ };
1082
+ /**
1083
+ * PGReconciliationApi - object-oriented interface
1084
+ * @export
1085
+ * @class PGReconciliationApi
1086
+ * @extends {BaseAPI}
1087
+ */
1088
+ /**
1089
+ * PaymentLinksApi - axios parameter creator
1090
+ * @export
1091
+ */
1092
+ const PaymentLinksApiAxiosParamCreator = function (configuration) {
1093
+ return {
1094
+ /**
1095
+ * 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.
1096
+ * @summary Cancel Payment Link
1097
+
1098
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1099
+ * @param {string} link_id The payment link ID for which you want to view the details.
1100
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1101
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1102
+ * @param {*} [options] Override http request option.
1103
+ * @throws {RequiredError}
1104
+ * x_idempotency_key?: string,
1105
+ */
1106
+ pGCancelLink: (x_api_version, link_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1107
+ // verify required parameter 'x_api_version' is not null or undefined
1108
+ assertParamExists('pGCancelLink', 'x_api_version', x_api_version);
1109
+ // verify required parameter 'link_id' is not null or undefined
1110
+ assertParamExists('pGCancelLink', 'link_id', link_id);
1111
+ const localVarPath = `/links/{link_id}/cancel`
1112
+ .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id)));
1113
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1114
+ var url = "https://sandbox.cashfree.com/pg";
1115
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1116
+ url = "https://api.cashfree.com/pg";
1117
+ }
1118
+ const localVarUrlObj = new URL(localVarPath, url);
1119
+ let baseOptions;
1120
+ if (configuration) {
1121
+ baseOptions = configuration.baseOptions;
1122
+ }
1123
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1124
+ const localVarHeaderParameter = {};
1125
+ const localVarQueryParameter = {};
1126
+ // authentication XPartnerAPIKey required
1127
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
1128
+ // authentication XClientSecret required
1129
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
1130
+ // authentication XPartnerMerchantID required
1131
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
1132
+ // authentication XClientID required
1133
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
1134
+ // authentication XClientSignatureHeader required
1135
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
1136
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1137
+ if (x_api_version != null && x_api_version != undefined) {
1138
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1139
+ }
1140
+ if (x_request_id != null && x_request_id != undefined) {
1141
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1142
+ }
1143
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1144
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1145
+ }
1146
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1147
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1148
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1149
+ return {
1150
+ url: toPathString(localVarUrlObj),
1151
+ options: localVarRequestOptions,
1152
+ };
1153
+ }),
1154
+ /**
1155
+ * Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url.
1156
+ * @summary Create Payment Link
1157
+
1158
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1159
+ * @param {CreateLinkRequest} CreateLinkRequest Request Body to Create Payment Links
1160
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1161
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1162
+ * @param {*} [options] Override http request option.
1163
+ * @throws {RequiredError}
1164
+ * x_idempotency_key?: string,
1165
+ */
1166
+ pGCreateLink: (x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1167
+ // verify required parameter 'x_api_version' is not null or undefined
1168
+ assertParamExists('pGCreateLink', 'x_api_version', x_api_version);
1169
+ // verify required parameter 'CreateLinkRequest' is not null or undefined
1170
+ assertParamExists('pGCreateLink', 'CreateLinkRequest', CreateLinkRequest);
1171
+ const localVarPath = `/links`;
1172
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1173
+ var url = "https://sandbox.cashfree.com/pg";
1174
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1175
+ url = "https://api.cashfree.com/pg";
1176
+ }
1177
+ const localVarUrlObj = new URL(localVarPath, url);
1178
+ let baseOptions;
1179
+ if (configuration) {
1180
+ baseOptions = configuration.baseOptions;
1181
+ }
1182
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1183
+ const localVarHeaderParameter = {};
1184
+ const localVarQueryParameter = {};
1185
+ // authentication XPartnerAPIKey required
1186
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
1187
+ // authentication XClientSecret required
1188
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
1189
+ // authentication XPartnerMerchantID required
1190
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
1191
+ // authentication XClientID required
1192
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
1193
+ // authentication XClientSignatureHeader required
1194
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
1195
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1196
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1197
+ if (x_api_version != null && x_api_version != undefined) {
1198
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1199
+ }
1200
+ if (x_request_id != null && x_request_id != undefined) {
1201
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1202
+ }
1203
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1204
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1205
+ }
1206
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1207
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1208
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1209
+ localVarRequestOptions.data = serializeDataIfNeeded(CreateLinkRequest, localVarRequestOptions, configuration);
1210
+ return {
1211
+ url: toPathString(localVarUrlObj),
1212
+ options: localVarRequestOptions,
1213
+ };
1214
+ }),
1215
+ /**
1216
+ * Use this API to view all details and status of a payment link.
1217
+ * @summary Fetch Payment Link Details
1218
+
1219
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1220
+ * @param {string} link_id The payment link ID for which you want to view the details.
1221
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1222
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1223
+ * @param {*} [options] Override http request option.
1224
+ * @throws {RequiredError}
1225
+ * x_idempotency_key?: string,
1226
+ */
1227
+ pGFetchLink: (x_api_version, link_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1228
+ // verify required parameter 'x_api_version' is not null or undefined
1229
+ assertParamExists('pGFetchLink', 'x_api_version', x_api_version);
1230
+ // verify required parameter 'link_id' is not null or undefined
1231
+ assertParamExists('pGFetchLink', 'link_id', link_id);
1232
+ const localVarPath = `/links/{link_id}`
1233
+ .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id)));
1234
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1235
+ var url = "https://sandbox.cashfree.com/pg";
1236
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1237
+ url = "https://api.cashfree.com/pg";
1238
+ }
1239
+ const localVarUrlObj = new URL(localVarPath, url);
1240
+ let baseOptions;
1241
+ if (configuration) {
1242
+ baseOptions = configuration.baseOptions;
1243
+ }
1244
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1245
+ const localVarHeaderParameter = {};
1246
+ const localVarQueryParameter = {};
1247
+ // authentication XPartnerAPIKey required
1248
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
1249
+ // authentication XClientSecret required
1250
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
1251
+ // authentication XPartnerMerchantID required
1252
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
1253
+ // authentication XClientID required
1254
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
1255
+ // authentication XClientSignatureHeader required
1256
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
1257
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1258
+ if (x_api_version != null && x_api_version != undefined) {
1259
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1260
+ }
1261
+ if (x_request_id != null && x_request_id != undefined) {
1262
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1263
+ }
1264
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1265
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1266
+ }
1267
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1268
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1269
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1270
+ return {
1271
+ url: toPathString(localVarUrlObj),
1272
+ options: localVarRequestOptions,
1273
+ };
1274
+ }),
1275
+ /**
1276
+ * Use this API to view all order details for a payment link.
1277
+ * @summary Get Orders for a Payment Link
1278
+
1279
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1280
+ * @param {string} link_id The payment link ID for which you want to view the details.
1281
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1282
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1283
+ * @param {*} [options] Override http request option.
1284
+ * @throws {RequiredError}
1285
+ * x_idempotency_key?: string,
1286
+ */
1287
+ pGLinkFetchOrders: (x_api_version, link_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1288
+ // verify required parameter 'x_api_version' is not null or undefined
1289
+ assertParamExists('pGLinkFetchOrders', 'x_api_version', x_api_version);
1290
+ // verify required parameter 'link_id' is not null or undefined
1291
+ assertParamExists('pGLinkFetchOrders', 'link_id', link_id);
1292
+ const localVarPath = `/links/{link_id}/orders`
1293
+ .replace(`{${"link_id"}}`, encodeURIComponent(String(link_id)));
1294
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1295
+ var url = "https://sandbox.cashfree.com/pg";
1296
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1297
+ url = "https://api.cashfree.com/pg";
1298
+ }
1299
+ const localVarUrlObj = new URL(localVarPath, url);
1300
+ let baseOptions;
1301
+ if (configuration) {
1302
+ baseOptions = configuration.baseOptions;
1303
+ }
1304
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1305
+ const localVarHeaderParameter = {};
1306
+ const localVarQueryParameter = {};
1307
+ // authentication XPartnerAPIKey required
1308
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
1309
+ // authentication XClientSecret required
1310
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
1311
+ // authentication XPartnerMerchantID required
1312
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
1313
+ // authentication XClientID required
1314
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
1315
+ // authentication XClientSignatureHeader required
1316
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
1317
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1318
+ if (x_api_version != null && x_api_version != undefined) {
1319
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1320
+ }
1321
+ if (x_request_id != null && x_request_id != undefined) {
1322
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1323
+ }
1324
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1325
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1326
+ }
1327
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1328
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1329
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1330
+ return {
1331
+ url: toPathString(localVarUrlObj),
1332
+ options: localVarRequestOptions,
1333
+ };
1334
+ }),
1335
+ };
1336
+ };
1337
+ /**
1338
+ * PaymentLinksApi - functional programming interface
1339
+ * @export
1340
+ */
1341
+ const PaymentLinksApiFp = function (configuration) {
1342
+ const localVarAxiosParamCreator = PaymentLinksApiAxiosParamCreator(configuration);
1343
+ return {
1344
+ /**
1345
+ * 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.
1346
+ * @summary Cancel Payment Link
1347
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1348
+ * @param {string} link_id The payment link ID for which you want to view the details.
1349
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1350
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1351
+ * @param {*} [options] Override http request option.
1352
+ * @throws {RequiredError}
1353
+ */
1354
+ pGCancelLink(x_api_version, link_id, x_request_id, x_idempotency_key, options) {
1355
+ return __awaiter(this, void 0, void 0, function* () {
1356
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGCancelLink(x_api_version, link_id, x_request_id, x_idempotency_key, options);
1357
+ var url = "https://sandbox.cashfree.com/pg";
1358
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1359
+ url = "https://api.cashfree.com/pg";
1360
+ }
1361
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
1362
+ });
1363
+ },
1364
+ /**
1365
+ * Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url.
1366
+ * @summary Create Payment Link
1367
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1368
+ * @param {CreateLinkRequest} CreateLinkRequest Request Body to Create Payment Links
1369
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1370
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1371
+ * @param {*} [options] Override http request option.
1372
+ * @throws {RequiredError}
1373
+ */
1374
+ pGCreateLink(x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options) {
1375
+ return __awaiter(this, void 0, void 0, function* () {
1376
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGCreateLink(x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options);
1377
+ var url = "https://sandbox.cashfree.com/pg";
1378
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1379
+ url = "https://api.cashfree.com/pg";
1380
+ }
1381
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
1382
+ });
1383
+ },
1384
+ /**
1385
+ * Use this API to view all details and status of a payment link.
1386
+ * @summary Fetch Payment Link Details
1387
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1388
+ * @param {string} link_id The payment link ID for which you want to view the details.
1389
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1390
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1391
+ * @param {*} [options] Override http request option.
1392
+ * @throws {RequiredError}
1393
+ */
1394
+ pGFetchLink(x_api_version, link_id, x_request_id, x_idempotency_key, options) {
1395
+ return __awaiter(this, void 0, void 0, function* () {
1396
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGFetchLink(x_api_version, link_id, x_request_id, x_idempotency_key, options);
1397
+ var url = "https://sandbox.cashfree.com/pg";
1398
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1399
+ url = "https://api.cashfree.com/pg";
1400
+ }
1401
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
1402
+ });
1403
+ },
1404
+ /**
1405
+ * Use this API to view all order details for a payment link.
1406
+ * @summary Get Orders for a Payment Link
1407
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1408
+ * @param {string} link_id The payment link ID for which you want to view the details.
1409
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1410
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1411
+ * @param {*} [options] Override http request option.
1412
+ * @throws {RequiredError}
1413
+ */
1414
+ pGLinkFetchOrders(x_api_version, link_id, x_request_id, x_idempotency_key, options) {
1415
+ return __awaiter(this, void 0, void 0, function* () {
1416
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGLinkFetchOrders(x_api_version, link_id, x_request_id, x_idempotency_key, options);
1417
+ var url = "https://sandbox.cashfree.com/pg";
1418
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1419
+ url = "https://api.cashfree.com/pg";
1420
+ }
1421
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
1422
+ });
1423
+ },
1424
+ };
1425
+ };
1426
+ /**
1427
+ * PaymentLinksApi - object-oriented interface
1428
+ * @export
1429
+ * @class PaymentLinksApi
1430
+ * @extends {BaseAPI}
1431
+ */
1432
+ /**
1433
+ * PaymentsApi - axios parameter creator
1434
+ * @export
1435
+ */
1436
+ const PaymentsApiAxiosParamCreator = function (configuration) {
1437
+ return {
1438
+ /**
1439
+ * Use this API to capture or void a preauthorized payment
1440
+ * @summary Preauthorization
1441
+
1442
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1443
+ * @param {string} order_id The id which uniquely identifies your order
1444
+ * @param {AuthorizeOrderRequest} AuthorizeOrderRequest Request to Capture or Void Transactions
1445
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1446
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1447
+ * @param {*} [options] Override http request option.
1448
+ * @throws {RequiredError}
1449
+ * x_request_id?: string,
1450
+ */
1451
+ pGAuthorizeOrder: (x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1452
+ // verify required parameter 'x_api_version' is not null or undefined
1453
+ assertParamExists('pGAuthorizeOrder', 'x_api_version', x_api_version);
1454
+ // verify required parameter 'order_id' is not null or undefined
1455
+ assertParamExists('pGAuthorizeOrder', 'order_id', order_id);
1456
+ // verify required parameter 'AuthorizeOrderRequest' is not null or undefined
1457
+ assertParamExists('pGAuthorizeOrder', 'AuthorizeOrderRequest', AuthorizeOrderRequest);
1458
+ const localVarPath = `/orders/{order_id}/authorization`
1459
+ .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id)));
1460
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1461
+ var url = "https://sandbox.cashfree.com/pg";
1462
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1463
+ url = "https://api.cashfree.com/pg";
1464
+ }
1465
+ const localVarUrlObj = new URL(localVarPath, url);
1466
+ let baseOptions;
1467
+ if (configuration) {
1468
+ baseOptions = configuration.baseOptions;
1469
+ }
1470
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1471
+ const localVarHeaderParameter = {};
1472
+ const localVarQueryParameter = {};
1473
+ // authentication XPartnerAPIKey required
1474
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
1475
+ // authentication XClientSecret required
1476
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
1477
+ // authentication XPartnerMerchantID required
1478
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
1479
+ // authentication XClientID required
1480
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
1481
+ // authentication XClientSignatureHeader required
1482
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
1483
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1484
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1485
+ if (x_api_version != null && x_api_version != undefined) {
1486
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1487
+ }
1488
+ if (x_request_id != null && x_request_id != undefined) {
1489
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1490
+ }
1491
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1492
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1493
+ }
1494
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1495
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1496
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1497
+ localVarRequestOptions.data = serializeDataIfNeeded(AuthorizeOrderRequest, localVarRequestOptions, configuration);
1498
+ return {
1499
+ url: toPathString(localVarUrlObj),
1500
+ options: localVarRequestOptions,
1501
+ };
1502
+ }),
1503
+ /**
1504
+ * If you accept OTP on your own page, you can use the below API to send OTP to Cashfree.
1505
+ * @summary Submit or Resend OTP
1506
+
1507
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1508
+ * @param {string} cf_payment_id The Cashfree payment or transaction ID.
1509
+ * @param {OrderAuthenticatePaymentRequest} OrderAuthenticatePaymentRequest Request body to submit/resend headless OTP. To use this API make sure you have headless OTP enabled for your account
1510
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1511
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1512
+ * @param {*} [options] Override http request option.
1513
+ * @throws {RequiredError}
1514
+ * x_request_id?: string,
1515
+ */
1516
+ pGOrderAuthenticatePayment: (x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1517
+ // verify required parameter 'x_api_version' is not null or undefined
1518
+ assertParamExists('pGOrderAuthenticatePayment', 'x_api_version', x_api_version);
1519
+ // verify required parameter 'cf_payment_id' is not null or undefined
1520
+ assertParamExists('pGOrderAuthenticatePayment', 'cf_payment_id', cf_payment_id);
1521
+ // verify required parameter 'OrderAuthenticatePaymentRequest' is not null or undefined
1522
+ assertParamExists('pGOrderAuthenticatePayment', 'OrderAuthenticatePaymentRequest', OrderAuthenticatePaymentRequest);
1523
+ const localVarPath = `/orders/pay/authenticate/{cf_payment_id}`
1524
+ .replace(`{${"cf_payment_id"}}`, encodeURIComponent(String(cf_payment_id)));
1525
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1526
+ var url = "https://sandbox.cashfree.com/pg";
1527
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1528
+ url = "https://api.cashfree.com/pg";
1529
+ }
1530
+ const localVarUrlObj = new URL(localVarPath, url);
1531
+ let baseOptions;
1532
+ if (configuration) {
1533
+ baseOptions = configuration.baseOptions;
1534
+ }
1535
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1536
+ const localVarHeaderParameter = {};
1537
+ const localVarQueryParameter = {};
1538
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1539
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1540
+ if (x_api_version != null && x_api_version != undefined) {
1541
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1542
+ }
1543
+ if (x_request_id != null && x_request_id != undefined) {
1544
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1545
+ }
1546
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1547
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1548
+ }
1549
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1550
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1551
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1552
+ localVarRequestOptions.data = serializeDataIfNeeded(OrderAuthenticatePaymentRequest, localVarRequestOptions, configuration);
1553
+ return {
1554
+ url: toPathString(localVarUrlObj),
1555
+ options: localVarRequestOptions,
1556
+ };
1557
+ }),
1558
+ /**
1559
+ * Use this API to view payment details of an order for a payment ID.
1560
+ * @summary Get Payment by ID
1561
+
1562
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1563
+ * @param {string} order_id The id which uniquely identifies your order
1564
+ * @param {string} cf_payment_id The Cashfree payment or transaction ID.
1565
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1566
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1567
+ * @param {*} [options] Override http request option.
1568
+ * @throws {RequiredError}
1569
+ * x_request_id?: string,
1570
+ */
1571
+ pGOrderFetchPayment: (x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1572
+ // verify required parameter 'x_api_version' is not null or undefined
1573
+ assertParamExists('pGOrderFetchPayment', 'x_api_version', x_api_version);
1574
+ // verify required parameter 'order_id' is not null or undefined
1575
+ assertParamExists('pGOrderFetchPayment', 'order_id', order_id);
1576
+ // verify required parameter 'cf_payment_id' is not null or undefined
1577
+ assertParamExists('pGOrderFetchPayment', 'cf_payment_id', cf_payment_id);
1578
+ const localVarPath = `/orders/{order_id}/payments/{cf_payment_id}`
1579
+ .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id)))
1580
+ .replace(`{${"cf_payment_id"}}`, encodeURIComponent(String(cf_payment_id)));
1581
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1582
+ var url = "https://sandbox.cashfree.com/pg";
1583
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1584
+ url = "https://api.cashfree.com/pg";
1585
+ }
1586
+ const localVarUrlObj = new URL(localVarPath, url);
1587
+ let baseOptions;
1588
+ if (configuration) {
1589
+ baseOptions = configuration.baseOptions;
1590
+ }
1591
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1592
+ const localVarHeaderParameter = {};
1593
+ const localVarQueryParameter = {};
1594
+ // authentication XPartnerAPIKey required
1595
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
1596
+ // authentication XClientSecret required
1597
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
1598
+ // authentication XPartnerMerchantID required
1599
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
1600
+ // authentication XClientID required
1601
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
1602
+ // authentication XClientSignatureHeader required
1603
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
1604
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1605
+ if (x_api_version != null && x_api_version != undefined) {
1606
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1607
+ }
1608
+ if (x_request_id != null && x_request_id != undefined) {
1609
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1610
+ }
1611
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1612
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1613
+ }
1614
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1615
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1616
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1617
+ return {
1618
+ url: toPathString(localVarUrlObj),
1619
+ options: localVarRequestOptions,
1620
+ };
1621
+ }),
1622
+ /**
1623
+ * Use this API to view all payment details for an order.
1624
+ * @summary Get Payments for an Order
1625
+
1626
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1627
+ * @param {string} order_id The id which uniquely identifies your order
1628
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1629
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1630
+ * @param {*} [options] Override http request option.
1631
+ * @throws {RequiredError}
1632
+ * x_idempotency_key?: string,
1633
+ */
1634
+ pGOrderFetchPayments: (x_api_version, order_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1635
+ // verify required parameter 'x_api_version' is not null or undefined
1636
+ assertParamExists('pGOrderFetchPayments', 'x_api_version', x_api_version);
1637
+ // verify required parameter 'order_id' is not null or undefined
1638
+ assertParamExists('pGOrderFetchPayments', 'order_id', order_id);
1639
+ const localVarPath = `/orders/{order_id}/payments`
1640
+ .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id)));
1641
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1642
+ var url = "https://sandbox.cashfree.com/pg";
1643
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1644
+ url = "https://api.cashfree.com/pg";
1645
+ }
1646
+ const localVarUrlObj = new URL(localVarPath, url);
1647
+ let baseOptions;
1648
+ if (configuration) {
1649
+ baseOptions = configuration.baseOptions;
1650
+ }
1651
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1652
+ const localVarHeaderParameter = {};
1653
+ const localVarQueryParameter = {};
1654
+ // authentication XPartnerAPIKey required
1655
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
1656
+ // authentication XClientSecret required
1657
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
1658
+ // authentication XPartnerMerchantID required
1659
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
1660
+ // authentication XClientID required
1661
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
1662
+ // authentication XClientSignatureHeader required
1663
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
1664
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1665
+ if (x_api_version != null && x_api_version != undefined) {
1666
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1667
+ }
1668
+ if (x_request_id != null && x_request_id != undefined) {
1669
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1670
+ }
1671
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1672
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1673
+ }
1674
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1675
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1676
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1677
+ return {
1678
+ url: toPathString(localVarUrlObj),
1679
+ options: localVarRequestOptions,
1680
+ };
1681
+ }),
1682
+ /**
1683
+ * 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\".
1684
+ * @summary Order Pay
1685
+
1686
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1687
+ * @param {PayOrderRequest} PayOrderRequest Request body to create a transaction at cashfree using `payment_session_id`
1688
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1689
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1690
+ * @param {*} [options] Override http request option.
1691
+ * @throws {RequiredError}
1692
+ * x_idempotency_key?: string,
1693
+ */
1694
+ pGPayOrder: (x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1695
+ // verify required parameter 'x_api_version' is not null or undefined
1696
+ assertParamExists('pGPayOrder', 'x_api_version', x_api_version);
1697
+ // verify required parameter 'PayOrderRequest' is not null or undefined
1698
+ assertParamExists('pGPayOrder', 'PayOrderRequest', PayOrderRequest);
1699
+ const localVarPath = `/orders/sessions`;
1700
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1701
+ var url = "https://sandbox.cashfree.com/pg";
1702
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1703
+ url = "https://api.cashfree.com/pg";
1704
+ }
1705
+ const localVarUrlObj = new URL(localVarPath, url);
1706
+ let baseOptions;
1707
+ if (configuration) {
1708
+ baseOptions = configuration.baseOptions;
1709
+ }
1710
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1711
+ const localVarHeaderParameter = {};
1712
+ const localVarQueryParameter = {};
1713
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1714
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1715
+ if (x_api_version != null && x_api_version != undefined) {
1716
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1717
+ }
1718
+ if (x_request_id != null && x_request_id != undefined) {
1719
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1720
+ }
1721
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1722
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1723
+ }
1724
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1725
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1726
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1727
+ localVarRequestOptions.data = serializeDataIfNeeded(PayOrderRequest, localVarRequestOptions, configuration);
1728
+ return {
1729
+ url: toPathString(localVarUrlObj),
1730
+ options: localVarRequestOptions,
1731
+ };
1732
+ }),
1733
+ };
1734
+ };
1735
+ /**
1736
+ * PaymentsApi - functional programming interface
1737
+ * @export
1738
+ */
1739
+ const PaymentsApiFp = function (configuration) {
1740
+ const localVarAxiosParamCreator = PaymentsApiAxiosParamCreator(configuration);
1741
+ return {
1742
+ /**
1743
+ * Use this API to capture or void a preauthorized payment
1744
+ * @summary Preauthorization
1745
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1746
+ * @param {string} order_id The id which uniquely identifies your order
1747
+ * @param {AuthorizeOrderRequest} AuthorizeOrderRequest Request to Capture or Void Transactions
1748
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1749
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1750
+ * @param {*} [options] Override http request option.
1751
+ * @throws {RequiredError}
1752
+ */
1753
+ pGAuthorizeOrder(x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options) {
1754
+ return __awaiter(this, void 0, void 0, function* () {
1755
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGAuthorizeOrder(x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options);
1756
+ var url = "https://sandbox.cashfree.com/pg";
1757
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1758
+ url = "https://api.cashfree.com/pg";
1759
+ }
1760
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
1761
+ });
1762
+ },
1763
+ /**
1764
+ * If you accept OTP on your own page, you can use the below API to send OTP to Cashfree.
1765
+ * @summary Submit or Resend OTP
1766
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1767
+ * @param {string} cf_payment_id The Cashfree payment or transaction ID.
1768
+ * @param {OrderAuthenticatePaymentRequest} OrderAuthenticatePaymentRequest Request body to submit/resend headless OTP. To use this API make sure you have headless OTP enabled for your account
1769
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1770
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1771
+ * @param {*} [options] Override http request option.
1772
+ * @throws {RequiredError}
1773
+ */
1774
+ pGOrderAuthenticatePayment(x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options) {
1775
+ return __awaiter(this, void 0, void 0, function* () {
1776
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGOrderAuthenticatePayment(x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options);
1777
+ var url = "https://sandbox.cashfree.com/pg";
1778
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1779
+ url = "https://api.cashfree.com/pg";
1780
+ }
1781
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
1782
+ });
1783
+ },
1784
+ /**
1785
+ * Use this API to view payment details of an order for a payment ID.
1786
+ * @summary Get Payment by ID
1787
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1788
+ * @param {string} order_id The id which uniquely identifies your order
1789
+ * @param {string} cf_payment_id The Cashfree payment or transaction ID.
1790
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1791
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1792
+ * @param {*} [options] Override http request option.
1793
+ * @throws {RequiredError}
1794
+ */
1795
+ pGOrderFetchPayment(x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options) {
1796
+ return __awaiter(this, void 0, void 0, function* () {
1797
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGOrderFetchPayment(x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options);
1798
+ var url = "https://sandbox.cashfree.com/pg";
1799
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1800
+ url = "https://api.cashfree.com/pg";
1801
+ }
1802
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
1803
+ });
1804
+ },
1805
+ /**
1806
+ * Use this API to view all payment details for an order.
1807
+ * @summary Get Payments for an Order
1808
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1809
+ * @param {string} order_id The id which uniquely identifies your order
1810
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1811
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1812
+ * @param {*} [options] Override http request option.
1813
+ * @throws {RequiredError}
1814
+ */
1815
+ pGOrderFetchPayments(x_api_version, order_id, x_request_id, x_idempotency_key, options) {
1816
+ return __awaiter(this, void 0, void 0, function* () {
1817
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGOrderFetchPayments(x_api_version, order_id, x_request_id, x_idempotency_key, options);
1818
+ var url = "https://sandbox.cashfree.com/pg";
1819
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1820
+ url = "https://api.cashfree.com/pg";
1821
+ }
1822
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
1823
+ });
1824
+ },
1825
+ /**
1826
+ * 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\".
1827
+ * @summary Order Pay
1828
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1829
+ * @param {PayOrderRequest} PayOrderRequest Request body to create a transaction at cashfree using `payment_session_id`
1830
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1831
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1832
+ * @param {*} [options] Override http request option.
1833
+ * @throws {RequiredError}
1834
+ */
1835
+ pGPayOrder(x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options) {
1836
+ return __awaiter(this, void 0, void 0, function* () {
1837
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGPayOrder(x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options);
1838
+ var url = "https://sandbox.cashfree.com/pg";
1839
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1840
+ url = "https://api.cashfree.com/pg";
1841
+ }
1842
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
1843
+ });
1844
+ },
1845
+ };
1846
+ };
1847
+ /**
1848
+ * PaymentsApi - object-oriented interface
1849
+ * @export
1850
+ * @class PaymentsApi
1851
+ * @extends {BaseAPI}
1852
+ */
1853
+ /**
1854
+ * RefundsApi - axios parameter creator
1855
+ * @export
1856
+ */
1857
+ const RefundsApiAxiosParamCreator = function (configuration) {
1858
+ return {
1859
+ /**
1860
+ * Use this API to initiate refunds.
1861
+ * @summary Create Refund
1862
+
1863
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1864
+ * @param {string} order_id The id which uniquely identifies your order
1865
+ * @param {OrderCreateRefundRequest} OrderCreateRefundRequest Request Body to Create Refunds
1866
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1867
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1868
+ * @param {*} [options] Override http request option.
1869
+ * @throws {RequiredError}
1870
+ * x_request_id?: string,
1871
+ */
1872
+ pGOrderCreateRefund: (x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1873
+ // verify required parameter 'x_api_version' is not null or undefined
1874
+ assertParamExists('pGOrderCreateRefund', 'x_api_version', x_api_version);
1875
+ // verify required parameter 'order_id' is not null or undefined
1876
+ assertParamExists('pGOrderCreateRefund', 'order_id', order_id);
1877
+ // verify required parameter 'OrderCreateRefundRequest' is not null or undefined
1878
+ assertParamExists('pGOrderCreateRefund', 'OrderCreateRefundRequest', OrderCreateRefundRequest);
1879
+ const localVarPath = `/orders/{order_id}/refunds`
1880
+ .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id)));
1881
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1882
+ var url = "https://sandbox.cashfree.com/pg";
1883
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1884
+ url = "https://api.cashfree.com/pg";
1885
+ }
1886
+ const localVarUrlObj = new URL(localVarPath, url);
1887
+ let baseOptions;
1888
+ if (configuration) {
1889
+ baseOptions = configuration.baseOptions;
1890
+ }
1891
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1892
+ const localVarHeaderParameter = {};
1893
+ const localVarQueryParameter = {};
1894
+ // authentication XPartnerAPIKey required
1895
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
1896
+ // authentication XClientSecret required
1897
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
1898
+ // authentication XPartnerMerchantID required
1899
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
1900
+ // authentication XClientID required
1901
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
1902
+ // authentication XClientSignatureHeader required
1903
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
1904
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1905
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1906
+ if (x_api_version != null && x_api_version != undefined) {
1907
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1908
+ }
1909
+ if (x_request_id != null && x_request_id != undefined) {
1910
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1911
+ }
1912
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1913
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1914
+ }
1915
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1916
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1917
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1918
+ localVarRequestOptions.data = serializeDataIfNeeded(OrderCreateRefundRequest, localVarRequestOptions, configuration);
1919
+ return {
1920
+ url: toPathString(localVarUrlObj),
1921
+ options: localVarRequestOptions,
1922
+ };
1923
+ }),
1924
+ /**
1925
+ * Use this API to fetch a specific refund processed on your Cashfree Account.
1926
+ * @summary Get Refund
1927
+
1928
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1929
+ * @param {string} order_id The id which uniquely identifies your order
1930
+ * @param {string} refund_id Refund Id of the refund you want to fetch.
1931
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1932
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1933
+ * @param {*} [options] Override http request option.
1934
+ * @throws {RequiredError}
1935
+ * x_request_id?: string,
1936
+ */
1937
+ pGOrderFetchRefund: (x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
1938
+ // verify required parameter 'x_api_version' is not null or undefined
1939
+ assertParamExists('pGOrderFetchRefund', 'x_api_version', x_api_version);
1940
+ // verify required parameter 'order_id' is not null or undefined
1941
+ assertParamExists('pGOrderFetchRefund', 'order_id', order_id);
1942
+ // verify required parameter 'refund_id' is not null or undefined
1943
+ assertParamExists('pGOrderFetchRefund', 'refund_id', refund_id);
1944
+ const localVarPath = `/orders/{order_id}/refunds/{refund_id}`
1945
+ .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id)))
1946
+ .replace(`{${"refund_id"}}`, encodeURIComponent(String(refund_id)));
1947
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1948
+ var url = "https://sandbox.cashfree.com/pg";
1949
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
1950
+ url = "https://api.cashfree.com/pg";
1951
+ }
1952
+ const localVarUrlObj = new URL(localVarPath, url);
1953
+ let baseOptions;
1954
+ if (configuration) {
1955
+ baseOptions = configuration.baseOptions;
1956
+ }
1957
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1958
+ const localVarHeaderParameter = {};
1959
+ const localVarQueryParameter = {};
1960
+ // authentication XPartnerAPIKey required
1961
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
1962
+ // authentication XClientSecret required
1963
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
1964
+ // authentication XPartnerMerchantID required
1965
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
1966
+ // authentication XClientID required
1967
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
1968
+ // authentication XClientSignatureHeader required
1969
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
1970
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
1971
+ if (x_api_version != null && x_api_version != undefined) {
1972
+ localVarHeaderParameter['x-api-version'] = x_api_version;
1973
+ }
1974
+ if (x_request_id != null && x_request_id != undefined) {
1975
+ localVarHeaderParameter['x-request-id'] = x_request_id;
1976
+ }
1977
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
1978
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
1979
+ }
1980
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1981
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1982
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1983
+ return {
1984
+ url: toPathString(localVarUrlObj),
1985
+ options: localVarRequestOptions,
1986
+ };
1987
+ }),
1988
+ /**
1989
+ * Use this API to fetch all refunds processed against an order.
1990
+ * @summary Get All Refunds for an Order
1991
+
1992
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
1993
+ * @param {string} order_id The id which uniquely identifies your order
1994
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
1995
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
1996
+ * @param {*} [options] Override http request option.
1997
+ * @throws {RequiredError}
1998
+ * x_idempotency_key?: string,
1999
+ */
2000
+ pGOrderFetchRefunds: (x_api_version, order_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
2001
+ // verify required parameter 'x_api_version' is not null or undefined
2002
+ assertParamExists('pGOrderFetchRefunds', 'x_api_version', x_api_version);
2003
+ // verify required parameter 'order_id' is not null or undefined
2004
+ assertParamExists('pGOrderFetchRefunds', 'order_id', order_id);
2005
+ const localVarPath = `/orders/{order_id}/refunds`
2006
+ .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id)));
2007
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2008
+ var url = "https://sandbox.cashfree.com/pg";
2009
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2010
+ url = "https://api.cashfree.com/pg";
2011
+ }
2012
+ const localVarUrlObj = new URL(localVarPath, url);
2013
+ let baseOptions;
2014
+ if (configuration) {
2015
+ baseOptions = configuration.baseOptions;
2016
+ }
2017
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2018
+ const localVarHeaderParameter = {};
2019
+ const localVarQueryParameter = {};
2020
+ // authentication XPartnerAPIKey required
2021
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2022
+ // authentication XClientSecret required
2023
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2024
+ // authentication XPartnerMerchantID required
2025
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2026
+ // authentication XClientID required
2027
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2028
+ // authentication XClientSignatureHeader required
2029
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2030
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2031
+ if (x_api_version != null && x_api_version != undefined) {
2032
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2033
+ }
2034
+ if (x_request_id != null && x_request_id != undefined) {
2035
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2036
+ }
2037
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2038
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2039
+ }
2040
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2041
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2042
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2043
+ return {
2044
+ url: toPathString(localVarUrlObj),
2045
+ options: localVarRequestOptions,
2046
+ };
2047
+ }),
2048
+ };
2049
+ };
2050
+ /**
2051
+ * RefundsApi - functional programming interface
2052
+ * @export
2053
+ */
2054
+ const RefundsApiFp = function (configuration) {
2055
+ const localVarAxiosParamCreator = RefundsApiAxiosParamCreator(configuration);
2056
+ return {
2057
+ /**
2058
+ * Use this API to initiate refunds.
2059
+ * @summary Create Refund
2060
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2061
+ * @param {string} order_id The id which uniquely identifies your order
2062
+ * @param {OrderCreateRefundRequest} OrderCreateRefundRequest Request Body to Create Refunds
2063
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2064
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2065
+ * @param {*} [options] Override http request option.
2066
+ * @throws {RequiredError}
2067
+ */
2068
+ pGOrderCreateRefund(x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options) {
2069
+ return __awaiter(this, void 0, void 0, function* () {
2070
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGOrderCreateRefund(x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options);
2071
+ var url = "https://sandbox.cashfree.com/pg";
2072
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2073
+ url = "https://api.cashfree.com/pg";
2074
+ }
2075
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
2076
+ });
2077
+ },
2078
+ /**
2079
+ * Use this API to fetch a specific refund processed on your Cashfree Account.
2080
+ * @summary Get Refund
2081
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2082
+ * @param {string} order_id The id which uniquely identifies your order
2083
+ * @param {string} refund_id Refund Id of the refund you want to fetch.
2084
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2085
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2086
+ * @param {*} [options] Override http request option.
2087
+ * @throws {RequiredError}
2088
+ */
2089
+ pGOrderFetchRefund(x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options) {
2090
+ return __awaiter(this, void 0, void 0, function* () {
2091
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGOrderFetchRefund(x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options);
2092
+ var url = "https://sandbox.cashfree.com/pg";
2093
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2094
+ url = "https://api.cashfree.com/pg";
2095
+ }
2096
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
2097
+ });
2098
+ },
2099
+ /**
2100
+ * Use this API to fetch all refunds processed against an order.
2101
+ * @summary Get All Refunds for an Order
2102
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2103
+ * @param {string} order_id The id which uniquely identifies your order
2104
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2105
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2106
+ * @param {*} [options] Override http request option.
2107
+ * @throws {RequiredError}
2108
+ */
2109
+ pGOrderFetchRefunds(x_api_version, order_id, x_request_id, x_idempotency_key, options) {
2110
+ return __awaiter(this, void 0, void 0, function* () {
2111
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGOrderFetchRefunds(x_api_version, order_id, x_request_id, x_idempotency_key, options);
2112
+ var url = "https://sandbox.cashfree.com/pg";
2113
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2114
+ url = "https://api.cashfree.com/pg";
2115
+ }
2116
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
2117
+ });
2118
+ },
2119
+ };
2120
+ };
2121
+ /**
2122
+ * RefundsApi - object-oriented interface
2123
+ * @export
2124
+ * @class RefundsApi
2125
+ * @extends {BaseAPI}
2126
+ */
2127
+ /**
2128
+ * SettlementReconciliationApi - axios parameter creator
2129
+ * @export
2130
+ */
2131
+ const SettlementReconciliationApiAxiosParamCreator = function (configuration) {
2132
+ return {
2133
+ /**
2134
+ * Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range.
2135
+ * @summary Get All Settlements
2136
+
2137
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2138
+ * @param {FetchSettlementsRequest} FetchSettlementsRequest Request Body to get the settlements
2139
+ * @param {string} [Content_Type] application/json
2140
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2141
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2142
+ * @param {string} [Accept] application/json
2143
+ * @param {*} [options] Override http request option.
2144
+ * @throws {RequiredError}
2145
+ * x_request_id?: string,
2146
+ */
2147
+ pGFetchSettlements: (x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options = {}) => __awaiter(this, void 0, void 0, function* () {
2148
+ // verify required parameter 'x_api_version' is not null or undefined
2149
+ assertParamExists('pGFetchSettlements', 'x_api_version', x_api_version);
2150
+ // verify required parameter 'FetchSettlementsRequest' is not null or undefined
2151
+ assertParamExists('pGFetchSettlements', 'FetchSettlementsRequest', FetchSettlementsRequest);
2152
+ const localVarPath = `/settlements`;
2153
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2154
+ var url = "https://sandbox.cashfree.com/pg";
2155
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2156
+ url = "https://api.cashfree.com/pg";
2157
+ }
2158
+ const localVarUrlObj = new URL(localVarPath, url);
2159
+ let baseOptions;
2160
+ if (configuration) {
2161
+ baseOptions = configuration.baseOptions;
2162
+ }
2163
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
2164
+ const localVarHeaderParameter = {};
2165
+ const localVarQueryParameter = {};
2166
+ // authentication XPartnerAPIKey required
2167
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2168
+ // authentication XClientSecret required
2169
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2170
+ // authentication XPartnerMerchantID required
2171
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2172
+ // authentication XClientID required
2173
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2174
+ // authentication XClientSignatureHeader required
2175
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2176
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2177
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2178
+ if (x_api_version != null && x_api_version != undefined) {
2179
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2180
+ }
2181
+ if (x_request_id != null && x_request_id != undefined) {
2182
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2183
+ }
2184
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2185
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2186
+ }
2187
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2188
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2189
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2190
+ localVarRequestOptions.data = serializeDataIfNeeded(FetchSettlementsRequest, localVarRequestOptions, configuration);
2191
+ return {
2192
+ url: toPathString(localVarUrlObj),
2193
+ options: localVarRequestOptions,
2194
+ };
2195
+ }),
2196
+ /**
2197
+ * - 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
2198
+ * @summary Settlement Reconciliation
2199
+
2200
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2201
+ * @param {SettlementFetchReconRequest} SettlementFetchReconRequest Request Body for the settlement reconciliation
2202
+ * @param {string} [Content_Type] application/json
2203
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2204
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2205
+ * @param {string} [Accept] application/json
2206
+ * @param {*} [options] Override http request option.
2207
+ * @throws {RequiredError}
2208
+ * x_request_id?: string,
2209
+ */
2210
+ pGSettlementFetchRecon: (x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options = {}) => __awaiter(this, void 0, void 0, function* () {
2211
+ // verify required parameter 'x_api_version' is not null or undefined
2212
+ assertParamExists('pGSettlementFetchRecon', 'x_api_version', x_api_version);
2213
+ // verify required parameter 'SettlementFetchReconRequest' is not null or undefined
2214
+ assertParamExists('pGSettlementFetchRecon', 'SettlementFetchReconRequest', SettlementFetchReconRequest);
2215
+ const localVarPath = `/settlement/recon`;
2216
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2217
+ var url = "https://sandbox.cashfree.com/pg";
2218
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2219
+ url = "https://api.cashfree.com/pg";
2220
+ }
2221
+ const localVarUrlObj = new URL(localVarPath, url);
2222
+ let baseOptions;
2223
+ if (configuration) {
2224
+ baseOptions = configuration.baseOptions;
2225
+ }
2226
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
2227
+ const localVarHeaderParameter = {};
2228
+ const localVarQueryParameter = {};
2229
+ // authentication XPartnerAPIKey required
2230
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2231
+ // authentication XClientSecret required
2232
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2233
+ // authentication XPartnerMerchantID required
2234
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2235
+ // authentication XClientID required
2236
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2237
+ // authentication XClientSignatureHeader required
2238
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2239
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2240
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2241
+ if (x_api_version != null && x_api_version != undefined) {
2242
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2243
+ }
2244
+ if (x_request_id != null && x_request_id != undefined) {
2245
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2246
+ }
2247
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2248
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2249
+ }
2250
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2251
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2252
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2253
+ localVarRequestOptions.data = serializeDataIfNeeded(SettlementFetchReconRequest, localVarRequestOptions, configuration);
2254
+ return {
2255
+ url: toPathString(localVarUrlObj),
2256
+ options: localVarRequestOptions,
2257
+ };
2258
+ }),
2259
+ };
2260
+ };
2261
+ /**
2262
+ * SettlementReconciliationApi - functional programming interface
2263
+ * @export
2264
+ */
2265
+ const SettlementReconciliationApiFp = function (configuration) {
2266
+ const localVarAxiosParamCreator = SettlementReconciliationApiAxiosParamCreator(configuration);
2267
+ return {
2268
+ /**
2269
+ * Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range.
2270
+ * @summary Get All Settlements
2271
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2272
+ * @param {FetchSettlementsRequest} FetchSettlementsRequest Request Body to get the settlements
2273
+ * @param {string} [Content_Type] application/json
2274
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2275
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2276
+ * @param {string} [Accept] application/json
2277
+ * @param {*} [options] Override http request option.
2278
+ * @throws {RequiredError}
2279
+ */
2280
+ pGFetchSettlements(x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options) {
2281
+ return __awaiter(this, void 0, void 0, function* () {
2282
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGFetchSettlements(x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options);
2283
+ var url = "https://sandbox.cashfree.com/pg";
2284
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2285
+ url = "https://api.cashfree.com/pg";
2286
+ }
2287
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
2288
+ });
2289
+ },
2290
+ /**
2291
+ * - 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
2292
+ * @summary Settlement Reconciliation
2293
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2294
+ * @param {SettlementFetchReconRequest} SettlementFetchReconRequest Request Body for the settlement reconciliation
2295
+ * @param {string} [Content_Type] application/json
2296
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2297
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2298
+ * @param {string} [Accept] application/json
2299
+ * @param {*} [options] Override http request option.
2300
+ * @throws {RequiredError}
2301
+ */
2302
+ pGSettlementFetchRecon(x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options) {
2303
+ return __awaiter(this, void 0, void 0, function* () {
2304
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGSettlementFetchRecon(x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options);
2305
+ var url = "https://sandbox.cashfree.com/pg";
2306
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2307
+ url = "https://api.cashfree.com/pg";
2308
+ }
2309
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
2310
+ });
2311
+ },
2312
+ };
2313
+ };
2314
+ /**
2315
+ * SettlementReconciliationApi - object-oriented interface
2316
+ * @export
2317
+ * @class SettlementReconciliationApi
2318
+ * @extends {BaseAPI}
2319
+ */
2320
+ /**
2321
+ * SettlementsApi - axios parameter creator
2322
+ * @export
2323
+ */
2324
+ const SettlementsApiAxiosParamCreator = function (configuration) {
2325
+ return {
2326
+ /**
2327
+ * Use this API to view all the settlements of a particular order.
2328
+ * @summary Get Settlements by Order ID
2329
+
2330
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2331
+ * @param {string} order_id The id which uniquely identifies your order
2332
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2333
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2334
+ * @param {*} [options] Override http request option.
2335
+ * @throws {RequiredError}
2336
+ * x_idempotency_key?: string,
2337
+ */
2338
+ pGOrderFetchSettlement: (x_api_version, order_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
2339
+ // verify required parameter 'x_api_version' is not null or undefined
2340
+ assertParamExists('pGOrderFetchSettlement', 'x_api_version', x_api_version);
2341
+ // verify required parameter 'order_id' is not null or undefined
2342
+ assertParamExists('pGOrderFetchSettlement', 'order_id', order_id);
2343
+ const localVarPath = `/orders/{order_id}/settlements`
2344
+ .replace(`{${"order_id"}}`, encodeURIComponent(String(order_id)));
2345
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2346
+ var url = "https://sandbox.cashfree.com/pg";
2347
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2348
+ url = "https://api.cashfree.com/pg";
2349
+ }
2350
+ const localVarUrlObj = new URL(localVarPath, url);
2351
+ let baseOptions;
2352
+ if (configuration) {
2353
+ baseOptions = configuration.baseOptions;
2354
+ }
2355
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2356
+ const localVarHeaderParameter = {};
2357
+ const localVarQueryParameter = {};
2358
+ // authentication XPartnerAPIKey required
2359
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2360
+ // authentication XClientSecret required
2361
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2362
+ // authentication XPartnerMerchantID required
2363
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2364
+ // authentication XClientID required
2365
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2366
+ // authentication XClientSignatureHeader required
2367
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2368
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2369
+ if (x_api_version != null && x_api_version != undefined) {
2370
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2371
+ }
2372
+ if (x_request_id != null && x_request_id != undefined) {
2373
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2374
+ }
2375
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2376
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2377
+ }
2378
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2379
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2380
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2381
+ return {
2382
+ url: toPathString(localVarUrlObj),
2383
+ options: localVarRequestOptions,
2384
+ };
2385
+ }),
2386
+ };
2387
+ };
2388
+ /**
2389
+ * SettlementsApi - functional programming interface
2390
+ * @export
2391
+ */
2392
+ const SettlementsApiFp = function (configuration) {
2393
+ const localVarAxiosParamCreator = SettlementsApiAxiosParamCreator(configuration);
2394
+ return {
2395
+ /**
2396
+ * Use this API to view all the settlements of a particular order.
2397
+ * @summary Get Settlements by Order ID
2398
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2399
+ * @param {string} order_id The id which uniquely identifies your order
2400
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2401
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2402
+ * @param {*} [options] Override http request option.
2403
+ * @throws {RequiredError}
2404
+ */
2405
+ pGOrderFetchSettlement(x_api_version, order_id, x_request_id, x_idempotency_key, options) {
2406
+ return __awaiter(this, void 0, void 0, function* () {
2407
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGOrderFetchSettlement(x_api_version, order_id, x_request_id, x_idempotency_key, options);
2408
+ var url = "https://sandbox.cashfree.com/pg";
2409
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2410
+ url = "https://api.cashfree.com/pg";
2411
+ }
2412
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
2413
+ });
2414
+ },
2415
+ };
2416
+ };
2417
+ /**
2418
+ * SettlementsApi - object-oriented interface
2419
+ * @export
2420
+ * @class SettlementsApi
2421
+ * @extends {BaseAPI}
2422
+ */
2423
+ /**
2424
+ * SoftPOSApi - axios parameter creator
2425
+ * @export
2426
+ */
2427
+ const SoftPOSApiAxiosParamCreator = function (configuration) {
2428
+ return {
2429
+ /**
2430
+ * Use this API to create new terminals to use softPOS.
2431
+ * @summary Create Terminal
2432
+
2433
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2434
+ * @param {CreateTerminalRequest} CreateTerminalRequest Request Body to Create Terminal for SPOS
2435
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2436
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2437
+ * @param {*} [options] Override http request option.
2438
+ * @throws {RequiredError}
2439
+ * x_idempotency_key?: string,
2440
+ */
2441
+ sposCreateTerminal: (x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
2442
+ // verify required parameter 'x_api_version' is not null or undefined
2443
+ assertParamExists('sposCreateTerminal', 'x_api_version', x_api_version);
2444
+ // verify required parameter 'CreateTerminalRequest' is not null or undefined
2445
+ assertParamExists('sposCreateTerminal', 'CreateTerminalRequest', CreateTerminalRequest);
2446
+ const localVarPath = `/terminal`;
2447
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2448
+ var url = "https://sandbox.cashfree.com/pg";
2449
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2450
+ url = "https://api.cashfree.com/pg";
2451
+ }
2452
+ const localVarUrlObj = new URL(localVarPath, url);
2453
+ let baseOptions;
2454
+ if (configuration) {
2455
+ baseOptions = configuration.baseOptions;
2456
+ }
2457
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
2458
+ const localVarHeaderParameter = {};
2459
+ const localVarQueryParameter = {};
2460
+ // authentication XPartnerAPIKey required
2461
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2462
+ // authentication XClientSecret required
2463
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2464
+ // authentication XPartnerMerchantID required
2465
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2466
+ // authentication XClientID required
2467
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2468
+ // authentication XClientSignatureHeader required
2469
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2470
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2471
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2472
+ if (x_api_version != null && x_api_version != undefined) {
2473
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2474
+ }
2475
+ if (x_request_id != null && x_request_id != undefined) {
2476
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2477
+ }
2478
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2479
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2480
+ }
2481
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2482
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2483
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2484
+ localVarRequestOptions.data = serializeDataIfNeeded(CreateTerminalRequest, localVarRequestOptions, configuration);
2485
+ return {
2486
+ url: toPathString(localVarUrlObj),
2487
+ options: localVarRequestOptions,
2488
+ };
2489
+ }),
2490
+ /**
2491
+ * 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.
2492
+ * @summary Create Terminal
2493
+
2494
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2495
+ * @param {CreateTerminalTransactionRequest} CreateTerminalTransactionRequest Request body to create a terminal transaction
2496
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2497
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2498
+ * @param {*} [options] Override http request option.
2499
+ * @throws {RequiredError}
2500
+ * x_idempotency_key?: string,
2501
+ */
2502
+ sposCreateTerminalTransaction: (x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
2503
+ // verify required parameter 'x_api_version' is not null or undefined
2504
+ assertParamExists('sposCreateTerminalTransaction', 'x_api_version', x_api_version);
2505
+ // verify required parameter 'CreateTerminalTransactionRequest' is not null or undefined
2506
+ assertParamExists('sposCreateTerminalTransaction', 'CreateTerminalTransactionRequest', CreateTerminalTransactionRequest);
2507
+ const localVarPath = `/terminal/transactions`;
2508
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2509
+ var url = "https://sandbox.cashfree.com/pg";
2510
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2511
+ url = "https://api.cashfree.com/pg";
2512
+ }
2513
+ const localVarUrlObj = new URL(localVarPath, url);
2514
+ let baseOptions;
2515
+ if (configuration) {
2516
+ baseOptions = configuration.baseOptions;
2517
+ }
2518
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
2519
+ const localVarHeaderParameter = {};
2520
+ const localVarQueryParameter = {};
2521
+ // authentication XPartnerAPIKey required
2522
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2523
+ // authentication XClientSecret required
2524
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2525
+ // authentication XPartnerMerchantID required
2526
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2527
+ // authentication XClientID required
2528
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2529
+ // authentication XClientSignatureHeader required
2530
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2531
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2532
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2533
+ if (x_api_version != null && x_api_version != undefined) {
2534
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2535
+ }
2536
+ if (x_request_id != null && x_request_id != undefined) {
2537
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2538
+ }
2539
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2540
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2541
+ }
2542
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2543
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2544
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2545
+ localVarRequestOptions.data = serializeDataIfNeeded(CreateTerminalTransactionRequest, localVarRequestOptions, configuration);
2546
+ return {
2547
+ url: toPathString(localVarUrlObj),
2548
+ options: localVarRequestOptions,
2549
+ };
2550
+ }),
2551
+ /**
2552
+ * Use this API to view all details of a terminal.
2553
+ * @summary Get terminal status using phone number
2554
+
2555
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2556
+ * @param {string} terminal_phone_no The terminal for which you want to view the order details.
2557
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2558
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2559
+ * @param {*} [options] Override http request option.
2560
+ * @throws {RequiredError}
2561
+ * x_idempotency_key?: string,
2562
+ */
2563
+ sposFetchTerminal: (x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
2564
+ // verify required parameter 'x_api_version' is not null or undefined
2565
+ assertParamExists('sposFetchTerminal', 'x_api_version', x_api_version);
2566
+ // verify required parameter 'terminal_phone_no' is not null or undefined
2567
+ assertParamExists('sposFetchTerminal', 'terminal_phone_no', terminal_phone_no);
2568
+ const localVarPath = `/terminal/{terminal_phone_no}`
2569
+ .replace(`{${"terminal_phone_no"}}`, encodeURIComponent(String(terminal_phone_no)));
2570
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2571
+ var url = "https://sandbox.cashfree.com/pg";
2572
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2573
+ url = "https://api.cashfree.com/pg";
2574
+ }
2575
+ const localVarUrlObj = new URL(localVarPath, url);
2576
+ let baseOptions;
2577
+ if (configuration) {
2578
+ baseOptions = configuration.baseOptions;
2579
+ }
2580
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2581
+ const localVarHeaderParameter = {};
2582
+ const localVarQueryParameter = {};
2583
+ // authentication XPartnerAPIKey required
2584
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2585
+ // authentication XClientSecret required
2586
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2587
+ // authentication XPartnerMerchantID required
2588
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2589
+ // authentication XClientID required
2590
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2591
+ // authentication XClientSignatureHeader required
2592
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2593
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2594
+ if (x_api_version != null && x_api_version != undefined) {
2595
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2596
+ }
2597
+ if (x_request_id != null && x_request_id != undefined) {
2598
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2599
+ }
2600
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2601
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2602
+ }
2603
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2604
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2605
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2606
+ return {
2607
+ url: toPathString(localVarUrlObj),
2608
+ options: localVarRequestOptions,
2609
+ };
2610
+ }),
2611
+ /**
2612
+ * 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.
2613
+ * @summary Fetch Terminal QR Codes
2614
+
2615
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2616
+ * @param {string} terminal_phone_no Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request.
2617
+ * @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.
2618
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2619
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2620
+ * @param {*} [options] Override http request option.
2621
+ * @throws {RequiredError}
2622
+ * x_request_id?: string,
2623
+ */
2624
+ sposFetchTerminalQRCodes: (x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
2625
+ // verify required parameter 'x_api_version' is not null or undefined
2626
+ assertParamExists('sposFetchTerminalQRCodes', 'x_api_version', x_api_version);
2627
+ // verify required parameter 'terminal_phone_no' is not null or undefined
2628
+ assertParamExists('sposFetchTerminalQRCodes', 'terminal_phone_no', terminal_phone_no);
2629
+ // verify required parameter 'cf_terminal_id' is not null or undefined
2630
+ assertParamExists('sposFetchTerminalQRCodes', 'cf_terminal_id', cf_terminal_id);
2631
+ const localVarPath = `/terminal/qrcodes`;
2632
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2633
+ var url = "https://sandbox.cashfree.com/pg";
2634
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2635
+ url = "https://api.cashfree.com/pg";
2636
+ }
2637
+ const localVarUrlObj = new URL(localVarPath, url);
2638
+ let baseOptions;
2639
+ if (configuration) {
2640
+ baseOptions = configuration.baseOptions;
2641
+ }
2642
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2643
+ const localVarHeaderParameter = {};
2644
+ const localVarQueryParameter = {};
2645
+ // authentication XPartnerAPIKey required
2646
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2647
+ // authentication XClientSecret required
2648
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2649
+ // authentication XPartnerMerchantID required
2650
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2651
+ // authentication XClientID required
2652
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2653
+ // authentication XClientSignatureHeader required
2654
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2655
+ if (terminal_phone_no !== undefined) {
2656
+ localVarQueryParameter['terminal_phone_no'] = terminal_phone_no;
2657
+ }
2658
+ if (cf_terminal_id !== undefined) {
2659
+ localVarQueryParameter['cf_terminal_id'] = cf_terminal_id;
2660
+ }
2661
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2662
+ if (x_api_version != null && x_api_version != undefined) {
2663
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2664
+ }
2665
+ if (x_request_id != null && x_request_id != undefined) {
2666
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2667
+ }
2668
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2669
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2670
+ }
2671
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2672
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2673
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2674
+ return {
2675
+ url: toPathString(localVarUrlObj),
2676
+ options: localVarRequestOptions,
2677
+ };
2678
+ }),
2679
+ };
2680
+ };
2681
+ /**
2682
+ * SoftPOSApi - functional programming interface
2683
+ * @export
2684
+ */
2685
+ const SoftPOSApiFp = function (configuration) {
2686
+ const localVarAxiosParamCreator = SoftPOSApiAxiosParamCreator(configuration);
2687
+ return {
2688
+ /**
2689
+ * Use this API to create new terminals to use softPOS.
2690
+ * @summary Create Terminal
2691
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2692
+ * @param {CreateTerminalRequest} CreateTerminalRequest Request Body to Create Terminal for SPOS
2693
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2694
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2695
+ * @param {*} [options] Override http request option.
2696
+ * @throws {RequiredError}
2697
+ */
2698
+ sposCreateTerminal(x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options) {
2699
+ return __awaiter(this, void 0, void 0, function* () {
2700
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sposCreateTerminal(x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options);
2701
+ var url = "https://sandbox.cashfree.com/pg";
2702
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2703
+ url = "https://api.cashfree.com/pg";
2704
+ }
2705
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
2706
+ });
2707
+ },
2708
+ /**
2709
+ * 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.
2710
+ * @summary Create Terminal
2711
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2712
+ * @param {CreateTerminalTransactionRequest} CreateTerminalTransactionRequest Request body to create a terminal transaction
2713
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2714
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2715
+ * @param {*} [options] Override http request option.
2716
+ * @throws {RequiredError}
2717
+ */
2718
+ sposCreateTerminalTransaction(x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options) {
2719
+ return __awaiter(this, void 0, void 0, function* () {
2720
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sposCreateTerminalTransaction(x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options);
2721
+ var url = "https://sandbox.cashfree.com/pg";
2722
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2723
+ url = "https://api.cashfree.com/pg";
2724
+ }
2725
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
2726
+ });
2727
+ },
2728
+ /**
2729
+ * Use this API to view all details of a terminal.
2730
+ * @summary Get terminal status using phone number
2731
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2732
+ * @param {string} terminal_phone_no The terminal for which you want to view the order details.
2733
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2734
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2735
+ * @param {*} [options] Override http request option.
2736
+ * @throws {RequiredError}
2737
+ */
2738
+ sposFetchTerminal(x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options) {
2739
+ return __awaiter(this, void 0, void 0, function* () {
2740
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sposFetchTerminal(x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options);
2741
+ var url = "https://sandbox.cashfree.com/pg";
2742
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2743
+ url = "https://api.cashfree.com/pg";
2744
+ }
2745
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
2746
+ });
2747
+ },
2748
+ /**
2749
+ * 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.
2750
+ * @summary Fetch Terminal QR Codes
2751
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2752
+ * @param {string} terminal_phone_no Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request.
2753
+ * @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.
2754
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2755
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2756
+ * @param {*} [options] Override http request option.
2757
+ * @throws {RequiredError}
2758
+ */
2759
+ sposFetchTerminalQRCodes(x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options) {
2760
+ return __awaiter(this, void 0, void 0, function* () {
2761
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sposFetchTerminalQRCodes(x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options);
2762
+ var url = "https://sandbox.cashfree.com/pg";
2763
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2764
+ url = "https://api.cashfree.com/pg";
2765
+ }
2766
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
2767
+ });
2768
+ },
2769
+ };
2770
+ };
2771
+ /**
2772
+ * SoftPOSApi - object-oriented interface
2773
+ * @export
2774
+ * @class SoftPOSApi
2775
+ * @extends {BaseAPI}
2776
+ */
2777
+ /**
2778
+ * TokenVaultApi - axios parameter creator
2779
+ * @export
2780
+ */
2781
+ const TokenVaultApiAxiosParamCreator = function (configuration) {
2782
+ return {
2783
+ /**
2784
+ * Use this API to delete a saved card instrument for a customer_id and instrument_id
2785
+ * @summary Delete Saved Card Instrument
2786
+
2787
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2788
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
2789
+ * @param {string} instrument_id The instrument_id which needs to be deleted
2790
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2791
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2792
+ * @param {*} [options] Override http request option.
2793
+ * @throws {RequiredError}
2794
+ * x_request_id?: string,
2795
+ */
2796
+ pGCustomerDeleteInstrument: (x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
2797
+ // verify required parameter 'x_api_version' is not null or undefined
2798
+ assertParamExists('pGCustomerDeleteInstrument', 'x_api_version', x_api_version);
2799
+ // verify required parameter 'customer_id' is not null or undefined
2800
+ assertParamExists('pGCustomerDeleteInstrument', 'customer_id', customer_id);
2801
+ // verify required parameter 'instrument_id' is not null or undefined
2802
+ assertParamExists('pGCustomerDeleteInstrument', 'instrument_id', instrument_id);
2803
+ const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}`
2804
+ .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id)))
2805
+ .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id)));
2806
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2807
+ var url = "https://sandbox.cashfree.com/pg";
2808
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2809
+ url = "https://api.cashfree.com/pg";
2810
+ }
2811
+ const localVarUrlObj = new URL(localVarPath, url);
2812
+ let baseOptions;
2813
+ if (configuration) {
2814
+ baseOptions = configuration.baseOptions;
2815
+ }
2816
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
2817
+ const localVarHeaderParameter = {};
2818
+ const localVarQueryParameter = {};
2819
+ // authentication XPartnerAPIKey required
2820
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2821
+ // authentication XClientSecret required
2822
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2823
+ // authentication XPartnerMerchantID required
2824
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2825
+ // authentication XClientID required
2826
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2827
+ // authentication XClientSignatureHeader required
2828
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2829
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2830
+ if (x_api_version != null && x_api_version != undefined) {
2831
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2832
+ }
2833
+ if (x_request_id != null && x_request_id != undefined) {
2834
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2835
+ }
2836
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2837
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2838
+ }
2839
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2840
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2841
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2842
+ return {
2843
+ url: toPathString(localVarUrlObj),
2844
+ options: localVarRequestOptions,
2845
+ };
2846
+ }),
2847
+ /**
2848
+ * Use this API to fetch a single specific saved card for a customer_id by it\'s instrument_id
2849
+ * @summary Fetch Specific Saved Card Instrument
2850
+
2851
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2852
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
2853
+ * @param {string} instrument_id The instrument_id of the saved instrument which needs to be queried
2854
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2855
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2856
+ * @param {*} [options] Override http request option.
2857
+ * @throws {RequiredError}
2858
+ * x_request_id?: string,
2859
+ */
2860
+ pGCustomerFetchInstrument: (x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
2861
+ // verify required parameter 'x_api_version' is not null or undefined
2862
+ assertParamExists('pGCustomerFetchInstrument', 'x_api_version', x_api_version);
2863
+ // verify required parameter 'customer_id' is not null or undefined
2864
+ assertParamExists('pGCustomerFetchInstrument', 'customer_id', customer_id);
2865
+ // verify required parameter 'instrument_id' is not null or undefined
2866
+ assertParamExists('pGCustomerFetchInstrument', 'instrument_id', instrument_id);
2867
+ const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}`
2868
+ .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id)))
2869
+ .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id)));
2870
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2871
+ var url = "https://sandbox.cashfree.com/pg";
2872
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2873
+ url = "https://api.cashfree.com/pg";
2874
+ }
2875
+ const localVarUrlObj = new URL(localVarPath, url);
2876
+ let baseOptions;
2877
+ if (configuration) {
2878
+ baseOptions = configuration.baseOptions;
2879
+ }
2880
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2881
+ const localVarHeaderParameter = {};
2882
+ const localVarQueryParameter = {};
2883
+ // authentication XPartnerAPIKey required
2884
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2885
+ // authentication XClientSecret required
2886
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2887
+ // authentication XPartnerMerchantID required
2888
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2889
+ // authentication XClientID required
2890
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2891
+ // authentication XClientSignatureHeader required
2892
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2893
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2894
+ if (x_api_version != null && x_api_version != undefined) {
2895
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2896
+ }
2897
+ if (x_request_id != null && x_request_id != undefined) {
2898
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2899
+ }
2900
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2901
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2902
+ }
2903
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2904
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2905
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2906
+ return {
2907
+ url: toPathString(localVarUrlObj),
2908
+ options: localVarRequestOptions,
2909
+ };
2910
+ }),
2911
+ /**
2912
+ * Use this API to fetch saved cards for a customer_id
2913
+ * @summary Fetch All Saved Card Instrument
2914
+
2915
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2916
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
2917
+ * @param {PGCustomerFetchInstrumentsInstrumentTypeEnum} instrument_type Payment mode or type of saved instrument
2918
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2919
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2920
+ * @param {*} [options] Override http request option.
2921
+ * @throws {RequiredError}
2922
+ * x_request_id?: string,
2923
+ */
2924
+ pGCustomerFetchInstruments: (x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
2925
+ // verify required parameter 'x_api_version' is not null or undefined
2926
+ assertParamExists('pGCustomerFetchInstruments', 'x_api_version', x_api_version);
2927
+ // verify required parameter 'customer_id' is not null or undefined
2928
+ assertParamExists('pGCustomerFetchInstruments', 'customer_id', customer_id);
2929
+ // verify required parameter 'instrument_type' is not null or undefined
2930
+ assertParamExists('pGCustomerFetchInstruments', 'instrument_type', instrument_type);
2931
+ const localVarPath = `/customers/{customer_id}/instruments`
2932
+ .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id)));
2933
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2934
+ var url = "https://sandbox.cashfree.com/pg";
2935
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
2936
+ url = "https://api.cashfree.com/pg";
2937
+ }
2938
+ const localVarUrlObj = new URL(localVarPath, url);
2939
+ let baseOptions;
2940
+ if (configuration) {
2941
+ baseOptions = configuration.baseOptions;
2942
+ }
2943
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2944
+ const localVarHeaderParameter = {};
2945
+ const localVarQueryParameter = {};
2946
+ // authentication XPartnerAPIKey required
2947
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
2948
+ // authentication XClientSecret required
2949
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
2950
+ // authentication XPartnerMerchantID required
2951
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
2952
+ // authentication XClientID required
2953
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
2954
+ // authentication XClientSignatureHeader required
2955
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
2956
+ if (instrument_type !== undefined) {
2957
+ localVarQueryParameter['instrument_type'] = instrument_type;
2958
+ }
2959
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
2960
+ if (x_api_version != null && x_api_version != undefined) {
2961
+ localVarHeaderParameter['x-api-version'] = x_api_version;
2962
+ }
2963
+ if (x_request_id != null && x_request_id != undefined) {
2964
+ localVarHeaderParameter['x-request-id'] = x_request_id;
2965
+ }
2966
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
2967
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
2968
+ }
2969
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2970
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2971
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2972
+ return {
2973
+ url: toPathString(localVarUrlObj),
2974
+ options: localVarRequestOptions,
2975
+ };
2976
+ }),
2977
+ /**
2978
+ * Use this API To get the card network token, token expiry and cryptogram for a saved card instrument using instrument id
2979
+ * @summary Fetch cryptogram for a saved card instrument
2980
+
2981
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
2982
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
2983
+ * @param {string} instrument_id The instrument_id of the saved card instrument which needs to be queried
2984
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
2985
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
2986
+ * @param {*} [options] Override http request option.
2987
+ * @throws {RequiredError}
2988
+ * x_request_id?: string,
2989
+ */
2990
+ pGCustomerInstrumentsFetchCryptogram: (x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options = {}) => __awaiter(this, void 0, void 0, function* () {
2991
+ // verify required parameter 'x_api_version' is not null or undefined
2992
+ assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'x_api_version', x_api_version);
2993
+ // verify required parameter 'customer_id' is not null or undefined
2994
+ assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'customer_id', customer_id);
2995
+ // verify required parameter 'instrument_id' is not null or undefined
2996
+ assertParamExists('pGCustomerInstrumentsFetchCryptogram', 'instrument_id', instrument_id);
2997
+ const localVarPath = `/customers/{customer_id}/instruments/{instrument_id}/cryptogram`
2998
+ .replace(`{${"customer_id"}}`, encodeURIComponent(String(customer_id)))
2999
+ .replace(`{${"instrument_id"}}`, encodeURIComponent(String(instrument_id)));
3000
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3001
+ var url = "https://sandbox.cashfree.com/pg";
3002
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
3003
+ url = "https://api.cashfree.com/pg";
3004
+ }
3005
+ const localVarUrlObj = new URL(localVarPath, url);
3006
+ let baseOptions;
3007
+ if (configuration) {
3008
+ baseOptions = configuration.baseOptions;
3009
+ }
3010
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
3011
+ const localVarHeaderParameter = {};
3012
+ const localVarQueryParameter = {};
3013
+ // authentication XPartnerAPIKey required
3014
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-apikey");
3015
+ // authentication XClientSecret required
3016
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-secret");
3017
+ // authentication XPartnerMerchantID required
3018
+ yield setApiKeyToObject(localVarHeaderParameter, "x-partner-merchantid");
3019
+ // authentication XClientID required
3020
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-id");
3021
+ // authentication XClientSignatureHeader required
3022
+ yield setApiKeyToObject(localVarHeaderParameter, "x-client-signature");
3023
+ localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.0.0';
3024
+ if (x_api_version != null && x_api_version != undefined) {
3025
+ localVarHeaderParameter['x-api-version'] = x_api_version;
3026
+ }
3027
+ if (x_request_id != null && x_request_id != undefined) {
3028
+ localVarHeaderParameter['x-request-id'] = x_request_id;
3029
+ }
3030
+ if (x_idempotency_key != null && x_idempotency_key != undefined) {
3031
+ localVarHeaderParameter['x-idempotency-key'] = x_idempotency_key;
3032
+ }
3033
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3034
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3035
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
3036
+ return {
3037
+ url: toPathString(localVarUrlObj),
3038
+ options: localVarRequestOptions,
3039
+ };
3040
+ }),
3041
+ };
3042
+ };
3043
+ /**
3044
+ * TokenVaultApi - functional programming interface
3045
+ * @export
3046
+ */
3047
+ const TokenVaultApiFp = function (configuration) {
3048
+ const localVarAxiosParamCreator = TokenVaultApiAxiosParamCreator(configuration);
3049
+ return {
3050
+ /**
3051
+ * Use this API to delete a saved card instrument for a customer_id and instrument_id
3052
+ * @summary Delete Saved Card Instrument
3053
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3054
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
3055
+ * @param {string} instrument_id The instrument_id which needs to be deleted
3056
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3057
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3058
+ * @param {*} [options] Override http request option.
3059
+ * @throws {RequiredError}
3060
+ */
3061
+ pGCustomerDeleteInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options) {
3062
+ return __awaiter(this, void 0, void 0, function* () {
3063
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGCustomerDeleteInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options);
3064
+ var url = "https://sandbox.cashfree.com/pg";
3065
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
3066
+ url = "https://api.cashfree.com/pg";
3067
+ }
3068
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
3069
+ });
3070
+ },
3071
+ /**
3072
+ * Use this API to fetch a single specific saved card for a customer_id by it\'s instrument_id
3073
+ * @summary Fetch Specific Saved Card Instrument
3074
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3075
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
3076
+ * @param {string} instrument_id The instrument_id of the saved instrument which needs to be queried
3077
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3078
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3079
+ * @param {*} [options] Override http request option.
3080
+ * @throws {RequiredError}
3081
+ */
3082
+ pGCustomerFetchInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options) {
3083
+ return __awaiter(this, void 0, void 0, function* () {
3084
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGCustomerFetchInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options);
3085
+ var url = "https://sandbox.cashfree.com/pg";
3086
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
3087
+ url = "https://api.cashfree.com/pg";
3088
+ }
3089
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
3090
+ });
3091
+ },
3092
+ /**
3093
+ * Use this API to fetch saved cards for a customer_id
3094
+ * @summary Fetch All Saved Card Instrument
3095
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3096
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
3097
+ * @param {PGCustomerFetchInstrumentsInstrumentTypeEnum} instrument_type Payment mode or type of saved instrument
3098
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3099
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3100
+ * @param {*} [options] Override http request option.
3101
+ * @throws {RequiredError}
3102
+ */
3103
+ pGCustomerFetchInstruments(x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options) {
3104
+ return __awaiter(this, void 0, void 0, function* () {
3105
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGCustomerFetchInstruments(x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options);
3106
+ var url = "https://sandbox.cashfree.com/pg";
3107
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
3108
+ url = "https://api.cashfree.com/pg";
3109
+ }
3110
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
3111
+ });
3112
+ },
3113
+ /**
3114
+ * Use this API To get the card network token, token expiry and cryptogram for a saved card instrument using instrument id
3115
+ * @summary Fetch cryptogram for a saved card instrument
3116
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3117
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
3118
+ * @param {string} instrument_id The instrument_id of the saved card instrument which needs to be queried
3119
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3120
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3121
+ * @param {*} [options] Override http request option.
3122
+ * @throws {RequiredError}
3123
+ */
3124
+ pGCustomerInstrumentsFetchCryptogram(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options) {
3125
+ return __awaiter(this, void 0, void 0, function* () {
3126
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pGCustomerInstrumentsFetchCryptogram(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options);
3127
+ var url = "https://sandbox.cashfree.com/pg";
3128
+ if (Cashfree.XEnvironment == CFEnvironment.PRODUCTION) {
3129
+ url = "https://api.cashfree.com/pg";
3130
+ }
3131
+ return createRequestFunction(localVarAxiosArgs, globalAxios, url, configuration);
3132
+ });
3133
+ },
3134
+ };
3135
+ };
3136
+ /**
3137
+ * TokenVaultApi - object-oriented interface
3138
+ * @export
3139
+ * @class TokenVaultApi
3140
+ * @extends {BaseAPI}
3141
+ */
3142
+ /**
3143
+ * @export
3144
+ */
3145
+ export const PGCustomerFetchInstrumentsInstrumentTypeEnum = {
3146
+ CARD: 'card',
3147
+ UNKNOWN_DEFAULT_OPEN_API: '11184809'
3148
+ };
3149
+ class Environment {
3150
+ constructor() {
3151
+ this.PRODUCTION = CFEnvironment.PRODUCTION;
3152
+ this.SANDBOX = CFEnvironment.SANDBOX;
3153
+ }
3154
+ }
3155
+ export class Cashfree {
3156
+ /**
3157
+ * Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number.
3158
+ * @summary Get Eligible Cardless EMI Payment Methods for a customer on an order
3159
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3160
+ * @param {EligibilityFetchCardlessEMIRequest} EligibilityFetchCardlessEMIRequest Request Body to get eligible cardless emi options for a customer and order
3161
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3162
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3163
+ * @param {*} [options] Override http request option.
3164
+ * @throws {RequiredError}
3165
+ * @memberof EligibilityApi
3166
+ */
3167
+ static PGEligibilityFetchCardlessEMI(x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options) {
3168
+ Sentry.init({
3169
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3170
+ // Performance Monitoring
3171
+ tracesSampleRate: 1.0,
3172
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3173
+ profilesSampleRate: 1.0,
3174
+ attachStacktrace: true,
3175
+ enableTracing: true,
3176
+ beforeSend: (event) => {
3177
+ delete event.contexts.os;
3178
+ delete event.contexts.device;
3179
+ delete event.server_name;
3180
+ return event;
3181
+ },
3182
+ });
3183
+ Sentry.configureScope((scope) => {
3184
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3185
+ scope.setExtra('environment', 'sandbox');
3186
+ }
3187
+ else {
3188
+ scope.setExtra('environment', 'production');
3189
+ }
3190
+ scope.setExtra('release', "3.0.0");
3191
+ });
3192
+ try {
3193
+ return EligibilityApiFp().pGEligibilityFetchCardlessEMI(x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3194
+ }
3195
+ catch (error) {
3196
+ Sentry.captureException(error);
3197
+ throw error;
3198
+ }
3199
+ }
3200
+ /**
3201
+ * Use this API to get eligible offers for an order_id or order amount.
3202
+ * @summary Get Eligible Offers for an Order
3203
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3204
+ * @param {EligibilityFetchOffersRequest} EligibilityFetchOffersRequest Request Body to get eligible offers for a customer and order
3205
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3206
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3207
+ * @param {*} [options] Override http request option.
3208
+ * @throws {RequiredError}
3209
+ * @memberof EligibilityApi
3210
+ */
3211
+ static PGEligibilityFetchOffers(x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options) {
3212
+ Sentry.init({
3213
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3214
+ // Performance Monitoring
3215
+ tracesSampleRate: 1.0,
3216
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3217
+ profilesSampleRate: 1.0,
3218
+ attachStacktrace: true,
3219
+ enableTracing: true,
3220
+ beforeSend: (event) => {
3221
+ delete event.contexts.os;
3222
+ delete event.contexts.device;
3223
+ delete event.server_name;
3224
+ return event;
3225
+ },
3226
+ });
3227
+ Sentry.configureScope((scope) => {
3228
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3229
+ scope.setExtra('environment', 'sandbox');
3230
+ }
3231
+ else {
3232
+ scope.setExtra('environment', 'production');
3233
+ }
3234
+ scope.setExtra('release', "3.0.0");
3235
+ });
3236
+ try {
3237
+ return EligibilityApiFp().pGEligibilityFetchOffers(x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3238
+ }
3239
+ catch (error) {
3240
+ Sentry.captureException(error);
3241
+ throw error;
3242
+ }
3243
+ }
3244
+ /**
3245
+ * Use this API to get eligible Paylater Payment Methods for a customer on an order.
3246
+ * @summary Get Eligible Paylater for a customer on an order
3247
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3248
+ * @param {EligibilityFetchPaylaterRequest} EligibilityFetchPaylaterRequest Request Body to get eligible paylater options for a customer and order
3249
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3250
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3251
+ * @param {*} [options] Override http request option.
3252
+ * @throws {RequiredError}
3253
+ * @memberof EligibilityApi
3254
+ */
3255
+ static PGEligibilityFetchPaylater(x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options) {
3256
+ Sentry.init({
3257
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3258
+ // Performance Monitoring
3259
+ tracesSampleRate: 1.0,
3260
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3261
+ profilesSampleRate: 1.0,
3262
+ attachStacktrace: true,
3263
+ enableTracing: true,
3264
+ beforeSend: (event) => {
3265
+ delete event.contexts.os;
3266
+ delete event.contexts.device;
3267
+ delete event.server_name;
3268
+ return event;
3269
+ },
3270
+ });
3271
+ Sentry.configureScope((scope) => {
3272
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3273
+ scope.setExtra('environment', 'sandbox');
3274
+ }
3275
+ else {
3276
+ scope.setExtra('environment', 'production');
3277
+ }
3278
+ scope.setExtra('release', "3.0.0");
3279
+ });
3280
+ try {
3281
+ return EligibilityApiFp().pGEligibilityFetchPaylater(x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3282
+ }
3283
+ catch (error) {
3284
+ Sentry.captureException(error);
3285
+ throw error;
3286
+ }
3287
+ }
3288
+ /**
3289
+ * Use this API to get eligible Payment Methods
3290
+ * @summary Get eligible Payment Methods
3291
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3292
+ * @param {EligibilityFetchPaymentMethodsRequest} EligibilityFetchPaymentMethodsRequest Request Body to get eligible payment methods for an account and order
3293
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3294
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3295
+ * @param {*} [options] Override http request option.
3296
+ * @throws {RequiredError}
3297
+ * @memberof EligibilityApi
3298
+ */
3299
+ static PGEligibilityFetchPaymentMethods(x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options) {
3300
+ Sentry.init({
3301
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3302
+ // Performance Monitoring
3303
+ tracesSampleRate: 1.0,
3304
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3305
+ profilesSampleRate: 1.0,
3306
+ attachStacktrace: true,
3307
+ enableTracing: true,
3308
+ beforeSend: (event) => {
3309
+ delete event.contexts.os;
3310
+ delete event.contexts.device;
3311
+ delete event.server_name;
3312
+ return event;
3313
+ },
3314
+ });
3315
+ Sentry.configureScope((scope) => {
3316
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3317
+ scope.setExtra('environment', 'sandbox');
3318
+ }
3319
+ else {
3320
+ scope.setExtra('environment', 'production');
3321
+ }
3322
+ scope.setExtra('release', "3.0.0");
3323
+ });
3324
+ try {
3325
+ return EligibilityApiFp().pGEligibilityFetchPaymentMethods(x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3326
+ }
3327
+ catch (error) {
3328
+ Sentry.captureException(error);
3329
+ throw error;
3330
+ }
3331
+ }
3332
+ /**
3333
+ * Use this API to create offers with Cashfree from your backend
3334
+ * @summary Create Offer
3335
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3336
+ * @param {CreateOfferRequest} CreateOfferRequest Request body to create an offer at Cashfree
3337
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3338
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3339
+ * @param {*} [options] Override http request option.
3340
+ * @throws {RequiredError}
3341
+ * @memberof OffersApi
3342
+ */
3343
+ static PGCreateOffer(x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options) {
3344
+ Sentry.init({
3345
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3346
+ // Performance Monitoring
3347
+ tracesSampleRate: 1.0,
3348
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3349
+ profilesSampleRate: 1.0,
3350
+ attachStacktrace: true,
3351
+ enableTracing: true,
3352
+ beforeSend: (event) => {
3353
+ delete event.contexts.os;
3354
+ delete event.contexts.device;
3355
+ delete event.server_name;
3356
+ return event;
3357
+ },
3358
+ });
3359
+ Sentry.configureScope((scope) => {
3360
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3361
+ scope.setExtra('environment', 'sandbox');
3362
+ }
3363
+ else {
3364
+ scope.setExtra('environment', 'production');
3365
+ }
3366
+ scope.setExtra('release', "3.0.0");
3367
+ });
3368
+ try {
3369
+ return OffersApiFp().pGCreateOffer(x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3370
+ }
3371
+ catch (error) {
3372
+ Sentry.captureException(error);
3373
+ throw error;
3374
+ }
3375
+ }
3376
+ /**
3377
+ * Use this API to get offer by offer_id
3378
+ * @summary Get Offer by ID
3379
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3380
+ * @param {string} offer_id The offer ID for which you want to view the offer details.
3381
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3382
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3383
+ * @param {*} [options] Override http request option.
3384
+ * @throws {RequiredError}
3385
+ * @memberof OffersApi
3386
+ */
3387
+ static PGFetchOffer(x_api_version, offer_id, x_request_id, x_idempotency_key, options) {
3388
+ Sentry.init({
3389
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3390
+ // Performance Monitoring
3391
+ tracesSampleRate: 1.0,
3392
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3393
+ profilesSampleRate: 1.0,
3394
+ attachStacktrace: true,
3395
+ enableTracing: true,
3396
+ beforeSend: (event) => {
3397
+ delete event.contexts.os;
3398
+ delete event.contexts.device;
3399
+ delete event.server_name;
3400
+ return event;
3401
+ },
3402
+ });
3403
+ Sentry.configureScope((scope) => {
3404
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3405
+ scope.setExtra('environment', 'sandbox');
3406
+ }
3407
+ else {
3408
+ scope.setExtra('environment', 'production');
3409
+ }
3410
+ scope.setExtra('release', "3.0.0");
3411
+ });
3412
+ try {
3413
+ return OffersApiFp().pGFetchOffer(x_api_version, offer_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3414
+ }
3415
+ catch (error) {
3416
+ Sentry.captureException(error);
3417
+ throw error;
3418
+ }
3419
+ }
3420
+ /**
3421
+ * ### 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.
3422
+ * @summary Create Order
3423
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3424
+ * @param {CreateOrderRequest} CreateOrderRequest Request body to create an order at cashfree
3425
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3426
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3427
+ * @param {*} [options] Override http request option.
3428
+ * @throws {RequiredError}
3429
+ * @memberof OrdersApi
3430
+ */
3431
+ static PGCreateOrder(x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options) {
3432
+ Sentry.init({
3433
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3434
+ // Performance Monitoring
3435
+ tracesSampleRate: 1.0,
3436
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3437
+ profilesSampleRate: 1.0,
3438
+ attachStacktrace: true,
3439
+ enableTracing: true,
3440
+ beforeSend: (event) => {
3441
+ delete event.contexts.os;
3442
+ delete event.contexts.device;
3443
+ delete event.server_name;
3444
+ return event;
3445
+ },
3446
+ });
3447
+ Sentry.configureScope((scope) => {
3448
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3449
+ scope.setExtra('environment', 'sandbox');
3450
+ }
3451
+ else {
3452
+ scope.setExtra('environment', 'production');
3453
+ }
3454
+ scope.setExtra('release', "3.0.0");
3455
+ });
3456
+ try {
3457
+ return OrdersApiFp().pGCreateOrder(x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3458
+ }
3459
+ catch (error) {
3460
+ Sentry.captureException(error);
3461
+ throw error;
3462
+ }
3463
+ }
3464
+ /**
3465
+ * 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`
3466
+ * @summary Get Order
3467
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3468
+ * @param {string} order_id The id which uniquely identifies your order
3469
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3470
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3471
+ * @param {*} [options] Override http request option.
3472
+ * @throws {RequiredError}
3473
+ * @memberof OrdersApi
3474
+ */
3475
+ static PGFetchOrder(x_api_version, order_id, x_request_id, x_idempotency_key, options) {
3476
+ Sentry.init({
3477
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3478
+ // Performance Monitoring
3479
+ tracesSampleRate: 1.0,
3480
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3481
+ profilesSampleRate: 1.0,
3482
+ attachStacktrace: true,
3483
+ enableTracing: true,
3484
+ beforeSend: (event) => {
3485
+ delete event.contexts.os;
3486
+ delete event.contexts.device;
3487
+ delete event.server_name;
3488
+ return event;
3489
+ },
3490
+ });
3491
+ Sentry.configureScope((scope) => {
3492
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3493
+ scope.setExtra('environment', 'sandbox');
3494
+ }
3495
+ else {
3496
+ scope.setExtra('environment', 'production');
3497
+ }
3498
+ scope.setExtra('release', "3.0.0");
3499
+ });
3500
+ try {
3501
+ return OrdersApiFp().pGFetchOrder(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3502
+ }
3503
+ catch (error) {
3504
+ Sentry.captureException(error);
3505
+ throw error;
3506
+ }
3507
+ }
3508
+ /**
3509
+ * - Use this API to get the payment gateway reconciliation details with date range. - It will have events for your payment account
3510
+ * @summary PG Reconciliation
3511
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3512
+ * @param {FetchReconRequest} FetchReconRequest Request Body for the reconciliation
3513
+ * @param {string} [Content_Type] application/json
3514
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3515
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3516
+ * @param {string} [Accept] application/json
3517
+ * @param {*} [options] Override http request option.
3518
+ * @throws {RequiredError}
3519
+ * @memberof PGReconciliationApi
3520
+ */
3521
+ static PGFetchRecon(x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options) {
3522
+ Sentry.init({
3523
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3524
+ // Performance Monitoring
3525
+ tracesSampleRate: 1.0,
3526
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3527
+ profilesSampleRate: 1.0,
3528
+ attachStacktrace: true,
3529
+ enableTracing: true,
3530
+ beforeSend: (event) => {
3531
+ delete event.contexts.os;
3532
+ delete event.contexts.device;
3533
+ delete event.server_name;
3534
+ return event;
3535
+ },
3536
+ });
3537
+ Sentry.configureScope((scope) => {
3538
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3539
+ scope.setExtra('environment', 'sandbox');
3540
+ }
3541
+ else {
3542
+ scope.setExtra('environment', 'production');
3543
+ }
3544
+ scope.setExtra('release', "3.0.0");
3545
+ });
3546
+ try {
3547
+ return PGReconciliationApiFp().pGFetchRecon(x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3548
+ }
3549
+ catch (error) {
3550
+ Sentry.captureException(error);
3551
+ throw error;
3552
+ }
3553
+ }
3554
+ /**
3555
+ * 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.
3556
+ * @summary Cancel Payment Link
3557
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3558
+ * @param {string} link_id The payment link ID for which you want to view the details.
3559
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3560
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3561
+ * @param {*} [options] Override http request option.
3562
+ * @throws {RequiredError}
3563
+ * @memberof PaymentLinksApi
3564
+ */
3565
+ static PGCancelLink(x_api_version, link_id, x_request_id, x_idempotency_key, options) {
3566
+ Sentry.init({
3567
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3568
+ // Performance Monitoring
3569
+ tracesSampleRate: 1.0,
3570
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3571
+ profilesSampleRate: 1.0,
3572
+ attachStacktrace: true,
3573
+ enableTracing: true,
3574
+ beforeSend: (event) => {
3575
+ delete event.contexts.os;
3576
+ delete event.contexts.device;
3577
+ delete event.server_name;
3578
+ return event;
3579
+ },
3580
+ });
3581
+ Sentry.configureScope((scope) => {
3582
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3583
+ scope.setExtra('environment', 'sandbox');
3584
+ }
3585
+ else {
3586
+ scope.setExtra('environment', 'production');
3587
+ }
3588
+ scope.setExtra('release', "3.0.0");
3589
+ });
3590
+ try {
3591
+ return PaymentLinksApiFp().pGCancelLink(x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3592
+ }
3593
+ catch (error) {
3594
+ Sentry.captureException(error);
3595
+ throw error;
3596
+ }
3597
+ }
3598
+ /**
3599
+ * Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url.
3600
+ * @summary Create Payment Link
3601
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3602
+ * @param {CreateLinkRequest} CreateLinkRequest Request Body to Create Payment Links
3603
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3604
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3605
+ * @param {*} [options] Override http request option.
3606
+ * @throws {RequiredError}
3607
+ * @memberof PaymentLinksApi
3608
+ */
3609
+ static PGCreateLink(x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options) {
3610
+ Sentry.init({
3611
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3612
+ // Performance Monitoring
3613
+ tracesSampleRate: 1.0,
3614
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3615
+ profilesSampleRate: 1.0,
3616
+ attachStacktrace: true,
3617
+ enableTracing: true,
3618
+ beforeSend: (event) => {
3619
+ delete event.contexts.os;
3620
+ delete event.contexts.device;
3621
+ delete event.server_name;
3622
+ return event;
3623
+ },
3624
+ });
3625
+ Sentry.configureScope((scope) => {
3626
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3627
+ scope.setExtra('environment', 'sandbox');
3628
+ }
3629
+ else {
3630
+ scope.setExtra('environment', 'production');
3631
+ }
3632
+ scope.setExtra('release', "3.0.0");
3633
+ });
3634
+ try {
3635
+ return PaymentLinksApiFp().pGCreateLink(x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3636
+ }
3637
+ catch (error) {
3638
+ Sentry.captureException(error);
3639
+ throw error;
3640
+ }
3641
+ }
3642
+ /**
3643
+ * Use this API to view all details and status of a payment link.
3644
+ * @summary Fetch Payment Link Details
3645
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3646
+ * @param {string} link_id The payment link ID for which you want to view the details.
3647
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3648
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3649
+ * @param {*} [options] Override http request option.
3650
+ * @throws {RequiredError}
3651
+ * @memberof PaymentLinksApi
3652
+ */
3653
+ static PGFetchLink(x_api_version, link_id, x_request_id, x_idempotency_key, options) {
3654
+ Sentry.init({
3655
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3656
+ // Performance Monitoring
3657
+ tracesSampleRate: 1.0,
3658
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3659
+ profilesSampleRate: 1.0,
3660
+ attachStacktrace: true,
3661
+ enableTracing: true,
3662
+ beforeSend: (event) => {
3663
+ delete event.contexts.os;
3664
+ delete event.contexts.device;
3665
+ delete event.server_name;
3666
+ return event;
3667
+ },
3668
+ });
3669
+ Sentry.configureScope((scope) => {
3670
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3671
+ scope.setExtra('environment', 'sandbox');
3672
+ }
3673
+ else {
3674
+ scope.setExtra('environment', 'production');
3675
+ }
3676
+ scope.setExtra('release', "3.0.0");
3677
+ });
3678
+ try {
3679
+ return PaymentLinksApiFp().pGFetchLink(x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3680
+ }
3681
+ catch (error) {
3682
+ Sentry.captureException(error);
3683
+ throw error;
3684
+ }
3685
+ }
3686
+ /**
3687
+ * Use this API to view all order details for a payment link.
3688
+ * @summary Get Orders for a Payment Link
3689
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3690
+ * @param {string} link_id The payment link ID for which you want to view the details.
3691
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3692
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3693
+ * @param {*} [options] Override http request option.
3694
+ * @throws {RequiredError}
3695
+ * @memberof PaymentLinksApi
3696
+ */
3697
+ static PGLinkFetchOrders(x_api_version, link_id, x_request_id, x_idempotency_key, options) {
3698
+ Sentry.init({
3699
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3700
+ // Performance Monitoring
3701
+ tracesSampleRate: 1.0,
3702
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3703
+ profilesSampleRate: 1.0,
3704
+ attachStacktrace: true,
3705
+ enableTracing: true,
3706
+ beforeSend: (event) => {
3707
+ delete event.contexts.os;
3708
+ delete event.contexts.device;
3709
+ delete event.server_name;
3710
+ return event;
3711
+ },
3712
+ });
3713
+ Sentry.configureScope((scope) => {
3714
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3715
+ scope.setExtra('environment', 'sandbox');
3716
+ }
3717
+ else {
3718
+ scope.setExtra('environment', 'production');
3719
+ }
3720
+ scope.setExtra('release', "3.0.0");
3721
+ });
3722
+ try {
3723
+ return PaymentLinksApiFp().pGLinkFetchOrders(x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3724
+ }
3725
+ catch (error) {
3726
+ Sentry.captureException(error);
3727
+ throw error;
3728
+ }
3729
+ }
3730
+ /**
3731
+ * Use this API to capture or void a preauthorized payment
3732
+ * @summary Preauthorization
3733
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3734
+ * @param {string} order_id The id which uniquely identifies your order
3735
+ * @param {AuthorizeOrderRequest} AuthorizeOrderRequest Request to Capture or Void Transactions
3736
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3737
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3738
+ * @param {*} [options] Override http request option.
3739
+ * @throws {RequiredError}
3740
+ * @memberof PaymentsApi
3741
+ */
3742
+ static PGAuthorizeOrder(x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options) {
3743
+ Sentry.init({
3744
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3745
+ // Performance Monitoring
3746
+ tracesSampleRate: 1.0,
3747
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3748
+ profilesSampleRate: 1.0,
3749
+ attachStacktrace: true,
3750
+ enableTracing: true,
3751
+ beforeSend: (event) => {
3752
+ delete event.contexts.os;
3753
+ delete event.contexts.device;
3754
+ delete event.server_name;
3755
+ return event;
3756
+ },
3757
+ });
3758
+ Sentry.configureScope((scope) => {
3759
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3760
+ scope.setExtra('environment', 'sandbox');
3761
+ }
3762
+ else {
3763
+ scope.setExtra('environment', 'production');
3764
+ }
3765
+ scope.setExtra('release', "3.0.0");
3766
+ });
3767
+ try {
3768
+ return PaymentsApiFp().pGAuthorizeOrder(x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3769
+ }
3770
+ catch (error) {
3771
+ Sentry.captureException(error);
3772
+ throw error;
3773
+ }
3774
+ }
3775
+ /**
3776
+ * If you accept OTP on your own page, you can use the below API to send OTP to Cashfree.
3777
+ * @summary Submit or Resend OTP
3778
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3779
+ * @param {string} cf_payment_id The Cashfree payment or transaction ID.
3780
+ * @param {OrderAuthenticatePaymentRequest} OrderAuthenticatePaymentRequest Request body to submit/resend headless OTP. To use this API make sure you have headless OTP enabled for your account
3781
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3782
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3783
+ * @param {*} [options] Override http request option.
3784
+ * @throws {RequiredError}
3785
+ * @memberof PaymentsApi
3786
+ */
3787
+ static PGOrderAuthenticatePayment(x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options) {
3788
+ Sentry.init({
3789
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3790
+ // Performance Monitoring
3791
+ tracesSampleRate: 1.0,
3792
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3793
+ profilesSampleRate: 1.0,
3794
+ attachStacktrace: true,
3795
+ enableTracing: true,
3796
+ beforeSend: (event) => {
3797
+ delete event.contexts.os;
3798
+ delete event.contexts.device;
3799
+ delete event.server_name;
3800
+ return event;
3801
+ },
3802
+ });
3803
+ Sentry.configureScope((scope) => {
3804
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3805
+ scope.setExtra('environment', 'sandbox');
3806
+ }
3807
+ else {
3808
+ scope.setExtra('environment', 'production');
3809
+ }
3810
+ scope.setExtra('release', "3.0.0");
3811
+ });
3812
+ try {
3813
+ return PaymentsApiFp().pGOrderAuthenticatePayment(x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3814
+ }
3815
+ catch (error) {
3816
+ Sentry.captureException(error);
3817
+ throw error;
3818
+ }
3819
+ }
3820
+ /**
3821
+ * Use this API to view payment details of an order for a payment ID.
3822
+ * @summary Get Payment by ID
3823
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3824
+ * @param {string} order_id The id which uniquely identifies your order
3825
+ * @param {string} cf_payment_id The Cashfree payment or transaction ID.
3826
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3827
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3828
+ * @param {*} [options] Override http request option.
3829
+ * @throws {RequiredError}
3830
+ * @memberof PaymentsApi
3831
+ */
3832
+ static PGOrderFetchPayment(x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options) {
3833
+ Sentry.init({
3834
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3835
+ // Performance Monitoring
3836
+ tracesSampleRate: 1.0,
3837
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3838
+ profilesSampleRate: 1.0,
3839
+ attachStacktrace: true,
3840
+ enableTracing: true,
3841
+ beforeSend: (event) => {
3842
+ delete event.contexts.os;
3843
+ delete event.contexts.device;
3844
+ delete event.server_name;
3845
+ return event;
3846
+ },
3847
+ });
3848
+ Sentry.configureScope((scope) => {
3849
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3850
+ scope.setExtra('environment', 'sandbox');
3851
+ }
3852
+ else {
3853
+ scope.setExtra('environment', 'production');
3854
+ }
3855
+ scope.setExtra('release', "3.0.0");
3856
+ });
3857
+ try {
3858
+ 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));
3859
+ }
3860
+ catch (error) {
3861
+ Sentry.captureException(error);
3862
+ throw error;
3863
+ }
3864
+ }
3865
+ /**
3866
+ * Use this API to view all payment details for an order.
3867
+ * @summary Get Payments for an Order
3868
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3869
+ * @param {string} order_id The id which uniquely identifies your order
3870
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3871
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3872
+ * @param {*} [options] Override http request option.
3873
+ * @throws {RequiredError}
3874
+ * @memberof PaymentsApi
3875
+ */
3876
+ static PGOrderFetchPayments(x_api_version, order_id, x_request_id, x_idempotency_key, options) {
3877
+ Sentry.init({
3878
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3879
+ // Performance Monitoring
3880
+ tracesSampleRate: 1.0,
3881
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3882
+ profilesSampleRate: 1.0,
3883
+ attachStacktrace: true,
3884
+ enableTracing: true,
3885
+ beforeSend: (event) => {
3886
+ delete event.contexts.os;
3887
+ delete event.contexts.device;
3888
+ delete event.server_name;
3889
+ return event;
3890
+ },
3891
+ });
3892
+ Sentry.configureScope((scope) => {
3893
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3894
+ scope.setExtra('environment', 'sandbox');
3895
+ }
3896
+ else {
3897
+ scope.setExtra('environment', 'production');
3898
+ }
3899
+ scope.setExtra('release', "3.0.0");
3900
+ });
3901
+ try {
3902
+ return PaymentsApiFp().pGOrderFetchPayments(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3903
+ }
3904
+ catch (error) {
3905
+ Sentry.captureException(error);
3906
+ throw error;
3907
+ }
3908
+ }
3909
+ /**
3910
+ * 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\".
3911
+ * @summary Order Pay
3912
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3913
+ * @param {PayOrderRequest} PayOrderRequest Request body to create a transaction at cashfree using `payment_session_id`
3914
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3915
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3916
+ * @param {*} [options] Override http request option.
3917
+ * @throws {RequiredError}
3918
+ * @memberof PaymentsApi
3919
+ */
3920
+ static PGPayOrder(x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options) {
3921
+ Sentry.init({
3922
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3923
+ // Performance Monitoring
3924
+ tracesSampleRate: 1.0,
3925
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3926
+ profilesSampleRate: 1.0,
3927
+ attachStacktrace: true,
3928
+ enableTracing: true,
3929
+ beforeSend: (event) => {
3930
+ delete event.contexts.os;
3931
+ delete event.contexts.device;
3932
+ delete event.server_name;
3933
+ return event;
3934
+ },
3935
+ });
3936
+ Sentry.configureScope((scope) => {
3937
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3938
+ scope.setExtra('environment', 'sandbox');
3939
+ }
3940
+ else {
3941
+ scope.setExtra('environment', 'production');
3942
+ }
3943
+ scope.setExtra('release', "3.0.0");
3944
+ });
3945
+ try {
3946
+ return PaymentsApiFp().pGPayOrder(x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3947
+ }
3948
+ catch (error) {
3949
+ Sentry.captureException(error);
3950
+ throw error;
3951
+ }
3952
+ }
3953
+ /**
3954
+ * Use this API to initiate refunds.
3955
+ * @summary Create Refund
3956
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
3957
+ * @param {string} order_id The id which uniquely identifies your order
3958
+ * @param {OrderCreateRefundRequest} OrderCreateRefundRequest Request Body to Create Refunds
3959
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
3960
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
3961
+ * @param {*} [options] Override http request option.
3962
+ * @throws {RequiredError}
3963
+ * @memberof RefundsApi
3964
+ */
3965
+ static PGOrderCreateRefund(x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options) {
3966
+ Sentry.init({
3967
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
3968
+ // Performance Monitoring
3969
+ tracesSampleRate: 1.0,
3970
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
3971
+ profilesSampleRate: 1.0,
3972
+ attachStacktrace: true,
3973
+ enableTracing: true,
3974
+ beforeSend: (event) => {
3975
+ delete event.contexts.os;
3976
+ delete event.contexts.device;
3977
+ delete event.server_name;
3978
+ return event;
3979
+ },
3980
+ });
3981
+ Sentry.configureScope((scope) => {
3982
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
3983
+ scope.setExtra('environment', 'sandbox');
3984
+ }
3985
+ else {
3986
+ scope.setExtra('environment', 'production');
3987
+ }
3988
+ scope.setExtra('release', "3.0.0");
3989
+ });
3990
+ try {
3991
+ return RefundsApiFp().pGOrderCreateRefund(x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
3992
+ }
3993
+ catch (error) {
3994
+ Sentry.captureException(error);
3995
+ throw error;
3996
+ }
3997
+ }
3998
+ /**
3999
+ * Use this API to fetch a specific refund processed on your Cashfree Account.
4000
+ * @summary Get Refund
4001
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4002
+ * @param {string} order_id The id which uniquely identifies your order
4003
+ * @param {string} refund_id Refund Id of the refund you want to fetch.
4004
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4005
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4006
+ * @param {*} [options] Override http request option.
4007
+ * @throws {RequiredError}
4008
+ * @memberof RefundsApi
4009
+ */
4010
+ static PGOrderFetchRefund(x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options) {
4011
+ Sentry.init({
4012
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4013
+ // Performance Monitoring
4014
+ tracesSampleRate: 1.0,
4015
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4016
+ profilesSampleRate: 1.0,
4017
+ attachStacktrace: true,
4018
+ enableTracing: true,
4019
+ beforeSend: (event) => {
4020
+ delete event.contexts.os;
4021
+ delete event.contexts.device;
4022
+ delete event.server_name;
4023
+ return event;
4024
+ },
4025
+ });
4026
+ Sentry.configureScope((scope) => {
4027
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4028
+ scope.setExtra('environment', 'sandbox');
4029
+ }
4030
+ else {
4031
+ scope.setExtra('environment', 'production');
4032
+ }
4033
+ scope.setExtra('release', "3.0.0");
4034
+ });
4035
+ try {
4036
+ return RefundsApiFp().pGOrderFetchRefund(x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4037
+ }
4038
+ catch (error) {
4039
+ Sentry.captureException(error);
4040
+ throw error;
4041
+ }
4042
+ }
4043
+ /**
4044
+ * Use this API to fetch all refunds processed against an order.
4045
+ * @summary Get All Refunds for an Order
4046
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4047
+ * @param {string} order_id The id which uniquely identifies your order
4048
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4049
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4050
+ * @param {*} [options] Override http request option.
4051
+ * @throws {RequiredError}
4052
+ * @memberof RefundsApi
4053
+ */
4054
+ static PGOrderFetchRefunds(x_api_version, order_id, x_request_id, x_idempotency_key, options) {
4055
+ Sentry.init({
4056
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4057
+ // Performance Monitoring
4058
+ tracesSampleRate: 1.0,
4059
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4060
+ profilesSampleRate: 1.0,
4061
+ attachStacktrace: true,
4062
+ enableTracing: true,
4063
+ beforeSend: (event) => {
4064
+ delete event.contexts.os;
4065
+ delete event.contexts.device;
4066
+ delete event.server_name;
4067
+ return event;
4068
+ },
4069
+ });
4070
+ Sentry.configureScope((scope) => {
4071
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4072
+ scope.setExtra('environment', 'sandbox');
4073
+ }
4074
+ else {
4075
+ scope.setExtra('environment', 'production');
4076
+ }
4077
+ scope.setExtra('release', "3.0.0");
4078
+ });
4079
+ try {
4080
+ return RefundsApiFp().pGOrderFetchRefunds(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4081
+ }
4082
+ catch (error) {
4083
+ Sentry.captureException(error);
4084
+ throw error;
4085
+ }
4086
+ }
4087
+ /**
4088
+ * Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range.
4089
+ * @summary Get All Settlements
4090
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4091
+ * @param {FetchSettlementsRequest} FetchSettlementsRequest Request Body to get the settlements
4092
+ * @param {string} [Content_Type] application/json
4093
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4094
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4095
+ * @param {string} [Accept] application/json
4096
+ * @param {*} [options] Override http request option.
4097
+ * @throws {RequiredError}
4098
+ * @memberof SettlementReconciliationApi
4099
+ */
4100
+ static PGFetchSettlements(x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options) {
4101
+ Sentry.init({
4102
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4103
+ // Performance Monitoring
4104
+ tracesSampleRate: 1.0,
4105
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4106
+ profilesSampleRate: 1.0,
4107
+ attachStacktrace: true,
4108
+ enableTracing: true,
4109
+ beforeSend: (event) => {
4110
+ delete event.contexts.os;
4111
+ delete event.contexts.device;
4112
+ delete event.server_name;
4113
+ return event;
4114
+ },
4115
+ });
4116
+ Sentry.configureScope((scope) => {
4117
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4118
+ scope.setExtra('environment', 'sandbox');
4119
+ }
4120
+ else {
4121
+ scope.setExtra('environment', 'production');
4122
+ }
4123
+ scope.setExtra('release', "3.0.0");
4124
+ });
4125
+ try {
4126
+ return SettlementReconciliationApiFp().pGFetchSettlements(x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4127
+ }
4128
+ catch (error) {
4129
+ Sentry.captureException(error);
4130
+ throw error;
4131
+ }
4132
+ }
4133
+ /**
4134
+ * - 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
4135
+ * @summary Settlement Reconciliation
4136
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4137
+ * @param {SettlementFetchReconRequest} SettlementFetchReconRequest Request Body for the settlement reconciliation
4138
+ * @param {string} [Content_Type] application/json
4139
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4140
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4141
+ * @param {string} [Accept] application/json
4142
+ * @param {*} [options] Override http request option.
4143
+ * @throws {RequiredError}
4144
+ * @memberof SettlementReconciliationApi
4145
+ */
4146
+ static PGSettlementFetchRecon(x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options) {
4147
+ Sentry.init({
4148
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4149
+ // Performance Monitoring
4150
+ tracesSampleRate: 1.0,
4151
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4152
+ profilesSampleRate: 1.0,
4153
+ attachStacktrace: true,
4154
+ enableTracing: true,
4155
+ beforeSend: (event) => {
4156
+ delete event.contexts.os;
4157
+ delete event.contexts.device;
4158
+ delete event.server_name;
4159
+ return event;
4160
+ },
4161
+ });
4162
+ Sentry.configureScope((scope) => {
4163
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4164
+ scope.setExtra('environment', 'sandbox');
4165
+ }
4166
+ else {
4167
+ scope.setExtra('environment', 'production');
4168
+ }
4169
+ scope.setExtra('release', "3.0.0");
4170
+ });
4171
+ try {
4172
+ return SettlementReconciliationApiFp().pGSettlementFetchRecon(x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4173
+ }
4174
+ catch (error) {
4175
+ Sentry.captureException(error);
4176
+ throw error;
4177
+ }
4178
+ }
4179
+ /**
4180
+ * Use this API to view all the settlements of a particular order.
4181
+ * @summary Get Settlements by Order ID
4182
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4183
+ * @param {string} order_id The id which uniquely identifies your order
4184
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4185
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4186
+ * @param {*} [options] Override http request option.
4187
+ * @throws {RequiredError}
4188
+ * @memberof SettlementsApi
4189
+ */
4190
+ static PGOrderFetchSettlement(x_api_version, order_id, x_request_id, x_idempotency_key, options) {
4191
+ Sentry.init({
4192
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4193
+ // Performance Monitoring
4194
+ tracesSampleRate: 1.0,
4195
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4196
+ profilesSampleRate: 1.0,
4197
+ attachStacktrace: true,
4198
+ enableTracing: true,
4199
+ beforeSend: (event) => {
4200
+ delete event.contexts.os;
4201
+ delete event.contexts.device;
4202
+ delete event.server_name;
4203
+ return event;
4204
+ },
4205
+ });
4206
+ Sentry.configureScope((scope) => {
4207
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4208
+ scope.setExtra('environment', 'sandbox');
4209
+ }
4210
+ else {
4211
+ scope.setExtra('environment', 'production');
4212
+ }
4213
+ scope.setExtra('release', "3.0.0");
4214
+ });
4215
+ try {
4216
+ return SettlementsApiFp().pGOrderFetchSettlement(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4217
+ }
4218
+ catch (error) {
4219
+ Sentry.captureException(error);
4220
+ throw error;
4221
+ }
4222
+ }
4223
+ /**
4224
+ * Use this API to create new terminals to use softPOS.
4225
+ * @summary Create Terminal
4226
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4227
+ * @param {CreateTerminalRequest} CreateTerminalRequest Request Body to Create Terminal for SPOS
4228
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4229
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4230
+ * @param {*} [options] Override http request option.
4231
+ * @throws {RequiredError}
4232
+ * @memberof SoftPOSApi
4233
+ */
4234
+ static SposCreateTerminal(x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options) {
4235
+ Sentry.init({
4236
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4237
+ // Performance Monitoring
4238
+ tracesSampleRate: 1.0,
4239
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4240
+ profilesSampleRate: 1.0,
4241
+ attachStacktrace: true,
4242
+ enableTracing: true,
4243
+ beforeSend: (event) => {
4244
+ delete event.contexts.os;
4245
+ delete event.contexts.device;
4246
+ delete event.server_name;
4247
+ return event;
4248
+ },
4249
+ });
4250
+ Sentry.configureScope((scope) => {
4251
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4252
+ scope.setExtra('environment', 'sandbox');
4253
+ }
4254
+ else {
4255
+ scope.setExtra('environment', 'production');
4256
+ }
4257
+ scope.setExtra('release', "3.0.0");
4258
+ });
4259
+ try {
4260
+ return SoftPOSApiFp().sposCreateTerminal(x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4261
+ }
4262
+ catch (error) {
4263
+ Sentry.captureException(error);
4264
+ throw error;
4265
+ }
4266
+ }
4267
+ /**
4268
+ * 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.
4269
+ * @summary Create Terminal
4270
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4271
+ * @param {CreateTerminalTransactionRequest} CreateTerminalTransactionRequest Request body to create a terminal transaction
4272
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4273
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4274
+ * @param {*} [options] Override http request option.
4275
+ * @throws {RequiredError}
4276
+ * @memberof SoftPOSApi
4277
+ */
4278
+ static SposCreateTerminalTransaction(x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options) {
4279
+ Sentry.init({
4280
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4281
+ // Performance Monitoring
4282
+ tracesSampleRate: 1.0,
4283
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4284
+ profilesSampleRate: 1.0,
4285
+ attachStacktrace: true,
4286
+ enableTracing: true,
4287
+ beforeSend: (event) => {
4288
+ delete event.contexts.os;
4289
+ delete event.contexts.device;
4290
+ delete event.server_name;
4291
+ return event;
4292
+ },
4293
+ });
4294
+ Sentry.configureScope((scope) => {
4295
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4296
+ scope.setExtra('environment', 'sandbox');
4297
+ }
4298
+ else {
4299
+ scope.setExtra('environment', 'production');
4300
+ }
4301
+ scope.setExtra('release', "3.0.0");
4302
+ });
4303
+ try {
4304
+ return SoftPOSApiFp().sposCreateTerminalTransaction(x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4305
+ }
4306
+ catch (error) {
4307
+ Sentry.captureException(error);
4308
+ throw error;
4309
+ }
4310
+ }
4311
+ /**
4312
+ * Use this API to view all details of a terminal.
4313
+ * @summary Get terminal status using phone number
4314
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4315
+ * @param {string} terminal_phone_no The terminal for which you want to view the order details.
4316
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4317
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4318
+ * @param {*} [options] Override http request option.
4319
+ * @throws {RequiredError}
4320
+ * @memberof SoftPOSApi
4321
+ */
4322
+ static SposFetchTerminal(x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options) {
4323
+ Sentry.init({
4324
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4325
+ // Performance Monitoring
4326
+ tracesSampleRate: 1.0,
4327
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4328
+ profilesSampleRate: 1.0,
4329
+ attachStacktrace: true,
4330
+ enableTracing: true,
4331
+ beforeSend: (event) => {
4332
+ delete event.contexts.os;
4333
+ delete event.contexts.device;
4334
+ delete event.server_name;
4335
+ return event;
4336
+ },
4337
+ });
4338
+ Sentry.configureScope((scope) => {
4339
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4340
+ scope.setExtra('environment', 'sandbox');
4341
+ }
4342
+ else {
4343
+ scope.setExtra('environment', 'production');
4344
+ }
4345
+ scope.setExtra('release', "3.0.0");
4346
+ });
4347
+ try {
4348
+ return SoftPOSApiFp().sposFetchTerminal(x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4349
+ }
4350
+ catch (error) {
4351
+ Sentry.captureException(error);
4352
+ throw error;
4353
+ }
4354
+ }
4355
+ /**
4356
+ * 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.
4357
+ * @summary Fetch Terminal QR Codes
4358
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4359
+ * @param {string} terminal_phone_no Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request.
4360
+ * @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.
4361
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4362
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4363
+ * @param {*} [options] Override http request option.
4364
+ * @throws {RequiredError}
4365
+ * @memberof SoftPOSApi
4366
+ */
4367
+ static SposFetchTerminalQRCodes(x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options) {
4368
+ Sentry.init({
4369
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4370
+ // Performance Monitoring
4371
+ tracesSampleRate: 1.0,
4372
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4373
+ profilesSampleRate: 1.0,
4374
+ attachStacktrace: true,
4375
+ enableTracing: true,
4376
+ beforeSend: (event) => {
4377
+ delete event.contexts.os;
4378
+ delete event.contexts.device;
4379
+ delete event.server_name;
4380
+ return event;
4381
+ },
4382
+ });
4383
+ Sentry.configureScope((scope) => {
4384
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4385
+ scope.setExtra('environment', 'sandbox');
4386
+ }
4387
+ else {
4388
+ scope.setExtra('environment', 'production');
4389
+ }
4390
+ scope.setExtra('release', "3.0.0");
4391
+ });
4392
+ try {
4393
+ 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));
4394
+ }
4395
+ catch (error) {
4396
+ Sentry.captureException(error);
4397
+ throw error;
4398
+ }
4399
+ }
4400
+ /**
4401
+ * Use this API to delete a saved card instrument for a customer_id and instrument_id
4402
+ * @summary Delete Saved Card Instrument
4403
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4404
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
4405
+ * @param {string} instrument_id The instrument_id which needs to be deleted
4406
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4407
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4408
+ * @param {*} [options] Override http request option.
4409
+ * @throws {RequiredError}
4410
+ * @memberof TokenVaultApi
4411
+ */
4412
+ static PGCustomerDeleteInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options) {
4413
+ Sentry.init({
4414
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4415
+ // Performance Monitoring
4416
+ tracesSampleRate: 1.0,
4417
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4418
+ profilesSampleRate: 1.0,
4419
+ attachStacktrace: true,
4420
+ enableTracing: true,
4421
+ beforeSend: (event) => {
4422
+ delete event.contexts.os;
4423
+ delete event.contexts.device;
4424
+ delete event.server_name;
4425
+ return event;
4426
+ },
4427
+ });
4428
+ Sentry.configureScope((scope) => {
4429
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4430
+ scope.setExtra('environment', 'sandbox');
4431
+ }
4432
+ else {
4433
+ scope.setExtra('environment', 'production');
4434
+ }
4435
+ scope.setExtra('release', "3.0.0");
4436
+ });
4437
+ try {
4438
+ return TokenVaultApiFp().pGCustomerDeleteInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4439
+ }
4440
+ catch (error) {
4441
+ Sentry.captureException(error);
4442
+ throw error;
4443
+ }
4444
+ }
4445
+ /**
4446
+ * Use this API to fetch a single specific saved card for a customer_id by it\'s instrument_id
4447
+ * @summary Fetch Specific Saved Card Instrument
4448
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4449
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
4450
+ * @param {string} instrument_id The instrument_id of the saved instrument which needs to be queried
4451
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4452
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4453
+ * @param {*} [options] Override http request option.
4454
+ * @throws {RequiredError}
4455
+ * @memberof TokenVaultApi
4456
+ */
4457
+ static PGCustomerFetchInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options) {
4458
+ Sentry.init({
4459
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4460
+ // Performance Monitoring
4461
+ tracesSampleRate: 1.0,
4462
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4463
+ profilesSampleRate: 1.0,
4464
+ attachStacktrace: true,
4465
+ enableTracing: true,
4466
+ beforeSend: (event) => {
4467
+ delete event.contexts.os;
4468
+ delete event.contexts.device;
4469
+ delete event.server_name;
4470
+ return event;
4471
+ },
4472
+ });
4473
+ Sentry.configureScope((scope) => {
4474
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4475
+ scope.setExtra('environment', 'sandbox');
4476
+ }
4477
+ else {
4478
+ scope.setExtra('environment', 'production');
4479
+ }
4480
+ scope.setExtra('release', "3.0.0");
4481
+ });
4482
+ try {
4483
+ return TokenVaultApiFp().pGCustomerFetchInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4484
+ }
4485
+ catch (error) {
4486
+ Sentry.captureException(error);
4487
+ throw error;
4488
+ }
4489
+ }
4490
+ /**
4491
+ * Use this API to fetch saved cards for a customer_id
4492
+ * @summary Fetch All Saved Card Instrument
4493
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4494
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
4495
+ * @param {PGCustomerFetchInstrumentsInstrumentTypeEnum} instrument_type Payment mode or type of saved instrument
4496
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4497
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4498
+ * @param {*} [options] Override http request option.
4499
+ * @throws {RequiredError}
4500
+ * @memberof TokenVaultApi
4501
+ */
4502
+ static PGCustomerFetchInstruments(x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options) {
4503
+ Sentry.init({
4504
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4505
+ // Performance Monitoring
4506
+ tracesSampleRate: 1.0,
4507
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4508
+ profilesSampleRate: 1.0,
4509
+ attachStacktrace: true,
4510
+ enableTracing: true,
4511
+ beforeSend: (event) => {
4512
+ delete event.contexts.os;
4513
+ delete event.contexts.device;
4514
+ delete event.server_name;
4515
+ return event;
4516
+ },
4517
+ });
4518
+ Sentry.configureScope((scope) => {
4519
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4520
+ scope.setExtra('environment', 'sandbox');
4521
+ }
4522
+ else {
4523
+ scope.setExtra('environment', 'production');
4524
+ }
4525
+ scope.setExtra('release', "3.0.0");
4526
+ });
4527
+ try {
4528
+ return TokenVaultApiFp().pGCustomerFetchInstruments(x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4529
+ }
4530
+ catch (error) {
4531
+ Sentry.captureException(error);
4532
+ throw error;
4533
+ }
4534
+ }
4535
+ /**
4536
+ * Use this API To get the card network token, token expiry and cryptogram for a saved card instrument using instrument id
4537
+ * @summary Fetch cryptogram for a saved card instrument
4538
+ * @param {string} x_api_version API version to be used. Format is in YYYY-MM-DD
4539
+ * @param {string} customer_id Your Customer ID that you had sent during create order API `POST/orders`
4540
+ * @param {string} instrument_id The instrument_id of the saved card instrument which needs to be queried
4541
+ * @param {string} [x_request_id] Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
4542
+ * @param {string} [x_idempotency_key] Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors. Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders
4543
+ * @param {*} [options] Override http request option.
4544
+ * @throws {RequiredError}
4545
+ * @memberof TokenVaultApi
4546
+ */
4547
+ static PGCustomerInstrumentsFetchCryptogram(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options) {
4548
+ Sentry.init({
4549
+ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696',
4550
+ // Performance Monitoring
4551
+ tracesSampleRate: 1.0,
4552
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
4553
+ profilesSampleRate: 1.0,
4554
+ attachStacktrace: true,
4555
+ enableTracing: true,
4556
+ beforeSend: (event) => {
4557
+ delete event.contexts.os;
4558
+ delete event.contexts.device;
4559
+ delete event.server_name;
4560
+ return event;
4561
+ },
4562
+ });
4563
+ Sentry.configureScope((scope) => {
4564
+ if (Cashfree.XEnvironment == CFEnvironment.SANDBOX) {
4565
+ scope.setExtra('environment', 'sandbox');
4566
+ }
4567
+ else {
4568
+ scope.setExtra('environment', 'production');
4569
+ }
4570
+ scope.setExtra('release', "3.0.0");
4571
+ });
4572
+ try {
4573
+ return TokenVaultApiFp().pGCustomerInstrumentsFetchCryptogram(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath));
4574
+ }
4575
+ catch (error) {
4576
+ Sentry.captureException(error);
4577
+ throw error;
4578
+ }
4579
+ }
4580
+ }
4581
+ Cashfree.Environment = new Environment();