@gofynd/fdk-client-javascript 1.4.13 → 1.4.15-beta.1

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.
@@ -2,13 +2,13 @@ const Joi = require("joi");
2
2
 
3
3
  /**
4
4
  * @typedef PaymentGatewayConfigResponse
5
- * @property {Object[]} [aggregators] - List of all speceific Payment options
6
- * with their Details.
5
+ * @property {Object[]} [aggregators] - List of all config specific to the
6
+ * aggregator with their Details.
7
7
  * @property {string} app_id - Application Id to which Payment config Mapped
8
- * @property {string[]} excluded_fields - List of all excluded options with their Details.
8
+ * @property {string[]} excluded_fields - List of all excluded config with their Details.
9
9
  * @property {boolean} success - Response is successful or not
10
10
  * @property {boolean} created - Response is created or not
11
- * @property {string[]} display_fields - List of all included options with their Details.
11
+ * @property {string[]} display_fields - List of all display related configs, i.e. logo
12
12
  */
13
13
 
14
14
  /**
@@ -24,7 +24,8 @@ const Joi = require("joi");
24
24
  * @property {string} config_type - Config Type of the aggregator
25
25
  * @property {boolean} [is_active] - Enable or Disable Flag
26
26
  * @property {string} key - Api key of the payment aggregator
27
- * @property {string} merchant_salt - Merchant key of the payment aggregator
27
+ * @property {string} merchant_salt - The secret key or token provided by the
28
+ * payment aggregator for the merchant.
28
29
  */
29
30
 
30
31
  /**
@@ -181,7 +182,7 @@ const Joi = require("joi");
181
182
  /**
182
183
  * @typedef PaymentOptionAndFlow
183
184
  * @property {RootPaymentMode[]} payment_option - Payment options
184
- * @property {PaymentFlow} payment_flows
185
+ * @property {PaymentFlow} [payment_flows]
185
186
  * @property {PaymentDefaultSelection} [payment_default_selection]
186
187
  */
187
188
 
@@ -368,9 +369,9 @@ const Joi = require("joi");
368
369
 
369
370
  /**
370
371
  * @typedef RefundAccountResponse
371
- * @property {boolean} [is_verified_flag]
372
- * @property {string} message - Response message
373
- * @property {Object} [data] - Refund account data.
372
+ * @property {boolean} [is_verified_flag] - Account is verified or not
373
+ * @property {string} [message] - Response message
374
+ * @property {Object} data - Refund account data.
374
375
  * @property {boolean} success - Success or failure flag.
375
376
  */
376
377
 
@@ -383,16 +384,16 @@ const Joi = require("joi");
383
384
 
384
385
  /**
385
386
  * @typedef BankDetailsForOTP
386
- * @property {string} ifsc_code
387
- * @property {string} account_no
388
- * @property {string} branch_name
389
- * @property {string} bank_name
390
- * @property {string} account_holder
387
+ * @property {string} ifsc_code - IFSC code of account
388
+ * @property {string} account_no - Account number
389
+ * @property {string} branch_name - Branch name of account
390
+ * @property {string} bank_name - Bank name of account
391
+ * @property {string} account_holder - Accountg holder name of account
391
392
  */
392
393
 
393
394
  /**
394
395
  * @typedef AddBeneficiaryDetailsOTPRequest
395
- * @property {string} order_id
396
+ * @property {string} order_id - Order_id for which account will be added
396
397
  * @property {BankDetailsForOTP} details
397
398
  */
398
399
 
@@ -415,11 +416,11 @@ const Joi = require("joi");
415
416
  * @property {string} display_name - Display Name Of Account
416
417
  * @property {string} [delights_user_name] - User Id Who filled the Beneficiary
417
418
  * @property {string} transfer_mode - Transfer Mode Of Account
418
- * @property {string} email - EMail of User
419
+ * @property {string} email - Email of User
419
420
  * @property {boolean} is_active - Boolean Flag whether Beneficiary set or not
420
421
  * @property {string} [branch_name] - Branch Name Of Account
421
422
  * @property {string} address - Address of User
422
- * @property {string} modified_on - MOdification Date of Beneficiary
423
+ * @property {string} modified_on - Modification Date of Beneficiary
423
424
  * @property {string} beneficiary_id - Benenficiary Id
424
425
  * @property {string} account_no - Account Number
425
426
  * @property {string} bank_name - Bank Name Of Account
@@ -434,7 +435,7 @@ const Joi = require("joi");
434
435
 
435
436
  /**
436
437
  * @typedef MultiTenderPaymentMeta
437
- * @property {Object} [extra_meta]
438
+ * @property {Object} [extra_meta] - Key value pair for extra data related to payment mode
438
439
  * @property {string} [order_id] - Fynd Platform order ID
439
440
  * @property {string} [payment_id] - A unique identifier associated with a
440
441
  * specific payment transaction
@@ -452,7 +453,7 @@ const Joi = require("joi");
452
453
  * @property {string} [name] - Payment mode name
453
454
  * @property {MultiTenderPaymentMeta} [meta]
454
455
  * @property {number} amount - Payment amount
455
- * @property {string} mode
456
+ * @property {string} mode - Payment mode short code
456
457
  */
457
458
 
458
459
  /**
@@ -477,10 +478,34 @@ const Joi = require("joi");
477
478
  * @property {number} usages - Used COD limit from the user Limit
478
479
  */
479
480
 
481
+ /**
482
+ * @typedef CODLimitConfig
483
+ * @property {number} storefront - Limit for storefront
484
+ * @property {number} pos - Limit for pos
485
+ */
486
+
487
+ /**
488
+ * @typedef CODPaymentLimitConfig
489
+ * @property {boolean} is_active - Boolean flag to show the status
490
+ * @property {number} usages - Used cod limit
491
+ * @property {number} user_id - User_id
492
+ * @property {string} merchant_user_id - Merchant_user_id
493
+ * @property {number} remaining_limit - Remaining COD limit
494
+ * @property {CODLimitConfig} limit
495
+ */
496
+
497
+ /**
498
+ * @typedef GetUserBULimitResponse
499
+ * @property {string} business_unit - COD limit business unit
500
+ * @property {string} display_name - Display name for cod limit
501
+ * @property {CODPaymentLimitConfig} config
502
+ */
503
+
480
504
  /**
481
505
  * @typedef GetUserCODLimitResponse
482
- * @property {CODdata} user_cod_data
506
+ * @property {GetUserBULimitResponse[]} items
483
507
  * @property {boolean} success - Response is successful or not
508
+ * @property {string} [message] - Message for cod limit
484
509
  */
485
510
 
486
511
  /**
@@ -807,7 +832,8 @@ const Joi = require("joi");
807
832
  * @property {string} [payment_link_url] - Url of payment link
808
833
  * @property {string} [payment_link_current_status] - Status of payment link
809
834
  * @property {string} [external_order_id] - Merchant order id
810
- * @property {number} [polling_timeout] - Polling request timeout
835
+ * @property {number} [polling_timeout] - Polling request timeout, perform
836
+ * polling till timeout elapsed or payment status is success/failure
811
837
  * @property {boolean} success - Successful or failure
812
838
  */
813
839
 
@@ -833,10 +859,11 @@ const Joi = require("joi");
833
859
 
834
860
  /**
835
861
  * @typedef CreatePaymentLinkMeta
836
- * @property {string} cart_id
837
- * @property {string} checkout_mode
838
- * @property {string} amount
839
- * @property {string} [assign_card_id]
862
+ * @property {string} cart_id - Cart id for which payment link needs to be generated.
863
+ * @property {string} checkout_mode - Checkout mode for the payment link i.e. self
864
+ * @property {string} amount - Payment link amount to be paid by the customer
865
+ * @property {string} [assign_card_id] - Assigned card id against which payment
866
+ * to be done via payment link
840
867
  */
841
868
 
842
869
  /**
@@ -982,7 +1009,8 @@ const Joi = require("joi");
982
1009
  * @property {AddressDetail} [shipping_address] - Shipping address
983
1010
  * @property {number} amount_captured - Amount which is captured or credited to
984
1011
  * merchant account
985
- * @property {number} [amount_refunded]
1012
+ * @property {number} [amount_refunded] - Amount refunded or credited back to
1013
+ * customer accout
986
1014
  * @property {string} [aggregator_customer_id] - Unique customer id generated by
987
1015
  * payment gateway, not required for standard checkout.
988
1016
  * @property {string} cancel_url - Cancel url sent by Fynd platform at the time
@@ -1004,13 +1032,13 @@ const Joi = require("joi");
1004
1032
  * @property {AddressDetail} [billing_address] - Billing address
1005
1033
  * @property {boolean} [captured] - Whether the payment is captured (credited to
1006
1034
  * merchant account) by payment gateway.
1007
- * @property {Object} [meta] - Metadata
1008
- * @property {string} status - Stautus of the payment
1035
+ * @property {Object} [meta] - Extra meta data specific to extension
1036
+ * @property {string} status - Status of the payment
1009
1037
  */
1010
1038
 
1011
1039
  /**
1012
1040
  * @typedef PaymentSessionRequestSerializer
1013
- * @property {Object} [meta] - Meta
1041
+ * @property {Object} [meta] - Extra meta data specific to extensions
1014
1042
  * @property {string} gid - Global identifier of the entity (e.g. order, cart
1015
1043
  * etc.) against which payment_session was initiated. This is generated by
1016
1044
  * Fynd payments platform and is unique.
@@ -1021,6 +1049,7 @@ const Joi = require("joi");
1021
1049
  * the schema `PaymentSessionDetail`.
1022
1050
  * @property {number} total_amount - Amount paid.
1023
1051
  * @property {string} checksum - Checksum to verify the payload
1052
+ * @property {string} [source] - Source of payment update session
1024
1053
  */
1025
1054
 
1026
1055
  /**
@@ -1083,33 +1112,34 @@ const Joi = require("joi");
1083
1112
 
1084
1113
  /**
1085
1114
  * @typedef PaymentDetailsSerializer
1086
- * @property {Object[]} payment_methods - Method of payment
1115
+ * @property {Object[]} payment_methods - List of payment methods
1087
1116
  * @property {string} gid - Global identifier of the entity (e.g. order, cart
1088
1117
  * etc.) against which payment_session was initiated. This is generated by
1089
1118
  * Fynd payments platform and is unique.
1090
- * @property {number} [amount_refunded]
1119
+ * @property {number} [amount_refunded] - Already refunded amount for the given
1120
+ * gid (global identifier for the order).
1091
1121
  * @property {string} currency - Currency of the payment.
1092
1122
  * @property {string} mode - Test or live, test mode uses test credentials so
1093
1123
  * that actual payment is not created.
1094
- * @property {string} [merchant_locale] - Merchant's locale
1095
- * @property {Object} [meta] - Metadata
1124
+ * @property {string} [merchant_locale] - Merchant's locale (language) i.e. en
1125
+ * @property {Object} [meta] - Extra meta data related to the payment methods
1096
1126
  * @property {string} [kind] - Optional kind of purchase/payment - one time
1097
1127
  * payment (sale) or subcription. defaults to sale.
1098
1128
  * @property {string} [success_url] - Success url sent by Fynd platform at the
1099
1129
  * time of payment creation
1100
- * @property {string} status - Stautus of the payment
1130
+ * @property {string} status - Status of the payment
1101
1131
  * @property {boolean} [captured] - Whether the payment is captured (credited to
1102
1132
  * merchant account) by payment gateway.
1103
1133
  * @property {string} [payment_id] - Unique transaction id generated by payment gateway
1104
1134
  * @property {string} g_user_id - Global user identifier - unique user id
1105
1135
  * generated by Fynd platform
1106
- * @property {string} [locale] - User's locale
1136
+ * @property {string} [locale] - User's locale (language), i.e. en
1107
1137
  * @property {string} [cancel_url] - Cancel url sent by Fynd platform at the
1108
- * time of payment creation
1138
+ * time of payment creation, redirect on payment cancellation
1109
1139
  * @property {string} [created] - Timestamp in epoch
1110
1140
  * @property {number} amount_captured - Amount which is captured or credited to
1111
1141
  * merchant account
1112
- * @property {number} amount - Amount paid.
1142
+ * @property {number} amount - Amount paid for the order.
1113
1143
  * @property {string} [aggregator_customer_id] - Unique customer id generated by
1114
1144
  * payment gateway, not required for standard checkout.
1115
1145
  * @property {string} [aggregator_order_id] - Unique order id or payment request
@@ -1551,7 +1581,7 @@ class PaymentPlatformModel {
1551
1581
  payment_option: Joi.array()
1552
1582
  .items(PaymentPlatformModel.RootPaymentMode())
1553
1583
  .required(),
1554
- payment_flows: PaymentPlatformModel.PaymentFlow().required(),
1584
+ payment_flows: PaymentPlatformModel.PaymentFlow(),
1555
1585
  payment_default_selection: PaymentPlatformModel.PaymentDefaultSelection(),
1556
1586
  });
1557
1587
  }
@@ -1790,8 +1820,8 @@ class PaymentPlatformModel {
1790
1820
  static RefundAccountResponse() {
1791
1821
  return Joi.object({
1792
1822
  is_verified_flag: Joi.boolean(),
1793
- message: Joi.string().allow("").required(),
1794
- data: Joi.any(),
1823
+ message: Joi.string().allow(""),
1824
+ data: Joi.any().required(),
1795
1825
  success: Joi.boolean().required(),
1796
1826
  });
1797
1827
  }
@@ -1920,11 +1950,43 @@ class PaymentPlatformModel {
1920
1950
  });
1921
1951
  }
1922
1952
 
1953
+ /** @returns {CODLimitConfig} */
1954
+ static CODLimitConfig() {
1955
+ return Joi.object({
1956
+ storefront: Joi.number().required(),
1957
+ pos: Joi.number().required(),
1958
+ });
1959
+ }
1960
+
1961
+ /** @returns {CODPaymentLimitConfig} */
1962
+ static CODPaymentLimitConfig() {
1963
+ return Joi.object({
1964
+ is_active: Joi.boolean().required(),
1965
+ usages: Joi.number().required(),
1966
+ user_id: Joi.number().required(),
1967
+ merchant_user_id: Joi.string().allow("").required(),
1968
+ remaining_limit: Joi.number().required(),
1969
+ limit: PaymentPlatformModel.CODLimitConfig().required(),
1970
+ });
1971
+ }
1972
+
1973
+ /** @returns {GetUserBULimitResponse} */
1974
+ static GetUserBULimitResponse() {
1975
+ return Joi.object({
1976
+ business_unit: Joi.string().allow("").required(),
1977
+ display_name: Joi.string().allow("").required(),
1978
+ config: PaymentPlatformModel.CODPaymentLimitConfig().required(),
1979
+ });
1980
+ }
1981
+
1923
1982
  /** @returns {GetUserCODLimitResponse} */
1924
1983
  static GetUserCODLimitResponse() {
1925
1984
  return Joi.object({
1926
- user_cod_data: PaymentPlatformModel.CODdata().required(),
1985
+ items: Joi.array()
1986
+ .items(PaymentPlatformModel.GetUserBULimitResponse())
1987
+ .required(),
1927
1988
  success: Joi.boolean().required(),
1989
+ message: Joi.string().allow(""),
1928
1990
  });
1929
1991
  }
1930
1992
 
@@ -2556,6 +2618,7 @@ class PaymentPlatformModel {
2556
2618
  .required(),
2557
2619
  total_amount: Joi.number().required(),
2558
2620
  checksum: Joi.string().allow("").required(),
2621
+ source: Joi.string().allow(""),
2559
2622
  });
2560
2623
  }
2561
2624
 
@@ -37,7 +37,7 @@ export = PaymentPlatformValidator;
37
37
  */
38
38
  /**
39
39
  * @typedef VerifyIfscCodeParam
40
- * @property {string} [ifscCode]
40
+ * @property {string} ifscCode
41
41
  */
42
42
  declare class PaymentPlatformValidator {
43
43
  /** @returns {ActivateAndDectivatePayoutParam} */
@@ -107,7 +107,7 @@ type UpdatePayoutParam = {
107
107
  body: PaymentPlatformModel.PayoutRequest;
108
108
  };
109
109
  type VerifyIfscCodeParam = {
110
- ifscCode?: string;
110
+ ifscCode: string;
111
111
  };
112
112
  type GetSubscriptionConfigParam = any;
113
113
  import PaymentPlatformModel = require("./PaymentPlatformModel");
@@ -49,7 +49,7 @@ const PaymentPlatformModel = require("./PaymentPlatformModel");
49
49
 
50
50
  /**
51
51
  * @typedef VerifyIfscCodeParam
52
- * @property {string} [ifscCode]
52
+ * @property {string} ifscCode
53
53
  */
54
54
 
55
55
  class PaymentPlatformValidator {
@@ -120,7 +120,7 @@ class PaymentPlatformValidator {
120
120
  /** @returns {VerifyIfscCodeParam} */
121
121
  static verifyIfscCode() {
122
122
  return Joi.object({
123
- ifscCode: Joi.string().allow(""),
123
+ ifscCode: Joi.string().allow("").required(),
124
124
  }).required();
125
125
  }
126
126
  }