@gofynd/fdk-client-javascript 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +293 -0
- package/sdk/application/Catalog/CatalogApplicationClient.js +408 -0
- package/sdk/application/Common/CommonApplicationClient.js +21 -0
- package/sdk/application/Communication/CommunicationApplicationClient.js +29 -0
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +147 -0
- package/sdk/application/Content/ContentApplicationClient.js +226 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +43 -0
- package/sdk/application/Finance/FinanceApplicationClient.js +21 -0
- package/sdk/application/Lead/LeadApplicationClient.js +73 -0
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -1
- package/sdk/application/Logistic/LogisticApplicationClient.js +192 -3
- package/sdk/application/Order/OrderApplicationClient.js +202 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +454 -0
- package/sdk/application/Rewards/RewardsApplicationClient.js +68 -0
- package/sdk/application/Share/ShareApplicationClient.js +96 -0
- package/sdk/application/Theme/ThemeApplicationClient.js +64 -0
- package/sdk/application/User/UserApplicationClient.js +412 -0
- package/sdk/application/Webhook/WebhookApplicationClient.js +13 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +10 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +75 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +54 -1
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +43 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +1 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +6 -0
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +16 -3
- package/sdk/partner/Webhook/WebhookPartnerModel.js +5 -3
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +4 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +46 -23
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +12 -23
- package/sdk/platform/Cart/CartPlatformModel.d.ts +59 -1
- package/sdk/platform/Cart/CartPlatformModel.js +31 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -12
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -81
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -10
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -12
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +13 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +82 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +10 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +12 -0
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +108 -1
- package/sdk/platform/Payment/PaymentPlatformModel.js +77 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +2 -2
- package/sdk/platform/User/UserPlatformModel.js +2 -2
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +58 -14
- package/sdk/platform/Webhook/WebhookPlatformModel.js +15 -14
- package/sdk/public/Catalog/CatalogPublicClient.js +15 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.js +16 -0
- package/sdk/public/Content/ContentPublicClient.js +116 -0
- package/sdk/public/Partner/PartnerPublicClient.js +15 -0
- package/sdk/public/Webhook/WebhookPublicClient.js +40 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +194 -46
- package/sdk/public/Webhook/WebhookPublicModel.js +51 -46
|
@@ -1566,6 +1566,20 @@ const Joi = require("joi");
|
|
|
1566
1566
|
* @property {boolean} [partial] - When adding multiple items check if all
|
|
1567
1567
|
* added. True if only few are added.
|
|
1568
1568
|
* @property {string} [message] - Message of add cart API response
|
|
1569
|
+
* @property {Object} [result] - Add to cart result data
|
|
1570
|
+
* @property {CartItemInfo[]} [items] - List of items that needs to be added in cart.
|
|
1571
|
+
*/
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* @typedef CartItemInfo
|
|
1575
|
+
* @property {number} [item_id] - Item id of the product that needs to be
|
|
1576
|
+
* added/updated/removed.
|
|
1577
|
+
* @property {string} [size] - Item size of the product that needs to be
|
|
1578
|
+
* added/updated/removed.
|
|
1579
|
+
* @property {number} [store_id] - Unique identifier of the store selected by
|
|
1580
|
+
* the user from which user want to buy a product.
|
|
1581
|
+
* @property {boolean} [success] - True if items are added/updated/removed successfully.
|
|
1582
|
+
* @property {string} [message] - Message for added/updated/removed item.
|
|
1569
1583
|
*/
|
|
1570
1584
|
|
|
1571
1585
|
/**
|
|
@@ -1604,6 +1618,8 @@ const Joi = require("joi");
|
|
|
1604
1618
|
* @property {boolean} [success] - True if all items are added successfully.
|
|
1605
1619
|
* False if partially added or not added.
|
|
1606
1620
|
* @property {CartDetailResult} [cart]
|
|
1621
|
+
* @property {Object} [result] - Contains article related result info
|
|
1622
|
+
* @property {CartItemInfo[]} [items] - List of items that needs to be updated in cart.
|
|
1607
1623
|
* @property {string} [message] - Message of update cart API response
|
|
1608
1624
|
*/
|
|
1609
1625
|
|
|
@@ -4112,6 +4128,19 @@ class CartPlatformModel {
|
|
|
4112
4128
|
cart: CartPlatformModel.CartDetailResult(),
|
|
4113
4129
|
partial: Joi.boolean(),
|
|
4114
4130
|
message: Joi.string().allow(""),
|
|
4131
|
+
result: Joi.object().pattern(/\S/, Joi.any()),
|
|
4132
|
+
items: Joi.array().items(CartPlatformModel.CartItemInfo()),
|
|
4133
|
+
});
|
|
4134
|
+
}
|
|
4135
|
+
|
|
4136
|
+
/** @returns {CartItemInfo} */
|
|
4137
|
+
static CartItemInfo() {
|
|
4138
|
+
return Joi.object({
|
|
4139
|
+
item_id: Joi.number(),
|
|
4140
|
+
size: Joi.string().allow(""),
|
|
4141
|
+
store_id: Joi.number(),
|
|
4142
|
+
success: Joi.boolean(),
|
|
4143
|
+
message: Joi.string().allow(""),
|
|
4115
4144
|
});
|
|
4116
4145
|
}
|
|
4117
4146
|
|
|
@@ -4156,6 +4185,8 @@ class CartPlatformModel {
|
|
|
4156
4185
|
return Joi.object({
|
|
4157
4186
|
success: Joi.boolean(),
|
|
4158
4187
|
cart: CartPlatformModel.CartDetailResult(),
|
|
4188
|
+
result: Joi.object().pattern(/\S/, Joi.any()),
|
|
4189
|
+
items: Joi.array().items(CartPlatformModel.CartItemInfo()),
|
|
4159
4190
|
message: Joi.string().allow(""),
|
|
4160
4191
|
});
|
|
4161
4192
|
}
|
|
@@ -153,18 +153,6 @@ declare class Content {
|
|
|
153
153
|
* @description: Generate and add a new page to the platform. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createPage/).
|
|
154
154
|
*/
|
|
155
155
|
createPage({ body, requestHeaders }?: ContentPlatformApplicationValidator.CreatePageParam, { responseHeaders }?: object): Promise<ContentPlatformModel.PageSchema>;
|
|
156
|
-
/**
|
|
157
|
-
* @param {ContentPlatformApplicationValidator.CreatePagePreviewParam} arg
|
|
158
|
-
* - Arg object
|
|
159
|
-
*
|
|
160
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
161
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
162
|
-
* @returns {Promise<ContentPlatformModel.PageSchema>} - Success response
|
|
163
|
-
* @name createPagePreview
|
|
164
|
-
* @summary: Create page preview
|
|
165
|
-
* @description: Generate and add a new page preview. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createPagePreview/).
|
|
166
|
-
*/
|
|
167
|
-
createPagePreview({ body, requestHeaders }?: ContentPlatformApplicationValidator.CreatePagePreviewParam, { responseHeaders }?: object): Promise<ContentPlatformModel.PageSchema>;
|
|
168
156
|
/**
|
|
169
157
|
* @param {ContentPlatformApplicationValidator.CreateSEOMarkupSchemaParam} arg
|
|
170
158
|
* - Arg object
|
|
@@ -1062,87 +1062,6 @@ class Content {
|
|
|
1062
1062
|
return response;
|
|
1063
1063
|
}
|
|
1064
1064
|
|
|
1065
|
-
/**
|
|
1066
|
-
* @param {ContentPlatformApplicationValidator.CreatePagePreviewParam} arg
|
|
1067
|
-
* - Arg object
|
|
1068
|
-
*
|
|
1069
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1070
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1071
|
-
* @returns {Promise<ContentPlatformModel.PageSchema>} - Success response
|
|
1072
|
-
* @name createPagePreview
|
|
1073
|
-
* @summary: Create page preview
|
|
1074
|
-
* @description: Generate and add a new page preview. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createPagePreview/).
|
|
1075
|
-
*/
|
|
1076
|
-
async createPagePreview(
|
|
1077
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1078
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1079
|
-
) {
|
|
1080
|
-
const {
|
|
1081
|
-
error,
|
|
1082
|
-
} = ContentPlatformApplicationValidator.createPagePreview().validate(
|
|
1083
|
-
{
|
|
1084
|
-
body,
|
|
1085
|
-
},
|
|
1086
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1087
|
-
);
|
|
1088
|
-
if (error) {
|
|
1089
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1093
|
-
const {
|
|
1094
|
-
error: warrning,
|
|
1095
|
-
} = ContentPlatformApplicationValidator.createPagePreview().validate(
|
|
1096
|
-
{
|
|
1097
|
-
body,
|
|
1098
|
-
},
|
|
1099
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1100
|
-
);
|
|
1101
|
-
if (warrning) {
|
|
1102
|
-
Logger({
|
|
1103
|
-
level: "WARN",
|
|
1104
|
-
message: `Parameter Validation warrnings for platform > Content > createPagePreview \n ${warrning}`,
|
|
1105
|
-
});
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
const query_params = {};
|
|
1109
|
-
|
|
1110
|
-
const response = await PlatformAPIClient.execute(
|
|
1111
|
-
this.config,
|
|
1112
|
-
"post",
|
|
1113
|
-
`/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/preview/`,
|
|
1114
|
-
query_params,
|
|
1115
|
-
body,
|
|
1116
|
-
requestHeaders,
|
|
1117
|
-
{ responseHeaders }
|
|
1118
|
-
);
|
|
1119
|
-
|
|
1120
|
-
let responseData = response;
|
|
1121
|
-
if (responseHeaders) {
|
|
1122
|
-
responseData = response[0];
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
const {
|
|
1126
|
-
error: res_error,
|
|
1127
|
-
} = ContentPlatformModel.PageSchema().validate(responseData, {
|
|
1128
|
-
abortEarly: false,
|
|
1129
|
-
allowUnknown: true,
|
|
1130
|
-
});
|
|
1131
|
-
|
|
1132
|
-
if (res_error) {
|
|
1133
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1134
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1135
|
-
} else {
|
|
1136
|
-
Logger({
|
|
1137
|
-
level: "WARN",
|
|
1138
|
-
message: `Response Validation Warnings for platform > Content > createPagePreview \n ${res_error}`,
|
|
1139
|
-
});
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
return response;
|
|
1144
|
-
}
|
|
1145
|
-
|
|
1146
1065
|
/**
|
|
1147
1066
|
* @param {ContentPlatformApplicationValidator.CreateSEOMarkupSchemaParam} arg
|
|
1148
1067
|
* - Arg object
|
|
@@ -54,10 +54,6 @@ export = ContentPlatformApplicationValidator;
|
|
|
54
54
|
* @typedef CreatePageParam
|
|
55
55
|
* @property {ContentPlatformModel.PagePayload} body
|
|
56
56
|
*/
|
|
57
|
-
/**
|
|
58
|
-
* @typedef CreatePagePreviewParam
|
|
59
|
-
* @property {ContentPlatformModel.PagePayload} body
|
|
60
|
-
*/
|
|
61
57
|
/**
|
|
62
58
|
* @typedef CreateSEOMarkupSchemaParam
|
|
63
59
|
* @property {ContentPlatformModel.SEOSchemaMarkupTemplateRequestBody} body
|
|
@@ -474,8 +470,6 @@ declare class ContentPlatformApplicationValidator {
|
|
|
474
470
|
static createNavigation(): CreateNavigationParam;
|
|
475
471
|
/** @returns {CreatePageParam} */
|
|
476
472
|
static createPage(): CreatePageParam;
|
|
477
|
-
/** @returns {CreatePagePreviewParam} */
|
|
478
|
-
static createPagePreview(): CreatePagePreviewParam;
|
|
479
473
|
/** @returns {CreateSEOMarkupSchemaParam} */
|
|
480
474
|
static createSEOMarkupSchema(): CreateSEOMarkupSchemaParam;
|
|
481
475
|
/** @returns {DeleteAnnouncementParam} */
|
|
@@ -638,7 +632,7 @@ declare class ContentPlatformApplicationValidator {
|
|
|
638
632
|
static updateSupportInformation(): UpdateSupportInformationParam;
|
|
639
633
|
}
|
|
640
634
|
declare namespace ContentPlatformApplicationValidator {
|
|
641
|
-
export { AddDataLoaderParam, AddFaqParam, AddInjectableTagParam, AddPathRedirectionRulesParam, CreateAnnouncementParam, CreateAppCustomFieldDefinitionParam, CreateAppCustomObjectBySlugParam, CreateAppCustomObjectDefinitionParam, CreateBlogParam, CreateFaqCategoryParam, CreateLandingPageParam, CreateNavigationParam, CreatePageParam,
|
|
635
|
+
export { AddDataLoaderParam, AddFaqParam, AddInjectableTagParam, AddPathRedirectionRulesParam, CreateAnnouncementParam, CreateAppCustomFieldDefinitionParam, CreateAppCustomObjectBySlugParam, CreateAppCustomObjectDefinitionParam, CreateBlogParam, CreateFaqCategoryParam, CreateLandingPageParam, CreateNavigationParam, CreatePageParam, CreateSEOMarkupSchemaParam, DeleteAnnouncementParam, DeleteAppCustomFieldDefinitionBySlugParam, DeleteAppCustomObjectBySlugParam, DeleteAppCustomObjectDefinitionBySlugParam, DeleteBlogParam, DeleteDataLoaderParam, DeleteFaqParam, DeleteFaqCategoryParam, DeleteLandingPageParam, DeleteNavigationParam, DeletePageParam, DeletePathRedirectionRulesParam, DeleteSEOMarkupSchemaParam, EditDataLoaderParam, EditInjectableTagParam, EditSEOMarkupSchemaParam, ExportAppCustomObjectEntriesBySlugParam, GenerateSEOTitleParam, GetAnnouncementByIdParam, GetAnnouncementsListParam, GetAppCustomFieldDefinitionByResourceParam, GetAppCustomFieldDefinitionBySlugParam, GetAppCustomFieldDefinitionsParam, GetAppCustomFieldTypesParam, GetAppCustomFieldsByResourceSlugParam, GetAppCustomObjectBySlugParam, GetAppCustomObjectDefinitionBySlugParam, GetAppCustomObjectDefinitionsParam, GetAppCustomObjectsBySlugParam, GetAppJobsParam, GetAppResourcesParam, GetBlogBySlugParam, GetBlogsParam, GetDataLoadersParam, GetDataLoadersByServiceParam, GetDefaultNavigationsParam, GetDefaultSEOMarkupSchemaParam, GetFaqByIdOrSlugParam, GetFaqCategoriesParam, GetFaqCategoryBySlugOrIdParam, GetFaqsByCategoryIdOrSlugParam, GetInjectableTagsParam, GetLandingPagesParam, GetLegalInformationParam, GetNavigationBySlugParam, GetNavigationsParam, GetPageBySlugParam, GetPageMetaParam, GetPageSpecParam, GetPagesParam, GetPathRedirectionRuleParam, GetPathRedirectionRulesParam, GetSEOConfigurationParam, GetSEOMarkupSchemaParam, GetSEOMarkupSchemasParam, GetSupportInformationParam, ImportAppCustomObjectEntriesBySlugParam, RemoveInjectableTagParam, ResetDataLoaderParam, SampleAppCustomObjectBulkEntryBySlugParam, SelectDataLoaderParam, UpdateAnnouncementParam, UpdateAnnouncementScheduleParam, UpdateAppCustomFieldByResourceSlugParam, UpdateAppCustomFieldDefinitionBySlugParam, UpdateAppCustomObjectBySlugParam, UpdateAppCustomObjectDefinitionBySlugParam, UpdateBlogParam, UpdateFaqParam, UpdateFaqCategoryParam, UpdateInjectableTagParam, UpdateLandingPageParam, UpdateLegalInformationParam, UpdateNavigationParam, UpdatePageParam, UpdatePagePreviewParam, UpdatePathRedirectionRulesParam, UpdateSEOConfigurationParam, UpdateSupportInformationParam };
|
|
642
636
|
}
|
|
643
637
|
type AddDataLoaderParam = {
|
|
644
638
|
body: ContentPlatformModel.DataLoaderSchema;
|
|
@@ -685,9 +679,6 @@ type CreateNavigationParam = {
|
|
|
685
679
|
type CreatePageParam = {
|
|
686
680
|
body: ContentPlatformModel.PagePayload;
|
|
687
681
|
};
|
|
688
|
-
type CreatePagePreviewParam = {
|
|
689
|
-
body: ContentPlatformModel.PagePayload;
|
|
690
|
-
};
|
|
691
682
|
type CreateSEOMarkupSchemaParam = {
|
|
692
683
|
body: ContentPlatformModel.SEOSchemaMarkupTemplateRequestBody;
|
|
693
684
|
};
|
|
@@ -70,11 +70,6 @@ const ContentPlatformModel = require("./ContentPlatformModel");
|
|
|
70
70
|
* @property {ContentPlatformModel.PagePayload} body
|
|
71
71
|
*/
|
|
72
72
|
|
|
73
|
-
/**
|
|
74
|
-
* @typedef CreatePagePreviewParam
|
|
75
|
-
* @property {ContentPlatformModel.PagePayload} body
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
73
|
/**
|
|
79
74
|
* @typedef CreateSEOMarkupSchemaParam
|
|
80
75
|
* @property {ContentPlatformModel.SEOSchemaMarkupTemplateRequestBody} body
|
|
@@ -639,13 +634,6 @@ class ContentPlatformApplicationValidator {
|
|
|
639
634
|
}).required();
|
|
640
635
|
}
|
|
641
636
|
|
|
642
|
-
/** @returns {CreatePagePreviewParam} */
|
|
643
|
-
static createPagePreview() {
|
|
644
|
-
return Joi.object({
|
|
645
|
-
body: ContentPlatformModel.PagePayload().required(),
|
|
646
|
-
}).required();
|
|
647
|
-
}
|
|
648
|
-
|
|
649
637
|
/** @returns {CreateSEOMarkupSchemaParam} */
|
|
650
638
|
static createSEOMarkupSchema() {
|
|
651
639
|
return Joi.object({
|
|
@@ -603,6 +603,19 @@ declare class Payment {
|
|
|
603
603
|
* @description: Allows users to update the details of a refund session associated with a specific global identifier (GID) and request ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/updateRefundSession/).
|
|
604
604
|
*/
|
|
605
605
|
updateRefundSession({ gid, requestId, body, requestHeaders }?: PaymentPlatformApplicationValidator.UpdateRefundSessionParam, { responseHeaders }?: object): Promise<PaymentPlatformModel.RefundSessionDetails>;
|
|
606
|
+
/**
|
|
607
|
+
* @param {PaymentPlatformApplicationValidator.ValidateCustomerAndCreditSummaryParam} arg
|
|
608
|
+
* - Arg object
|
|
609
|
+
*
|
|
610
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
611
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
612
|
+
* @returns {Promise<PaymentPlatformModel.ValidateCustomerCreditSchema>} -
|
|
613
|
+
* Success response
|
|
614
|
+
* @name validateCustomerAndCreditSummary
|
|
615
|
+
* @summary: Verify payment customer and show credit summary
|
|
616
|
+
* @description: Verify if the user is eligible for payment and also show credit summary if activated. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/validateCustomerAndCreditSummary/).
|
|
617
|
+
*/
|
|
618
|
+
validateCustomerAndCreditSummary({ body, requestHeaders }?: PaymentPlatformApplicationValidator.ValidateCustomerAndCreditSummaryParam, { responseHeaders }?: object): Promise<PaymentPlatformModel.ValidateCustomerCreditSchema>;
|
|
606
619
|
/**
|
|
607
620
|
* @param {PaymentPlatformApplicationValidator.VerifyCustomerForPaymentParam} arg
|
|
608
621
|
* - Arg object
|
|
@@ -4122,6 +4122,88 @@ class Payment {
|
|
|
4122
4122
|
return response;
|
|
4123
4123
|
}
|
|
4124
4124
|
|
|
4125
|
+
/**
|
|
4126
|
+
* @param {PaymentPlatformApplicationValidator.ValidateCustomerAndCreditSummaryParam} arg
|
|
4127
|
+
* - Arg object
|
|
4128
|
+
*
|
|
4129
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
4130
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
4131
|
+
* @returns {Promise<PaymentPlatformModel.ValidateCustomerCreditSchema>} -
|
|
4132
|
+
* Success response
|
|
4133
|
+
* @name validateCustomerAndCreditSummary
|
|
4134
|
+
* @summary: Verify payment customer and show credit summary
|
|
4135
|
+
* @description: Verify if the user is eligible for payment and also show credit summary if activated. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/validateCustomerAndCreditSummary/).
|
|
4136
|
+
*/
|
|
4137
|
+
async validateCustomerAndCreditSummary(
|
|
4138
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
4139
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
4140
|
+
) {
|
|
4141
|
+
const {
|
|
4142
|
+
error,
|
|
4143
|
+
} = PaymentPlatformApplicationValidator.validateCustomerAndCreditSummary().validate(
|
|
4144
|
+
{
|
|
4145
|
+
body,
|
|
4146
|
+
},
|
|
4147
|
+
{ abortEarly: false, allowUnknown: true }
|
|
4148
|
+
);
|
|
4149
|
+
if (error) {
|
|
4150
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
4151
|
+
}
|
|
4152
|
+
|
|
4153
|
+
// Showing warrnings if extra unknown parameters are found
|
|
4154
|
+
const {
|
|
4155
|
+
error: warrning,
|
|
4156
|
+
} = PaymentPlatformApplicationValidator.validateCustomerAndCreditSummary().validate(
|
|
4157
|
+
{
|
|
4158
|
+
body,
|
|
4159
|
+
},
|
|
4160
|
+
{ abortEarly: false, allowUnknown: false }
|
|
4161
|
+
);
|
|
4162
|
+
if (warrning) {
|
|
4163
|
+
Logger({
|
|
4164
|
+
level: "WARN",
|
|
4165
|
+
message: `Parameter Validation warrnings for platform > Payment > validateCustomerAndCreditSummary \n ${warrning}`,
|
|
4166
|
+
});
|
|
4167
|
+
}
|
|
4168
|
+
|
|
4169
|
+
const query_params = {};
|
|
4170
|
+
|
|
4171
|
+
const response = await PlatformAPIClient.execute(
|
|
4172
|
+
this.config,
|
|
4173
|
+
"post",
|
|
4174
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/validate/customer-credits`,
|
|
4175
|
+
query_params,
|
|
4176
|
+
body,
|
|
4177
|
+
requestHeaders,
|
|
4178
|
+
{ responseHeaders }
|
|
4179
|
+
);
|
|
4180
|
+
|
|
4181
|
+
let responseData = response;
|
|
4182
|
+
if (responseHeaders) {
|
|
4183
|
+
responseData = response[0];
|
|
4184
|
+
}
|
|
4185
|
+
|
|
4186
|
+
const {
|
|
4187
|
+
error: res_error,
|
|
4188
|
+
} = PaymentPlatformModel.ValidateCustomerCreditSchema().validate(
|
|
4189
|
+
responseData,
|
|
4190
|
+
{ abortEarly: false, allowUnknown: true }
|
|
4191
|
+
);
|
|
4192
|
+
|
|
4193
|
+
if (res_error) {
|
|
4194
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
4195
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
4196
|
+
} else {
|
|
4197
|
+
Logger({
|
|
4198
|
+
level: "WARN",
|
|
4199
|
+
message: `Response Validation Warnings for platform > Payment > validateCustomerAndCreditSummary \n ${res_error}`,
|
|
4200
|
+
});
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
|
|
4204
|
+
return response;
|
|
4205
|
+
}
|
|
4206
|
+
|
|
4125
4207
|
/**
|
|
4126
4208
|
* @param {PaymentPlatformApplicationValidator.VerifyCustomerForPaymentParam} arg
|
|
4127
4209
|
* - Arg object
|
|
@@ -239,6 +239,10 @@ export = PaymentPlatformApplicationValidator;
|
|
|
239
239
|
* session. This is generated by Fynd platform and is usually shipment_id.
|
|
240
240
|
* @property {PaymentPlatformModel.RefundSessionCreation} body
|
|
241
241
|
*/
|
|
242
|
+
/**
|
|
243
|
+
* @typedef ValidateCustomerAndCreditSummaryParam
|
|
244
|
+
* @property {PaymentPlatformModel.CustomerValidationSchema} body
|
|
245
|
+
*/
|
|
242
246
|
/**
|
|
243
247
|
* @typedef VerifyCustomerForPaymentParam
|
|
244
248
|
* @property {PaymentPlatformModel.ValidateCustomerCreation} body
|
|
@@ -342,11 +346,13 @@ declare class PaymentPlatformApplicationValidator {
|
|
|
342
346
|
static updatePaymentSession(): UpdatePaymentSessionParam;
|
|
343
347
|
/** @returns {UpdateRefundSessionParam} */
|
|
344
348
|
static updateRefundSession(): UpdateRefundSessionParam;
|
|
349
|
+
/** @returns {ValidateCustomerAndCreditSummaryParam} */
|
|
350
|
+
static validateCustomerAndCreditSummary(): ValidateCustomerAndCreditSummaryParam;
|
|
345
351
|
/** @returns {VerifyCustomerForPaymentParam} */
|
|
346
352
|
static verifyCustomerForPayment(): VerifyCustomerForPaymentParam;
|
|
347
353
|
}
|
|
348
354
|
declare namespace PaymentPlatformApplicationValidator {
|
|
349
|
-
export { AddEdcDeviceParam, AddRefundBankAccountUsingOTPParam, CancelPaymentLinkParam, CheckAndUpdatePaymentStatusParam, ConfirmPaymentParam, CreateMerchantRefundPriorityParam, CreatePaymentLinkParam, CreatePaymentOrderParam, EdcAggregatorsAndModelListParam, EdcDeviceListParam, EdcDeviceStatsParam, GetBankAccountDetailsOpenAPIParam, GetBrandPaymentGatewayConfigParam, GetEdcDeviceParam, GetMerchantAggregatorAppVersionParam, GetMerchantAggregatorPaymentModeDetailsParam, GetMerchantPaymentOptionParam, GetMerchantRefundPriorityParam, GetPGConfigAggregatorsParam, GetPaymentCodeOptionParam, GetPaymentLinkParam, GetPaymentModeControlRoutesParam, GetPaymentModeCustomConfigParam, GetPaymentModeRoutesParam, GetPaymentSessionParam, GetPosPaymentModeRoutesParam, GetUserBeneficiariesParam, GetUserCODlimitRoutesParam, GetUserOrderBeneficiariesParam, InitialisePaymentParam, MerchantOnBoardingParam, OauthGetUrlParam, PatchMerchantAggregatorPaymentModeDetailsParam, PatchMerchantPaymentOptionParam, PatchMerchantPaymentOptionVersionParam, PaymentStatusBulkParam, PollingPaymentLinkParam, RepaymentDetailsParam, ResendOrCancelPaymentParam, ResendPaymentLinkParam, RevokeOauthTokenParam, SaveBrandPaymentGatewayConfigParam, SetMerchantModeControlRoutesParam, SetPaymentModeCustomConfigParam, SetUserCODlimitRoutesParam, UpdateEdcDeviceParam, UpdateMerchantRefundPriorityParam, UpdatePaymentSessionParam, UpdateRefundSessionParam, VerifyCustomerForPaymentParam };
|
|
355
|
+
export { AddEdcDeviceParam, AddRefundBankAccountUsingOTPParam, CancelPaymentLinkParam, CheckAndUpdatePaymentStatusParam, ConfirmPaymentParam, CreateMerchantRefundPriorityParam, CreatePaymentLinkParam, CreatePaymentOrderParam, EdcAggregatorsAndModelListParam, EdcDeviceListParam, EdcDeviceStatsParam, GetBankAccountDetailsOpenAPIParam, GetBrandPaymentGatewayConfigParam, GetEdcDeviceParam, GetMerchantAggregatorAppVersionParam, GetMerchantAggregatorPaymentModeDetailsParam, GetMerchantPaymentOptionParam, GetMerchantRefundPriorityParam, GetPGConfigAggregatorsParam, GetPaymentCodeOptionParam, GetPaymentLinkParam, GetPaymentModeControlRoutesParam, GetPaymentModeCustomConfigParam, GetPaymentModeRoutesParam, GetPaymentSessionParam, GetPosPaymentModeRoutesParam, GetUserBeneficiariesParam, GetUserCODlimitRoutesParam, GetUserOrderBeneficiariesParam, InitialisePaymentParam, MerchantOnBoardingParam, OauthGetUrlParam, PatchMerchantAggregatorPaymentModeDetailsParam, PatchMerchantPaymentOptionParam, PatchMerchantPaymentOptionVersionParam, PaymentStatusBulkParam, PollingPaymentLinkParam, RepaymentDetailsParam, ResendOrCancelPaymentParam, ResendPaymentLinkParam, RevokeOauthTokenParam, SaveBrandPaymentGatewayConfigParam, SetMerchantModeControlRoutesParam, SetPaymentModeCustomConfigParam, SetUserCODlimitRoutesParam, UpdateEdcDeviceParam, UpdateMerchantRefundPriorityParam, UpdatePaymentSessionParam, UpdateRefundSessionParam, ValidateCustomerAndCreditSummaryParam, VerifyCustomerForPaymentParam };
|
|
350
356
|
}
|
|
351
357
|
type AddEdcDeviceParam = {
|
|
352
358
|
/**
|
|
@@ -647,6 +653,9 @@ type UpdateRefundSessionParam = {
|
|
|
647
653
|
requestId: string;
|
|
648
654
|
body: PaymentPlatformModel.RefundSessionCreation;
|
|
649
655
|
};
|
|
656
|
+
type ValidateCustomerAndCreditSummaryParam = {
|
|
657
|
+
body: PaymentPlatformModel.CustomerValidationSchema;
|
|
658
|
+
};
|
|
650
659
|
type VerifyCustomerForPaymentParam = {
|
|
651
660
|
body: PaymentPlatformModel.ValidateCustomerCreation;
|
|
652
661
|
};
|
|
@@ -291,6 +291,11 @@ const PaymentPlatformModel = require("./PaymentPlatformModel");
|
|
|
291
291
|
* @property {PaymentPlatformModel.RefundSessionCreation} body
|
|
292
292
|
*/
|
|
293
293
|
|
|
294
|
+
/**
|
|
295
|
+
* @typedef ValidateCustomerAndCreditSummaryParam
|
|
296
|
+
* @property {PaymentPlatformModel.CustomerValidationSchema} body
|
|
297
|
+
*/
|
|
298
|
+
|
|
294
299
|
/**
|
|
295
300
|
* @typedef VerifyCustomerForPaymentParam
|
|
296
301
|
* @property {PaymentPlatformModel.ValidateCustomerCreation} body
|
|
@@ -671,6 +676,13 @@ class PaymentPlatformApplicationValidator {
|
|
|
671
676
|
}).required();
|
|
672
677
|
}
|
|
673
678
|
|
|
679
|
+
/** @returns {ValidateCustomerAndCreditSummaryParam} */
|
|
680
|
+
static validateCustomerAndCreditSummary() {
|
|
681
|
+
return Joi.object({
|
|
682
|
+
body: PaymentPlatformModel.CustomerValidationSchema().required(),
|
|
683
|
+
}).required();
|
|
684
|
+
}
|
|
685
|
+
|
|
674
686
|
/** @returns {VerifyCustomerForPaymentParam} */
|
|
675
687
|
static verifyCustomerForPayment() {
|
|
676
688
|
return Joi.object({
|
|
@@ -1225,10 +1225,42 @@ export = PaymentPlatformModel;
|
|
|
1225
1225
|
* @property {string} message
|
|
1226
1226
|
* @property {PaymentModeCustomConfigSchema[]} items
|
|
1227
1227
|
*/
|
|
1228
|
+
/**
|
|
1229
|
+
* @typedef CustomerValidationSchema
|
|
1230
|
+
* @property {string} aggregator - Aggregator name of the payment gateway.
|
|
1231
|
+
* @property {number} transaction_amount - Payable amount
|
|
1232
|
+
* @property {string} [cart_id] - Unique identifier for the shopping cart.
|
|
1233
|
+
*/
|
|
1234
|
+
/**
|
|
1235
|
+
* @typedef UserCreditSchema
|
|
1236
|
+
* @property {number} amount - The monetary value, which can represent available
|
|
1237
|
+
* balance, redeemed balance, or hold amount, depending on the context.
|
|
1238
|
+
* @property {string} currency - The currency code (e.g., INR, USD).
|
|
1239
|
+
* @property {string} [unique_id] - A unique identifier for the payment transaction.
|
|
1240
|
+
*/
|
|
1241
|
+
/**
|
|
1242
|
+
* @typedef CreditAccountSummary
|
|
1243
|
+
* @property {string} account_id - Unique identifier associated with the
|
|
1244
|
+
* customer's account
|
|
1245
|
+
* @property {string} status - Current state of the account, indicating whether
|
|
1246
|
+
* it is ACTIVE, INACTIVE, or UNREGISTERED.
|
|
1247
|
+
* @property {UserCreditSchema} [redeemable_balance]
|
|
1248
|
+
* @property {UserCreditSchema} [available_balance]
|
|
1249
|
+
* @property {UserCreditSchema} [amount_on_hold]
|
|
1250
|
+
*/
|
|
1251
|
+
/**
|
|
1252
|
+
* @typedef ValidateCustomerCreditSchema
|
|
1253
|
+
* @property {boolean} success - Successful or failure of API
|
|
1254
|
+
* @property {boolean} is_eligible - The customer is eligible to make a transaction or not
|
|
1255
|
+
* @property {boolean} [is_applied] - Credit is applied to the user's account or not
|
|
1256
|
+
* @property {string} message - Detailed message about the user credt eligibility.
|
|
1257
|
+
* @property {string} [cart_id] - Unique identifier for the shopping cart.
|
|
1258
|
+
* @property {CreditAccountSummary} [account]
|
|
1259
|
+
*/
|
|
1228
1260
|
declare class PaymentPlatformModel {
|
|
1229
1261
|
}
|
|
1230
1262
|
declare namespace PaymentPlatformModel {
|
|
1231
|
-
export { PaymentGatewayConfigDetails, ErrorCodeDescription, PaymentGatewayConfig, PaymentGatewayConfigCreation, PaymentGatewayToBeReviewed, ErrorCodeAndDescription, HttpErrorDetails, IntentAppErrorList, ProductCODData, CODChargesLimitsDetails, PaymentModeLogo, IntentApp, PaymentModeList, RootPaymentMode, PaymentOptions, AggregatorRoute, PaymentDefaultSelection, PaymentFlow, PaymentOptionAndFlow, AdvanceObject, SplitObject, AdvancePaymentObject, PaymentModeRouteDetails, PaymentOptionsDetails, PayoutCustomer, PayoutMoreAttributes, PayoutAggregator, Payout, PayoutsDetails, PayoutBankDetails, PayoutCreation, PayoutDetails, UpdatePayoutDetails, UpdatePayoutCreation, DeletePayoutDetails, SubscriptionPaymentMethodDetails, DeleteSubscriptionPaymentMethodDetails, SubscriptionConfigDetails, SaveSubscriptionSetupIntentCreation, SaveSubscriptionSetupIntentDetails, RefundAccountDetails, NotFoundResourceError, BankDetailsForOTP, AddBeneficiaryDetailsOTPCreation, IfscCodeDetails, OrderBeneficiaryDetails, OrderBeneficiaryFetchResults, MultiTenderPaymentMeta, MultiTenderPaymentMethod, PaymentConfirmationCreation, PaymentConfirmationDetails, CODdata, CODLimitConfig, CODPaymentLimitConfig, GetUserBULimitResponseSchema, GetUserCODLimitDetails, SetCODForUserCreation, SetCODOptionDetails, EdcModelData, EdcAggregatorAndModelListDetails, StatisticsData, EdcDeviceStatsDetails, EdcAddCreation, EdcDevice, EdcDeviceAddDetails, EdcDeviceDetails, EdcUpdate, EdcDeviceUpdateDetails, Page, EdcDeviceListDetails, PaymentInitializationCreation, PaymentInitializationDetails, PaymentStatusUpdateCreation, PaymentStatusUpdateDetails, ResendOrCancelPaymentCreation, LinkStatus, ResendOrCancelPaymentDetails, PaymentStatusBulkHandlerCreation, PaymentObjectList, PaymentStatusObject, PaymentStatusBulkHandlerDetails, GetOauthUrlDetails, RevokeOAuthToken, RepaymentRequestDetails, RepaymentDetailsSerialiserPayAll, RepaymentDetails, MerchantOnBoardingCreation, MerchantOnBoardingDetails, ValidateCustomerCreation, ValidateCustomerDetails, GetPaymentLinkDetails, ErrorDescription, ErrorDetails, CreatePaymentLinkMeta, CreatePaymentLinkCreation, CreatePaymentLinkDetails, PollingPaymentLinkDetails, CancelOrResendPaymentLinkCreation, ResendPaymentLinkDetails, CancelPaymentLinkDetails, Code, PaymentCode, GetPaymentCode, GetPaymentCodeDetails, PlatformPaymentModeDetails, MerchnatPaymentModeCreation, OrderDetail, AddressDetail, ReasonDetail, PaymentSessionDetail, PaymentSessionCreation, PaymentSessionPutDetails, RefundSessionDetail, RefundSessionCreation, RefundSessionDetails, PaymentDetails, CartDetails, RefundDetails, PaymentSessionFetchDetails, RefundSourcesPriority, RefundPriorityDetails, RefundPriorityCreation, MerchantPaymentModeCreation, FromConfig, ToConfig, PlatformPaymentModeCopyConfigCreation, PaymentMethodsMetaOrder, PaymentOrderMethods, PaymentOrderCreation, PaymentOrderData, PaymentOrderDetails, AggregatorVersionItemSchema, AggregatorVersionDetails, AggregatorVersionRequestSchema, PatchAggregatorControl, PaymentModeCustomConfigSchema, PaymentCustomConfigDetailsSchema, PaymentCustomConfigCustomerSchema, PaymentCustomConfigModeSchema, PaymentCustomConfigDetailsRequestSchema, PaymentCustomConfigCustomerRequestSchema, PaymentCustomConfigRequestSchema, PaymentCustomConfigResponseSchema };
|
|
1263
|
+
export { PaymentGatewayConfigDetails, ErrorCodeDescription, PaymentGatewayConfig, PaymentGatewayConfigCreation, PaymentGatewayToBeReviewed, ErrorCodeAndDescription, HttpErrorDetails, IntentAppErrorList, ProductCODData, CODChargesLimitsDetails, PaymentModeLogo, IntentApp, PaymentModeList, RootPaymentMode, PaymentOptions, AggregatorRoute, PaymentDefaultSelection, PaymentFlow, PaymentOptionAndFlow, AdvanceObject, SplitObject, AdvancePaymentObject, PaymentModeRouteDetails, PaymentOptionsDetails, PayoutCustomer, PayoutMoreAttributes, PayoutAggregator, Payout, PayoutsDetails, PayoutBankDetails, PayoutCreation, PayoutDetails, UpdatePayoutDetails, UpdatePayoutCreation, DeletePayoutDetails, SubscriptionPaymentMethodDetails, DeleteSubscriptionPaymentMethodDetails, SubscriptionConfigDetails, SaveSubscriptionSetupIntentCreation, SaveSubscriptionSetupIntentDetails, RefundAccountDetails, NotFoundResourceError, BankDetailsForOTP, AddBeneficiaryDetailsOTPCreation, IfscCodeDetails, OrderBeneficiaryDetails, OrderBeneficiaryFetchResults, MultiTenderPaymentMeta, MultiTenderPaymentMethod, PaymentConfirmationCreation, PaymentConfirmationDetails, CODdata, CODLimitConfig, CODPaymentLimitConfig, GetUserBULimitResponseSchema, GetUserCODLimitDetails, SetCODForUserCreation, SetCODOptionDetails, EdcModelData, EdcAggregatorAndModelListDetails, StatisticsData, EdcDeviceStatsDetails, EdcAddCreation, EdcDevice, EdcDeviceAddDetails, EdcDeviceDetails, EdcUpdate, EdcDeviceUpdateDetails, Page, EdcDeviceListDetails, PaymentInitializationCreation, PaymentInitializationDetails, PaymentStatusUpdateCreation, PaymentStatusUpdateDetails, ResendOrCancelPaymentCreation, LinkStatus, ResendOrCancelPaymentDetails, PaymentStatusBulkHandlerCreation, PaymentObjectList, PaymentStatusObject, PaymentStatusBulkHandlerDetails, GetOauthUrlDetails, RevokeOAuthToken, RepaymentRequestDetails, RepaymentDetailsSerialiserPayAll, RepaymentDetails, MerchantOnBoardingCreation, MerchantOnBoardingDetails, ValidateCustomerCreation, ValidateCustomerDetails, GetPaymentLinkDetails, ErrorDescription, ErrorDetails, CreatePaymentLinkMeta, CreatePaymentLinkCreation, CreatePaymentLinkDetails, PollingPaymentLinkDetails, CancelOrResendPaymentLinkCreation, ResendPaymentLinkDetails, CancelPaymentLinkDetails, Code, PaymentCode, GetPaymentCode, GetPaymentCodeDetails, PlatformPaymentModeDetails, MerchnatPaymentModeCreation, OrderDetail, AddressDetail, ReasonDetail, PaymentSessionDetail, PaymentSessionCreation, PaymentSessionPutDetails, RefundSessionDetail, RefundSessionCreation, RefundSessionDetails, PaymentDetails, CartDetails, RefundDetails, PaymentSessionFetchDetails, RefundSourcesPriority, RefundPriorityDetails, RefundPriorityCreation, MerchantPaymentModeCreation, FromConfig, ToConfig, PlatformPaymentModeCopyConfigCreation, PaymentMethodsMetaOrder, PaymentOrderMethods, PaymentOrderCreation, PaymentOrderData, PaymentOrderDetails, AggregatorVersionItemSchema, AggregatorVersionDetails, AggregatorVersionRequestSchema, PatchAggregatorControl, PaymentModeCustomConfigSchema, PaymentCustomConfigDetailsSchema, PaymentCustomConfigCustomerSchema, PaymentCustomConfigModeSchema, PaymentCustomConfigDetailsRequestSchema, PaymentCustomConfigCustomerRequestSchema, PaymentCustomConfigRequestSchema, PaymentCustomConfigResponseSchema, CustomerValidationSchema, UserCreditSchema, CreditAccountSummary, ValidateCustomerCreditSchema };
|
|
1232
1264
|
}
|
|
1233
1265
|
/** @returns {PaymentGatewayConfigDetails} */
|
|
1234
1266
|
declare function PaymentGatewayConfigDetails(): PaymentGatewayConfigDetails;
|
|
@@ -4471,3 +4503,78 @@ type PaymentCustomConfigResponseSchema = {
|
|
|
4471
4503
|
message: string;
|
|
4472
4504
|
items: PaymentModeCustomConfigSchema[];
|
|
4473
4505
|
};
|
|
4506
|
+
/** @returns {CustomerValidationSchema} */
|
|
4507
|
+
declare function CustomerValidationSchema(): CustomerValidationSchema;
|
|
4508
|
+
type CustomerValidationSchema = {
|
|
4509
|
+
/**
|
|
4510
|
+
* - Aggregator name of the payment gateway.
|
|
4511
|
+
*/
|
|
4512
|
+
aggregator: string;
|
|
4513
|
+
/**
|
|
4514
|
+
* - Payable amount
|
|
4515
|
+
*/
|
|
4516
|
+
transaction_amount: number;
|
|
4517
|
+
/**
|
|
4518
|
+
* - Unique identifier for the shopping cart.
|
|
4519
|
+
*/
|
|
4520
|
+
cart_id?: string;
|
|
4521
|
+
};
|
|
4522
|
+
/** @returns {UserCreditSchema} */
|
|
4523
|
+
declare function UserCreditSchema(): UserCreditSchema;
|
|
4524
|
+
type UserCreditSchema = {
|
|
4525
|
+
/**
|
|
4526
|
+
* - The monetary value, which can represent available
|
|
4527
|
+
* balance, redeemed balance, or hold amount, depending on the context.
|
|
4528
|
+
*/
|
|
4529
|
+
amount: number;
|
|
4530
|
+
/**
|
|
4531
|
+
* - The currency code (e.g., INR, USD).
|
|
4532
|
+
*/
|
|
4533
|
+
currency: string;
|
|
4534
|
+
/**
|
|
4535
|
+
* - A unique identifier for the payment transaction.
|
|
4536
|
+
*/
|
|
4537
|
+
unique_id?: string;
|
|
4538
|
+
};
|
|
4539
|
+
/** @returns {CreditAccountSummary} */
|
|
4540
|
+
declare function CreditAccountSummary(): CreditAccountSummary;
|
|
4541
|
+
type CreditAccountSummary = {
|
|
4542
|
+
/**
|
|
4543
|
+
* - Unique identifier associated with the
|
|
4544
|
+
* customer's account
|
|
4545
|
+
*/
|
|
4546
|
+
account_id: string;
|
|
4547
|
+
/**
|
|
4548
|
+
* - Current state of the account, indicating whether
|
|
4549
|
+
* it is ACTIVE, INACTIVE, or UNREGISTERED.
|
|
4550
|
+
*/
|
|
4551
|
+
status: string;
|
|
4552
|
+
redeemable_balance?: UserCreditSchema;
|
|
4553
|
+
available_balance?: UserCreditSchema;
|
|
4554
|
+
amount_on_hold?: UserCreditSchema;
|
|
4555
|
+
};
|
|
4556
|
+
/** @returns {ValidateCustomerCreditSchema} */
|
|
4557
|
+
declare function ValidateCustomerCreditSchema(): ValidateCustomerCreditSchema;
|
|
4558
|
+
type ValidateCustomerCreditSchema = {
|
|
4559
|
+
/**
|
|
4560
|
+
* - Successful or failure of API
|
|
4561
|
+
*/
|
|
4562
|
+
success: boolean;
|
|
4563
|
+
/**
|
|
4564
|
+
* - The customer is eligible to make a transaction or not
|
|
4565
|
+
*/
|
|
4566
|
+
is_eligible: boolean;
|
|
4567
|
+
/**
|
|
4568
|
+
* - Credit is applied to the user's account or not
|
|
4569
|
+
*/
|
|
4570
|
+
is_applied?: boolean;
|
|
4571
|
+
/**
|
|
4572
|
+
* - Detailed message about the user credt eligibility.
|
|
4573
|
+
*/
|
|
4574
|
+
message: string;
|
|
4575
|
+
/**
|
|
4576
|
+
* - Unique identifier for the shopping cart.
|
|
4577
|
+
*/
|
|
4578
|
+
cart_id?: string;
|
|
4579
|
+
account?: CreditAccountSummary;
|
|
4580
|
+
};
|
|
@@ -1369,6 +1369,42 @@ const Joi = require("joi");
|
|
|
1369
1369
|
* @property {PaymentModeCustomConfigSchema[]} items
|
|
1370
1370
|
*/
|
|
1371
1371
|
|
|
1372
|
+
/**
|
|
1373
|
+
* @typedef CustomerValidationSchema
|
|
1374
|
+
* @property {string} aggregator - Aggregator name of the payment gateway.
|
|
1375
|
+
* @property {number} transaction_amount - Payable amount
|
|
1376
|
+
* @property {string} [cart_id] - Unique identifier for the shopping cart.
|
|
1377
|
+
*/
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* @typedef UserCreditSchema
|
|
1381
|
+
* @property {number} amount - The monetary value, which can represent available
|
|
1382
|
+
* balance, redeemed balance, or hold amount, depending on the context.
|
|
1383
|
+
* @property {string} currency - The currency code (e.g., INR, USD).
|
|
1384
|
+
* @property {string} [unique_id] - A unique identifier for the payment transaction.
|
|
1385
|
+
*/
|
|
1386
|
+
|
|
1387
|
+
/**
|
|
1388
|
+
* @typedef CreditAccountSummary
|
|
1389
|
+
* @property {string} account_id - Unique identifier associated with the
|
|
1390
|
+
* customer's account
|
|
1391
|
+
* @property {string} status - Current state of the account, indicating whether
|
|
1392
|
+
* it is ACTIVE, INACTIVE, or UNREGISTERED.
|
|
1393
|
+
* @property {UserCreditSchema} [redeemable_balance]
|
|
1394
|
+
* @property {UserCreditSchema} [available_balance]
|
|
1395
|
+
* @property {UserCreditSchema} [amount_on_hold]
|
|
1396
|
+
*/
|
|
1397
|
+
|
|
1398
|
+
/**
|
|
1399
|
+
* @typedef ValidateCustomerCreditSchema
|
|
1400
|
+
* @property {boolean} success - Successful or failure of API
|
|
1401
|
+
* @property {boolean} is_eligible - The customer is eligible to make a transaction or not
|
|
1402
|
+
* @property {boolean} [is_applied] - Credit is applied to the user's account or not
|
|
1403
|
+
* @property {string} message - Detailed message about the user credt eligibility.
|
|
1404
|
+
* @property {string} [cart_id] - Unique identifier for the shopping cart.
|
|
1405
|
+
* @property {CreditAccountSummary} [account]
|
|
1406
|
+
*/
|
|
1407
|
+
|
|
1372
1408
|
class PaymentPlatformModel {
|
|
1373
1409
|
/** @returns {PaymentGatewayConfigDetails} */
|
|
1374
1410
|
static PaymentGatewayConfigDetails() {
|
|
@@ -3007,5 +3043,46 @@ class PaymentPlatformModel {
|
|
|
3007
3043
|
.required(),
|
|
3008
3044
|
});
|
|
3009
3045
|
}
|
|
3046
|
+
|
|
3047
|
+
/** @returns {CustomerValidationSchema} */
|
|
3048
|
+
static CustomerValidationSchema() {
|
|
3049
|
+
return Joi.object({
|
|
3050
|
+
aggregator: Joi.string().allow("").required(),
|
|
3051
|
+
transaction_amount: Joi.number().required(),
|
|
3052
|
+
cart_id: Joi.string().allow(""),
|
|
3053
|
+
});
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
/** @returns {UserCreditSchema} */
|
|
3057
|
+
static UserCreditSchema() {
|
|
3058
|
+
return Joi.object({
|
|
3059
|
+
amount: Joi.number().required(),
|
|
3060
|
+
currency: Joi.string().allow("").required(),
|
|
3061
|
+
unique_id: Joi.string().allow(""),
|
|
3062
|
+
});
|
|
3063
|
+
}
|
|
3064
|
+
|
|
3065
|
+
/** @returns {CreditAccountSummary} */
|
|
3066
|
+
static CreditAccountSummary() {
|
|
3067
|
+
return Joi.object({
|
|
3068
|
+
account_id: Joi.string().allow("").required(),
|
|
3069
|
+
status: Joi.string().allow("").required(),
|
|
3070
|
+
redeemable_balance: PaymentPlatformModel.UserCreditSchema(),
|
|
3071
|
+
available_balance: PaymentPlatformModel.UserCreditSchema(),
|
|
3072
|
+
amount_on_hold: PaymentPlatformModel.UserCreditSchema(),
|
|
3073
|
+
});
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
/** @returns {ValidateCustomerCreditSchema} */
|
|
3077
|
+
static ValidateCustomerCreditSchema() {
|
|
3078
|
+
return Joi.object({
|
|
3079
|
+
success: Joi.boolean().required(),
|
|
3080
|
+
is_eligible: Joi.boolean().required(),
|
|
3081
|
+
is_applied: Joi.boolean(),
|
|
3082
|
+
message: Joi.string().allow("").required(),
|
|
3083
|
+
cart_id: Joi.string().allow(""),
|
|
3084
|
+
account: PaymentPlatformModel.CreditAccountSummary(),
|
|
3085
|
+
});
|
|
3086
|
+
}
|
|
3010
3087
|
}
|
|
3011
3088
|
module.exports = PaymentPlatformModel;
|
|
@@ -211,7 +211,7 @@ export = UserPlatformModel;
|
|
|
211
211
|
* @property {string} [first_name]
|
|
212
212
|
* @property {string} [last_name]
|
|
213
213
|
* @property {string} [gender]
|
|
214
|
-
* @property {string} username
|
|
214
|
+
* @property {string} [username]
|
|
215
215
|
* @property {Object} [meta]
|
|
216
216
|
* @property {string} [external_id]
|
|
217
217
|
* @property {string} [rr_id]
|
|
@@ -835,7 +835,7 @@ type CreateUserRequestSchema = {
|
|
|
835
835
|
first_name?: string;
|
|
836
836
|
last_name?: string;
|
|
837
837
|
gender?: string;
|
|
838
|
-
username
|
|
838
|
+
username?: string;
|
|
839
839
|
meta?: any;
|
|
840
840
|
external_id?: string;
|
|
841
841
|
rr_id?: string;
|