@gofynd/fdk-client-javascript 1.4.15-beta.1 → 1.4.15-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/application.d.ts +1 -2
- package/application.js +2 -3
- package/index.d.ts +1 -2
- package/index.js +7 -1
- package/package.json +3 -4
- package/sdk/application/ApplicationClient.js +0 -18
- package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
- package/sdk/application/Cart/CartApplicationClient.js +60 -1185
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +90 -142
- package/sdk/application/Catalog/CatalogApplicationClient.js +187 -1293
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
- package/sdk/application/Common/CommonApplicationClient.js +5 -89
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
- package/sdk/application/Communication/CommunicationApplicationClient.js +6 -145
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +31 -718
- package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
- package/sdk/application/Content/ContentApplicationClient.js +77 -914
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -11
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +19 -125
- package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
- package/sdk/application/Lead/LeadApplicationClient.js +32 -202
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
- package/sdk/application/Logistic/LogisticApplicationClient.js +50 -478
- package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
- package/sdk/application/Order/OrderApplicationClient.js +86 -472
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
- package/sdk/application/Payment/PaymentApplicationClient.js +57 -2102
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
- package/sdk/application/Rewards/RewardsApplicationClient.js +16 -305
- package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
- package/sdk/application/Share/ShareApplicationClient.js +34 -294
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
- package/sdk/application/Theme/ThemeApplicationClient.js +28 -162
- package/sdk/application/User/UserApplicationClient.d.ts +85 -136
- package/sdk/application/User/UserApplicationClient.js +45 -1815
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
- package/sdk/application/Webhook/WebhookApplicationClient.js +4 -47
- package/sdk/application/index.d.ts +0 -18
- package/sdk/application/index.js +0 -33
- package/sdk/common/Utility.d.ts +1 -1
- package/sdk/common/Utility.js +10 -7
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/common/utils.d.ts +0 -1
- package/sdk/common/utils.js +0 -14
- package/sdk/partner/OAuthClient.js +1 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
- package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +39 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +247 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +33 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +37 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +193 -1
- package/sdk/platform/Cart/CartPlatformModel.js +132 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
- package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -4
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +14 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +6 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
- package/sdk/platform/Order/OrderPlatformClient.js +99 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -0
- package/sdk/platform/Order/OrderPlatformModel.js +3 -0
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +56 -19
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +42 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +3 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -2
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
- package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
- package/sdk/public/Configuration/ConfigurationPublicClient.js +5 -2
- package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
- package/sdk/public/Content/ContentPublicClient.js +14 -2
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +14 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +5 -2
- package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
- package/sdk/application/Cart/CartApplicationModel.js +0 -2497
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
- package/sdk/application/Cart/CartApplicationValidator.js +0 -530
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
- package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
- package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
- package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
- package/sdk/application/Common/CommonApplicationModel.js +0 -308
- package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
- package/sdk/application/Common/CommonApplicationValidator.js +0 -38
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
- package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
- package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
- package/sdk/application/Content/ContentApplicationModel.js +0 -1589
- package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
- package/sdk/application/Content/ContentApplicationValidator.js +0 -264
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
- package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
- package/sdk/application/Lead/LeadApplicationModel.js +0 -480
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
- package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
- package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
- package/sdk/application/Order/OrderApplicationModel.js +0 -1471
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
- package/sdk/application/Order/OrderApplicationValidator.js +0 -197
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
- package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
- package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
- package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
- package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
- package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
- package/sdk/application/Share/ShareApplicationModel.js +0 -234
- package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
- package/sdk/application/Share/ShareApplicationValidator.js +0 -91
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
- package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
- package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
- package/sdk/application/User/UserApplicationModel.js +0 -1382
- package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
- package/sdk/application/User/UserApplicationValidator.js +0 -573
- package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
- package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
- package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
- package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
- package/sdk/common/Clickstream.d.ts +0 -1
- package/sdk/common/Clickstream.js +0 -464
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
1
|
const {
|
|
3
2
|
FDKClientValidationError,
|
|
4
3
|
FDKResponseValidationError,
|
|
5
4
|
} = require("../../common/FDKError");
|
|
5
|
+
|
|
6
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
6
7
|
const constructUrl = require("../constructUrl");
|
|
7
8
|
const Paginator = require("../../common/Paginator");
|
|
8
|
-
const
|
|
9
|
-
const PaymentApplicationModel = require("./PaymentApplicationModel");
|
|
10
|
-
const { Logger } = require("./../../common/Logger");
|
|
11
|
-
const Joi = require("joi");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
12
10
|
|
|
13
11
|
class Payment {
|
|
14
12
|
constructor(_conf) {
|
|
@@ -109,11 +107,9 @@ class Payment {
|
|
|
109
107
|
}
|
|
110
108
|
|
|
111
109
|
/**
|
|
112
|
-
* @param {PaymentApplicationValidator.AddBeneficiaryDetailsParam} arg - Arg object.
|
|
113
110
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
114
111
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
115
|
-
* @returns {Promise<
|
|
116
|
-
* Success response
|
|
112
|
+
* @returns {Promise<RefundAccountResponse>} - Success response
|
|
117
113
|
* @name addBeneficiaryDetails
|
|
118
114
|
* @summary: Add beneficiary for refund
|
|
119
115
|
* @description: Add beneficiary details specifically for refund transactions, including account holder name, account number and bank details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/addBeneficiaryDetails/).
|
|
@@ -122,30 +118,6 @@ class Payment {
|
|
|
122
118
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
123
119
|
{ responseHeaders } = { responseHeaders: false }
|
|
124
120
|
) {
|
|
125
|
-
const {
|
|
126
|
-
error,
|
|
127
|
-
} = PaymentApplicationValidator.addBeneficiaryDetails().validate(
|
|
128
|
-
{ body },
|
|
129
|
-
{ abortEarly: false, allowUnknown: true }
|
|
130
|
-
);
|
|
131
|
-
if (error) {
|
|
132
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Showing warrnings if extra unknown parameters are found
|
|
136
|
-
const {
|
|
137
|
-
error: warrning,
|
|
138
|
-
} = PaymentApplicationValidator.addBeneficiaryDetails().validate(
|
|
139
|
-
{ body },
|
|
140
|
-
{ abortEarly: false, allowUnknown: false }
|
|
141
|
-
);
|
|
142
|
-
if (warrning) {
|
|
143
|
-
Logger({
|
|
144
|
-
level: "WARN",
|
|
145
|
-
message: `Parameter Validation warrnings for application > Payment > addBeneficiaryDetails \n ${warrning}`,
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
121
|
const query_params = {};
|
|
150
122
|
|
|
151
123
|
const xHeaders = {};
|
|
@@ -168,35 +140,13 @@ class Payment {
|
|
|
168
140
|
responseData = response[0];
|
|
169
141
|
}
|
|
170
142
|
|
|
171
|
-
const {
|
|
172
|
-
error: res_error,
|
|
173
|
-
} = PaymentApplicationModel.RefundAccountResponse().validate(responseData, {
|
|
174
|
-
abortEarly: false,
|
|
175
|
-
allowUnknown: true,
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
if (res_error) {
|
|
179
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
180
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
181
|
-
} else {
|
|
182
|
-
Logger({
|
|
183
|
-
level: "WARN",
|
|
184
|
-
message: `Response Validation Warnings for application > Payment > addBeneficiaryDetails \n ${res_error}`,
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
143
|
return response;
|
|
190
144
|
}
|
|
191
145
|
|
|
192
146
|
/**
|
|
193
|
-
* @param {PaymentApplicationValidator.AddRefundBankAccountUsingOTPParam} arg
|
|
194
|
-
* - Arg object.
|
|
195
|
-
*
|
|
196
147
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
197
148
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
198
|
-
* @returns {Promise<
|
|
199
|
-
* Success response
|
|
149
|
+
* @returns {Promise<RefundAccountResponse>} - Success response
|
|
200
150
|
* @name addRefundBankAccountUsingOTP
|
|
201
151
|
* @summary: Add refund account using OTP verification
|
|
202
152
|
* @description: Add bank account specifically for refunds, employing OTP verification for security. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/addRefundBankAccountUsingOTP/).
|
|
@@ -205,30 +155,6 @@ class Payment {
|
|
|
205
155
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
206
156
|
{ responseHeaders } = { responseHeaders: false }
|
|
207
157
|
) {
|
|
208
|
-
const {
|
|
209
|
-
error,
|
|
210
|
-
} = PaymentApplicationValidator.addRefundBankAccountUsingOTP().validate(
|
|
211
|
-
{ body },
|
|
212
|
-
{ abortEarly: false, allowUnknown: true }
|
|
213
|
-
);
|
|
214
|
-
if (error) {
|
|
215
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Showing warrnings if extra unknown parameters are found
|
|
219
|
-
const {
|
|
220
|
-
error: warrning,
|
|
221
|
-
} = PaymentApplicationValidator.addRefundBankAccountUsingOTP().validate(
|
|
222
|
-
{ body },
|
|
223
|
-
{ abortEarly: false, allowUnknown: false }
|
|
224
|
-
);
|
|
225
|
-
if (warrning) {
|
|
226
|
-
Logger({
|
|
227
|
-
level: "WARN",
|
|
228
|
-
message: `Parameter Validation warrnings for application > Payment > addRefundBankAccountUsingOTP \n ${warrning}`,
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
|
|
232
158
|
const query_params = {};
|
|
233
159
|
|
|
234
160
|
const xHeaders = {};
|
|
@@ -251,32 +177,13 @@ class Payment {
|
|
|
251
177
|
responseData = response[0];
|
|
252
178
|
}
|
|
253
179
|
|
|
254
|
-
const {
|
|
255
|
-
error: res_error,
|
|
256
|
-
} = PaymentApplicationModel.RefundAccountResponse().validate(responseData, {
|
|
257
|
-
abortEarly: false,
|
|
258
|
-
allowUnknown: true,
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
if (res_error) {
|
|
262
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
263
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
264
|
-
} else {
|
|
265
|
-
Logger({
|
|
266
|
-
level: "WARN",
|
|
267
|
-
message: `Response Validation Warnings for application > Payment > addRefundBankAccountUsingOTP \n ${res_error}`,
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
180
|
return response;
|
|
273
181
|
}
|
|
274
182
|
|
|
275
183
|
/**
|
|
276
|
-
* @param {PaymentApplicationValidator.AttachCardToCustomerParam} arg - Arg object.
|
|
277
184
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
278
185
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
279
|
-
* @returns {Promise<
|
|
186
|
+
* @returns {Promise<AttachCardsResponse>} - Success response
|
|
280
187
|
* @name attachCardToCustomer
|
|
281
188
|
* @summary: Link payment card to customer
|
|
282
189
|
* @description: Link payment card to a user account for seamless transactions. Upon successful linking, the card becomes associated with the user's profile, enabling secure and convenient payments. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/attachCardToCustomer/).
|
|
@@ -285,30 +192,6 @@ class Payment {
|
|
|
285
192
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
286
193
|
{ responseHeaders } = { responseHeaders: false }
|
|
287
194
|
) {
|
|
288
|
-
const {
|
|
289
|
-
error,
|
|
290
|
-
} = PaymentApplicationValidator.attachCardToCustomer().validate(
|
|
291
|
-
{ body },
|
|
292
|
-
{ abortEarly: false, allowUnknown: true }
|
|
293
|
-
);
|
|
294
|
-
if (error) {
|
|
295
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// Showing warrnings if extra unknown parameters are found
|
|
299
|
-
const {
|
|
300
|
-
error: warrning,
|
|
301
|
-
} = PaymentApplicationValidator.attachCardToCustomer().validate(
|
|
302
|
-
{ body },
|
|
303
|
-
{ abortEarly: false, allowUnknown: false }
|
|
304
|
-
);
|
|
305
|
-
if (warrning) {
|
|
306
|
-
Logger({
|
|
307
|
-
level: "WARN",
|
|
308
|
-
message: `Parameter Validation warrnings for application > Payment > attachCardToCustomer \n ${warrning}`,
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
|
|
312
195
|
const query_params = {};
|
|
313
196
|
|
|
314
197
|
const xHeaders = {};
|
|
@@ -331,33 +214,13 @@ class Payment {
|
|
|
331
214
|
responseData = response[0];
|
|
332
215
|
}
|
|
333
216
|
|
|
334
|
-
const {
|
|
335
|
-
error: res_error,
|
|
336
|
-
} = PaymentApplicationModel.AttachCardsResponse().validate(responseData, {
|
|
337
|
-
abortEarly: false,
|
|
338
|
-
allowUnknown: true,
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
if (res_error) {
|
|
342
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
343
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
344
|
-
} else {
|
|
345
|
-
Logger({
|
|
346
|
-
level: "WARN",
|
|
347
|
-
message: `Response Validation Warnings for application > Payment > attachCardToCustomer \n ${res_error}`,
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
217
|
return response;
|
|
353
218
|
}
|
|
354
219
|
|
|
355
220
|
/**
|
|
356
|
-
* @param {PaymentApplicationValidator.CancelPaymentLinkParam} arg - Arg object.
|
|
357
221
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
358
222
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
359
|
-
* @returns {Promise<
|
|
360
|
-
* Success response
|
|
223
|
+
* @returns {Promise<CancelPaymentLinkResponse>} - Success response
|
|
361
224
|
* @name cancelPaymentLink
|
|
362
225
|
* @summary: Cancel payment link
|
|
363
226
|
* @description: Cancel previously generated payment link. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/cancelPaymentLink/).
|
|
@@ -366,28 +229,6 @@ class Payment {
|
|
|
366
229
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
367
230
|
{ responseHeaders } = { responseHeaders: false }
|
|
368
231
|
) {
|
|
369
|
-
const { error } = PaymentApplicationValidator.cancelPaymentLink().validate(
|
|
370
|
-
{ body },
|
|
371
|
-
{ abortEarly: false, allowUnknown: true }
|
|
372
|
-
);
|
|
373
|
-
if (error) {
|
|
374
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
// Showing warrnings if extra unknown parameters are found
|
|
378
|
-
const {
|
|
379
|
-
error: warrning,
|
|
380
|
-
} = PaymentApplicationValidator.cancelPaymentLink().validate(
|
|
381
|
-
{ body },
|
|
382
|
-
{ abortEarly: false, allowUnknown: false }
|
|
383
|
-
);
|
|
384
|
-
if (warrning) {
|
|
385
|
-
Logger({
|
|
386
|
-
level: "WARN",
|
|
387
|
-
message: `Parameter Validation warrnings for application > Payment > cancelPaymentLink \n ${warrning}`,
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
|
|
391
232
|
const query_params = {};
|
|
392
233
|
|
|
393
234
|
const xHeaders = {};
|
|
@@ -410,32 +251,13 @@ class Payment {
|
|
|
410
251
|
responseData = response[0];
|
|
411
252
|
}
|
|
412
253
|
|
|
413
|
-
const {
|
|
414
|
-
error: res_error,
|
|
415
|
-
} = PaymentApplicationModel.CancelPaymentLinkResponse().validate(
|
|
416
|
-
responseData,
|
|
417
|
-
{ abortEarly: false, allowUnknown: true }
|
|
418
|
-
);
|
|
419
|
-
|
|
420
|
-
if (res_error) {
|
|
421
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
422
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
423
|
-
} else {
|
|
424
|
-
Logger({
|
|
425
|
-
level: "WARN",
|
|
426
|
-
message: `Response Validation Warnings for application > Payment > cancelPaymentLink \n ${res_error}`,
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
|
|
431
254
|
return response;
|
|
432
255
|
}
|
|
433
256
|
|
|
434
257
|
/**
|
|
435
|
-
* @param {PaymentApplicationValidator.CardDetailsParam} arg - Arg object.
|
|
436
258
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
437
259
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
438
|
-
* @returns {Promise<
|
|
260
|
+
* @returns {Promise<CardDetailsResponse>} - Success response
|
|
439
261
|
* @name cardDetails
|
|
440
262
|
* @summary: Get card details
|
|
441
263
|
* @description: Get details of a specified payment card, including information such as the card type, brand, country, and expiration date. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/cardDetails/).
|
|
@@ -444,26 +266,13 @@ class Payment {
|
|
|
444
266
|
{ cardInfo, aggregator, requestHeaders } = { requestHeaders: {} },
|
|
445
267
|
{ responseHeaders } = { responseHeaders: false }
|
|
446
268
|
) {
|
|
447
|
-
const
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
// Showing warrnings if extra unknown parameters are found
|
|
456
|
-
const {
|
|
457
|
-
error: warrning,
|
|
458
|
-
} = PaymentApplicationValidator.cardDetails().validate(
|
|
459
|
-
{ cardInfo, aggregator },
|
|
460
|
-
{ abortEarly: false, allowUnknown: false }
|
|
461
|
-
);
|
|
462
|
-
if (warrning) {
|
|
463
|
-
Logger({
|
|
464
|
-
level: "WARN",
|
|
465
|
-
message: `Parameter Validation warrnings for application > Payment > cardDetails \n ${warrning}`,
|
|
269
|
+
const errors = validateRequiredParams(arguments[0], ["cardInfo"]);
|
|
270
|
+
if (errors.length > 0) {
|
|
271
|
+
const error = new FDKClientValidationError({
|
|
272
|
+
message: "Missing required field",
|
|
273
|
+
details: errors,
|
|
466
274
|
});
|
|
275
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
467
276
|
}
|
|
468
277
|
|
|
469
278
|
const query_params = {};
|
|
@@ -489,36 +298,13 @@ class Payment {
|
|
|
489
298
|
responseData = response[0];
|
|
490
299
|
}
|
|
491
300
|
|
|
492
|
-
const {
|
|
493
|
-
error: res_error,
|
|
494
|
-
} = PaymentApplicationModel.CardDetailsResponse().validate(responseData, {
|
|
495
|
-
abortEarly: false,
|
|
496
|
-
allowUnknown: true,
|
|
497
|
-
});
|
|
498
|
-
|
|
499
|
-
if (res_error) {
|
|
500
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
501
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
502
|
-
} else {
|
|
503
|
-
Logger({
|
|
504
|
-
level: "WARN",
|
|
505
|
-
message: `Response Validation Warnings for application > Payment > cardDetails \n ${res_error}`,
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
|
|
510
301
|
return response;
|
|
511
302
|
}
|
|
512
303
|
|
|
513
304
|
/**
|
|
514
|
-
* @param {PaymentApplicationValidator.CheckAndUpdatePaymentStatusParam} arg
|
|
515
|
-
* - Arg object.
|
|
516
|
-
*
|
|
517
305
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
518
306
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
519
|
-
* @returns {Promise<
|
|
520
|
-
* - Success response
|
|
521
|
-
*
|
|
307
|
+
* @returns {Promise<PaymentStatusUpdateResponse>} - Success response
|
|
522
308
|
* @name checkAndUpdatePaymentStatus
|
|
523
309
|
* @summary: Update payment status
|
|
524
310
|
* @description: Polling process to confirm the payment status. It periodically checks and updates the current status of a payment, ensuring timely and accurate confirmation of payment transactions. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/checkAndUpdatePaymentStatus/).
|
|
@@ -527,30 +313,6 @@ class Payment {
|
|
|
527
313
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
528
314
|
{ responseHeaders } = { responseHeaders: false }
|
|
529
315
|
) {
|
|
530
|
-
const {
|
|
531
|
-
error,
|
|
532
|
-
} = PaymentApplicationValidator.checkAndUpdatePaymentStatus().validate(
|
|
533
|
-
{ body },
|
|
534
|
-
{ abortEarly: false, allowUnknown: true }
|
|
535
|
-
);
|
|
536
|
-
if (error) {
|
|
537
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
// Showing warrnings if extra unknown parameters are found
|
|
541
|
-
const {
|
|
542
|
-
error: warrning,
|
|
543
|
-
} = PaymentApplicationValidator.checkAndUpdatePaymentStatus().validate(
|
|
544
|
-
{ body },
|
|
545
|
-
{ abortEarly: false, allowUnknown: false }
|
|
546
|
-
);
|
|
547
|
-
if (warrning) {
|
|
548
|
-
Logger({
|
|
549
|
-
level: "WARN",
|
|
550
|
-
message: `Parameter Validation warrnings for application > Payment > checkAndUpdatePaymentStatus \n ${warrning}`,
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
|
|
554
316
|
const query_params = {};
|
|
555
317
|
|
|
556
318
|
const xHeaders = {};
|
|
@@ -573,36 +335,13 @@ class Payment {
|
|
|
573
335
|
responseData = response[0];
|
|
574
336
|
}
|
|
575
337
|
|
|
576
|
-
const {
|
|
577
|
-
error: res_error,
|
|
578
|
-
} = PaymentApplicationModel.PaymentStatusUpdateResponse().validate(
|
|
579
|
-
responseData,
|
|
580
|
-
{ abortEarly: false, allowUnknown: true }
|
|
581
|
-
);
|
|
582
|
-
|
|
583
|
-
if (res_error) {
|
|
584
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
585
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
586
|
-
} else {
|
|
587
|
-
Logger({
|
|
588
|
-
level: "WARN",
|
|
589
|
-
message: `Response Validation Warnings for application > Payment > checkAndUpdatePaymentStatus \n ${res_error}`,
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
|
|
594
338
|
return response;
|
|
595
339
|
}
|
|
596
340
|
|
|
597
341
|
/**
|
|
598
|
-
* @param {PaymentApplicationValidator.CheckAndUpdatePaymentStatusPaymentLinkParam} arg
|
|
599
|
-
* - Arg object.
|
|
600
|
-
*
|
|
601
342
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
602
343
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
603
|
-
* @returns {Promise<
|
|
604
|
-
* - Success response
|
|
605
|
-
*
|
|
344
|
+
* @returns {Promise<PaymentStatusUpdateResponse>} - Success response
|
|
606
345
|
* @name checkAndUpdatePaymentStatusPaymentLink
|
|
607
346
|
* @summary: Update payment link status
|
|
608
347
|
* @description: Verify and update status of a payment made through a link.Upon successful verification and update, the response includes details about the aggregator name, payment status, and whether retrying the process is required. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/checkAndUpdatePaymentStatusPaymentLink/).
|
|
@@ -611,30 +350,6 @@ class Payment {
|
|
|
611
350
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
612
351
|
{ responseHeaders } = { responseHeaders: false }
|
|
613
352
|
) {
|
|
614
|
-
const {
|
|
615
|
-
error,
|
|
616
|
-
} = PaymentApplicationValidator.checkAndUpdatePaymentStatusPaymentLink().validate(
|
|
617
|
-
{ body },
|
|
618
|
-
{ abortEarly: false, allowUnknown: true }
|
|
619
|
-
);
|
|
620
|
-
if (error) {
|
|
621
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
// Showing warrnings if extra unknown parameters are found
|
|
625
|
-
const {
|
|
626
|
-
error: warrning,
|
|
627
|
-
} = PaymentApplicationValidator.checkAndUpdatePaymentStatusPaymentLink().validate(
|
|
628
|
-
{ body },
|
|
629
|
-
{ abortEarly: false, allowUnknown: false }
|
|
630
|
-
);
|
|
631
|
-
if (warrning) {
|
|
632
|
-
Logger({
|
|
633
|
-
level: "WARN",
|
|
634
|
-
message: `Parameter Validation warrnings for application > Payment > checkAndUpdatePaymentStatusPaymentLink \n ${warrning}`,
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
|
|
638
353
|
const query_params = {};
|
|
639
354
|
|
|
640
355
|
const xHeaders = {};
|
|
@@ -657,32 +372,13 @@ class Payment {
|
|
|
657
372
|
responseData = response[0];
|
|
658
373
|
}
|
|
659
374
|
|
|
660
|
-
const {
|
|
661
|
-
error: res_error,
|
|
662
|
-
} = PaymentApplicationModel.PaymentStatusUpdateResponse().validate(
|
|
663
|
-
responseData,
|
|
664
|
-
{ abortEarly: false, allowUnknown: true }
|
|
665
|
-
);
|
|
666
|
-
|
|
667
|
-
if (res_error) {
|
|
668
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
669
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
670
|
-
} else {
|
|
671
|
-
Logger({
|
|
672
|
-
level: "WARN",
|
|
673
|
-
message: `Response Validation Warnings for application > Payment > checkAndUpdatePaymentStatusPaymentLink \n ${res_error}`,
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
|
|
678
375
|
return response;
|
|
679
376
|
}
|
|
680
377
|
|
|
681
378
|
/**
|
|
682
|
-
* @param {PaymentApplicationValidator.CheckCreditParam} arg - Arg object.
|
|
683
379
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
684
380
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
685
|
-
* @returns {Promise<
|
|
381
|
+
* @returns {Promise<CheckCreditResponse>} - Success response
|
|
686
382
|
* @name checkCredit
|
|
687
383
|
* @summary: Verify credit availability and status
|
|
688
384
|
* @description: Check the availability and status of customer credit, providing the status of payment along with registration information and signup URL if the customer is not registered. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/checkCredit/).
|
|
@@ -691,28 +387,6 @@ class Payment {
|
|
|
691
387
|
{ aggregator, requestHeaders } = { requestHeaders: {} },
|
|
692
388
|
{ responseHeaders } = { responseHeaders: false }
|
|
693
389
|
) {
|
|
694
|
-
const { error } = PaymentApplicationValidator.checkCredit().validate(
|
|
695
|
-
{ aggregator },
|
|
696
|
-
{ abortEarly: false, allowUnknown: true }
|
|
697
|
-
);
|
|
698
|
-
if (error) {
|
|
699
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
// Showing warrnings if extra unknown parameters are found
|
|
703
|
-
const {
|
|
704
|
-
error: warrning,
|
|
705
|
-
} = PaymentApplicationValidator.checkCredit().validate(
|
|
706
|
-
{ aggregator },
|
|
707
|
-
{ abortEarly: false, allowUnknown: false }
|
|
708
|
-
);
|
|
709
|
-
if (warrning) {
|
|
710
|
-
Logger({
|
|
711
|
-
level: "WARN",
|
|
712
|
-
message: `Parameter Validation warrnings for application > Payment > checkCredit \n ${warrning}`,
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
|
|
716
390
|
const query_params = {};
|
|
717
391
|
query_params["aggregator"] = aggregator;
|
|
718
392
|
|
|
@@ -736,35 +410,13 @@ class Payment {
|
|
|
736
410
|
responseData = response[0];
|
|
737
411
|
}
|
|
738
412
|
|
|
739
|
-
const {
|
|
740
|
-
error: res_error,
|
|
741
|
-
} = PaymentApplicationModel.CheckCreditResponse().validate(responseData, {
|
|
742
|
-
abortEarly: false,
|
|
743
|
-
allowUnknown: true,
|
|
744
|
-
});
|
|
745
|
-
|
|
746
|
-
if (res_error) {
|
|
747
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
748
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
749
|
-
} else {
|
|
750
|
-
Logger({
|
|
751
|
-
level: "WARN",
|
|
752
|
-
message: `Response Validation Warnings for application > Payment > checkCredit \n ${res_error}`,
|
|
753
|
-
});
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
|
|
757
413
|
return response;
|
|
758
414
|
}
|
|
759
415
|
|
|
760
416
|
/**
|
|
761
|
-
* @param {PaymentApplicationValidator.CreateOrderHandlerPaymentLinkParam} arg
|
|
762
|
-
* - Arg object.
|
|
763
|
-
*
|
|
764
417
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
765
418
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
766
|
-
* @returns {Promise<
|
|
767
|
-
* Success response
|
|
419
|
+
* @returns {Promise<CreateOrderUserResponse>} - Success response
|
|
768
420
|
* @name createOrderHandlerPaymentLink
|
|
769
421
|
* @summary: Create order for payment via link
|
|
770
422
|
* @description: Initiate the creation of an order handler for processing payments through a link. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/createOrderHandlerPaymentLink/).
|
|
@@ -773,30 +425,6 @@ class Payment {
|
|
|
773
425
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
774
426
|
{ responseHeaders } = { responseHeaders: false }
|
|
775
427
|
) {
|
|
776
|
-
const {
|
|
777
|
-
error,
|
|
778
|
-
} = PaymentApplicationValidator.createOrderHandlerPaymentLink().validate(
|
|
779
|
-
{ body },
|
|
780
|
-
{ abortEarly: false, allowUnknown: true }
|
|
781
|
-
);
|
|
782
|
-
if (error) {
|
|
783
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
// Showing warrnings if extra unknown parameters are found
|
|
787
|
-
const {
|
|
788
|
-
error: warrning,
|
|
789
|
-
} = PaymentApplicationValidator.createOrderHandlerPaymentLink().validate(
|
|
790
|
-
{ body },
|
|
791
|
-
{ abortEarly: false, allowUnknown: false }
|
|
792
|
-
);
|
|
793
|
-
if (warrning) {
|
|
794
|
-
Logger({
|
|
795
|
-
level: "WARN",
|
|
796
|
-
message: `Parameter Validation warrnings for application > Payment > createOrderHandlerPaymentLink \n ${warrning}`,
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
|
|
800
428
|
const query_params = {};
|
|
801
429
|
|
|
802
430
|
const xHeaders = {};
|
|
@@ -819,33 +447,13 @@ class Payment {
|
|
|
819
447
|
responseData = response[0];
|
|
820
448
|
}
|
|
821
449
|
|
|
822
|
-
const {
|
|
823
|
-
error: res_error,
|
|
824
|
-
} = PaymentApplicationModel.CreateOrderUserResponse().validate(
|
|
825
|
-
responseData,
|
|
826
|
-
{ abortEarly: false, allowUnknown: true }
|
|
827
|
-
);
|
|
828
|
-
|
|
829
|
-
if (res_error) {
|
|
830
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
831
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
832
|
-
} else {
|
|
833
|
-
Logger({
|
|
834
|
-
level: "WARN",
|
|
835
|
-
message: `Response Validation Warnings for application > Payment > createOrderHandlerPaymentLink \n ${res_error}`,
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
|
|
840
450
|
return response;
|
|
841
451
|
}
|
|
842
452
|
|
|
843
453
|
/**
|
|
844
|
-
* @param {PaymentApplicationValidator.CreatePaymentLinkParam} arg - Arg object.
|
|
845
454
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
846
455
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
847
|
-
* @returns {Promise<
|
|
848
|
-
* Success response
|
|
456
|
+
* @returns {Promise<CreatePaymentLinkResponse>} - Success response
|
|
849
457
|
* @name createPaymentLink
|
|
850
458
|
* @summary: Create payment link
|
|
851
459
|
* @description: Create new payment link for transactions. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/createPaymentLink/).
|
|
@@ -854,28 +462,6 @@ class Payment {
|
|
|
854
462
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
855
463
|
{ responseHeaders } = { responseHeaders: false }
|
|
856
464
|
) {
|
|
857
|
-
const { error } = PaymentApplicationValidator.createPaymentLink().validate(
|
|
858
|
-
{ body },
|
|
859
|
-
{ abortEarly: false, allowUnknown: true }
|
|
860
|
-
);
|
|
861
|
-
if (error) {
|
|
862
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
// Showing warrnings if extra unknown parameters are found
|
|
866
|
-
const {
|
|
867
|
-
error: warrning,
|
|
868
|
-
} = PaymentApplicationValidator.createPaymentLink().validate(
|
|
869
|
-
{ body },
|
|
870
|
-
{ abortEarly: false, allowUnknown: false }
|
|
871
|
-
);
|
|
872
|
-
if (warrning) {
|
|
873
|
-
Logger({
|
|
874
|
-
level: "WARN",
|
|
875
|
-
message: `Parameter Validation warrnings for application > Payment > createPaymentLink \n ${warrning}`,
|
|
876
|
-
});
|
|
877
|
-
}
|
|
878
|
-
|
|
879
465
|
const query_params = {};
|
|
880
466
|
|
|
881
467
|
const xHeaders = {};
|
|
@@ -898,32 +484,13 @@ class Payment {
|
|
|
898
484
|
responseData = response[0];
|
|
899
485
|
}
|
|
900
486
|
|
|
901
|
-
const {
|
|
902
|
-
error: res_error,
|
|
903
|
-
} = PaymentApplicationModel.CreatePaymentLinkResponse().validate(
|
|
904
|
-
responseData,
|
|
905
|
-
{ abortEarly: false, allowUnknown: true }
|
|
906
|
-
);
|
|
907
|
-
|
|
908
|
-
if (res_error) {
|
|
909
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
910
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
911
|
-
} else {
|
|
912
|
-
Logger({
|
|
913
|
-
level: "WARN",
|
|
914
|
-
message: `Response Validation Warnings for application > Payment > createPaymentLink \n ${res_error}`,
|
|
915
|
-
});
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
|
|
919
487
|
return response;
|
|
920
488
|
}
|
|
921
489
|
|
|
922
490
|
/**
|
|
923
|
-
* @param {PaymentApplicationValidator.CreatePaymentOrderParam} arg - Arg object.
|
|
924
491
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
925
492
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
926
|
-
* @returns {Promise<
|
|
493
|
+
* @returns {Promise<PaymentOrderResponse>} - Success response
|
|
927
494
|
* @name createPaymentOrder
|
|
928
495
|
* @summary: Create Order
|
|
929
496
|
* @description: Create an order and payment on the aggregator side. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/createPaymentOrder/).
|
|
@@ -932,28 +499,6 @@ class Payment {
|
|
|
932
499
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
933
500
|
{ responseHeaders } = { responseHeaders: false }
|
|
934
501
|
) {
|
|
935
|
-
const { error } = PaymentApplicationValidator.createPaymentOrder().validate(
|
|
936
|
-
{ body },
|
|
937
|
-
{ abortEarly: false, allowUnknown: true }
|
|
938
|
-
);
|
|
939
|
-
if (error) {
|
|
940
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
// Showing warrnings if extra unknown parameters are found
|
|
944
|
-
const {
|
|
945
|
-
error: warrning,
|
|
946
|
-
} = PaymentApplicationValidator.createPaymentOrder().validate(
|
|
947
|
-
{ body },
|
|
948
|
-
{ abortEarly: false, allowUnknown: false }
|
|
949
|
-
);
|
|
950
|
-
if (warrning) {
|
|
951
|
-
Logger({
|
|
952
|
-
level: "WARN",
|
|
953
|
-
message: `Parameter Validation warrnings for application > Payment > createPaymentOrder \n ${warrning}`,
|
|
954
|
-
});
|
|
955
|
-
}
|
|
956
|
-
|
|
957
502
|
const query_params = {};
|
|
958
503
|
|
|
959
504
|
const xHeaders = {};
|
|
@@ -976,34 +521,13 @@ class Payment {
|
|
|
976
521
|
responseData = response[0];
|
|
977
522
|
}
|
|
978
523
|
|
|
979
|
-
const {
|
|
980
|
-
error: res_error,
|
|
981
|
-
} = PaymentApplicationModel.PaymentOrderResponse().validate(responseData, {
|
|
982
|
-
abortEarly: false,
|
|
983
|
-
allowUnknown: true,
|
|
984
|
-
});
|
|
985
|
-
|
|
986
|
-
if (res_error) {
|
|
987
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
988
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
989
|
-
} else {
|
|
990
|
-
Logger({
|
|
991
|
-
level: "WARN",
|
|
992
|
-
message: `Response Validation Warnings for application > Payment > createPaymentOrder \n ${res_error}`,
|
|
993
|
-
});
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
|
|
997
524
|
return response;
|
|
998
525
|
}
|
|
999
526
|
|
|
1000
527
|
/**
|
|
1001
|
-
* @param {PaymentApplicationValidator.CustomerCreditSummaryParam} arg - Arg object.
|
|
1002
528
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1003
529
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1004
|
-
* @returns {Promise<
|
|
1005
|
-
* - Success response
|
|
1006
|
-
*
|
|
530
|
+
* @returns {Promise<CustomerCreditSummaryResponse>} - Success response
|
|
1007
531
|
* @name customerCreditSummary
|
|
1008
532
|
* @summary: Credit summary
|
|
1009
533
|
* @description: Get summary of the customer's credit information, including details such as merchant customer reference ID, status, balance, limit, due amount, used amount, due date, days overdue, total due amount, and a repayment URL. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/customerCreditSummary/).
|
|
@@ -1012,30 +536,6 @@ class Payment {
|
|
|
1012
536
|
{ aggregator, requestHeaders } = { requestHeaders: {} },
|
|
1013
537
|
{ responseHeaders } = { responseHeaders: false }
|
|
1014
538
|
) {
|
|
1015
|
-
const {
|
|
1016
|
-
error,
|
|
1017
|
-
} = PaymentApplicationValidator.customerCreditSummary().validate(
|
|
1018
|
-
{ aggregator },
|
|
1019
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1020
|
-
);
|
|
1021
|
-
if (error) {
|
|
1022
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1026
|
-
const {
|
|
1027
|
-
error: warrning,
|
|
1028
|
-
} = PaymentApplicationValidator.customerCreditSummary().validate(
|
|
1029
|
-
{ aggregator },
|
|
1030
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1031
|
-
);
|
|
1032
|
-
if (warrning) {
|
|
1033
|
-
Logger({
|
|
1034
|
-
level: "WARN",
|
|
1035
|
-
message: `Parameter Validation warrnings for application > Payment > customerCreditSummary \n ${warrning}`,
|
|
1036
|
-
});
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
539
|
const query_params = {};
|
|
1040
540
|
query_params["aggregator"] = aggregator;
|
|
1041
541
|
|
|
@@ -1059,33 +559,13 @@ class Payment {
|
|
|
1059
559
|
responseData = response[0];
|
|
1060
560
|
}
|
|
1061
561
|
|
|
1062
|
-
const {
|
|
1063
|
-
error: res_error,
|
|
1064
|
-
} = PaymentApplicationModel.CustomerCreditSummaryResponse().validate(
|
|
1065
|
-
responseData,
|
|
1066
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1067
|
-
);
|
|
1068
|
-
|
|
1069
|
-
if (res_error) {
|
|
1070
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1071
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1072
|
-
} else {
|
|
1073
|
-
Logger({
|
|
1074
|
-
level: "WARN",
|
|
1075
|
-
message: `Response Validation Warnings for application > Payment > customerCreditSummary \n ${res_error}`,
|
|
1076
|
-
});
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
562
|
return response;
|
|
1081
563
|
}
|
|
1082
564
|
|
|
1083
565
|
/**
|
|
1084
|
-
* @param {PaymentApplicationValidator.CustomerOnboardParam} arg - Arg object.
|
|
1085
566
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1086
567
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1087
|
-
* @returns {Promise<
|
|
1088
|
-
* Success response
|
|
568
|
+
* @returns {Promise<CustomerOnboardingResponse>} - Success response
|
|
1089
569
|
* @name customerOnboard
|
|
1090
570
|
* @summary: Onboard customer for payment
|
|
1091
571
|
* @description: Initiate the onboarding process for payment services, providing personal, business, and device information, along with marketplace details, to enable customer registration and credit availability. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/customerOnboard/).
|
|
@@ -1094,28 +574,6 @@ class Payment {
|
|
|
1094
574
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1095
575
|
{ responseHeaders } = { responseHeaders: false }
|
|
1096
576
|
) {
|
|
1097
|
-
const { error } = PaymentApplicationValidator.customerOnboard().validate(
|
|
1098
|
-
{ body },
|
|
1099
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1100
|
-
);
|
|
1101
|
-
if (error) {
|
|
1102
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1106
|
-
const {
|
|
1107
|
-
error: warrning,
|
|
1108
|
-
} = PaymentApplicationValidator.customerOnboard().validate(
|
|
1109
|
-
{ body },
|
|
1110
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1111
|
-
);
|
|
1112
|
-
if (warrning) {
|
|
1113
|
-
Logger({
|
|
1114
|
-
level: "WARN",
|
|
1115
|
-
message: `Parameter Validation warrnings for application > Payment > customerOnboard \n ${warrning}`,
|
|
1116
|
-
});
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
577
|
const query_params = {};
|
|
1120
578
|
|
|
1121
579
|
const xHeaders = {};
|
|
@@ -1138,32 +596,13 @@ class Payment {
|
|
|
1138
596
|
responseData = response[0];
|
|
1139
597
|
}
|
|
1140
598
|
|
|
1141
|
-
const {
|
|
1142
|
-
error: res_error,
|
|
1143
|
-
} = PaymentApplicationModel.CustomerOnboardingResponse().validate(
|
|
1144
|
-
responseData,
|
|
1145
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1146
|
-
);
|
|
1147
|
-
|
|
1148
|
-
if (res_error) {
|
|
1149
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1150
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1151
|
-
} else {
|
|
1152
|
-
Logger({
|
|
1153
|
-
level: "WARN",
|
|
1154
|
-
message: `Response Validation Warnings for application > Payment > customerOnboard \n ${res_error}`,
|
|
1155
|
-
});
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
599
|
return response;
|
|
1160
600
|
}
|
|
1161
601
|
|
|
1162
602
|
/**
|
|
1163
|
-
* @param {PaymentApplicationValidator.DeleteUserCardParam} arg - Arg object.
|
|
1164
603
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1165
604
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1166
|
-
* @returns {Promise<
|
|
605
|
+
* @returns {Promise<DeleteCardsResponse>} - Success response
|
|
1167
606
|
* @name deleteUserCard
|
|
1168
607
|
* @summary: Delete customer card
|
|
1169
608
|
* @description: Delete payment card from the user's account. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/deleteUserCard/).
|
|
@@ -1172,28 +611,6 @@ class Payment {
|
|
|
1172
611
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1173
612
|
{ responseHeaders } = { responseHeaders: false }
|
|
1174
613
|
) {
|
|
1175
|
-
const { error } = PaymentApplicationValidator.deleteUserCard().validate(
|
|
1176
|
-
{ body },
|
|
1177
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1178
|
-
);
|
|
1179
|
-
if (error) {
|
|
1180
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1184
|
-
const {
|
|
1185
|
-
error: warrning,
|
|
1186
|
-
} = PaymentApplicationValidator.deleteUserCard().validate(
|
|
1187
|
-
{ body },
|
|
1188
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1189
|
-
);
|
|
1190
|
-
if (warrning) {
|
|
1191
|
-
Logger({
|
|
1192
|
-
level: "WARN",
|
|
1193
|
-
message: `Parameter Validation warrnings for application > Payment > deleteUserCard \n ${warrning}`,
|
|
1194
|
-
});
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
614
|
const query_params = {};
|
|
1198
615
|
|
|
1199
616
|
const xHeaders = {};
|
|
@@ -1216,32 +633,13 @@ class Payment {
|
|
|
1216
633
|
responseData = response[0];
|
|
1217
634
|
}
|
|
1218
635
|
|
|
1219
|
-
const {
|
|
1220
|
-
error: res_error,
|
|
1221
|
-
} = PaymentApplicationModel.DeleteCardsResponse().validate(responseData, {
|
|
1222
|
-
abortEarly: false,
|
|
1223
|
-
allowUnknown: true,
|
|
1224
|
-
});
|
|
1225
|
-
|
|
1226
|
-
if (res_error) {
|
|
1227
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1228
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1229
|
-
} else {
|
|
1230
|
-
Logger({
|
|
1231
|
-
level: "WARN",
|
|
1232
|
-
message: `Response Validation Warnings for application > Payment > deleteUserCard \n ${res_error}`,
|
|
1233
|
-
});
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
636
|
return response;
|
|
1238
637
|
}
|
|
1239
638
|
|
|
1240
639
|
/**
|
|
1241
|
-
* @param {PaymentApplicationValidator.DelinkWalletParam} arg - Arg object.
|
|
1242
640
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1243
641
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1244
|
-
* @returns {Promise<
|
|
642
|
+
* @returns {Promise<WalletResponseSchema>} - Success response
|
|
1245
643
|
* @name delinkWallet
|
|
1246
644
|
* @summary: Delink the wallet
|
|
1247
645
|
* @description: Delink the wallet. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/delinkWallet/).
|
|
@@ -1250,28 +648,6 @@ class Payment {
|
|
|
1250
648
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1251
649
|
{ responseHeaders } = { responseHeaders: false }
|
|
1252
650
|
) {
|
|
1253
|
-
const { error } = PaymentApplicationValidator.delinkWallet().validate(
|
|
1254
|
-
{ body },
|
|
1255
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1256
|
-
);
|
|
1257
|
-
if (error) {
|
|
1258
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1262
|
-
const {
|
|
1263
|
-
error: warrning,
|
|
1264
|
-
} = PaymentApplicationValidator.delinkWallet().validate(
|
|
1265
|
-
{ body },
|
|
1266
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1267
|
-
);
|
|
1268
|
-
if (warrning) {
|
|
1269
|
-
Logger({
|
|
1270
|
-
level: "WARN",
|
|
1271
|
-
message: `Parameter Validation warrnings for application > Payment > delinkWallet \n ${warrning}`,
|
|
1272
|
-
});
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
651
|
const query_params = {};
|
|
1276
652
|
|
|
1277
653
|
const xHeaders = {};
|
|
@@ -1294,36 +670,13 @@ class Payment {
|
|
|
1294
670
|
responseData = response[0];
|
|
1295
671
|
}
|
|
1296
672
|
|
|
1297
|
-
const {
|
|
1298
|
-
error: res_error,
|
|
1299
|
-
} = PaymentApplicationModel.WalletResponseSchema().validate(responseData, {
|
|
1300
|
-
abortEarly: false,
|
|
1301
|
-
allowUnknown: true,
|
|
1302
|
-
});
|
|
1303
|
-
|
|
1304
|
-
if (res_error) {
|
|
1305
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1306
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1307
|
-
} else {
|
|
1308
|
-
Logger({
|
|
1309
|
-
level: "WARN",
|
|
1310
|
-
message: `Response Validation Warnings for application > Payment > delinkWallet \n ${res_error}`,
|
|
1311
|
-
});
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
673
|
return response;
|
|
1316
674
|
}
|
|
1317
675
|
|
|
1318
676
|
/**
|
|
1319
|
-
* @param {PaymentApplicationValidator.EnableOrDisableRefundTransferModeParam} arg
|
|
1320
|
-
* - Arg object.
|
|
1321
|
-
*
|
|
1322
677
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1323
678
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1324
|
-
* @returns {Promise<
|
|
1325
|
-
* - Success response
|
|
1326
|
-
*
|
|
679
|
+
* @returns {Promise<UpdateRefundTransferModeResponse>} - Success response
|
|
1327
680
|
* @name enableOrDisableRefundTransferMode
|
|
1328
681
|
* @summary: Toggle refund mode
|
|
1329
682
|
* @description: Enable/Disable a particular refund transfer mode based on the request body parameters, indicating whether the mode should be enabled or disabled. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/enableOrDisableRefundTransferMode/).
|
|
@@ -1332,30 +685,6 @@ class Payment {
|
|
|
1332
685
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1333
686
|
{ responseHeaders } = { responseHeaders: false }
|
|
1334
687
|
) {
|
|
1335
|
-
const {
|
|
1336
|
-
error,
|
|
1337
|
-
} = PaymentApplicationValidator.enableOrDisableRefundTransferMode().validate(
|
|
1338
|
-
{ body },
|
|
1339
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1340
|
-
);
|
|
1341
|
-
if (error) {
|
|
1342
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1346
|
-
const {
|
|
1347
|
-
error: warrning,
|
|
1348
|
-
} = PaymentApplicationValidator.enableOrDisableRefundTransferMode().validate(
|
|
1349
|
-
{ body },
|
|
1350
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1351
|
-
);
|
|
1352
|
-
if (warrning) {
|
|
1353
|
-
Logger({
|
|
1354
|
-
level: "WARN",
|
|
1355
|
-
message: `Parameter Validation warrnings for application > Payment > enableOrDisableRefundTransferMode \n ${warrning}`,
|
|
1356
|
-
});
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
688
|
const query_params = {};
|
|
1360
689
|
|
|
1361
690
|
const xHeaders = {};
|
|
@@ -1378,34 +707,13 @@ class Payment {
|
|
|
1378
707
|
responseData = response[0];
|
|
1379
708
|
}
|
|
1380
709
|
|
|
1381
|
-
const {
|
|
1382
|
-
error: res_error,
|
|
1383
|
-
} = PaymentApplicationModel.UpdateRefundTransferModeResponse().validate(
|
|
1384
|
-
responseData,
|
|
1385
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1386
|
-
);
|
|
1387
|
-
|
|
1388
|
-
if (res_error) {
|
|
1389
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1390
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1391
|
-
} else {
|
|
1392
|
-
Logger({
|
|
1393
|
-
level: "WARN",
|
|
1394
|
-
message: `Response Validation Warnings for application > Payment > enableOrDisableRefundTransferMode \n ${res_error}`,
|
|
1395
|
-
});
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
710
|
return response;
|
|
1400
711
|
}
|
|
1401
712
|
|
|
1402
713
|
/**
|
|
1403
|
-
* @param {PaymentApplicationValidator.GetActiveCardAggregatorParam} arg - Arg object.
|
|
1404
714
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1405
715
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1406
|
-
* @returns {Promise<
|
|
1407
|
-
* - Success response
|
|
1408
|
-
*
|
|
716
|
+
* @returns {Promise<ActiveCardPaymentGatewayResponse>} - Success response
|
|
1409
717
|
* @name getActiveCardAggregator
|
|
1410
718
|
* @summary: Retrieve active card aggregator
|
|
1411
719
|
* @description: Get details about the active card aggregator used by the user, including the aggregator name.You can refresh the data by setting the 'refresh' parameter to true if needed. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getActiveCardAggregator/).
|
|
@@ -1414,30 +722,6 @@ class Payment {
|
|
|
1414
722
|
{ refresh, requestHeaders } = { requestHeaders: {} },
|
|
1415
723
|
{ responseHeaders } = { responseHeaders: false }
|
|
1416
724
|
) {
|
|
1417
|
-
const {
|
|
1418
|
-
error,
|
|
1419
|
-
} = PaymentApplicationValidator.getActiveCardAggregator().validate(
|
|
1420
|
-
{ refresh },
|
|
1421
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1422
|
-
);
|
|
1423
|
-
if (error) {
|
|
1424
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1428
|
-
const {
|
|
1429
|
-
error: warrning,
|
|
1430
|
-
} = PaymentApplicationValidator.getActiveCardAggregator().validate(
|
|
1431
|
-
{ refresh },
|
|
1432
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1433
|
-
);
|
|
1434
|
-
if (warrning) {
|
|
1435
|
-
Logger({
|
|
1436
|
-
level: "WARN",
|
|
1437
|
-
message: `Parameter Validation warrnings for application > Payment > getActiveCardAggregator \n ${warrning}`,
|
|
1438
|
-
});
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
725
|
const query_params = {};
|
|
1442
726
|
query_params["refresh"] = refresh;
|
|
1443
727
|
|
|
@@ -1461,34 +745,13 @@ class Payment {
|
|
|
1461
745
|
responseData = response[0];
|
|
1462
746
|
}
|
|
1463
747
|
|
|
1464
|
-
const {
|
|
1465
|
-
error: res_error,
|
|
1466
|
-
} = PaymentApplicationModel.ActiveCardPaymentGatewayResponse().validate(
|
|
1467
|
-
responseData,
|
|
1468
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1469
|
-
);
|
|
1470
|
-
|
|
1471
|
-
if (res_error) {
|
|
1472
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1473
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1474
|
-
} else {
|
|
1475
|
-
Logger({
|
|
1476
|
-
level: "WARN",
|
|
1477
|
-
message: `Response Validation Warnings for application > Payment > getActiveCardAggregator \n ${res_error}`,
|
|
1478
|
-
});
|
|
1479
|
-
}
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
748
|
return response;
|
|
1483
749
|
}
|
|
1484
750
|
|
|
1485
751
|
/**
|
|
1486
|
-
* @param {PaymentApplicationValidator.GetActiveRefundTransferModesParam} arg
|
|
1487
|
-
* - Arg object.
|
|
1488
|
-
*
|
|
1489
752
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1490
753
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1491
|
-
* @returns {Promise<
|
|
754
|
+
* @returns {Promise<TransferModeResponse>} - Success response
|
|
1492
755
|
* @name getActiveRefundTransferModes
|
|
1493
756
|
* @summary: Get refund transfer modes
|
|
1494
757
|
* @description: Lists available refund modes, such as UPI, providing details like display name, logo, and ID for each mode. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getActiveRefundTransferModes/).
|
|
@@ -1497,30 +760,6 @@ class Payment {
|
|
|
1497
760
|
{ requestHeaders } = { requestHeaders: {} },
|
|
1498
761
|
{ responseHeaders } = { responseHeaders: false }
|
|
1499
762
|
) {
|
|
1500
|
-
const {
|
|
1501
|
-
error,
|
|
1502
|
-
} = PaymentApplicationValidator.getActiveRefundTransferModes().validate(
|
|
1503
|
-
{},
|
|
1504
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1505
|
-
);
|
|
1506
|
-
if (error) {
|
|
1507
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1508
|
-
}
|
|
1509
|
-
|
|
1510
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1511
|
-
const {
|
|
1512
|
-
error: warrning,
|
|
1513
|
-
} = PaymentApplicationValidator.getActiveRefundTransferModes().validate(
|
|
1514
|
-
{},
|
|
1515
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1516
|
-
);
|
|
1517
|
-
if (warrning) {
|
|
1518
|
-
Logger({
|
|
1519
|
-
level: "WARN",
|
|
1520
|
-
message: `Parameter Validation warrnings for application > Payment > getActiveRefundTransferModes \n ${warrning}`,
|
|
1521
|
-
});
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
763
|
const query_params = {};
|
|
1525
764
|
|
|
1526
765
|
const xHeaders = {};
|
|
@@ -1543,32 +782,13 @@ class Payment {
|
|
|
1543
782
|
responseData = response[0];
|
|
1544
783
|
}
|
|
1545
784
|
|
|
1546
|
-
const {
|
|
1547
|
-
error: res_error,
|
|
1548
|
-
} = PaymentApplicationModel.TransferModeResponse().validate(responseData, {
|
|
1549
|
-
abortEarly: false,
|
|
1550
|
-
allowUnknown: true,
|
|
1551
|
-
});
|
|
1552
|
-
|
|
1553
|
-
if (res_error) {
|
|
1554
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1555
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1556
|
-
} else {
|
|
1557
|
-
Logger({
|
|
1558
|
-
level: "WARN",
|
|
1559
|
-
message: `Response Validation Warnings for application > Payment > getActiveRefundTransferModes \n ${res_error}`,
|
|
1560
|
-
});
|
|
1561
|
-
}
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
785
|
return response;
|
|
1565
786
|
}
|
|
1566
787
|
|
|
1567
788
|
/**
|
|
1568
|
-
* @param {PaymentApplicationValidator.GetActiveUserCardsParam} arg - Arg object.
|
|
1569
789
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1570
790
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1571
|
-
* @returns {Promise<
|
|
791
|
+
* @returns {Promise<ListCardsResponse>} - Success response
|
|
1572
792
|
* @name getActiveUserCards
|
|
1573
793
|
* @summary: Get customer cards
|
|
1574
794
|
* @description: List all active cards saved by the user.Includes details such as the card's aggregator name, card ID, token, reference, number, expiration date, type, issuer, brand, nickname, and whether it has expired. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getActiveUserCards/).
|
|
@@ -1577,28 +797,6 @@ class Payment {
|
|
|
1577
797
|
{ forceRefresh, requestHeaders } = { requestHeaders: {} },
|
|
1578
798
|
{ responseHeaders } = { responseHeaders: false }
|
|
1579
799
|
) {
|
|
1580
|
-
const { error } = PaymentApplicationValidator.getActiveUserCards().validate(
|
|
1581
|
-
{ forceRefresh },
|
|
1582
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1583
|
-
);
|
|
1584
|
-
if (error) {
|
|
1585
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1589
|
-
const {
|
|
1590
|
-
error: warrning,
|
|
1591
|
-
} = PaymentApplicationValidator.getActiveUserCards().validate(
|
|
1592
|
-
{ forceRefresh },
|
|
1593
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1594
|
-
);
|
|
1595
|
-
if (warrning) {
|
|
1596
|
-
Logger({
|
|
1597
|
-
level: "WARN",
|
|
1598
|
-
message: `Parameter Validation warrnings for application > Payment > getActiveUserCards \n ${warrning}`,
|
|
1599
|
-
});
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
800
|
const query_params = {};
|
|
1603
801
|
query_params["force_refresh"] = forceRefresh;
|
|
1604
802
|
|
|
@@ -1622,34 +820,13 @@ class Payment {
|
|
|
1622
820
|
responseData = response[0];
|
|
1623
821
|
}
|
|
1624
822
|
|
|
1625
|
-
const {
|
|
1626
|
-
error: res_error,
|
|
1627
|
-
} = PaymentApplicationModel.ListCardsResponse().validate(responseData, {
|
|
1628
|
-
abortEarly: false,
|
|
1629
|
-
allowUnknown: true,
|
|
1630
|
-
});
|
|
1631
|
-
|
|
1632
|
-
if (res_error) {
|
|
1633
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1634
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1635
|
-
} else {
|
|
1636
|
-
Logger({
|
|
1637
|
-
level: "WARN",
|
|
1638
|
-
message: `Response Validation Warnings for application > Payment > getActiveUserCards \n ${res_error}`,
|
|
1639
|
-
});
|
|
1640
|
-
}
|
|
1641
|
-
}
|
|
1642
|
-
|
|
1643
823
|
return response;
|
|
1644
824
|
}
|
|
1645
825
|
|
|
1646
826
|
/**
|
|
1647
|
-
* @param {PaymentApplicationValidator.GetAggregatorsConfigParam} arg - Arg object.
|
|
1648
827
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1649
828
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1650
|
-
* @returns {Promise<
|
|
1651
|
-
* - Success response
|
|
1652
|
-
*
|
|
829
|
+
* @returns {Promise<AggregatorsConfigDetailResponse>} - Success response
|
|
1653
830
|
* @name getAggregatorsConfig
|
|
1654
831
|
* @summary: Get payment aggregators
|
|
1655
832
|
* @description: Get aggregator secret key of all payment gateways utilized for payments when using the SDK for the payment gateway. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getAggregatorsConfig/).
|
|
@@ -1658,30 +835,6 @@ class Payment {
|
|
|
1658
835
|
{ xApiToken, refresh, requestHeaders } = { requestHeaders: {} },
|
|
1659
836
|
{ responseHeaders } = { responseHeaders: false }
|
|
1660
837
|
) {
|
|
1661
|
-
const {
|
|
1662
|
-
error,
|
|
1663
|
-
} = PaymentApplicationValidator.getAggregatorsConfig().validate(
|
|
1664
|
-
{ xApiToken, refresh },
|
|
1665
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1666
|
-
);
|
|
1667
|
-
if (error) {
|
|
1668
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1672
|
-
const {
|
|
1673
|
-
error: warrning,
|
|
1674
|
-
} = PaymentApplicationValidator.getAggregatorsConfig().validate(
|
|
1675
|
-
{ xApiToken, refresh },
|
|
1676
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1677
|
-
);
|
|
1678
|
-
if (warrning) {
|
|
1679
|
-
Logger({
|
|
1680
|
-
level: "WARN",
|
|
1681
|
-
message: `Parameter Validation warrnings for application > Payment > getAggregatorsConfig \n ${warrning}`,
|
|
1682
|
-
});
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
838
|
const query_params = {};
|
|
1686
839
|
query_params["refresh"] = refresh;
|
|
1687
840
|
|
|
@@ -1706,35 +859,13 @@ class Payment {
|
|
|
1706
859
|
responseData = response[0];
|
|
1707
860
|
}
|
|
1708
861
|
|
|
1709
|
-
const {
|
|
1710
|
-
error: res_error,
|
|
1711
|
-
} = PaymentApplicationModel.AggregatorsConfigDetailResponse().validate(
|
|
1712
|
-
responseData,
|
|
1713
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1714
|
-
);
|
|
1715
|
-
|
|
1716
|
-
if (res_error) {
|
|
1717
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1718
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1719
|
-
} else {
|
|
1720
|
-
Logger({
|
|
1721
|
-
level: "WARN",
|
|
1722
|
-
message: `Response Validation Warnings for application > Payment > getAggregatorsConfig \n ${res_error}`,
|
|
1723
|
-
});
|
|
1724
|
-
}
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
862
|
return response;
|
|
1728
863
|
}
|
|
1729
864
|
|
|
1730
865
|
/**
|
|
1731
|
-
* @param {PaymentApplicationValidator.GetEpaylaterBannerDetailsParam} arg
|
|
1732
|
-
* - Arg object.
|
|
1733
|
-
*
|
|
1734
866
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1735
867
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1736
|
-
* @returns {Promise<
|
|
1737
|
-
* Success response
|
|
868
|
+
* @returns {Promise<EpaylaterBannerResponse>} - Success response
|
|
1738
869
|
* @name getEpaylaterBannerDetails
|
|
1739
870
|
* @summary: Epaylater banner info
|
|
1740
871
|
* @description: Get Epaylater payment banner details. It provides information about the banner's display status, along with relevant messages and the user's registration status. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getEpaylaterBannerDetails/).
|
|
@@ -1743,30 +874,6 @@ class Payment {
|
|
|
1743
874
|
{ requestHeaders } = { requestHeaders: {} },
|
|
1744
875
|
{ responseHeaders } = { responseHeaders: false }
|
|
1745
876
|
) {
|
|
1746
|
-
const {
|
|
1747
|
-
error,
|
|
1748
|
-
} = PaymentApplicationValidator.getEpaylaterBannerDetails().validate(
|
|
1749
|
-
{},
|
|
1750
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1751
|
-
);
|
|
1752
|
-
if (error) {
|
|
1753
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1757
|
-
const {
|
|
1758
|
-
error: warrning,
|
|
1759
|
-
} = PaymentApplicationValidator.getEpaylaterBannerDetails().validate(
|
|
1760
|
-
{},
|
|
1761
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1762
|
-
);
|
|
1763
|
-
if (warrning) {
|
|
1764
|
-
Logger({
|
|
1765
|
-
level: "WARN",
|
|
1766
|
-
message: `Parameter Validation warrnings for application > Payment > getEpaylaterBannerDetails \n ${warrning}`,
|
|
1767
|
-
});
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
877
|
const query_params = {};
|
|
1771
878
|
|
|
1772
879
|
const xHeaders = {};
|
|
@@ -1789,35 +896,13 @@ class Payment {
|
|
|
1789
896
|
responseData = response[0];
|
|
1790
897
|
}
|
|
1791
898
|
|
|
1792
|
-
const {
|
|
1793
|
-
error: res_error,
|
|
1794
|
-
} = PaymentApplicationModel.EpaylaterBannerResponse().validate(
|
|
1795
|
-
responseData,
|
|
1796
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1797
|
-
);
|
|
1798
|
-
|
|
1799
|
-
if (res_error) {
|
|
1800
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1801
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1802
|
-
} else {
|
|
1803
|
-
Logger({
|
|
1804
|
-
level: "WARN",
|
|
1805
|
-
message: `Response Validation Warnings for application > Payment > getEpaylaterBannerDetails \n ${res_error}`,
|
|
1806
|
-
});
|
|
1807
|
-
}
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
899
|
return response;
|
|
1811
900
|
}
|
|
1812
901
|
|
|
1813
902
|
/**
|
|
1814
|
-
* @param {PaymentApplicationValidator.GetOrderBeneficiariesDetailParam} arg
|
|
1815
|
-
* - Arg object.
|
|
1816
|
-
*
|
|
1817
903
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1818
904
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1819
|
-
* @returns {Promise<
|
|
1820
|
-
* Success response
|
|
905
|
+
* @returns {Promise<OrderBeneficiaryResponse>} - Success response
|
|
1821
906
|
* @name getOrderBeneficiariesDetail
|
|
1822
907
|
* @summary: Retrieve beneficiary details
|
|
1823
908
|
* @description: Get beneficiary details like bank name , ifsc code , branch name associated with a specific order for refund processing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getOrderBeneficiariesDetail/).
|
|
@@ -1826,30 +911,6 @@ class Payment {
|
|
|
1826
911
|
{ orderId, requestHeaders } = { requestHeaders: {} },
|
|
1827
912
|
{ responseHeaders } = { responseHeaders: false }
|
|
1828
913
|
) {
|
|
1829
|
-
const {
|
|
1830
|
-
error,
|
|
1831
|
-
} = PaymentApplicationValidator.getOrderBeneficiariesDetail().validate(
|
|
1832
|
-
{ orderId },
|
|
1833
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1834
|
-
);
|
|
1835
|
-
if (error) {
|
|
1836
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1840
|
-
const {
|
|
1841
|
-
error: warrning,
|
|
1842
|
-
} = PaymentApplicationValidator.getOrderBeneficiariesDetail().validate(
|
|
1843
|
-
{ orderId },
|
|
1844
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1845
|
-
);
|
|
1846
|
-
if (warrning) {
|
|
1847
|
-
Logger({
|
|
1848
|
-
level: "WARN",
|
|
1849
|
-
message: `Parameter Validation warrnings for application > Payment > getOrderBeneficiariesDetail \n ${warrning}`,
|
|
1850
|
-
});
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
914
|
const query_params = {};
|
|
1854
915
|
query_params["order_id"] = orderId;
|
|
1855
916
|
|
|
@@ -1873,33 +934,13 @@ class Payment {
|
|
|
1873
934
|
responseData = response[0];
|
|
1874
935
|
}
|
|
1875
936
|
|
|
1876
|
-
const {
|
|
1877
|
-
error: res_error,
|
|
1878
|
-
} = PaymentApplicationModel.OrderBeneficiaryResponse().validate(
|
|
1879
|
-
responseData,
|
|
1880
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1881
|
-
);
|
|
1882
|
-
|
|
1883
|
-
if (res_error) {
|
|
1884
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1885
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1886
|
-
} else {
|
|
1887
|
-
Logger({
|
|
1888
|
-
level: "WARN",
|
|
1889
|
-
message: `Response Validation Warnings for application > Payment > getOrderBeneficiariesDetail \n ${res_error}`,
|
|
1890
|
-
});
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
|
|
1894
937
|
return response;
|
|
1895
938
|
}
|
|
1896
939
|
|
|
1897
940
|
/**
|
|
1898
|
-
* @param {PaymentApplicationValidator.GetPaymentLinkParam} arg - Arg object.
|
|
1899
941
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1900
942
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1901
|
-
* @returns {Promise<
|
|
1902
|
-
* Success response
|
|
943
|
+
* @returns {Promise<GetPaymentLinkResponse>} - Success response
|
|
1903
944
|
* @name getPaymentLink
|
|
1904
945
|
* @summary: Get payment link
|
|
1905
946
|
* @description: Get a generated payment link. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getPaymentLink/).
|
|
@@ -1908,28 +949,6 @@ class Payment {
|
|
|
1908
949
|
{ paymentLinkId, requestHeaders } = { requestHeaders: {} },
|
|
1909
950
|
{ responseHeaders } = { responseHeaders: false }
|
|
1910
951
|
) {
|
|
1911
|
-
const { error } = PaymentApplicationValidator.getPaymentLink().validate(
|
|
1912
|
-
{ paymentLinkId },
|
|
1913
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1914
|
-
);
|
|
1915
|
-
if (error) {
|
|
1916
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1920
|
-
const {
|
|
1921
|
-
error: warrning,
|
|
1922
|
-
} = PaymentApplicationValidator.getPaymentLink().validate(
|
|
1923
|
-
{ paymentLinkId },
|
|
1924
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1925
|
-
);
|
|
1926
|
-
if (warrning) {
|
|
1927
|
-
Logger({
|
|
1928
|
-
level: "WARN",
|
|
1929
|
-
message: `Parameter Validation warrnings for application > Payment > getPaymentLink \n ${warrning}`,
|
|
1930
|
-
});
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
952
|
const query_params = {};
|
|
1934
953
|
query_params["payment_link_id"] = paymentLinkId;
|
|
1935
954
|
|
|
@@ -1953,33 +972,13 @@ class Payment {
|
|
|
1953
972
|
responseData = response[0];
|
|
1954
973
|
}
|
|
1955
974
|
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
} = PaymentApplicationModel.GetPaymentLinkResponse().validate(
|
|
1959
|
-
responseData,
|
|
1960
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1961
|
-
);
|
|
1962
|
-
|
|
1963
|
-
if (res_error) {
|
|
1964
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1965
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1966
|
-
} else {
|
|
1967
|
-
Logger({
|
|
1968
|
-
level: "WARN",
|
|
1969
|
-
message: `Response Validation Warnings for application > Payment > getPaymentLink \n ${res_error}`,
|
|
1970
|
-
});
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
|
|
1974
|
-
return response;
|
|
1975
|
-
}
|
|
975
|
+
return response;
|
|
976
|
+
}
|
|
1976
977
|
|
|
1977
978
|
/**
|
|
1978
|
-
* @param {PaymentApplicationValidator.GetPaymentModeRoutesParam} arg - Arg object.
|
|
1979
979
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1980
980
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1981
|
-
* @returns {Promise<
|
|
1982
|
-
* Success response
|
|
981
|
+
* @returns {Promise<PaymentModeRouteResponse>} - Success response
|
|
1983
982
|
* @name getPaymentModeRoutes
|
|
1984
983
|
* @summary: Get payment modes
|
|
1985
984
|
* @description: Get available payment methods on the payment page, specifying the aggregator for each option, such as 'Netbanking powered by Juspay' and 'Card powered by Razorpay'. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getPaymentModeRoutes/).
|
|
@@ -2000,52 +999,6 @@ class Payment {
|
|
|
2000
999
|
} = { requestHeaders: {} },
|
|
2001
1000
|
{ responseHeaders } = { responseHeaders: false }
|
|
2002
1001
|
) {
|
|
2003
|
-
const {
|
|
2004
|
-
error,
|
|
2005
|
-
} = PaymentApplicationValidator.getPaymentModeRoutes().validate(
|
|
2006
|
-
{
|
|
2007
|
-
amount,
|
|
2008
|
-
cartId,
|
|
2009
|
-
checkoutMode,
|
|
2010
|
-
refresh,
|
|
2011
|
-
orderId,
|
|
2012
|
-
cardReference,
|
|
2013
|
-
userDetails,
|
|
2014
|
-
displaySplit,
|
|
2015
|
-
advancePayment,
|
|
2016
|
-
shipmentId,
|
|
2017
|
-
},
|
|
2018
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2019
|
-
);
|
|
2020
|
-
if (error) {
|
|
2021
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2024
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2025
|
-
const {
|
|
2026
|
-
error: warrning,
|
|
2027
|
-
} = PaymentApplicationValidator.getPaymentModeRoutes().validate(
|
|
2028
|
-
{
|
|
2029
|
-
amount,
|
|
2030
|
-
cartId,
|
|
2031
|
-
checkoutMode,
|
|
2032
|
-
refresh,
|
|
2033
|
-
orderId,
|
|
2034
|
-
cardReference,
|
|
2035
|
-
userDetails,
|
|
2036
|
-
displaySplit,
|
|
2037
|
-
advancePayment,
|
|
2038
|
-
shipmentId,
|
|
2039
|
-
},
|
|
2040
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2041
|
-
);
|
|
2042
|
-
if (warrning) {
|
|
2043
|
-
Logger({
|
|
2044
|
-
level: "WARN",
|
|
2045
|
-
message: `Parameter Validation warrnings for application > Payment > getPaymentModeRoutes \n ${warrning}`,
|
|
2046
|
-
});
|
|
2047
|
-
}
|
|
2048
|
-
|
|
2049
1002
|
const query_params = {};
|
|
2050
1003
|
query_params["amount"] = amount;
|
|
2051
1004
|
query_params["cart_id"] = cartId;
|
|
@@ -2078,35 +1031,13 @@ class Payment {
|
|
|
2078
1031
|
responseData = response[0];
|
|
2079
1032
|
}
|
|
2080
1033
|
|
|
2081
|
-
const {
|
|
2082
|
-
error: res_error,
|
|
2083
|
-
} = PaymentApplicationModel.PaymentModeRouteResponse().validate(
|
|
2084
|
-
responseData,
|
|
2085
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2086
|
-
);
|
|
2087
|
-
|
|
2088
|
-
if (res_error) {
|
|
2089
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2090
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2091
|
-
} else {
|
|
2092
|
-
Logger({
|
|
2093
|
-
level: "WARN",
|
|
2094
|
-
message: `Response Validation Warnings for application > Payment > getPaymentModeRoutes \n ${res_error}`,
|
|
2095
|
-
});
|
|
2096
|
-
}
|
|
2097
|
-
}
|
|
2098
|
-
|
|
2099
1034
|
return response;
|
|
2100
1035
|
}
|
|
2101
1036
|
|
|
2102
1037
|
/**
|
|
2103
|
-
* @param {PaymentApplicationValidator.GetPaymentModeRoutesPaymentLinkParam} arg
|
|
2104
|
-
* - Arg object.
|
|
2105
|
-
*
|
|
2106
1038
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2107
1039
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2108
|
-
* @returns {Promise<
|
|
2109
|
-
* Success response
|
|
1040
|
+
* @returns {Promise<PaymentModeRouteResponse>} - Success response
|
|
2110
1041
|
* @name getPaymentModeRoutesPaymentLink
|
|
2111
1042
|
* @summary: Payment modes for payment link
|
|
2112
1043
|
* @description: List payment modes available for a given payment link. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getPaymentModeRoutesPaymentLink/).
|
|
@@ -2115,30 +1046,6 @@ class Payment {
|
|
|
2115
1046
|
{ paymentLinkId, requestHeaders } = { requestHeaders: {} },
|
|
2116
1047
|
{ responseHeaders } = { responseHeaders: false }
|
|
2117
1048
|
) {
|
|
2118
|
-
const {
|
|
2119
|
-
error,
|
|
2120
|
-
} = PaymentApplicationValidator.getPaymentModeRoutesPaymentLink().validate(
|
|
2121
|
-
{ paymentLinkId },
|
|
2122
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2123
|
-
);
|
|
2124
|
-
if (error) {
|
|
2125
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2126
|
-
}
|
|
2127
|
-
|
|
2128
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2129
|
-
const {
|
|
2130
|
-
error: warrning,
|
|
2131
|
-
} = PaymentApplicationValidator.getPaymentModeRoutesPaymentLink().validate(
|
|
2132
|
-
{ paymentLinkId },
|
|
2133
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2134
|
-
);
|
|
2135
|
-
if (warrning) {
|
|
2136
|
-
Logger({
|
|
2137
|
-
level: "WARN",
|
|
2138
|
-
message: `Parameter Validation warrnings for application > Payment > getPaymentModeRoutesPaymentLink \n ${warrning}`,
|
|
2139
|
-
});
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
1049
|
const query_params = {};
|
|
2143
1050
|
query_params["payment_link_id"] = paymentLinkId;
|
|
2144
1051
|
|
|
@@ -2162,33 +1069,13 @@ class Payment {
|
|
|
2162
1069
|
responseData = response[0];
|
|
2163
1070
|
}
|
|
2164
1071
|
|
|
2165
|
-
const {
|
|
2166
|
-
error: res_error,
|
|
2167
|
-
} = PaymentApplicationModel.PaymentModeRouteResponse().validate(
|
|
2168
|
-
responseData,
|
|
2169
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2170
|
-
);
|
|
2171
|
-
|
|
2172
|
-
if (res_error) {
|
|
2173
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2174
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2175
|
-
} else {
|
|
2176
|
-
Logger({
|
|
2177
|
-
level: "WARN",
|
|
2178
|
-
message: `Response Validation Warnings for application > Payment > getPaymentModeRoutesPaymentLink \n ${res_error}`,
|
|
2179
|
-
});
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
|
|
2183
1072
|
return response;
|
|
2184
1073
|
}
|
|
2185
1074
|
|
|
2186
1075
|
/**
|
|
2187
|
-
* @param {PaymentApplicationValidator.GetPosPaymentModeRoutesParam} arg - Arg object.
|
|
2188
1076
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2189
1077
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2190
|
-
* @returns {Promise<
|
|
2191
|
-
* Success response
|
|
1078
|
+
* @returns {Promise<PaymentModeRouteResponse>} - Success response
|
|
2192
1079
|
* @name getPosPaymentModeRoutes
|
|
2193
1080
|
* @summary: POS payment modes
|
|
2194
1081
|
* @description: Get available payment methods on the payment page for POS, specifying the aggregator for each option, such as 'CARD powered by Juspay' and 'QR powered by Razorpay'. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getPosPaymentModeRoutes/).
|
|
@@ -2207,48 +1094,6 @@ class Payment {
|
|
|
2207
1094
|
} = { requestHeaders: {} },
|
|
2208
1095
|
{ responseHeaders } = { responseHeaders: false }
|
|
2209
1096
|
) {
|
|
2210
|
-
const {
|
|
2211
|
-
error,
|
|
2212
|
-
} = PaymentApplicationValidator.getPosPaymentModeRoutes().validate(
|
|
2213
|
-
{
|
|
2214
|
-
amount,
|
|
2215
|
-
pincode,
|
|
2216
|
-
orderType,
|
|
2217
|
-
cartId,
|
|
2218
|
-
checkoutMode,
|
|
2219
|
-
refresh,
|
|
2220
|
-
cardReference,
|
|
2221
|
-
userDetails,
|
|
2222
|
-
},
|
|
2223
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2224
|
-
);
|
|
2225
|
-
if (error) {
|
|
2226
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2227
|
-
}
|
|
2228
|
-
|
|
2229
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2230
|
-
const {
|
|
2231
|
-
error: warrning,
|
|
2232
|
-
} = PaymentApplicationValidator.getPosPaymentModeRoutes().validate(
|
|
2233
|
-
{
|
|
2234
|
-
amount,
|
|
2235
|
-
pincode,
|
|
2236
|
-
orderType,
|
|
2237
|
-
cartId,
|
|
2238
|
-
checkoutMode,
|
|
2239
|
-
refresh,
|
|
2240
|
-
cardReference,
|
|
2241
|
-
userDetails,
|
|
2242
|
-
},
|
|
2243
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2244
|
-
);
|
|
2245
|
-
if (warrning) {
|
|
2246
|
-
Logger({
|
|
2247
|
-
level: "WARN",
|
|
2248
|
-
message: `Parameter Validation warrnings for application > Payment > getPosPaymentModeRoutes \n ${warrning}`,
|
|
2249
|
-
});
|
|
2250
|
-
}
|
|
2251
|
-
|
|
2252
1097
|
const query_params = {};
|
|
2253
1098
|
query_params["amount"] = amount;
|
|
2254
1099
|
query_params["cart_id"] = cartId;
|
|
@@ -2279,32 +1124,13 @@ class Payment {
|
|
|
2279
1124
|
responseData = response[0];
|
|
2280
1125
|
}
|
|
2281
1126
|
|
|
2282
|
-
const {
|
|
2283
|
-
error: res_error,
|
|
2284
|
-
} = PaymentApplicationModel.PaymentModeRouteResponse().validate(
|
|
2285
|
-
responseData,
|
|
2286
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2287
|
-
);
|
|
2288
|
-
|
|
2289
|
-
if (res_error) {
|
|
2290
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2291
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2292
|
-
} else {
|
|
2293
|
-
Logger({
|
|
2294
|
-
level: "WARN",
|
|
2295
|
-
message: `Response Validation Warnings for application > Payment > getPosPaymentModeRoutes \n ${res_error}`,
|
|
2296
|
-
});
|
|
2297
|
-
}
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2300
1127
|
return response;
|
|
2301
1128
|
}
|
|
2302
1129
|
|
|
2303
1130
|
/**
|
|
2304
|
-
* @param {PaymentApplicationValidator.GetRupifiBannerDetailsParam} arg - Arg object.
|
|
2305
1131
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2306
1132
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2307
|
-
* @returns {Promise<
|
|
1133
|
+
* @returns {Promise<RupifiBannerResponse>} - Success response
|
|
2308
1134
|
* @name getRupifiBannerDetails
|
|
2309
1135
|
* @summary: Rupifi banner info
|
|
2310
1136
|
* @description: Get Rupifi payment banner details. It provides information such as the KYC URL and the current status of the Rupifi payment banner. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getRupifiBannerDetails/).
|
|
@@ -2313,30 +1139,6 @@ class Payment {
|
|
|
2313
1139
|
{ requestHeaders } = { requestHeaders: {} },
|
|
2314
1140
|
{ responseHeaders } = { responseHeaders: false }
|
|
2315
1141
|
) {
|
|
2316
|
-
const {
|
|
2317
|
-
error,
|
|
2318
|
-
} = PaymentApplicationValidator.getRupifiBannerDetails().validate(
|
|
2319
|
-
{},
|
|
2320
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2321
|
-
);
|
|
2322
|
-
if (error) {
|
|
2323
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2324
|
-
}
|
|
2325
|
-
|
|
2326
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2327
|
-
const {
|
|
2328
|
-
error: warrning,
|
|
2329
|
-
} = PaymentApplicationValidator.getRupifiBannerDetails().validate(
|
|
2330
|
-
{},
|
|
2331
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2332
|
-
);
|
|
2333
|
-
if (warrning) {
|
|
2334
|
-
Logger({
|
|
2335
|
-
level: "WARN",
|
|
2336
|
-
message: `Parameter Validation warrnings for application > Payment > getRupifiBannerDetails \n ${warrning}`,
|
|
2337
|
-
});
|
|
2338
|
-
}
|
|
2339
|
-
|
|
2340
1142
|
const query_params = {};
|
|
2341
1143
|
|
|
2342
1144
|
const xHeaders = {};
|
|
@@ -2359,35 +1161,13 @@ class Payment {
|
|
|
2359
1161
|
responseData = response[0];
|
|
2360
1162
|
}
|
|
2361
1163
|
|
|
2362
|
-
const {
|
|
2363
|
-
error: res_error,
|
|
2364
|
-
} = PaymentApplicationModel.RupifiBannerResponse().validate(responseData, {
|
|
2365
|
-
abortEarly: false,
|
|
2366
|
-
allowUnknown: true,
|
|
2367
|
-
});
|
|
2368
|
-
|
|
2369
|
-
if (res_error) {
|
|
2370
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2371
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2372
|
-
} else {
|
|
2373
|
-
Logger({
|
|
2374
|
-
level: "WARN",
|
|
2375
|
-
message: `Response Validation Warnings for application > Payment > getRupifiBannerDetails \n ${res_error}`,
|
|
2376
|
-
});
|
|
2377
|
-
}
|
|
2378
|
-
}
|
|
2379
|
-
|
|
2380
1164
|
return response;
|
|
2381
1165
|
}
|
|
2382
1166
|
|
|
2383
1167
|
/**
|
|
2384
|
-
* @param {PaymentApplicationValidator.GetUserBeneficiariesDetailParam} arg
|
|
2385
|
-
* - Arg object.
|
|
2386
|
-
*
|
|
2387
1168
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2388
1169
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2389
|
-
* @returns {Promise<
|
|
2390
|
-
* Success response
|
|
1170
|
+
* @returns {Promise<OrderBeneficiaryResponse>} - Success response
|
|
2391
1171
|
* @name getUserBeneficiariesDetail
|
|
2392
1172
|
* @summary: Retrieve beneficiary details
|
|
2393
1173
|
* @description: Get beneficiaries associated with the user for processing refunds, based on the provided order ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getUserBeneficiariesDetail/).
|
|
@@ -2396,30 +1176,6 @@ class Payment {
|
|
|
2396
1176
|
{ orderId, requestHeaders } = { requestHeaders: {} },
|
|
2397
1177
|
{ responseHeaders } = { responseHeaders: false }
|
|
2398
1178
|
) {
|
|
2399
|
-
const {
|
|
2400
|
-
error,
|
|
2401
|
-
} = PaymentApplicationValidator.getUserBeneficiariesDetail().validate(
|
|
2402
|
-
{ orderId },
|
|
2403
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2404
|
-
);
|
|
2405
|
-
if (error) {
|
|
2406
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2407
|
-
}
|
|
2408
|
-
|
|
2409
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2410
|
-
const {
|
|
2411
|
-
error: warrning,
|
|
2412
|
-
} = PaymentApplicationValidator.getUserBeneficiariesDetail().validate(
|
|
2413
|
-
{ orderId },
|
|
2414
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2415
|
-
);
|
|
2416
|
-
if (warrning) {
|
|
2417
|
-
Logger({
|
|
2418
|
-
level: "WARN",
|
|
2419
|
-
message: `Parameter Validation warrnings for application > Payment > getUserBeneficiariesDetail \n ${warrning}`,
|
|
2420
|
-
});
|
|
2421
|
-
}
|
|
2422
|
-
|
|
2423
1179
|
const query_params = {};
|
|
2424
1180
|
query_params["order_id"] = orderId;
|
|
2425
1181
|
|
|
@@ -2443,34 +1199,13 @@ class Payment {
|
|
|
2443
1199
|
responseData = response[0];
|
|
2444
1200
|
}
|
|
2445
1201
|
|
|
2446
|
-
const {
|
|
2447
|
-
error: res_error,
|
|
2448
|
-
} = PaymentApplicationModel.OrderBeneficiaryResponse().validate(
|
|
2449
|
-
responseData,
|
|
2450
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2451
|
-
);
|
|
2452
|
-
|
|
2453
|
-
if (res_error) {
|
|
2454
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2455
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2456
|
-
} else {
|
|
2457
|
-
Logger({
|
|
2458
|
-
level: "WARN",
|
|
2459
|
-
message: `Response Validation Warnings for application > Payment > getUserBeneficiariesDetail \n ${res_error}`,
|
|
2460
|
-
});
|
|
2461
|
-
}
|
|
2462
|
-
}
|
|
2463
|
-
|
|
2464
1202
|
return response;
|
|
2465
1203
|
}
|
|
2466
1204
|
|
|
2467
1205
|
/**
|
|
2468
|
-
* @param {PaymentApplicationValidator.InitialisePaymentParam} arg - Arg object.
|
|
2469
1206
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2470
1207
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2471
|
-
* @returns {Promise<
|
|
2472
|
-
* - Success response
|
|
2473
|
-
*
|
|
1208
|
+
* @returns {Promise<PaymentInitializationResponse>} - Success response
|
|
2474
1209
|
* @name initialisePayment
|
|
2475
1210
|
* @summary: Start payment process
|
|
2476
1211
|
* @description: Initiate the payment procedure for an order. Upon successful initiation, it returns a details including the success status, aggregator information, payment method, status, merchant order ID aggregator order , polling URL, timeout, virtual ID, Razorpay payment ID, customer ID, and device ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/initialisePayment/).
|
|
@@ -2479,28 +1214,6 @@ class Payment {
|
|
|
2479
1214
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2480
1215
|
{ responseHeaders } = { responseHeaders: false }
|
|
2481
1216
|
) {
|
|
2482
|
-
const { error } = PaymentApplicationValidator.initialisePayment().validate(
|
|
2483
|
-
{ body },
|
|
2484
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2485
|
-
);
|
|
2486
|
-
if (error) {
|
|
2487
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2488
|
-
}
|
|
2489
|
-
|
|
2490
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2491
|
-
const {
|
|
2492
|
-
error: warrning,
|
|
2493
|
-
} = PaymentApplicationValidator.initialisePayment().validate(
|
|
2494
|
-
{ body },
|
|
2495
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2496
|
-
);
|
|
2497
|
-
if (warrning) {
|
|
2498
|
-
Logger({
|
|
2499
|
-
level: "WARN",
|
|
2500
|
-
message: `Parameter Validation warrnings for application > Payment > initialisePayment \n ${warrning}`,
|
|
2501
|
-
});
|
|
2502
|
-
}
|
|
2503
|
-
|
|
2504
1217
|
const query_params = {};
|
|
2505
1218
|
|
|
2506
1219
|
const xHeaders = {};
|
|
@@ -2523,36 +1236,13 @@ class Payment {
|
|
|
2523
1236
|
responseData = response[0];
|
|
2524
1237
|
}
|
|
2525
1238
|
|
|
2526
|
-
const {
|
|
2527
|
-
error: res_error,
|
|
2528
|
-
} = PaymentApplicationModel.PaymentInitializationResponse().validate(
|
|
2529
|
-
responseData,
|
|
2530
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2531
|
-
);
|
|
2532
|
-
|
|
2533
|
-
if (res_error) {
|
|
2534
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2535
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2536
|
-
} else {
|
|
2537
|
-
Logger({
|
|
2538
|
-
level: "WARN",
|
|
2539
|
-
message: `Response Validation Warnings for application > Payment > initialisePayment \n ${res_error}`,
|
|
2540
|
-
});
|
|
2541
|
-
}
|
|
2542
|
-
}
|
|
2543
|
-
|
|
2544
1239
|
return response;
|
|
2545
1240
|
}
|
|
2546
1241
|
|
|
2547
1242
|
/**
|
|
2548
|
-
* @param {PaymentApplicationValidator.InitialisePaymentPaymentLinkParam} arg
|
|
2549
|
-
* - Arg object.
|
|
2550
|
-
*
|
|
2551
1243
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2552
1244
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2553
|
-
* @returns {Promise<
|
|
2554
|
-
* - Success response
|
|
2555
|
-
*
|
|
1245
|
+
* @returns {Promise<PaymentInitializationResponse>} - Success response
|
|
2556
1246
|
* @name initialisePaymentPaymentLink
|
|
2557
1247
|
* @summary: Initialize payment link
|
|
2558
1248
|
* @description: Begin payment process for an order by initializing it through a payment link.Upon successful initialization, the response includes details about the payment status, aggregator details, order IDs, polling URL for status updates, and other relevant information. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/initialisePaymentPaymentLink/).
|
|
@@ -2561,30 +1251,6 @@ class Payment {
|
|
|
2561
1251
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2562
1252
|
{ responseHeaders } = { responseHeaders: false }
|
|
2563
1253
|
) {
|
|
2564
|
-
const {
|
|
2565
|
-
error,
|
|
2566
|
-
} = PaymentApplicationValidator.initialisePaymentPaymentLink().validate(
|
|
2567
|
-
{ body },
|
|
2568
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2569
|
-
);
|
|
2570
|
-
if (error) {
|
|
2571
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2572
|
-
}
|
|
2573
|
-
|
|
2574
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2575
|
-
const {
|
|
2576
|
-
error: warrning,
|
|
2577
|
-
} = PaymentApplicationValidator.initialisePaymentPaymentLink().validate(
|
|
2578
|
-
{ body },
|
|
2579
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2580
|
-
);
|
|
2581
|
-
if (warrning) {
|
|
2582
|
-
Logger({
|
|
2583
|
-
level: "WARN",
|
|
2584
|
-
message: `Parameter Validation warrnings for application > Payment > initialisePaymentPaymentLink \n ${warrning}`,
|
|
2585
|
-
});
|
|
2586
|
-
}
|
|
2587
|
-
|
|
2588
1254
|
const query_params = {};
|
|
2589
1255
|
|
|
2590
1256
|
const xHeaders = {};
|
|
@@ -2607,32 +1273,13 @@ class Payment {
|
|
|
2607
1273
|
responseData = response[0];
|
|
2608
1274
|
}
|
|
2609
1275
|
|
|
2610
|
-
const {
|
|
2611
|
-
error: res_error,
|
|
2612
|
-
} = PaymentApplicationModel.PaymentInitializationResponse().validate(
|
|
2613
|
-
responseData,
|
|
2614
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2615
|
-
);
|
|
2616
|
-
|
|
2617
|
-
if (res_error) {
|
|
2618
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2619
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2620
|
-
} else {
|
|
2621
|
-
Logger({
|
|
2622
|
-
level: "WARN",
|
|
2623
|
-
message: `Response Validation Warnings for application > Payment > initialisePaymentPaymentLink \n ${res_error}`,
|
|
2624
|
-
});
|
|
2625
|
-
}
|
|
2626
|
-
}
|
|
2627
|
-
|
|
2628
1276
|
return response;
|
|
2629
1277
|
}
|
|
2630
1278
|
|
|
2631
1279
|
/**
|
|
2632
|
-
* @param {PaymentApplicationValidator.LinkWalletParam} arg - Arg object.
|
|
2633
1280
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2634
1281
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2635
|
-
* @returns {Promise<
|
|
1282
|
+
* @returns {Promise<WalletResponseSchema>} - Success response
|
|
2636
1283
|
* @name linkWallet
|
|
2637
1284
|
* @summary: OTP verification
|
|
2638
1285
|
* @description: Verify the linking of wallet using OTP for further processing of payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/linkWallet/).
|
|
@@ -2641,28 +1288,6 @@ class Payment {
|
|
|
2641
1288
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2642
1289
|
{ responseHeaders } = { responseHeaders: false }
|
|
2643
1290
|
) {
|
|
2644
|
-
const { error } = PaymentApplicationValidator.linkWallet().validate(
|
|
2645
|
-
{ body },
|
|
2646
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2647
|
-
);
|
|
2648
|
-
if (error) {
|
|
2649
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2650
|
-
}
|
|
2651
|
-
|
|
2652
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2653
|
-
const {
|
|
2654
|
-
error: warrning,
|
|
2655
|
-
} = PaymentApplicationValidator.linkWallet().validate(
|
|
2656
|
-
{ body },
|
|
2657
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2658
|
-
);
|
|
2659
|
-
if (warrning) {
|
|
2660
|
-
Logger({
|
|
2661
|
-
level: "WARN",
|
|
2662
|
-
message: `Parameter Validation warrnings for application > Payment > linkWallet \n ${warrning}`,
|
|
2663
|
-
});
|
|
2664
|
-
}
|
|
2665
|
-
|
|
2666
1291
|
const query_params = {};
|
|
2667
1292
|
|
|
2668
1293
|
const xHeaders = {};
|
|
@@ -2685,34 +1310,13 @@ class Payment {
|
|
|
2685
1310
|
responseData = response[0];
|
|
2686
1311
|
}
|
|
2687
1312
|
|
|
2688
|
-
const {
|
|
2689
|
-
error: res_error,
|
|
2690
|
-
} = PaymentApplicationModel.WalletResponseSchema().validate(responseData, {
|
|
2691
|
-
abortEarly: false,
|
|
2692
|
-
allowUnknown: true,
|
|
2693
|
-
});
|
|
2694
|
-
|
|
2695
|
-
if (res_error) {
|
|
2696
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2697
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2698
|
-
} else {
|
|
2699
|
-
Logger({
|
|
2700
|
-
level: "WARN",
|
|
2701
|
-
message: `Response Validation Warnings for application > Payment > linkWallet \n ${res_error}`,
|
|
2702
|
-
});
|
|
2703
|
-
}
|
|
2704
|
-
}
|
|
2705
|
-
|
|
2706
1313
|
return response;
|
|
2707
1314
|
}
|
|
2708
1315
|
|
|
2709
1316
|
/**
|
|
2710
|
-
* @param {PaymentApplicationValidator.OutstandingOrderDetailsParam} arg - Arg object.
|
|
2711
1317
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2712
1318
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2713
|
-
* @returns {Promise<
|
|
2714
|
-
* - Success response
|
|
2715
|
-
*
|
|
1319
|
+
* @returns {Promise<OutstandingOrderDetailsResponse>} - Success response
|
|
2716
1320
|
* @name outstandingOrderDetails
|
|
2717
1321
|
* @summary: Outstanding orders
|
|
2718
1322
|
* @description: Get details of orders with outstanding payments. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/outstandingOrderDetails/).
|
|
@@ -2721,30 +1325,6 @@ class Payment {
|
|
|
2721
1325
|
{ aggregator, requestHeaders } = { requestHeaders: {} },
|
|
2722
1326
|
{ responseHeaders } = { responseHeaders: false }
|
|
2723
1327
|
) {
|
|
2724
|
-
const {
|
|
2725
|
-
error,
|
|
2726
|
-
} = PaymentApplicationValidator.outstandingOrderDetails().validate(
|
|
2727
|
-
{ aggregator },
|
|
2728
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2729
|
-
);
|
|
2730
|
-
if (error) {
|
|
2731
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2732
|
-
}
|
|
2733
|
-
|
|
2734
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2735
|
-
const {
|
|
2736
|
-
error: warrning,
|
|
2737
|
-
} = PaymentApplicationValidator.outstandingOrderDetails().validate(
|
|
2738
|
-
{ aggregator },
|
|
2739
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2740
|
-
);
|
|
2741
|
-
if (warrning) {
|
|
2742
|
-
Logger({
|
|
2743
|
-
level: "WARN",
|
|
2744
|
-
message: `Parameter Validation warrnings for application > Payment > outstandingOrderDetails \n ${warrning}`,
|
|
2745
|
-
});
|
|
2746
|
-
}
|
|
2747
|
-
|
|
2748
1328
|
const query_params = {};
|
|
2749
1329
|
query_params["aggregator"] = aggregator;
|
|
2750
1330
|
|
|
@@ -2768,33 +1348,13 @@ class Payment {
|
|
|
2768
1348
|
responseData = response[0];
|
|
2769
1349
|
}
|
|
2770
1350
|
|
|
2771
|
-
const {
|
|
2772
|
-
error: res_error,
|
|
2773
|
-
} = PaymentApplicationModel.OutstandingOrderDetailsResponse().validate(
|
|
2774
|
-
responseData,
|
|
2775
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2776
|
-
);
|
|
2777
|
-
|
|
2778
|
-
if (res_error) {
|
|
2779
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2780
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2781
|
-
} else {
|
|
2782
|
-
Logger({
|
|
2783
|
-
level: "WARN",
|
|
2784
|
-
message: `Response Validation Warnings for application > Payment > outstandingOrderDetails \n ${res_error}`,
|
|
2785
|
-
});
|
|
2786
|
-
}
|
|
2787
|
-
}
|
|
2788
|
-
|
|
2789
1351
|
return response;
|
|
2790
1352
|
}
|
|
2791
1353
|
|
|
2792
1354
|
/**
|
|
2793
|
-
* @param {PaymentApplicationValidator.PaidOrderDetailsParam} arg - Arg object.
|
|
2794
1355
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2795
1356
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2796
|
-
* @returns {Promise<
|
|
2797
|
-
* Success response
|
|
1357
|
+
* @returns {Promise<PaidOrderDetailsResponse>} - Success response
|
|
2798
1358
|
* @name paidOrderDetails
|
|
2799
1359
|
* @summary: Retrieve details of paid orders
|
|
2800
1360
|
* @description: Get details of orders that have been paid for, including shipment ID, order ID, due date, payment date, amount, and transaction ID, based on the aggregator merchant user ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/paidOrderDetails/).
|
|
@@ -2803,28 +1363,6 @@ class Payment {
|
|
|
2803
1363
|
{ aggregator, requestHeaders } = { requestHeaders: {} },
|
|
2804
1364
|
{ responseHeaders } = { responseHeaders: false }
|
|
2805
1365
|
) {
|
|
2806
|
-
const { error } = PaymentApplicationValidator.paidOrderDetails().validate(
|
|
2807
|
-
{ aggregator },
|
|
2808
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2809
|
-
);
|
|
2810
|
-
if (error) {
|
|
2811
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2812
|
-
}
|
|
2813
|
-
|
|
2814
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2815
|
-
const {
|
|
2816
|
-
error: warrning,
|
|
2817
|
-
} = PaymentApplicationValidator.paidOrderDetails().validate(
|
|
2818
|
-
{ aggregator },
|
|
2819
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2820
|
-
);
|
|
2821
|
-
if (warrning) {
|
|
2822
|
-
Logger({
|
|
2823
|
-
level: "WARN",
|
|
2824
|
-
message: `Parameter Validation warrnings for application > Payment > paidOrderDetails \n ${warrning}`,
|
|
2825
|
-
});
|
|
2826
|
-
}
|
|
2827
|
-
|
|
2828
1366
|
const query_params = {};
|
|
2829
1367
|
query_params["aggregator"] = aggregator;
|
|
2830
1368
|
|
|
@@ -2848,33 +1386,13 @@ class Payment {
|
|
|
2848
1386
|
responseData = response[0];
|
|
2849
1387
|
}
|
|
2850
1388
|
|
|
2851
|
-
const {
|
|
2852
|
-
error: res_error,
|
|
2853
|
-
} = PaymentApplicationModel.PaidOrderDetailsResponse().validate(
|
|
2854
|
-
responseData,
|
|
2855
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2856
|
-
);
|
|
2857
|
-
|
|
2858
|
-
if (res_error) {
|
|
2859
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2860
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2861
|
-
} else {
|
|
2862
|
-
Logger({
|
|
2863
|
-
level: "WARN",
|
|
2864
|
-
message: `Response Validation Warnings for application > Payment > paidOrderDetails \n ${res_error}`,
|
|
2865
|
-
});
|
|
2866
|
-
}
|
|
2867
|
-
}
|
|
2868
|
-
|
|
2869
1389
|
return response;
|
|
2870
1390
|
}
|
|
2871
1391
|
|
|
2872
1392
|
/**
|
|
2873
|
-
* @param {PaymentApplicationValidator.PollingPaymentLinkParam} arg - Arg object.
|
|
2874
1393
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2875
1394
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2876
|
-
* @returns {Promise<
|
|
2877
|
-
* Success response
|
|
1395
|
+
* @returns {Promise<PollingPaymentLinkResponse>} - Success response
|
|
2878
1396
|
* @name pollingPaymentLink
|
|
2879
1397
|
* @summary: Poll status of payment link
|
|
2880
1398
|
* @description: Get real-time information about the payment link's current status, such as whether it has been processed, cancelled, or expired. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/pollingPaymentLink/).
|
|
@@ -2883,28 +1401,6 @@ class Payment {
|
|
|
2883
1401
|
{ paymentLinkId, requestHeaders } = { requestHeaders: {} },
|
|
2884
1402
|
{ responseHeaders } = { responseHeaders: false }
|
|
2885
1403
|
) {
|
|
2886
|
-
const { error } = PaymentApplicationValidator.pollingPaymentLink().validate(
|
|
2887
|
-
{ paymentLinkId },
|
|
2888
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2889
|
-
);
|
|
2890
|
-
if (error) {
|
|
2891
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2892
|
-
}
|
|
2893
|
-
|
|
2894
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2895
|
-
const {
|
|
2896
|
-
error: warrning,
|
|
2897
|
-
} = PaymentApplicationValidator.pollingPaymentLink().validate(
|
|
2898
|
-
{ paymentLinkId },
|
|
2899
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2900
|
-
);
|
|
2901
|
-
if (warrning) {
|
|
2902
|
-
Logger({
|
|
2903
|
-
level: "WARN",
|
|
2904
|
-
message: `Parameter Validation warrnings for application > Payment > pollingPaymentLink \n ${warrning}`,
|
|
2905
|
-
});
|
|
2906
|
-
}
|
|
2907
|
-
|
|
2908
1404
|
const query_params = {};
|
|
2909
1405
|
query_params["payment_link_id"] = paymentLinkId;
|
|
2910
1406
|
|
|
@@ -2928,34 +1424,13 @@ class Payment {
|
|
|
2928
1424
|
responseData = response[0];
|
|
2929
1425
|
}
|
|
2930
1426
|
|
|
2931
|
-
const {
|
|
2932
|
-
error: res_error,
|
|
2933
|
-
} = PaymentApplicationModel.PollingPaymentLinkResponse().validate(
|
|
2934
|
-
responseData,
|
|
2935
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2936
|
-
);
|
|
2937
|
-
|
|
2938
|
-
if (res_error) {
|
|
2939
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2940
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2941
|
-
} else {
|
|
2942
|
-
Logger({
|
|
2943
|
-
level: "WARN",
|
|
2944
|
-
message: `Response Validation Warnings for application > Payment > pollingPaymentLink \n ${res_error}`,
|
|
2945
|
-
});
|
|
2946
|
-
}
|
|
2947
|
-
}
|
|
2948
|
-
|
|
2949
1427
|
return response;
|
|
2950
1428
|
}
|
|
2951
1429
|
|
|
2952
1430
|
/**
|
|
2953
|
-
* @param {PaymentApplicationValidator.RedirectToAggregatorParam} arg - Arg object.
|
|
2954
1431
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2955
1432
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2956
|
-
* @returns {Promise<
|
|
2957
|
-
* - Success response
|
|
2958
|
-
*
|
|
1433
|
+
* @returns {Promise<RedirectToAggregatorResponse>} - Success response
|
|
2959
1434
|
* @name redirectToAggregator
|
|
2960
1435
|
* @summary: Redirects users to the payment aggregator's interface
|
|
2961
1436
|
* @description: Get details about the active card aggregator used by the user, including the aggregator's name. You can refresh the data by setting the 'refresh' parameter to true if needed. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/redirectToAggregator/).
|
|
@@ -2964,30 +1439,6 @@ class Payment {
|
|
|
2964
1439
|
{ source, aggregator, requestHeaders } = { requestHeaders: {} },
|
|
2965
1440
|
{ responseHeaders } = { responseHeaders: false }
|
|
2966
1441
|
) {
|
|
2967
|
-
const {
|
|
2968
|
-
error,
|
|
2969
|
-
} = PaymentApplicationValidator.redirectToAggregator().validate(
|
|
2970
|
-
{ source, aggregator },
|
|
2971
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2972
|
-
);
|
|
2973
|
-
if (error) {
|
|
2974
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2978
|
-
const {
|
|
2979
|
-
error: warrning,
|
|
2980
|
-
} = PaymentApplicationValidator.redirectToAggregator().validate(
|
|
2981
|
-
{ source, aggregator },
|
|
2982
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2983
|
-
);
|
|
2984
|
-
if (warrning) {
|
|
2985
|
-
Logger({
|
|
2986
|
-
level: "WARN",
|
|
2987
|
-
message: `Parameter Validation warrnings for application > Payment > redirectToAggregator \n ${warrning}`,
|
|
2988
|
-
});
|
|
2989
|
-
}
|
|
2990
|
-
|
|
2991
1442
|
const query_params = {};
|
|
2992
1443
|
query_params["source"] = source;
|
|
2993
1444
|
query_params["aggregator"] = aggregator;
|
|
@@ -3012,32 +1463,13 @@ class Payment {
|
|
|
3012
1463
|
responseData = response[0];
|
|
3013
1464
|
}
|
|
3014
1465
|
|
|
3015
|
-
const {
|
|
3016
|
-
error: res_error,
|
|
3017
|
-
} = PaymentApplicationModel.RedirectToAggregatorResponse().validate(
|
|
3018
|
-
responseData,
|
|
3019
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3020
|
-
);
|
|
3021
|
-
|
|
3022
|
-
if (res_error) {
|
|
3023
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3024
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3025
|
-
} else {
|
|
3026
|
-
Logger({
|
|
3027
|
-
level: "WARN",
|
|
3028
|
-
message: `Response Validation Warnings for application > Payment > redirectToAggregator \n ${res_error}`,
|
|
3029
|
-
});
|
|
3030
|
-
}
|
|
3031
|
-
}
|
|
3032
|
-
|
|
3033
1466
|
return response;
|
|
3034
1467
|
}
|
|
3035
1468
|
|
|
3036
1469
|
/**
|
|
3037
|
-
* @param {PaymentApplicationValidator.RenderHTMLParam} arg - Arg object.
|
|
3038
1470
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3039
1471
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3040
|
-
* @returns {Promise<
|
|
1472
|
+
* @returns {Promise<renderHTMLResponse>} - Success response
|
|
3041
1473
|
* @name renderHTML
|
|
3042
1474
|
* @summary: Render HTML
|
|
3043
1475
|
* @description: Render HTML for a payment aggregator page. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/renderHTML/).
|
|
@@ -3046,28 +1478,6 @@ class Payment {
|
|
|
3046
1478
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3047
1479
|
{ responseHeaders } = { responseHeaders: false }
|
|
3048
1480
|
) {
|
|
3049
|
-
const { error } = PaymentApplicationValidator.renderHTML().validate(
|
|
3050
|
-
{ body },
|
|
3051
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3052
|
-
);
|
|
3053
|
-
if (error) {
|
|
3054
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3055
|
-
}
|
|
3056
|
-
|
|
3057
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3058
|
-
const {
|
|
3059
|
-
error: warrning,
|
|
3060
|
-
} = PaymentApplicationValidator.renderHTML().validate(
|
|
3061
|
-
{ body },
|
|
3062
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3063
|
-
);
|
|
3064
|
-
if (warrning) {
|
|
3065
|
-
Logger({
|
|
3066
|
-
level: "WARN",
|
|
3067
|
-
message: `Parameter Validation warrnings for application > Payment > renderHTML \n ${warrning}`,
|
|
3068
|
-
});
|
|
3069
|
-
}
|
|
3070
|
-
|
|
3071
1481
|
const query_params = {};
|
|
3072
1482
|
|
|
3073
1483
|
const xHeaders = {};
|
|
@@ -3090,34 +1500,13 @@ class Payment {
|
|
|
3090
1500
|
responseData = response[0];
|
|
3091
1501
|
}
|
|
3092
1502
|
|
|
3093
|
-
const {
|
|
3094
|
-
error: res_error,
|
|
3095
|
-
} = PaymentApplicationModel.renderHTMLResponse().validate(responseData, {
|
|
3096
|
-
abortEarly: false,
|
|
3097
|
-
allowUnknown: true,
|
|
3098
|
-
});
|
|
3099
|
-
|
|
3100
|
-
if (res_error) {
|
|
3101
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3102
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3103
|
-
} else {
|
|
3104
|
-
Logger({
|
|
3105
|
-
level: "WARN",
|
|
3106
|
-
message: `Response Validation Warnings for application > Payment > renderHTML \n ${res_error}`,
|
|
3107
|
-
});
|
|
3108
|
-
}
|
|
3109
|
-
}
|
|
3110
|
-
|
|
3111
1503
|
return response;
|
|
3112
1504
|
}
|
|
3113
1505
|
|
|
3114
1506
|
/**
|
|
3115
|
-
* @param {PaymentApplicationValidator.ResendOrCancelPaymentParam} arg - Arg object.
|
|
3116
1507
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3117
1508
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3118
|
-
* @returns {Promise<
|
|
3119
|
-
* - Success response
|
|
3120
|
-
*
|
|
1509
|
+
* @returns {Promise<ResendOrCancelPaymentResponse>} - Success response
|
|
3121
1510
|
* @name resendOrCancelPayment
|
|
3122
1511
|
* @summary: Resend or cancel a pending payment transaction
|
|
3123
1512
|
* @description: Resend or cancel payment link that have been initiated but may require modification or cancellation for various reasons, ensuring flexibility and control in payment processing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/resendOrCancelPayment/).
|
|
@@ -3126,30 +1515,6 @@ class Payment {
|
|
|
3126
1515
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3127
1516
|
{ responseHeaders } = { responseHeaders: false }
|
|
3128
1517
|
) {
|
|
3129
|
-
const {
|
|
3130
|
-
error,
|
|
3131
|
-
} = PaymentApplicationValidator.resendOrCancelPayment().validate(
|
|
3132
|
-
{ body },
|
|
3133
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3134
|
-
);
|
|
3135
|
-
if (error) {
|
|
3136
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3137
|
-
}
|
|
3138
|
-
|
|
3139
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3140
|
-
const {
|
|
3141
|
-
error: warrning,
|
|
3142
|
-
} = PaymentApplicationValidator.resendOrCancelPayment().validate(
|
|
3143
|
-
{ body },
|
|
3144
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3145
|
-
);
|
|
3146
|
-
if (warrning) {
|
|
3147
|
-
Logger({
|
|
3148
|
-
level: "WARN",
|
|
3149
|
-
message: `Parameter Validation warrnings for application > Payment > resendOrCancelPayment \n ${warrning}`,
|
|
3150
|
-
});
|
|
3151
|
-
}
|
|
3152
|
-
|
|
3153
1518
|
const query_params = {};
|
|
3154
1519
|
|
|
3155
1520
|
const xHeaders = {};
|
|
@@ -3172,33 +1537,13 @@ class Payment {
|
|
|
3172
1537
|
responseData = response[0];
|
|
3173
1538
|
}
|
|
3174
1539
|
|
|
3175
|
-
const {
|
|
3176
|
-
error: res_error,
|
|
3177
|
-
} = PaymentApplicationModel.ResendOrCancelPaymentResponse().validate(
|
|
3178
|
-
responseData,
|
|
3179
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3180
|
-
);
|
|
3181
|
-
|
|
3182
|
-
if (res_error) {
|
|
3183
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3184
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3185
|
-
} else {
|
|
3186
|
-
Logger({
|
|
3187
|
-
level: "WARN",
|
|
3188
|
-
message: `Response Validation Warnings for application > Payment > resendOrCancelPayment \n ${res_error}`,
|
|
3189
|
-
});
|
|
3190
|
-
}
|
|
3191
|
-
}
|
|
3192
|
-
|
|
3193
1540
|
return response;
|
|
3194
1541
|
}
|
|
3195
1542
|
|
|
3196
1543
|
/**
|
|
3197
|
-
* @param {PaymentApplicationValidator.ResendPaymentLinkParam} arg - Arg object.
|
|
3198
1544
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3199
1545
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3200
|
-
* @returns {Promise<
|
|
3201
|
-
* Success response
|
|
1546
|
+
* @returns {Promise<ResendPaymentLinkResponse>} - Success response
|
|
3202
1547
|
* @name resendPaymentLink
|
|
3203
1548
|
* @summary: Resend payment link
|
|
3204
1549
|
* @description: Resend an existing payment link to the user to complete the payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/resendPaymentLink/).
|
|
@@ -3207,28 +1552,6 @@ class Payment {
|
|
|
3207
1552
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3208
1553
|
{ responseHeaders } = { responseHeaders: false }
|
|
3209
1554
|
) {
|
|
3210
|
-
const { error } = PaymentApplicationValidator.resendPaymentLink().validate(
|
|
3211
|
-
{ body },
|
|
3212
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3213
|
-
);
|
|
3214
|
-
if (error) {
|
|
3215
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3216
|
-
}
|
|
3217
|
-
|
|
3218
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3219
|
-
const {
|
|
3220
|
-
error: warrning,
|
|
3221
|
-
} = PaymentApplicationValidator.resendPaymentLink().validate(
|
|
3222
|
-
{ body },
|
|
3223
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3224
|
-
);
|
|
3225
|
-
if (warrning) {
|
|
3226
|
-
Logger({
|
|
3227
|
-
level: "WARN",
|
|
3228
|
-
message: `Parameter Validation warrnings for application > Payment > resendPaymentLink \n ${warrning}`,
|
|
3229
|
-
});
|
|
3230
|
-
}
|
|
3231
|
-
|
|
3232
1555
|
const query_params = {};
|
|
3233
1556
|
|
|
3234
1557
|
const xHeaders = {};
|
|
@@ -3251,35 +1574,13 @@ class Payment {
|
|
|
3251
1574
|
responseData = response[0];
|
|
3252
1575
|
}
|
|
3253
1576
|
|
|
3254
|
-
const {
|
|
3255
|
-
error: res_error,
|
|
3256
|
-
} = PaymentApplicationModel.ResendPaymentLinkResponse().validate(
|
|
3257
|
-
responseData,
|
|
3258
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3259
|
-
);
|
|
3260
|
-
|
|
3261
|
-
if (res_error) {
|
|
3262
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3263
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3264
|
-
} else {
|
|
3265
|
-
Logger({
|
|
3266
|
-
level: "WARN",
|
|
3267
|
-
message: `Response Validation Warnings for application > Payment > resendPaymentLink \n ${res_error}`,
|
|
3268
|
-
});
|
|
3269
|
-
}
|
|
3270
|
-
}
|
|
3271
|
-
|
|
3272
1577
|
return response;
|
|
3273
1578
|
}
|
|
3274
1579
|
|
|
3275
1580
|
/**
|
|
3276
|
-
* @param {PaymentApplicationValidator.UpdateDefaultBeneficiaryParam} arg -
|
|
3277
|
-
* Arg object.
|
|
3278
1581
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3279
1582
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3280
|
-
* @returns {Promise<
|
|
3281
|
-
* - Success response
|
|
3282
|
-
*
|
|
1583
|
+
* @returns {Promise<SetDefaultBeneficiaryResponse>} - Success response
|
|
3283
1584
|
* @name updateDefaultBeneficiary
|
|
3284
1585
|
* @summary: Set default beneficiary for refund
|
|
3285
1586
|
* @description: Update default beneficiary for the order refund of the user. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/updateDefaultBeneficiary/).
|
|
@@ -3288,30 +1589,6 @@ class Payment {
|
|
|
3288
1589
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3289
1590
|
{ responseHeaders } = { responseHeaders: false }
|
|
3290
1591
|
) {
|
|
3291
|
-
const {
|
|
3292
|
-
error,
|
|
3293
|
-
} = PaymentApplicationValidator.updateDefaultBeneficiary().validate(
|
|
3294
|
-
{ body },
|
|
3295
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3296
|
-
);
|
|
3297
|
-
if (error) {
|
|
3298
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3299
|
-
}
|
|
3300
|
-
|
|
3301
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3302
|
-
const {
|
|
3303
|
-
error: warrning,
|
|
3304
|
-
} = PaymentApplicationValidator.updateDefaultBeneficiary().validate(
|
|
3305
|
-
{ body },
|
|
3306
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3307
|
-
);
|
|
3308
|
-
if (warrning) {
|
|
3309
|
-
Logger({
|
|
3310
|
-
level: "WARN",
|
|
3311
|
-
message: `Parameter Validation warrnings for application > Payment > updateDefaultBeneficiary \n ${warrning}`,
|
|
3312
|
-
});
|
|
3313
|
-
}
|
|
3314
|
-
|
|
3315
1592
|
const query_params = {};
|
|
3316
1593
|
|
|
3317
1594
|
const xHeaders = {};
|
|
@@ -3334,32 +1611,13 @@ class Payment {
|
|
|
3334
1611
|
responseData = response[0];
|
|
3335
1612
|
}
|
|
3336
1613
|
|
|
3337
|
-
const {
|
|
3338
|
-
error: res_error,
|
|
3339
|
-
} = PaymentApplicationModel.SetDefaultBeneficiaryResponse().validate(
|
|
3340
|
-
responseData,
|
|
3341
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3342
|
-
);
|
|
3343
|
-
|
|
3344
|
-
if (res_error) {
|
|
3345
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3346
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3347
|
-
} else {
|
|
3348
|
-
Logger({
|
|
3349
|
-
level: "WARN",
|
|
3350
|
-
message: `Response Validation Warnings for application > Payment > updateDefaultBeneficiary \n ${res_error}`,
|
|
3351
|
-
});
|
|
3352
|
-
}
|
|
3353
|
-
}
|
|
3354
|
-
|
|
3355
1614
|
return response;
|
|
3356
1615
|
}
|
|
3357
1616
|
|
|
3358
1617
|
/**
|
|
3359
|
-
* @param {PaymentApplicationValidator.ValidateVPAParam} arg - Arg object.
|
|
3360
1618
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3361
1619
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3362
|
-
* @returns {Promise<
|
|
1620
|
+
* @returns {Promise<ValidateVPAResponse>} - Success response
|
|
3363
1621
|
* @name validateVPA
|
|
3364
1622
|
* @summary: Validate VPA
|
|
3365
1623
|
* @description: Validate if a Virtual Payment Address (VPA) is valid for processing payments and returns the validation result.is_valid boolean value indicating whether the VPA is valid for payments. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/validateVPA/).
|
|
@@ -3368,28 +1626,6 @@ class Payment {
|
|
|
3368
1626
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3369
1627
|
{ responseHeaders } = { responseHeaders: false }
|
|
3370
1628
|
) {
|
|
3371
|
-
const { error } = PaymentApplicationValidator.validateVPA().validate(
|
|
3372
|
-
{ body },
|
|
3373
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3374
|
-
);
|
|
3375
|
-
if (error) {
|
|
3376
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3377
|
-
}
|
|
3378
|
-
|
|
3379
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3380
|
-
const {
|
|
3381
|
-
error: warrning,
|
|
3382
|
-
} = PaymentApplicationValidator.validateVPA().validate(
|
|
3383
|
-
{ body },
|
|
3384
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3385
|
-
);
|
|
3386
|
-
if (warrning) {
|
|
3387
|
-
Logger({
|
|
3388
|
-
level: "WARN",
|
|
3389
|
-
message: `Parameter Validation warrnings for application > Payment > validateVPA \n ${warrning}`,
|
|
3390
|
-
});
|
|
3391
|
-
}
|
|
3392
|
-
|
|
3393
1629
|
const query_params = {};
|
|
3394
1630
|
|
|
3395
1631
|
const xHeaders = {};
|
|
@@ -3412,33 +1648,13 @@ class Payment {
|
|
|
3412
1648
|
responseData = response[0];
|
|
3413
1649
|
}
|
|
3414
1650
|
|
|
3415
|
-
const {
|
|
3416
|
-
error: res_error,
|
|
3417
|
-
} = PaymentApplicationModel.ValidateVPAResponse().validate(responseData, {
|
|
3418
|
-
abortEarly: false,
|
|
3419
|
-
allowUnknown: true,
|
|
3420
|
-
});
|
|
3421
|
-
|
|
3422
|
-
if (res_error) {
|
|
3423
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3424
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3425
|
-
} else {
|
|
3426
|
-
Logger({
|
|
3427
|
-
level: "WARN",
|
|
3428
|
-
message: `Response Validation Warnings for application > Payment > validateVPA \n ${res_error}`,
|
|
3429
|
-
});
|
|
3430
|
-
}
|
|
3431
|
-
}
|
|
3432
|
-
|
|
3433
1651
|
return response;
|
|
3434
1652
|
}
|
|
3435
1653
|
|
|
3436
1654
|
/**
|
|
3437
|
-
* @param {PaymentApplicationValidator.VerifyAndChargePaymentParam} arg - Arg object.
|
|
3438
1655
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3439
1656
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3440
|
-
* @returns {Promise<
|
|
3441
|
-
* Success response
|
|
1657
|
+
* @returns {Promise<ChargeCustomerResponse>} - Success response
|
|
3442
1658
|
* @name verifyAndChargePayment
|
|
3443
1659
|
* @summary: Verify order confirmation and charge
|
|
3444
1660
|
* @description: Verify the payment status and charge from the customer's BNPL (Buy Now, Pay Later) account after order confirmation. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/verifyAndChargePayment/).
|
|
@@ -3447,30 +1663,6 @@ class Payment {
|
|
|
3447
1663
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3448
1664
|
{ responseHeaders } = { responseHeaders: false }
|
|
3449
1665
|
) {
|
|
3450
|
-
const {
|
|
3451
|
-
error,
|
|
3452
|
-
} = PaymentApplicationValidator.verifyAndChargePayment().validate(
|
|
3453
|
-
{ body },
|
|
3454
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3455
|
-
);
|
|
3456
|
-
if (error) {
|
|
3457
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3458
|
-
}
|
|
3459
|
-
|
|
3460
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3461
|
-
const {
|
|
3462
|
-
error: warrning,
|
|
3463
|
-
} = PaymentApplicationValidator.verifyAndChargePayment().validate(
|
|
3464
|
-
{ body },
|
|
3465
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3466
|
-
);
|
|
3467
|
-
if (warrning) {
|
|
3468
|
-
Logger({
|
|
3469
|
-
level: "WARN",
|
|
3470
|
-
message: `Parameter Validation warrnings for application > Payment > verifyAndChargePayment \n ${warrning}`,
|
|
3471
|
-
});
|
|
3472
|
-
}
|
|
3473
|
-
|
|
3474
1666
|
const query_params = {};
|
|
3475
1667
|
|
|
3476
1668
|
const xHeaders = {};
|
|
@@ -3493,34 +1685,13 @@ class Payment {
|
|
|
3493
1685
|
responseData = response[0];
|
|
3494
1686
|
}
|
|
3495
1687
|
|
|
3496
|
-
const {
|
|
3497
|
-
error: res_error,
|
|
3498
|
-
} = PaymentApplicationModel.ChargeCustomerResponse().validate(
|
|
3499
|
-
responseData,
|
|
3500
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3501
|
-
);
|
|
3502
|
-
|
|
3503
|
-
if (res_error) {
|
|
3504
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3505
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3506
|
-
} else {
|
|
3507
|
-
Logger({
|
|
3508
|
-
level: "WARN",
|
|
3509
|
-
message: `Response Validation Warnings for application > Payment > verifyAndChargePayment \n ${res_error}`,
|
|
3510
|
-
});
|
|
3511
|
-
}
|
|
3512
|
-
}
|
|
3513
|
-
|
|
3514
1688
|
return response;
|
|
3515
1689
|
}
|
|
3516
1690
|
|
|
3517
1691
|
/**
|
|
3518
|
-
* @param {PaymentApplicationValidator.VerifyCustomerForPaymentParam} arg -
|
|
3519
|
-
* Arg object.
|
|
3520
1692
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3521
1693
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3522
|
-
* @returns {Promise<
|
|
3523
|
-
* Success response
|
|
1694
|
+
* @returns {Promise<ValidateCustomerResponse>} - Success response
|
|
3524
1695
|
* @name verifyCustomerForPayment
|
|
3525
1696
|
* @summary: Verify payment customer
|
|
3526
1697
|
* @description: Verify if the user is eligible for pay-later payment from the payment aggregator side using the customer's phone number. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/verifyCustomerForPayment/).
|
|
@@ -3529,30 +1700,6 @@ class Payment {
|
|
|
3529
1700
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3530
1701
|
{ responseHeaders } = { responseHeaders: false }
|
|
3531
1702
|
) {
|
|
3532
|
-
const {
|
|
3533
|
-
error,
|
|
3534
|
-
} = PaymentApplicationValidator.verifyCustomerForPayment().validate(
|
|
3535
|
-
{ body },
|
|
3536
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3537
|
-
);
|
|
3538
|
-
if (error) {
|
|
3539
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3540
|
-
}
|
|
3541
|
-
|
|
3542
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3543
|
-
const {
|
|
3544
|
-
error: warrning,
|
|
3545
|
-
} = PaymentApplicationValidator.verifyCustomerForPayment().validate(
|
|
3546
|
-
{ body },
|
|
3547
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3548
|
-
);
|
|
3549
|
-
if (warrning) {
|
|
3550
|
-
Logger({
|
|
3551
|
-
level: "WARN",
|
|
3552
|
-
message: `Parameter Validation warrnings for application > Payment > verifyCustomerForPayment \n ${warrning}`,
|
|
3553
|
-
});
|
|
3554
|
-
}
|
|
3555
|
-
|
|
3556
1703
|
const query_params = {};
|
|
3557
1704
|
|
|
3558
1705
|
const xHeaders = {};
|
|
@@ -3575,32 +1722,13 @@ class Payment {
|
|
|
3575
1722
|
responseData = response[0];
|
|
3576
1723
|
}
|
|
3577
1724
|
|
|
3578
|
-
const {
|
|
3579
|
-
error: res_error,
|
|
3580
|
-
} = PaymentApplicationModel.ValidateCustomerResponse().validate(
|
|
3581
|
-
responseData,
|
|
3582
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3583
|
-
);
|
|
3584
|
-
|
|
3585
|
-
if (res_error) {
|
|
3586
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3587
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3588
|
-
} else {
|
|
3589
|
-
Logger({
|
|
3590
|
-
level: "WARN",
|
|
3591
|
-
message: `Response Validation Warnings for application > Payment > verifyCustomerForPayment \n ${res_error}`,
|
|
3592
|
-
});
|
|
3593
|
-
}
|
|
3594
|
-
}
|
|
3595
|
-
|
|
3596
1725
|
return response;
|
|
3597
1726
|
}
|
|
3598
1727
|
|
|
3599
1728
|
/**
|
|
3600
|
-
* @param {PaymentApplicationValidator.VerifyIfscCodeParam} arg - Arg object.
|
|
3601
1729
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3602
1730
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3603
|
-
* @returns {Promise<
|
|
1731
|
+
* @returns {Promise<IfscCodeResponse>} - Success response
|
|
3604
1732
|
* @name verifyIfscCode
|
|
3605
1733
|
* @summary: Verify IFSC
|
|
3606
1734
|
* @description: Validate IFSC code and returns bank details if valid. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/verifyIfscCode/).
|
|
@@ -3609,28 +1737,6 @@ class Payment {
|
|
|
3609
1737
|
{ ifscCode, requestHeaders } = { requestHeaders: {} },
|
|
3610
1738
|
{ responseHeaders } = { responseHeaders: false }
|
|
3611
1739
|
) {
|
|
3612
|
-
const { error } = PaymentApplicationValidator.verifyIfscCode().validate(
|
|
3613
|
-
{ ifscCode },
|
|
3614
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3615
|
-
);
|
|
3616
|
-
if (error) {
|
|
3617
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3618
|
-
}
|
|
3619
|
-
|
|
3620
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3621
|
-
const {
|
|
3622
|
-
error: warrning,
|
|
3623
|
-
} = PaymentApplicationValidator.verifyIfscCode().validate(
|
|
3624
|
-
{ ifscCode },
|
|
3625
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3626
|
-
);
|
|
3627
|
-
if (warrning) {
|
|
3628
|
-
Logger({
|
|
3629
|
-
level: "WARN",
|
|
3630
|
-
message: `Parameter Validation warrnings for application > Payment > verifyIfscCode \n ${warrning}`,
|
|
3631
|
-
});
|
|
3632
|
-
}
|
|
3633
|
-
|
|
3634
1740
|
const query_params = {};
|
|
3635
1741
|
query_params["ifsc_code"] = ifscCode;
|
|
3636
1742
|
|
|
@@ -3654,36 +1760,13 @@ class Payment {
|
|
|
3654
1760
|
responseData = response[0];
|
|
3655
1761
|
}
|
|
3656
1762
|
|
|
3657
|
-
const {
|
|
3658
|
-
error: res_error,
|
|
3659
|
-
} = PaymentApplicationModel.IfscCodeResponse().validate(responseData, {
|
|
3660
|
-
abortEarly: false,
|
|
3661
|
-
allowUnknown: true,
|
|
3662
|
-
});
|
|
3663
|
-
|
|
3664
|
-
if (res_error) {
|
|
3665
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3666
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3667
|
-
} else {
|
|
3668
|
-
Logger({
|
|
3669
|
-
level: "WARN",
|
|
3670
|
-
message: `Response Validation Warnings for application > Payment > verifyIfscCode \n ${res_error}`,
|
|
3671
|
-
});
|
|
3672
|
-
}
|
|
3673
|
-
}
|
|
3674
|
-
|
|
3675
1763
|
return response;
|
|
3676
1764
|
}
|
|
3677
1765
|
|
|
3678
1766
|
/**
|
|
3679
|
-
* @param {PaymentApplicationValidator.VerifyOtpAndAddBeneficiaryForBankParam} arg
|
|
3680
|
-
* - Arg object.
|
|
3681
|
-
*
|
|
3682
1767
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3683
1768
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3684
|
-
* @returns {Promise<
|
|
3685
|
-
* - Success response
|
|
3686
|
-
*
|
|
1769
|
+
* @returns {Promise<AddBeneficiaryViaOtpVerificationResponse>} - Success response
|
|
3687
1770
|
* @name verifyOtpAndAddBeneficiaryForBank
|
|
3688
1771
|
* @summary: Verify OTP for bank and add beneficiary
|
|
3689
1772
|
* @description: Verify the OTP provided by the user and adds a bank beneficiary for refund processing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/verifyOtpAndAddBeneficiaryForBank/).
|
|
@@ -3692,30 +1775,6 @@ class Payment {
|
|
|
3692
1775
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3693
1776
|
{ responseHeaders } = { responseHeaders: false }
|
|
3694
1777
|
) {
|
|
3695
|
-
const {
|
|
3696
|
-
error,
|
|
3697
|
-
} = PaymentApplicationValidator.verifyOtpAndAddBeneficiaryForBank().validate(
|
|
3698
|
-
{ body },
|
|
3699
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3700
|
-
);
|
|
3701
|
-
if (error) {
|
|
3702
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3703
|
-
}
|
|
3704
|
-
|
|
3705
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3706
|
-
const {
|
|
3707
|
-
error: warrning,
|
|
3708
|
-
} = PaymentApplicationValidator.verifyOtpAndAddBeneficiaryForBank().validate(
|
|
3709
|
-
{ body },
|
|
3710
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3711
|
-
);
|
|
3712
|
-
if (warrning) {
|
|
3713
|
-
Logger({
|
|
3714
|
-
level: "WARN",
|
|
3715
|
-
message: `Parameter Validation warrnings for application > Payment > verifyOtpAndAddBeneficiaryForBank \n ${warrning}`,
|
|
3716
|
-
});
|
|
3717
|
-
}
|
|
3718
|
-
|
|
3719
1778
|
const query_params = {};
|
|
3720
1779
|
|
|
3721
1780
|
const xHeaders = {};
|
|
@@ -3738,34 +1797,13 @@ class Payment {
|
|
|
3738
1797
|
responseData = response[0];
|
|
3739
1798
|
}
|
|
3740
1799
|
|
|
3741
|
-
const {
|
|
3742
|
-
error: res_error,
|
|
3743
|
-
} = PaymentApplicationModel.AddBeneficiaryViaOtpVerificationResponse().validate(
|
|
3744
|
-
responseData,
|
|
3745
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3746
|
-
);
|
|
3747
|
-
|
|
3748
|
-
if (res_error) {
|
|
3749
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3750
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3751
|
-
} else {
|
|
3752
|
-
Logger({
|
|
3753
|
-
level: "WARN",
|
|
3754
|
-
message: `Response Validation Warnings for application > Payment > verifyOtpAndAddBeneficiaryForBank \n ${res_error}`,
|
|
3755
|
-
});
|
|
3756
|
-
}
|
|
3757
|
-
}
|
|
3758
|
-
|
|
3759
1800
|
return response;
|
|
3760
1801
|
}
|
|
3761
1802
|
|
|
3762
1803
|
/**
|
|
3763
|
-
* @param {PaymentApplicationValidator.VerifyOtpAndAddBeneficiaryForWalletParam} arg
|
|
3764
|
-
* - Arg object.
|
|
3765
|
-
*
|
|
3766
1804
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3767
1805
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3768
|
-
* @returns {Promise<
|
|
1806
|
+
* @returns {Promise<WalletOtpResponse>} - Success response
|
|
3769
1807
|
* @name verifyOtpAndAddBeneficiaryForWallet
|
|
3770
1808
|
* @summary: Verify OTP for wallet
|
|
3771
1809
|
* @description: Verify OTP provided by the user and adds a wallet beneficiary. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/verifyOtpAndAddBeneficiaryForWallet/).
|
|
@@ -3774,30 +1812,6 @@ class Payment {
|
|
|
3774
1812
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3775
1813
|
{ responseHeaders } = { responseHeaders: false }
|
|
3776
1814
|
) {
|
|
3777
|
-
const {
|
|
3778
|
-
error,
|
|
3779
|
-
} = PaymentApplicationValidator.verifyOtpAndAddBeneficiaryForWallet().validate(
|
|
3780
|
-
{ body },
|
|
3781
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3782
|
-
);
|
|
3783
|
-
if (error) {
|
|
3784
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3785
|
-
}
|
|
3786
|
-
|
|
3787
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3788
|
-
const {
|
|
3789
|
-
error: warrning,
|
|
3790
|
-
} = PaymentApplicationValidator.verifyOtpAndAddBeneficiaryForWallet().validate(
|
|
3791
|
-
{ body },
|
|
3792
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3793
|
-
);
|
|
3794
|
-
if (warrning) {
|
|
3795
|
-
Logger({
|
|
3796
|
-
level: "WARN",
|
|
3797
|
-
message: `Parameter Validation warrnings for application > Payment > verifyOtpAndAddBeneficiaryForWallet \n ${warrning}`,
|
|
3798
|
-
});
|
|
3799
|
-
}
|
|
3800
|
-
|
|
3801
1815
|
const query_params = {};
|
|
3802
1816
|
|
|
3803
1817
|
const xHeaders = {};
|
|
@@ -3820,32 +1834,13 @@ class Payment {
|
|
|
3820
1834
|
responseData = response[0];
|
|
3821
1835
|
}
|
|
3822
1836
|
|
|
3823
|
-
const {
|
|
3824
|
-
error: res_error,
|
|
3825
|
-
} = PaymentApplicationModel.WalletOtpResponse().validate(responseData, {
|
|
3826
|
-
abortEarly: false,
|
|
3827
|
-
allowUnknown: true,
|
|
3828
|
-
});
|
|
3829
|
-
|
|
3830
|
-
if (res_error) {
|
|
3831
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3832
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3833
|
-
} else {
|
|
3834
|
-
Logger({
|
|
3835
|
-
level: "WARN",
|
|
3836
|
-
message: `Response Validation Warnings for application > Payment > verifyOtpAndAddBeneficiaryForWallet \n ${res_error}`,
|
|
3837
|
-
});
|
|
3838
|
-
}
|
|
3839
|
-
}
|
|
3840
|
-
|
|
3841
1837
|
return response;
|
|
3842
1838
|
}
|
|
3843
1839
|
|
|
3844
1840
|
/**
|
|
3845
|
-
* @param {PaymentApplicationValidator.WalletLinkInitiateParam} arg - Arg object.
|
|
3846
1841
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3847
1842
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3848
|
-
* @returns {Promise<
|
|
1843
|
+
* @returns {Promise<WalletResponseSchema>} - Success response
|
|
3849
1844
|
* @name walletLinkInitiate
|
|
3850
1845
|
* @summary: Initiate linking of wallet
|
|
3851
1846
|
* @description: Link wallet for the aggregator for processing of payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/walletLinkInitiate/).
|
|
@@ -3854,28 +1849,6 @@ class Payment {
|
|
|
3854
1849
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3855
1850
|
{ responseHeaders } = { responseHeaders: false }
|
|
3856
1851
|
) {
|
|
3857
|
-
const { error } = PaymentApplicationValidator.walletLinkInitiate().validate(
|
|
3858
|
-
{ body },
|
|
3859
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3860
|
-
);
|
|
3861
|
-
if (error) {
|
|
3862
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3863
|
-
}
|
|
3864
|
-
|
|
3865
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3866
|
-
const {
|
|
3867
|
-
error: warrning,
|
|
3868
|
-
} = PaymentApplicationValidator.walletLinkInitiate().validate(
|
|
3869
|
-
{ body },
|
|
3870
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3871
|
-
);
|
|
3872
|
-
if (warrning) {
|
|
3873
|
-
Logger({
|
|
3874
|
-
level: "WARN",
|
|
3875
|
-
message: `Parameter Validation warrnings for application > Payment > walletLinkInitiate \n ${warrning}`,
|
|
3876
|
-
});
|
|
3877
|
-
}
|
|
3878
|
-
|
|
3879
1852
|
const query_params = {};
|
|
3880
1853
|
|
|
3881
1854
|
const xHeaders = {};
|
|
@@ -3898,24 +1871,6 @@ class Payment {
|
|
|
3898
1871
|
responseData = response[0];
|
|
3899
1872
|
}
|
|
3900
1873
|
|
|
3901
|
-
const {
|
|
3902
|
-
error: res_error,
|
|
3903
|
-
} = PaymentApplicationModel.WalletResponseSchema().validate(responseData, {
|
|
3904
|
-
abortEarly: false,
|
|
3905
|
-
allowUnknown: true,
|
|
3906
|
-
});
|
|
3907
|
-
|
|
3908
|
-
if (res_error) {
|
|
3909
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
3910
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3911
|
-
} else {
|
|
3912
|
-
Logger({
|
|
3913
|
-
level: "WARN",
|
|
3914
|
-
message: `Response Validation Warnings for application > Payment > walletLinkInitiate \n ${res_error}`,
|
|
3915
|
-
});
|
|
3916
|
-
}
|
|
3917
|
-
}
|
|
3918
|
-
|
|
3919
1874
|
return response;
|
|
3920
1875
|
}
|
|
3921
1876
|
}
|