@gofynd/fdk-client-javascript 1.1.2 → 1.1.4

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.
Files changed (120) hide show
  1. package/README.md +2 -2
  2. package/index.d.ts +7 -7
  3. package/index.js +12 -12
  4. package/package.json +1 -1
  5. package/sdk/application/ApplicationClient.d.ts +20 -20
  6. package/sdk/application/ApplicationClient.js +26 -26
  7. package/sdk/application/Cart/CartApplicationClient.d.ts +36 -6
  8. package/sdk/application/Cart/CartApplicationClient.js +105 -10
  9. package/sdk/application/Cart/CartApplicationModel.d.ts +9 -0
  10. package/sdk/application/Cart/CartApplicationModel.js +105 -1
  11. package/sdk/application/Cart/CartApplicationValidator.d.ts +1 -0
  12. package/sdk/application/Cart/CartApplicationValidator.js +15 -1
  13. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1 -0
  14. package/sdk/application/Catalog/CatalogApplicationModel.js +13 -0
  15. package/sdk/application/Common/CommonApplicationModel.js +4 -0
  16. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +14 -10
  17. package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -10
  18. package/sdk/application/Configuration/ConfigurationApplicationModel.js +6 -5
  19. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
  20. package/sdk/application/Content/ContentApplicationModel.js +3 -1
  21. package/sdk/application/Lead/LeadApplicationModel.js +4 -1
  22. package/sdk/application/Logistic/LogisticApplicationModel.js +3 -2
  23. package/sdk/application/Order/OrderApplicationClient.d.ts +2 -2
  24. package/sdk/application/Order/OrderApplicationClient.js +2 -2
  25. package/sdk/application/Order/OrderApplicationModel.js +18 -8
  26. package/sdk/application/Payment/PaymentApplicationClient.d.ts +35 -0
  27. package/sdk/application/Payment/PaymentApplicationClient.js +200 -0
  28. package/sdk/application/Payment/PaymentApplicationModel.d.ts +4 -0
  29. package/sdk/application/Payment/PaymentApplicationModel.js +58 -7
  30. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +3 -0
  31. package/sdk/application/Payment/PaymentApplicationValidator.js +19 -0
  32. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +16 -3
  33. package/sdk/application/PosCart/PosCartApplicationClient.js +39 -6
  34. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +6 -0
  35. package/sdk/application/PosCart/PosCartApplicationModel.js +63 -1
  36. package/sdk/application/PosCart/PosCartApplicationValidator.js +6 -0
  37. package/sdk/application/index.d.ts +10 -10
  38. package/sdk/application/index.js +13 -13
  39. package/sdk/common/Constant.d.ts +5 -0
  40. package/sdk/common/Constant.js +5 -0
  41. package/sdk/partner/OAuthClient.js +1 -1
  42. package/sdk/platform/Billing/BillingPlatformModel.js +6 -1
  43. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +491 -2
  44. package/sdk/platform/Cart/CartPlatformApplicationClient.js +2661 -337
  45. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +32 -0
  46. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +269 -0
  47. package/sdk/platform/Cart/CartPlatformModel.d.ts +58 -0
  48. package/sdk/platform/Cart/CartPlatformModel.js +652 -3
  49. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +8 -2
  50. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +10 -0
  51. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -0
  52. package/sdk/platform/Catalog/CatalogPlatformClient.js +2 -2
  53. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1 -0
  54. package/sdk/platform/Catalog/CatalogPlatformModel.js +43 -31
  55. package/sdk/platform/Common/CommonPlatformModel.js +4 -0
  56. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1 -0
  57. package/sdk/platform/Communication/CommunicationPlatformModel.js +9 -0
  58. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -2
  59. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +2 -2
  60. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +5 -4
  61. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +99 -78
  62. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +99 -78
  63. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +87 -71
  64. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +87 -71
  65. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2 -0
  66. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +34 -7
  67. package/sdk/platform/Content/ContentPlatformModel.js +3 -1
  68. package/sdk/platform/Finance/FinancePlatformClient.d.ts +135 -0
  69. package/sdk/platform/Finance/FinancePlatformClient.js +853 -0
  70. package/sdk/platform/Finance/FinancePlatformModel.d.ts +51 -0
  71. package/sdk/platform/Finance/FinancePlatformModel.js +342 -0
  72. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +16 -0
  73. package/sdk/platform/Finance/FinancePlatformValidator.js +84 -0
  74. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +11 -1
  75. package/sdk/platform/Order/OrderPlatformApplicationClient.js +66 -2
  76. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -0
  77. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -0
  78. package/sdk/platform/Order/OrderPlatformClient.d.ts +161 -79
  79. package/sdk/platform/Order/OrderPlatformClient.js +546 -114
  80. package/sdk/platform/Order/OrderPlatformModel.d.ts +42 -6
  81. package/sdk/platform/Order/OrderPlatformModel.js +569 -159
  82. package/sdk/platform/Order/OrderPlatformValidator.d.ts +6 -0
  83. package/sdk/platform/Order/OrderPlatformValidator.js +52 -9
  84. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +22 -0
  85. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +127 -0
  86. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +2 -0
  87. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +13 -0
  88. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +145 -0
  89. package/sdk/platform/Partner/PartnerPlatformClient.js +799 -0
  90. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +39 -0
  91. package/sdk/platform/Partner/PartnerPlatformModel.js +367 -0
  92. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +14 -0
  93. package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -0
  94. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +221 -0
  95. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1476 -190
  96. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +20 -0
  97. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +126 -0
  98. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +48 -0
  99. package/sdk/platform/Payment/PaymentPlatformModel.js +452 -7
  100. package/sdk/platform/PlatformApplicationClient.d.ts +1249 -937
  101. package/sdk/platform/PlatformApplicationClient.js +1366 -1033
  102. package/sdk/platform/PlatformClient.d.ts +10979 -8771
  103. package/sdk/platform/PlatformClient.js +11874 -9197
  104. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +134 -0
  105. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +852 -0
  106. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +16 -0
  107. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +81 -0
  108. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +223 -0
  109. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +1296 -0
  110. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +97 -0
  111. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +778 -0
  112. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +21 -0
  113. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +130 -0
  114. package/sdk/platform/index.d.ts +16 -14
  115. package/sdk/platform/index.js +22 -18
  116. package/sdk/public/Configuration/ConfigurationPublicModel.js +5 -0
  117. package/sdk/public/PublicClient.d.ts +2 -2
  118. package/sdk/public/PublicClient.js +4 -4
  119. package/sdk/public/index.d.ts +1 -1
  120. package/sdk/public/index.js +2 -2
@@ -108,14 +108,15 @@ class LogisticModel {
108
108
  articles: Joi.array().items(Joi.any()).required(),
109
109
  configuration: Joi.any().required(),
110
110
  identifier: Joi.string().allow("").required(),
111
- ignored_locations: Joi.array().items(Joi.string().allow("")).required(),
111
+ ignored_locations: Joi.array().items(Joi.number()).required(),
112
112
  to_pincode: Joi.string().allow("").required(),
113
113
  });
114
114
  }
115
115
  static ReAssignStoreResponse() {
116
116
  return Joi.object({
117
- articles: Joi.array().items(Joi.any()),
117
+ assigned_stores: Joi.array().items(Joi.any()),
118
118
  error: Joi.any().required(),
119
+ pystormbreaker_uuid: Joi.string().allow("").required(),
119
120
  success: Joi.boolean().required(),
120
121
  to_pincode: Joi.string().allow("").required(),
121
122
  });
@@ -83,13 +83,13 @@ declare class Order {
83
83
  * @param {Object} arg - Arg object.
84
84
  * @param {string} arg.orderId - A unique number used for identifying and
85
85
  * tracking your orders.
86
- * @returns {Promise<OrderList>} - Success response
86
+ * @returns {Promise<OrderById>} - Success response
87
87
  * @summary: Get POS Order
88
88
  * @description: Use this API to retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID.
89
89
  */
90
90
  getPosOrderById({ orderId }?: {
91
91
  orderId: string;
92
- }): Promise<OrderList>;
92
+ }): Promise<OrderById>;
93
93
  /**
94
94
  * @param {Object} arg - Arg object.
95
95
  * @param {string} arg.shipmentId - ID of the bag. An order may contain
@@ -336,7 +336,7 @@ class Order {
336
336
  * @param {Object} arg - Arg object.
337
337
  * @param {string} arg.orderId - A unique number used for identifying and
338
338
  * tracking your orders.
339
- * @returns {Promise<OrderList>} - Success response
339
+ * @returns {Promise<OrderById>} - Success response
340
340
  * @summary: Get POS Order
341
341
  * @description: Use this API to retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID.
342
342
  */
@@ -378,7 +378,7 @@ class Order {
378
378
  xHeaders
379
379
  );
380
380
 
381
- const { error: res_error } = OrderModel.OrderList().validate(response, {
381
+ const { error: res_error } = OrderModel.OrderById().validate(response, {
382
382
  abortEarly: false,
383
383
  allowUnknown: false,
384
384
  });
@@ -51,15 +51,16 @@ class OrderModel {
51
51
  currency_code: Joi.string().allow(""),
52
52
  currency_symbol: Joi.string().allow(""),
53
53
  current_status: OrderModel.CurrentStatus(),
54
- delivery_date: Joi.string().allow(""),
54
+ delivery_date: Joi.string().allow("").allow(null),
55
55
  financial_breakup: Joi.array().items(OrderModel.FinancialBreakup()),
56
56
  id: Joi.number(),
57
57
  item: OrderModel.Item(),
58
58
  line_number: Joi.number(),
59
+ meta: Joi.any(),
59
60
  parent_promo_bags: Joi.any(),
60
61
  prices: OrderModel.Prices(),
61
62
  quantity: Joi.number(),
62
- returnable_date: Joi.string().allow(""),
63
+ returnable_date: Joi.string().allow("").allow(null),
63
64
  seller_identifier: Joi.string().allow(""),
64
65
  });
65
66
  }
@@ -90,7 +91,7 @@ class OrderModel {
90
91
  }
91
92
  static CurrentStatus() {
92
93
  return Joi.object({
93
- journey_type: Joi.string().allow(""),
94
+ journey_type: Joi.string().allow("").allow(null),
94
95
  name: Joi.string().allow(""),
95
96
  status: Joi.string().allow(""),
96
97
  updated_at: Joi.string().allow(""),
@@ -127,8 +128,8 @@ class OrderModel {
127
128
  created_at: Joi.string().allow(""),
128
129
  email: Joi.string().allow(""),
129
130
  landmark: Joi.string().allow(""),
130
- latitude: Joi.number(),
131
- longitude: Joi.number(),
131
+ latitude: Joi.number().allow(null),
132
+ longitude: Joi.number().allow(null),
132
133
  name: Joi.string().allow(""),
133
134
  phone: Joi.string().allow(""),
134
135
  pincode: Joi.string().allow(""),
@@ -229,6 +230,9 @@ class OrderModel {
229
230
  code: Joi.string().allow(""),
230
231
  id: Joi.number(),
231
232
  image: Joi.array().items(Joi.string().allow("")),
233
+ l1_categories: Joi.array().items(Joi.string().allow("")),
234
+ l2_categories: Joi.array().items(Joi.string().allow("")),
235
+ l3_category_name: Joi.string().allow(""),
232
236
  name: Joi.string().allow(""),
233
237
  seller_identifier: Joi.string().allow(""),
234
238
  size: Joi.string().allow(""),
@@ -444,20 +448,20 @@ class OrderModel {
444
448
  comment: Joi.string().allow(""),
445
449
  custom_meta: Joi.array().items(Joi.any()),
446
450
  delivery_address: OrderModel.DeliveryAddress(),
447
- delivery_date: Joi.string().allow(""),
451
+ delivery_date: Joi.string().allow("").allow(null),
448
452
  dp_name: Joi.string().allow(""),
449
453
  fulfilling_company: OrderModel.FulfillingCompany(),
450
454
  fulfilling_store: OrderModel.FulfillingStore(),
451
455
  invoice: OrderModel.Invoice(),
452
456
  need_help_url: Joi.string().allow(""),
453
457
  order_id: Joi.string().allow(""),
454
- order_type: Joi.string().allow(""),
458
+ order_type: Joi.string().allow("").allow(null),
455
459
  payment: OrderModel.ShipmentPayment(),
456
460
  prices: OrderModel.Prices(),
457
461
  promise: OrderModel.Promise(),
458
462
  refund_details: Joi.any(),
459
463
  return_meta: Joi.any(),
460
- returnable_date: Joi.string().allow(""),
464
+ returnable_date: Joi.string().allow("").allow(null),
461
465
  shipment_created_at: Joi.string().allow(""),
462
466
  shipment_id: Joi.string().allow(""),
463
467
  shipment_status: OrderModel.ShipmentStatus(),
@@ -484,6 +488,7 @@ class OrderModel {
484
488
  return Joi.object({
485
489
  hex_code: Joi.string().allow(""),
486
490
  title: Joi.string().allow(""),
491
+ value: Joi.string().allow("").allow(null),
487
492
  });
488
493
  }
489
494
  static ShipmentTotalDetails() {
@@ -500,10 +505,12 @@ class OrderModel {
500
505
  }
501
506
  static ShipmentUserInfo() {
502
507
  return Joi.object({
508
+ email: Joi.string().allow(""),
503
509
  first_name: Joi.string().allow(""),
504
510
  gender: Joi.string().allow(""),
505
511
  last_name: Joi.string().allow(""),
506
512
  mobile: Joi.string().allow(""),
513
+ name: Joi.string().allow(""),
507
514
  });
508
515
  }
509
516
  static StatuesRequest() {
@@ -543,6 +550,7 @@ class OrderModel {
543
550
  status: Joi.string().allow(""),
544
551
  time: Joi.string().allow(""),
545
552
  tracking_details: Joi.array().items(OrderModel.NestedTrackingDetails()),
553
+ value: Joi.string().allow("").allow(null),
546
554
  });
547
555
  }
548
556
  static UpdateShipmentStatusRequest() {
@@ -557,7 +565,9 @@ class OrderModel {
557
565
  static UserInfo() {
558
566
  return Joi.object({
559
567
  email: Joi.string().allow(""),
568
+ first_name: Joi.string().allow(""),
560
569
  gender: Joi.string().allow(""),
570
+ last_name: Joi.string().allow(""),
561
571
  mobile: Joi.string().allow(""),
562
572
  name: Joi.string().allow(""),
563
573
  });
@@ -7,6 +7,7 @@ declare class Payment {
7
7
  addRefundBankAccountUsingOTP: string;
8
8
  attachCardToCustomer: string;
9
9
  cancelPaymentLink: string;
10
+ cardDetails: string;
10
11
  checkAndUpdatePaymentStatus: string;
11
12
  checkAndUpdatePaymentStatusPaymentLink: string;
12
13
  checkCredit: string;
@@ -30,6 +31,8 @@ declare class Payment {
30
31
  getUserBeneficiariesDetail: string;
31
32
  initialisePayment: string;
32
33
  initialisePaymentPaymentLink: string;
34
+ outstandingOrderDetails: string;
35
+ paidOrderDetails: string;
33
36
  pollingPaymentLink: string;
34
37
  redirectToAggregator: string;
35
38
  renderHTML: string;
@@ -85,6 +88,18 @@ declare class Payment {
85
88
  cancelPaymentLink({ body }?: {
86
89
  body: CancelOrResendPaymentLinkRequest;
87
90
  }): Promise<CancelPaymentLinkResponse>;
91
+ /**
92
+ * @param {Object} arg - Arg object.
93
+ * @param {string} arg.cardInfo - Card first 6 digit IIN(prefix) number.
94
+ * @param {string} [arg.aggregator] -
95
+ * @returns {Promise<CardDetailsResponse>} - Success response
96
+ * @summary: API to get Card info from PG
97
+ * @description: API to get Card info from PG
98
+ */
99
+ cardDetails({ cardInfo, aggregator }?: {
100
+ cardInfo: string;
101
+ aggregator?: string;
102
+ }): Promise<CardDetailsResponse>;
88
103
  /**
89
104
  * @param {Object} arg - Arg object.
90
105
  * @param {PaymentStatusUpdateRequest} arg.body
@@ -348,6 +363,26 @@ declare class Payment {
348
363
  initialisePaymentPaymentLink({ body }?: {
349
364
  body: PaymentInitializationRequest;
350
365
  }): Promise<PaymentInitializationResponse>;
366
+ /**
367
+ * @param {Object} arg - Arg object.
368
+ * @param {string} [arg.aggregator] -
369
+ * @returns {Promise<OutstandingOrderDetailsResponse>} - Success response
370
+ * @summary: API to fetch the outstanding order details
371
+ * @description: Use this API to fetch the outstanding order details.
372
+ */
373
+ outstandingOrderDetails({ aggregator }?: {
374
+ aggregator?: string;
375
+ }): Promise<OutstandingOrderDetailsResponse>;
376
+ /**
377
+ * @param {Object} arg - Arg object.
378
+ * @param {string} [arg.aggregator] -
379
+ * @returns {Promise<PaidOrderDetailsResponse>} - Success response
380
+ * @summary: API to fetch the paid order details
381
+ * @description: Use this API to fetch the paid order details.
382
+ */
383
+ paidOrderDetails({ aggregator }?: {
384
+ aggregator?: string;
385
+ }): Promise<PaidOrderDetailsResponse>;
351
386
  /**
352
387
  * @param {Object} arg - Arg object.
353
388
  * @param {string} [arg.paymentLinkId] -
@@ -17,6 +17,7 @@ class Payment {
17
17
  attachCardToCustomer: "/service/application/payment/v1.0/card/attach",
18
18
  cancelPaymentLink:
19
19
  "/service/application/payment/v1.0/cancel-payment-link/",
20
+ cardDetails: "/service/application/payment/v1.0/cards/info/{card_info}",
20
21
  checkAndUpdatePaymentStatus:
21
22
  "/service/application/payment/v1.0/payment/confirm/polling",
22
23
  checkAndUpdatePaymentStatusPaymentLink:
@@ -55,6 +56,10 @@ class Payment {
55
56
  initialisePayment: "/service/application/payment/v1.0/payment/request",
56
57
  initialisePaymentPaymentLink:
57
58
  "/service/application/payment/v1.0/payment/request/link/",
59
+ outstandingOrderDetails:
60
+ "/service/application/payment/v1.0/payment/outstanding-orders/",
61
+ paidOrderDetails:
62
+ "/service/application/payment/v1.0/payment/paid-orders/",
58
63
  pollingPaymentLink:
59
64
  "/service/application/payment/v1.0/polling-payment-link/",
60
65
  redirectToAggregator:
@@ -353,6 +358,71 @@ class Payment {
353
358
  return response;
354
359
  }
355
360
 
361
+ /**
362
+ * @param {Object} arg - Arg object.
363
+ * @param {string} arg.cardInfo - Card first 6 digit IIN(prefix) number.
364
+ * @param {string} [arg.aggregator] -
365
+ * @returns {Promise<CardDetailsResponse>} - Success response
366
+ * @summary: API to get Card info from PG
367
+ * @description: API to get Card info from PG
368
+ */
369
+ async cardDetails({ cardInfo, aggregator } = {}) {
370
+ const { error } = PaymentValidator.cardDetails().validate(
371
+ { cardInfo, aggregator },
372
+ { abortEarly: false, allowUnknown: true }
373
+ );
374
+ if (error) {
375
+ return Promise.reject(new FDKClientValidationError(error));
376
+ }
377
+
378
+ // Showing warrnings if extra unknown parameters are found
379
+ const { error: warrning } = PaymentValidator.cardDetails().validate(
380
+ { cardInfo, aggregator },
381
+ { abortEarly: false, allowUnknown: false }
382
+ );
383
+ if (warrning) {
384
+ Logger({
385
+ level: "WARN",
386
+ message: "Parameter Validation warrnings for cardDetails",
387
+ });
388
+ Logger({ level: "WARN", message: warrning });
389
+ }
390
+
391
+ const query_params = {};
392
+ query_params["aggregator"] = aggregator;
393
+
394
+ const xHeaders = {};
395
+
396
+ const response = await ApplicationAPIClient.execute(
397
+ this._conf,
398
+ "get",
399
+ constructUrl({
400
+ url: this._urls["cardDetails"],
401
+ params: { cardInfo },
402
+ }),
403
+ query_params,
404
+ undefined,
405
+ xHeaders
406
+ );
407
+
408
+ const {
409
+ error: res_error,
410
+ } = PaymentModel.CardDetailsResponse().validate(response, {
411
+ abortEarly: false,
412
+ allowUnknown: false,
413
+ });
414
+
415
+ if (res_error) {
416
+ Logger({
417
+ level: "WARN",
418
+ message: "Response Validation Warnnings for cardDetails",
419
+ });
420
+ Logger({ level: "WARN", message: res_error });
421
+ }
422
+
423
+ return response;
424
+ }
425
+
356
426
  /**
357
427
  * @param {Object} arg - Arg object.
358
428
  * @param {PaymentStatusUpdateRequest} arg.body
@@ -1958,6 +2028,136 @@ class Payment {
1958
2028
  return response;
1959
2029
  }
1960
2030
 
2031
+ /**
2032
+ * @param {Object} arg - Arg object.
2033
+ * @param {string} [arg.aggregator] -
2034
+ * @returns {Promise<OutstandingOrderDetailsResponse>} - Success response
2035
+ * @summary: API to fetch the outstanding order details
2036
+ * @description: Use this API to fetch the outstanding order details.
2037
+ */
2038
+ async outstandingOrderDetails({ aggregator } = {}) {
2039
+ const { error } = PaymentValidator.outstandingOrderDetails().validate(
2040
+ { aggregator },
2041
+ { abortEarly: false, allowUnknown: true }
2042
+ );
2043
+ if (error) {
2044
+ return Promise.reject(new FDKClientValidationError(error));
2045
+ }
2046
+
2047
+ // Showing warrnings if extra unknown parameters are found
2048
+ const {
2049
+ error: warrning,
2050
+ } = PaymentValidator.outstandingOrderDetails().validate(
2051
+ { aggregator },
2052
+ { abortEarly: false, allowUnknown: false }
2053
+ );
2054
+ if (warrning) {
2055
+ Logger({
2056
+ level: "WARN",
2057
+ message: "Parameter Validation warrnings for outstandingOrderDetails",
2058
+ });
2059
+ Logger({ level: "WARN", message: warrning });
2060
+ }
2061
+
2062
+ const query_params = {};
2063
+ query_params["aggregator"] = aggregator;
2064
+
2065
+ const xHeaders = {};
2066
+
2067
+ const response = await ApplicationAPIClient.execute(
2068
+ this._conf,
2069
+ "get",
2070
+ constructUrl({
2071
+ url: this._urls["outstandingOrderDetails"],
2072
+ params: {},
2073
+ }),
2074
+ query_params,
2075
+ undefined,
2076
+ xHeaders
2077
+ );
2078
+
2079
+ const {
2080
+ error: res_error,
2081
+ } = PaymentModel.OutstandingOrderDetailsResponse().validate(response, {
2082
+ abortEarly: false,
2083
+ allowUnknown: false,
2084
+ });
2085
+
2086
+ if (res_error) {
2087
+ Logger({
2088
+ level: "WARN",
2089
+ message: "Response Validation Warnnings for outstandingOrderDetails",
2090
+ });
2091
+ Logger({ level: "WARN", message: res_error });
2092
+ }
2093
+
2094
+ return response;
2095
+ }
2096
+
2097
+ /**
2098
+ * @param {Object} arg - Arg object.
2099
+ * @param {string} [arg.aggregator] -
2100
+ * @returns {Promise<PaidOrderDetailsResponse>} - Success response
2101
+ * @summary: API to fetch the paid order details
2102
+ * @description: Use this API to fetch the paid order details.
2103
+ */
2104
+ async paidOrderDetails({ aggregator } = {}) {
2105
+ const { error } = PaymentValidator.paidOrderDetails().validate(
2106
+ { aggregator },
2107
+ { abortEarly: false, allowUnknown: true }
2108
+ );
2109
+ if (error) {
2110
+ return Promise.reject(new FDKClientValidationError(error));
2111
+ }
2112
+
2113
+ // Showing warrnings if extra unknown parameters are found
2114
+ const { error: warrning } = PaymentValidator.paidOrderDetails().validate(
2115
+ { aggregator },
2116
+ { abortEarly: false, allowUnknown: false }
2117
+ );
2118
+ if (warrning) {
2119
+ Logger({
2120
+ level: "WARN",
2121
+ message: "Parameter Validation warrnings for paidOrderDetails",
2122
+ });
2123
+ Logger({ level: "WARN", message: warrning });
2124
+ }
2125
+
2126
+ const query_params = {};
2127
+ query_params["aggregator"] = aggregator;
2128
+
2129
+ const xHeaders = {};
2130
+
2131
+ const response = await ApplicationAPIClient.execute(
2132
+ this._conf,
2133
+ "get",
2134
+ constructUrl({
2135
+ url: this._urls["paidOrderDetails"],
2136
+ params: {},
2137
+ }),
2138
+ query_params,
2139
+ undefined,
2140
+ xHeaders
2141
+ );
2142
+
2143
+ const {
2144
+ error: res_error,
2145
+ } = PaymentModel.PaidOrderDetailsResponse().validate(response, {
2146
+ abortEarly: false,
2147
+ allowUnknown: false,
2148
+ });
2149
+
2150
+ if (res_error) {
2151
+ Logger({
2152
+ level: "WARN",
2153
+ message: "Response Validation Warnnings for paidOrderDetails",
2154
+ });
2155
+ Logger({ level: "WARN", message: res_error });
2156
+ }
2157
+
2158
+ return response;
2159
+ }
2160
+
1961
2161
  /**
1962
2162
  * @param {Object} arg - Arg object.
1963
2163
  * @param {string} [arg.paymentLinkId] -
@@ -17,6 +17,8 @@ declare class PaymentModel {
17
17
  static CancelOrResendPaymentLinkRequest(): any;
18
18
  static CancelPaymentLinkResponse(): any;
19
19
  static Card(): any;
20
+ static CardDetails(): any;
21
+ static CardDetailsResponse(): any;
20
22
  static CardPaymentGateway(): any;
21
23
  static ChargeCustomerRequest(): any;
22
24
  static ChargeCustomerResponse(): any;
@@ -55,6 +57,8 @@ declare class PaymentModel {
55
57
  static OnboardSummary(): any;
56
58
  static OrderBeneficiaryDetails(): any;
57
59
  static OrderBeneficiaryResponse(): any;
60
+ static OutstandingOrderDetailsResponse(): any;
61
+ static PaidOrderDetailsResponse(): any;
58
62
  static PaymentFlow(): any;
59
63
  static PaymentInitializationRequest(): any;
60
64
  static PaymentInitializationResponse(): any;
@@ -91,9 +91,9 @@ class PaymentModel {
91
91
  }
92
92
  static BalanceDetails() {
93
93
  return Joi.object({
94
- currency: Joi.string().allow("").required(),
95
- formatted_value: Joi.string().allow("").required(),
96
- value: Joi.number().required(),
94
+ currency: Joi.string().allow("").allow(null),
95
+ formatted_value: Joi.string().allow("").allow(null),
96
+ value: Joi.number().allow(null),
97
97
  });
98
98
  }
99
99
  static BankDetailsForOTP() {
@@ -168,6 +168,32 @@ class PaymentModel {
168
168
  nickname: Joi.string().allow("").allow(null),
169
169
  });
170
170
  }
171
+ static CardDetails() {
172
+ return Joi.object({
173
+ bank: Joi.string().allow("").required(),
174
+ bank_code: Joi.string().allow("").allow(null).required(),
175
+ card_brand: Joi.string().allow("").required(),
176
+ card_exp_month: Joi.string().allow(""),
177
+ card_exp_year: Joi.string().allow(""),
178
+ card_object: Joi.string().allow("").required(),
179
+ card_sub_type: Joi.string().allow("").allow(null).required(),
180
+ card_token: Joi.string().allow(""),
181
+ country: Joi.string().allow("").required(),
182
+ extended_card_type: Joi.string().allow("").required(),
183
+ id: Joi.string().allow("").required(),
184
+ is_domestic_card: Joi.boolean().required(),
185
+ name_on_card: Joi.string().allow(""),
186
+ status: Joi.boolean().required(),
187
+ type: Joi.string().allow("").required(),
188
+ user: Joi.string().allow(""),
189
+ });
190
+ }
191
+ static CardDetailsResponse() {
192
+ return Joi.object({
193
+ data: PaymentModel.CardDetails().required(),
194
+ success: Joi.boolean().required(),
195
+ });
196
+ }
171
197
  static CardPaymentGateway() {
172
198
  return Joi.object({
173
199
  aggregator: Joi.string().allow("").required(),
@@ -281,10 +307,13 @@ class PaymentModel {
281
307
  }
282
308
  static CreditSummary() {
283
309
  return Joi.object({
310
+ amount_available: PaymentModel.BalanceDetails(),
284
311
  balance: PaymentModel.BalanceDetails(),
285
- merchant_customer_ref_id: Joi.string().allow("").required(),
286
- status: Joi.string().allow("").required(),
287
- status_message: Joi.string().allow("").required(),
312
+ buyer_status: Joi.string().allow("").allow(null),
313
+ credit_line_id: Joi.string().allow("").allow(null),
314
+ merchant_customer_ref_id: Joi.string().allow("").allow(null),
315
+ status: Joi.string().allow("").allow(null),
316
+ status_message: Joi.string().allow("").allow(null),
288
317
  });
289
318
  }
290
319
  static CustomerCreditSummaryResponse() {
@@ -492,8 +521,25 @@ class PaymentModel {
492
521
  show_beneficiary_details: Joi.boolean(),
493
522
  });
494
523
  }
524
+ static OutstandingOrderDetailsResponse() {
525
+ return Joi.object({
526
+ data: Joi.array().items(Joi.any()),
527
+ message: Joi.string().allow("").allow(null),
528
+ status_code: Joi.number().required(),
529
+ success: Joi.boolean().required(),
530
+ });
531
+ }
532
+ static PaidOrderDetailsResponse() {
533
+ return Joi.object({
534
+ data: Joi.array().items(Joi.any()),
535
+ message: Joi.string().allow("").allow(null),
536
+ status_code: Joi.number().required(),
537
+ success: Joi.boolean().required(),
538
+ });
539
+ }
495
540
  static PaymentFlow() {
496
541
  return Joi.object({
542
+ ajiodhan: PaymentModel.AggregatorRoute(),
497
543
  bqr_razorpay: PaymentModel.AggregatorRoute(),
498
544
  ccavenue: PaymentModel.AggregatorRoute(),
499
545
  epaylater: PaymentModel.AggregatorRoute(),
@@ -516,6 +562,7 @@ class PaymentModel {
516
562
  contact: Joi.string().allow("").required(),
517
563
  currency: Joi.string().allow("").required(),
518
564
  customer_id: Joi.string().allow("").required(),
565
+ device_id: Joi.string().allow("").allow(null),
519
566
  email: Joi.string().allow("").required(),
520
567
  merchant_order_id: Joi.string().allow("").required(),
521
568
  method: Joi.string().allow("").required(),
@@ -533,6 +580,7 @@ class PaymentModel {
533
580
  bqr_image: Joi.string().allow("").allow(null),
534
581
  currency: Joi.string().allow("").allow(null),
535
582
  customer_id: Joi.string().allow("").allow(null),
583
+ device_id: Joi.string().allow("").allow(null),
536
584
  merchant_order_id: Joi.string().allow("").required(),
537
585
  method: Joi.string().allow("").required(),
538
586
  polling_url: Joi.string().allow("").required(),
@@ -618,12 +666,14 @@ class PaymentModel {
618
666
  contact: Joi.string().allow("").required(),
619
667
  currency: Joi.string().allow("").required(),
620
668
  customer_id: Joi.string().allow("").required(),
669
+ device_id: Joi.string().allow("").allow(null),
621
670
  email: Joi.string().allow("").required(),
622
671
  merchant_order_id: Joi.string().allow("").required(),
672
+ merchant_transaction_id: Joi.string().allow("").required(),
623
673
  method: Joi.string().allow("").required(),
624
674
  order_id: Joi.string().allow("").required(),
625
675
  status: Joi.string().allow("").required(),
626
- vpa: Joi.string().allow("").required(),
676
+ vpa: Joi.string().allow(""),
627
677
  });
628
678
  }
629
679
  static PaymentStatusUpdateResponse() {
@@ -682,6 +732,7 @@ class PaymentModel {
682
732
  }
683
733
  static ResendOrCancelPaymentRequest() {
684
734
  return Joi.object({
735
+ device_id: Joi.string().allow("").allow(null),
685
736
  order_id: Joi.string().allow("").required(),
686
737
  request_type: Joi.string().allow("").required(),
687
738
  });
@@ -4,6 +4,7 @@ declare class PaymentValidator {
4
4
  static addRefundBankAccountUsingOTP(): any;
5
5
  static attachCardToCustomer(): any;
6
6
  static cancelPaymentLink(): any;
7
+ static cardDetails(): any;
7
8
  static checkAndUpdatePaymentStatus(): any;
8
9
  static checkAndUpdatePaymentStatusPaymentLink(): any;
9
10
  static checkCredit(): any;
@@ -27,6 +28,8 @@ declare class PaymentValidator {
27
28
  static getUserBeneficiariesDetail(): any;
28
29
  static initialisePayment(): any;
29
30
  static initialisePaymentPaymentLink(): any;
31
+ static outstandingOrderDetails(): any;
32
+ static paidOrderDetails(): any;
30
33
  static pollingPaymentLink(): any;
31
34
  static redirectToAggregator(): any;
32
35
  static renderHTML(): any;
@@ -26,6 +26,13 @@ class PaymentValidator {
26
26
  }).required();
27
27
  }
28
28
 
29
+ static cardDetails() {
30
+ return Joi.object({
31
+ cardInfo: Joi.string().allow("").required(),
32
+ aggregator: Joi.string().allow(""),
33
+ }).required();
34
+ }
35
+
29
36
  static checkAndUpdatePaymentStatus() {
30
37
  return Joi.object({
31
38
  body: PaymentModel.PaymentStatusUpdateRequest().required(),
@@ -172,6 +179,18 @@ class PaymentValidator {
172
179
  }).required();
173
180
  }
174
181
 
182
+ static outstandingOrderDetails() {
183
+ return Joi.object({
184
+ aggregator: Joi.string().allow(""),
185
+ });
186
+ }
187
+
188
+ static paidOrderDetails() {
189
+ return Joi.object({
190
+ aggregator: Joi.string().allow(""),
191
+ });
192
+ }
193
+
175
194
  static pollingPaymentLink() {
176
195
  return Joi.object({
177
196
  paymentLinkId: Joi.string().allow(""),