@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
@@ -16,6 +16,18 @@ class PaymentModel {
16
16
  ifsc_code: Joi.string().allow("").required(),
17
17
  });
18
18
  }
19
+ static CancelOrResendPaymentLinkRequest() {
20
+ return Joi.object({
21
+ payment_link_id: Joi.string().allow("").required(),
22
+ });
23
+ }
24
+ static CancelPaymentLinkResponse() {
25
+ return Joi.object({
26
+ message: Joi.string().allow("").required(),
27
+ status_code: Joi.number().required(),
28
+ success: Joi.boolean().required(),
29
+ });
30
+ }
19
31
  static CODdata() {
20
32
  return Joi.object({
21
33
  is_active: Joi.boolean().required(),
@@ -25,6 +37,42 @@ class PaymentModel {
25
37
  user_id: Joi.string().allow("").required(),
26
38
  });
27
39
  }
40
+ static Code() {
41
+ return Joi.object({
42
+ code: Joi.string().allow("").required(),
43
+ merchant_code: Joi.string().allow("").required(),
44
+ name: Joi.string().allow("").required(),
45
+ });
46
+ }
47
+ static CreatePaymentLinkMeta() {
48
+ return Joi.object({
49
+ amount: Joi.string().allow("").required(),
50
+ assign_card_id: Joi.string().allow("").allow(null),
51
+ cart_id: Joi.string().allow("").required(),
52
+ checkout_mode: Joi.string().allow("").required(),
53
+ pincode: Joi.string().allow("").required(),
54
+ });
55
+ }
56
+ static CreatePaymentLinkRequest() {
57
+ return Joi.object({
58
+ amount: Joi.number().required(),
59
+ description: Joi.string().allow("").allow(null),
60
+ email: Joi.string().allow("").required(),
61
+ external_order_id: Joi.string().allow("").required(),
62
+ meta: PaymentModel.CreatePaymentLinkMeta().required(),
63
+ mobile_number: Joi.string().allow("").required(),
64
+ });
65
+ }
66
+ static CreatePaymentLinkResponse() {
67
+ return Joi.object({
68
+ message: Joi.string().allow("").required(),
69
+ payment_link_id: Joi.string().allow("").allow(null),
70
+ payment_link_url: Joi.string().allow("").allow(null),
71
+ polling_timeout: Joi.number().allow(null),
72
+ status_code: Joi.number().required(),
73
+ success: Joi.boolean().required(),
74
+ });
75
+ }
28
76
  static DeletePayoutResponse() {
29
77
  return Joi.object({
30
78
  success: Joi.boolean().required(),
@@ -35,6 +83,85 @@ class PaymentModel {
35
83
  success: Joi.boolean().required(),
36
84
  });
37
85
  }
86
+ static EdcAddRequest() {
87
+ return Joi.object({
88
+ aggregator_id: Joi.number().required(),
89
+ device_tag: Joi.string().allow("").allow(null),
90
+ edc_device_serial_no: Joi.string().allow("").required(),
91
+ edc_model: Joi.string().allow("").required(),
92
+ store_id: Joi.number().required(),
93
+ terminal_serial_no: Joi.string().allow("").required(),
94
+ });
95
+ }
96
+ static EdcAggregatorAndModelListResponse() {
97
+ return Joi.object({
98
+ data: Joi.array().items(PaymentModel.EdcModelData()).required(),
99
+ success: Joi.boolean().required(),
100
+ });
101
+ }
102
+ static EdcDevice() {
103
+ return Joi.object({
104
+ aggregator_id: Joi.number().required(),
105
+ aggregator_name: Joi.string().allow(""),
106
+ application_id: Joi.string().allow("").required(),
107
+ device_tag: Joi.string().allow("").required(),
108
+ edc_device_serial_no: Joi.string().allow("").required(),
109
+ edc_model: Joi.string().allow(""),
110
+ is_active: Joi.boolean().required(),
111
+ merchant_store_pos_code: Joi.string().allow("").allow(null),
112
+ store_id: Joi.number().required(),
113
+ terminal_serial_no: Joi.string().allow("").required(),
114
+ terminal_unique_identifier: Joi.string().allow("").required(),
115
+ });
116
+ }
117
+ static EdcDeviceAddResponse() {
118
+ return Joi.object({
119
+ data: PaymentModel.EdcDevice().required(),
120
+ success: Joi.boolean().required(),
121
+ });
122
+ }
123
+ static EdcDeviceDetailsResponse() {
124
+ return Joi.object({
125
+ data: PaymentModel.EdcDevice().required(),
126
+ success: Joi.boolean().required(),
127
+ });
128
+ }
129
+ static EdcDeviceListResponse() {
130
+ return Joi.object({
131
+ items: Joi.array().items(PaymentModel.EdcDevice()).required(),
132
+ page: PaymentModel.Page().required(),
133
+ success: Joi.boolean().required(),
134
+ });
135
+ }
136
+ static EdcDeviceStatsResponse() {
137
+ return Joi.object({
138
+ statistics: PaymentModel.StatisticsData().required(),
139
+ success: Joi.boolean().required(),
140
+ });
141
+ }
142
+ static EdcDeviceUpdateResponse() {
143
+ return Joi.object({
144
+ success: Joi.boolean().required(),
145
+ });
146
+ }
147
+ static EdcModelData() {
148
+ return Joi.object({
149
+ aggregator: Joi.string().allow("").required(),
150
+ aggregator_id: Joi.number().required(),
151
+ models: Joi.array().items(Joi.string().allow("")).required(),
152
+ });
153
+ }
154
+ static EdcUpdateRequest() {
155
+ return Joi.object({
156
+ aggregator_id: Joi.number(),
157
+ device_tag: Joi.string().allow("").allow(null),
158
+ edc_device_serial_no: Joi.string().allow(""),
159
+ edc_model: Joi.string().allow(""),
160
+ is_active: Joi.boolean(),
161
+ merchant_store_pos_code: Joi.string().allow(""),
162
+ store_id: Joi.number(),
163
+ });
164
+ }
38
165
  static ErrorCodeAndDescription() {
39
166
  return Joi.object({
40
167
  code: Joi.string().allow("").required(),
@@ -48,12 +175,56 @@ class PaymentModel {
48
175
  success: Joi.boolean().required(),
49
176
  });
50
177
  }
178
+ static ErrorDescription() {
179
+ return Joi.object({
180
+ amount: Joi.number().allow(null),
181
+ cancelled: Joi.boolean().allow(null),
182
+ expired: Joi.boolean().allow(null),
183
+ invalid_id: Joi.boolean().allow(null),
184
+ merchant_name: Joi.string().allow("").allow(null),
185
+ merchant_order_id: Joi.string().allow("").allow(null),
186
+ msg: Joi.string().allow("").allow(null),
187
+ payment_transaction_id: Joi.string().allow("").allow(null),
188
+ });
189
+ }
190
+ static ErrorResponse() {
191
+ return Joi.object({
192
+ error: PaymentModel.ErrorDescription(),
193
+ message: Joi.string().allow("").required(),
194
+ status_code: Joi.number().required(),
195
+ success: Joi.boolean().required(),
196
+ });
197
+ }
51
198
  static GetOauthUrlResponse() {
52
199
  return Joi.object({
53
200
  success: Joi.boolean().required(),
54
201
  url: Joi.string().allow("").required(),
55
202
  });
56
203
  }
204
+ static GetPaymentCode() {
205
+ return Joi.object({
206
+ method_code: PaymentModel.PaymentCode().required(),
207
+ });
208
+ }
209
+ static GetPaymentCodeResponse() {
210
+ return Joi.object({
211
+ data: PaymentModel.GetPaymentCode().required(),
212
+ success: Joi.boolean().required(),
213
+ });
214
+ }
215
+ static GetPaymentLinkResponse() {
216
+ return Joi.object({
217
+ amount: Joi.number().allow(null),
218
+ external_order_id: Joi.string().allow("").allow(null),
219
+ merchant_name: Joi.string().allow("").allow(null),
220
+ message: Joi.string().allow("").required(),
221
+ payment_link_current_status: Joi.string().allow("").allow(null),
222
+ payment_link_url: Joi.string().allow("").allow(null),
223
+ polling_timeout: Joi.number().allow(null),
224
+ status_code: Joi.number().required(),
225
+ success: Joi.boolean().required(),
226
+ });
227
+ }
57
228
  static GetUserCODLimitResponse() {
58
229
  return Joi.object({
59
230
  success: Joi.boolean().required(),
@@ -87,6 +258,27 @@ class PaymentModel {
87
258
  package_name: Joi.string().allow("").allow(null),
88
259
  });
89
260
  }
261
+ static LinkStatus() {
262
+ return Joi.object({
263
+ message: Joi.string().allow("").required(),
264
+ status: Joi.boolean().required(),
265
+ });
266
+ }
267
+ static MerchantOnBoardingRequest() {
268
+ return Joi.object({
269
+ aggregator: Joi.string().allow("").required(),
270
+ app_id: Joi.string().allow("").required(),
271
+ credit_line_id: Joi.string().allow("").required(),
272
+ status: Joi.string().allow("").required(),
273
+ user_id: Joi.string().allow("").required(),
274
+ });
275
+ }
276
+ static MerchantOnBoardingResponse() {
277
+ return Joi.object({
278
+ data: Joi.any().required(),
279
+ success: Joi.boolean().required(),
280
+ });
281
+ }
90
282
  static MultiTenderPaymentMeta() {
91
283
  return Joi.object({
92
284
  current_status: Joi.string().allow(""),
@@ -140,6 +332,25 @@ class PaymentModel {
140
332
  show_beneficiary_details: Joi.boolean(),
141
333
  });
142
334
  }
335
+ static Page() {
336
+ return Joi.object({
337
+ current: Joi.number(),
338
+ has_next: Joi.boolean(),
339
+ has_previous: Joi.boolean(),
340
+ item_total: Joi.number(),
341
+ next_id: Joi.string().allow(""),
342
+ size: Joi.number(),
343
+ type: Joi.string().allow("").required(),
344
+ });
345
+ }
346
+ static PaymentCode() {
347
+ return Joi.object({
348
+ codes: PaymentModel.Code().required(),
349
+ name: Joi.string().allow("").required(),
350
+ networks: Joi.string().allow("").required(),
351
+ types: Joi.string().allow("").required(),
352
+ });
353
+ }
143
354
  static PaymentConfirmationRequest() {
144
355
  return Joi.object({
145
356
  order_id: Joi.string().allow("").required(),
@@ -187,6 +398,44 @@ class PaymentModel {
187
398
  success: Joi.boolean().required(),
188
399
  });
189
400
  }
401
+ static PaymentInitializationRequest() {
402
+ return Joi.object({
403
+ aggregator: Joi.string().allow("").required(),
404
+ amount: Joi.number().allow(null).required(),
405
+ contact: Joi.string().allow("").required(),
406
+ currency: Joi.string().allow("").required(),
407
+ customer_id: Joi.string().allow("").required(),
408
+ device_id: Joi.string().allow("").allow(null),
409
+ email: Joi.string().allow("").required(),
410
+ merchant_order_id: Joi.string().allow("").required(),
411
+ method: Joi.string().allow("").required(),
412
+ order_id: Joi.string().allow("").required(),
413
+ razorpay_payment_id: Joi.string().allow("").allow(null),
414
+ timeout: Joi.number().allow(null),
415
+ vpa: Joi.string().allow("").allow(null),
416
+ });
417
+ }
418
+ static PaymentInitializationResponse() {
419
+ return Joi.object({
420
+ aggregator: Joi.string().allow("").required(),
421
+ aggregator_order_id: Joi.string().allow(""),
422
+ amount: Joi.number().allow(null),
423
+ bqr_image: Joi.string().allow("").allow(null),
424
+ currency: Joi.string().allow("").allow(null),
425
+ customer_id: Joi.string().allow("").allow(null),
426
+ device_id: Joi.string().allow("").allow(null),
427
+ merchant_order_id: Joi.string().allow("").required(),
428
+ method: Joi.string().allow("").required(),
429
+ polling_url: Joi.string().allow("").required(),
430
+ razorpay_payment_id: Joi.string().allow("").allow(null),
431
+ status: Joi.string().allow(""),
432
+ success: Joi.boolean().required(),
433
+ timeout: Joi.number().allow(null),
434
+ upi_poll_url: Joi.string().allow("").allow(null),
435
+ virtual_id: Joi.string().allow("").allow(null),
436
+ vpa: Joi.string().allow("").allow(null),
437
+ });
438
+ }
190
439
  static PaymentModeList() {
191
440
  return Joi.object({
192
441
  aggregator_name: Joi.string().allow("").required(),
@@ -232,6 +481,28 @@ class PaymentModel {
232
481
  small: Joi.string().allow("").required(),
233
482
  });
234
483
  }
484
+ static PaymentObjectListSerializer() {
485
+ return Joi.object({
486
+ aggregator_payment_object: Joi.any().allow(null),
487
+ all_status: Joi.array().items(Joi.string().allow("")).required(),
488
+ amount_in_paisa: Joi.string().allow("").required(),
489
+ application_id: Joi.string().allow("").required(),
490
+ collected_by: Joi.string().allow("").required(),
491
+ company_id: Joi.string().allow("").required(),
492
+ created_on: Joi.string().allow("").required(),
493
+ currency: Joi.string().allow("").required(),
494
+ current_status: Joi.string().allow("").required(),
495
+ id: Joi.string().allow("").required(),
496
+ modified_on: Joi.string().allow("").required(),
497
+ payment_gateway: Joi.string().allow("").required(),
498
+ payment_id: Joi.string().allow("").allow(null),
499
+ payment_mode: Joi.string().allow("").required(),
500
+ payment_mode_identifier: Joi.string().allow("").required(),
501
+ refund_object: Joi.any().allow(null),
502
+ refunded_by: Joi.string().allow("").required(),
503
+ user_object: Joi.any().required(),
504
+ });
505
+ }
235
506
  static PaymentOptions() {
236
507
  return Joi.object({
237
508
  payment_option: Joi.array()
@@ -245,6 +516,72 @@ class PaymentModel {
245
516
  success: Joi.boolean().required(),
246
517
  });
247
518
  }
519
+ static PaymentStatusBulkHandlerRequest() {
520
+ return Joi.object({
521
+ merchant_order_id: Joi.array().items(Joi.string().allow("")).required(),
522
+ });
523
+ }
524
+ static PaymentStatusBulkHandlerResponse() {
525
+ return Joi.object({
526
+ count: Joi.number(),
527
+ data: Joi.array().items(PaymentModel.PaymentStatusObject()),
528
+ error: Joi.string().allow(""),
529
+ status: Joi.number().required(),
530
+ success: Joi.string().allow("").required(),
531
+ });
532
+ }
533
+ static PaymentStatusObject() {
534
+ return Joi.object({
535
+ merchant_order_id: Joi.string().allow("").required(),
536
+ payment_object_list: Joi.array().items(
537
+ PaymentModel.PaymentObjectListSerializer()
538
+ ),
539
+ });
540
+ }
541
+ static PaymentStatusUpdateRequest() {
542
+ return Joi.object({
543
+ aggregator: Joi.string().allow("").required(),
544
+ amount: Joi.number().allow(null).required(),
545
+ contact: Joi.string().allow("").required(),
546
+ currency: Joi.string().allow("").required(),
547
+ customer_id: Joi.string().allow("").required(),
548
+ device_id: Joi.string().allow("").allow(null),
549
+ email: Joi.string().allow("").required(),
550
+ merchant_order_id: Joi.string().allow("").required(),
551
+ merchant_transaction_id: Joi.string().allow("").required(),
552
+ method: Joi.string().allow("").required(),
553
+ order_id: Joi.string().allow("").required(),
554
+ status: Joi.string().allow("").required(),
555
+ vpa: Joi.string().allow(""),
556
+ });
557
+ }
558
+ static PaymentStatusUpdateResponse() {
559
+ return Joi.object({
560
+ aggregator_name: Joi.string().allow("").required(),
561
+ redirect_url: Joi.string().allow("").allow(null),
562
+ retry: Joi.boolean().required(),
563
+ status: Joi.string().allow("").required(),
564
+ success: Joi.boolean().allow(null),
565
+ });
566
+ }
567
+ static Payout() {
568
+ return Joi.object({
569
+ customers: PaymentModel.PayoutCustomer().required(),
570
+ is_active: Joi.boolean().required(),
571
+ is_default: Joi.boolean().required(),
572
+ more_attributes: PaymentModel.PayoutMoreAttributes().required(),
573
+ payouts_aggregators: Joi.array().items(PaymentModel.PayoutAggregator()),
574
+ transfer_type: Joi.string().allow("").required(),
575
+ unique_transfer_no: Joi.string().allow("").required(),
576
+ });
577
+ }
578
+ static PayoutAggregator() {
579
+ return Joi.object({
580
+ aggregator_fund_id: Joi.number().allow(null),
581
+ aggregator_id: Joi.number().allow(null),
582
+ payout_details_id: Joi.number().allow(null),
583
+ });
584
+ }
248
585
  static PayoutBankDetails() {
249
586
  return Joi.object({
250
587
  account_holder: Joi.string().allow(""),
@@ -259,6 +596,28 @@ class PaymentModel {
259
596
  state: Joi.string().allow(""),
260
597
  });
261
598
  }
599
+ static PayoutCustomer() {
600
+ return Joi.object({
601
+ email: Joi.string().allow("").allow(null),
602
+ id: Joi.number().allow(null),
603
+ mobile: Joi.string().allow("").allow(null),
604
+ name: Joi.string().allow("").allow(null),
605
+ unique_external_id: Joi.string().allow("").allow(null),
606
+ });
607
+ }
608
+ static PayoutMoreAttributes() {
609
+ return Joi.object({
610
+ account_holder: Joi.string().allow("").allow(null),
611
+ account_no: Joi.string().allow("").allow(null),
612
+ account_type: Joi.string().allow("").allow(null),
613
+ bank_name: Joi.string().allow("").allow(null),
614
+ branch_name: Joi.string().allow("").allow(null),
615
+ city: Joi.string().allow("").allow(null),
616
+ country: Joi.string().allow("").allow(null),
617
+ ifsc_code: Joi.string().allow("").allow(null),
618
+ state: Joi.string().allow("").allow(null),
619
+ });
620
+ }
262
621
  static PayoutRequest() {
263
622
  return Joi.object({
264
623
  aggregator: Joi.string().allow("").required(),
@@ -285,13 +644,22 @@ class PaymentModel {
285
644
  }
286
645
  static PayoutsResponse() {
287
646
  return Joi.object({
288
- customers: Joi.any().required(),
289
- is_active: Joi.boolean().required(),
290
- is_default: Joi.boolean().required(),
291
- more_attributes: Joi.any().required(),
292
- payouts_aggregators: Joi.array().items(Joi.any()).required(),
293
- transfer_type: Joi.string().allow("").required(),
294
- unique_transfer_no: Joi.any().required(),
647
+ items: Joi.array().items(PaymentModel.Payout()).required(),
648
+ success: Joi.boolean().required(),
649
+ });
650
+ }
651
+ static PollingPaymentLinkResponse() {
652
+ return Joi.object({
653
+ aggregator_name: Joi.string().allow("").allow(null),
654
+ amount: Joi.number().allow(null),
655
+ http_status: Joi.number().allow(null),
656
+ message: Joi.string().allow("").allow(null),
657
+ order_id: Joi.string().allow("").allow(null),
658
+ payment_link_id: Joi.string().allow("").allow(null),
659
+ redirect_url: Joi.string().allow("").allow(null),
660
+ status: Joi.string().allow("").allow(null),
661
+ status_code: Joi.number().allow(null),
662
+ success: Joi.boolean().allow(null),
295
663
  });
296
664
  }
297
665
  static RefundAccountResponse() {
@@ -302,6 +670,58 @@ class PaymentModel {
302
670
  success: Joi.boolean().required(),
303
671
  });
304
672
  }
673
+ static RepaymentDetailsSerialiserPayAll() {
674
+ return Joi.object({
675
+ aggregator_order_id: Joi.string().allow("").required(),
676
+ aggregator_transaction_id: Joi.string().allow("").required(),
677
+ extension_order_id: Joi.string().allow("").allow(null).required(),
678
+ shipment_details: Joi.array().items(
679
+ PaymentModel.RepaymentRequestDetails()
680
+ ),
681
+ total_amount: Joi.number().required(),
682
+ });
683
+ }
684
+ static RepaymentRequestDetails() {
685
+ return Joi.object({
686
+ aggregator: Joi.string().allow("").required(),
687
+ aggregator_order_id: Joi.string().allow("").required(),
688
+ aggregator_transaction_id: Joi.string().allow("").required(),
689
+ amount: Joi.number().required(),
690
+ current_status: Joi.string().allow("").required(),
691
+ fwd_shipment_id: Joi.string().allow("").required(),
692
+ merchant_order_id: Joi.string().allow("").required(),
693
+ outstanding_details_id: Joi.number().required(),
694
+ payment_mode: Joi.string().allow("").required(),
695
+ payment_mode_identifier: Joi.string().allow("").required(),
696
+ });
697
+ }
698
+ static RepaymentResponse() {
699
+ return Joi.object({
700
+ data: Joi.any().required(),
701
+ success: Joi.boolean().required(),
702
+ });
703
+ }
704
+ static ResendOrCancelPaymentRequest() {
705
+ return Joi.object({
706
+ device_id: Joi.string().allow("").allow(null),
707
+ order_id: Joi.string().allow("").required(),
708
+ request_type: Joi.string().allow("").required(),
709
+ });
710
+ }
711
+ static ResendOrCancelPaymentResponse() {
712
+ return Joi.object({
713
+ data: PaymentModel.LinkStatus().required(),
714
+ success: Joi.boolean().required(),
715
+ });
716
+ }
717
+ static ResendPaymentLinkResponse() {
718
+ return Joi.object({
719
+ message: Joi.string().allow("").required(),
720
+ polling_timeout: Joi.number().allow(null),
721
+ status_code: Joi.number().required(),
722
+ success: Joi.boolean().required(),
723
+ });
724
+ }
305
725
  static RevokeOAuthToken() {
306
726
  return Joi.object({
307
727
  message: Joi.string().allow("").required(),
@@ -345,6 +765,12 @@ class PaymentModel {
345
765
  success: Joi.boolean().required(),
346
766
  });
347
767
  }
768
+ static StatisticsData() {
769
+ return Joi.object({
770
+ active_device_count: Joi.number().required(),
771
+ inactive_device_count: Joi.number().required(),
772
+ });
773
+ }
348
774
  static SubscriptionConfigResponse() {
349
775
  return Joi.object({
350
776
  aggregator: Joi.string().allow("").required(),
@@ -372,5 +798,24 @@ class PaymentModel {
372
798
  success: Joi.boolean().required(),
373
799
  });
374
800
  }
801
+ static ValidateCustomerRequest() {
802
+ return Joi.object({
803
+ aggregator: Joi.string().allow("").required(),
804
+ billing_address: Joi.any(),
805
+ delivery_address: Joi.any(),
806
+ merchant_params: Joi.any(),
807
+ order_items: Joi.array().items(Joi.any()),
808
+ payload: Joi.string().allow("").allow(null),
809
+ phone_number: Joi.string().allow("").required(),
810
+ transaction_amount_in_paise: Joi.number().required(),
811
+ });
812
+ }
813
+ static ValidateCustomerResponse() {
814
+ return Joi.object({
815
+ data: Joi.any().required(),
816
+ message: Joi.string().allow("").required(),
817
+ success: Joi.boolean().required(),
818
+ });
819
+ }
375
820
  }
376
821
  module.exports = PaymentModel;