@gofynd/fdk-client-javascript 1.4.2-beta.1 → 1.4.2-beta.10
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 +3 -2
- package/sdk/application/ApplicationClient.js +20 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +3 -5
- package/sdk/application/Cart/CartApplicationModel.d.ts +1634 -1742
- package/sdk/application/Cart/CartApplicationModel.js +1388 -1464
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -4
- package/sdk/application/Cart/CartApplicationValidator.js +0 -4
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +6 -3
- package/sdk/application/Catalog/CatalogApplicationClient.js +20 -7
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
- package/sdk/application/Catalog/CatalogApplicationModel.js +1613 -1613
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +14 -0
- package/sdk/application/Catalog/CatalogApplicationValidator.js +6 -0
- package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
- package/sdk/application/Common/CommonApplicationModel.js +172 -172
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
- package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1492 -1626
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1038 -1180
- package/sdk/application/Content/ContentApplicationClient.d.ts +0 -36
- package/sdk/application/Content/ContentApplicationClient.js +0 -246
- package/sdk/application/Content/ContentApplicationModel.d.ts +546 -753
- package/sdk/application/Content/ContentApplicationModel.js +565 -817
- package/sdk/application/Content/ContentApplicationValidator.d.ts +1 -40
- package/sdk/application/Content/ContentApplicationValidator.js +0 -41
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
- package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
- package/sdk/application/Lead/LeadApplicationModel.js +301 -301
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +0 -67
- package/sdk/application/Logistic/LogisticApplicationClient.js +0 -547
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +257 -712
- package/sdk/application/Logistic/LogisticApplicationModel.js +267 -755
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +1 -211
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -131
- package/sdk/application/Order/OrderApplicationClient.d.ts +3 -3
- package/sdk/application/Order/OrderApplicationClient.js +8 -32
- package/sdk/application/Order/OrderApplicationModel.d.ts +845 -853
- package/sdk/application/Order/OrderApplicationModel.js +816 -824
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -20
- package/sdk/application/Order/OrderApplicationValidator.js +0 -8
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -46
- package/sdk/application/Payment/PaymentApplicationClient.js +10 -341
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +1892 -2199
- package/sdk/application/Payment/PaymentApplicationModel.js +1235 -1506
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +14 -59
- package/sdk/application/Payment/PaymentApplicationValidator.js +10 -64
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1396 -1429
- package/sdk/application/PosCart/PosCartApplicationModel.js +1233 -1257
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
- package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
- package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
- package/sdk/application/Share/ShareApplicationModel.js +121 -121
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationClient.js +3 -7
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +783 -969
- package/sdk/application/Theme/ThemeApplicationModel.js +571 -867
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -10
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -4
- package/sdk/application/User/UserApplicationClient.d.ts +0 -33
- package/sdk/application/User/UserApplicationClient.js +0 -239
- package/sdk/application/User/UserApplicationModel.d.ts +753 -768
- package/sdk/application/User/UserApplicationModel.js +731 -755
- package/sdk/application/User/UserApplicationValidator.d.ts +1 -34
- package/sdk/application/User/UserApplicationValidator.js +0 -36
- package/sdk/common/Clickstream.d.ts +1 -0
- package/sdk/common/Clickstream.js +254 -0
- package/sdk/common/Utility.js +1 -4
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +72 -60
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +70 -58
- package/sdk/partner/PartnerClient.d.ts +0 -6
- package/sdk/partner/PartnerClient.js +0 -9
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +0 -10
- package/sdk/partner/Theme/ThemePartnerClient.js +0 -80
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1178 -1153
- package/sdk/partner/Theme/ThemePartnerModel.js +830 -974
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +0 -1
- package/sdk/partner/Theme/ThemePartnerValidator.js +0 -9
- package/sdk/partner/index.d.ts +0 -3
- package/sdk/partner/index.js +0 -6
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +2 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +1 -11
- package/sdk/platform/Billing/BillingPlatformClient.js +3 -110
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +734 -800
- package/sdk/platform/Billing/BillingPlatformModel.js +732 -810
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +4 -43
- package/sdk/platform/Billing/BillingPlatformValidator.js +2 -29
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +11 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +81 -7
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +13 -5
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +12 -4
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3223 -3328
- package/sdk/platform/Cart/CartPlatformModel.js +2875 -2946
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +11 -15
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +21 -52
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +0 -27
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +0 -11
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +15 -27
- package/sdk/platform/Catalog/CatalogPlatformClient.js +93 -189
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +617 -920
- package/sdk/platform/Catalog/CatalogPlatformModel.js +584 -919
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +27 -41
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +19 -31
- package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
- package/sdk/platform/Common/CommonPlatformModel.js +187 -187
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +37 -139
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +52 -737
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +3 -133
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +1 -113
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1079 -1228
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1090 -1262
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -8
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +4 -32
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +629 -658
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +641 -675
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +0 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +0 -6
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +8 -8
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +4 -4
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2992 -3231
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2092 -2303
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +2 -2
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +2 -2
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -391
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1074 -3656
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -351
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -410
- package/sdk/platform/Content/ContentPlatformModel.d.ts +972 -2071
- package/sdk/platform/Content/ContentPlatformModel.js +1039 -2355
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformClient.js +2 -2
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +174 -259
- package/sdk/platform/Discount/DiscountPlatformModel.js +163 -257
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +6 -16
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +8 -117
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +4 -55
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +2 -39
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +821 -892
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +833 -901
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +0 -33
- package/sdk/platform/Finance/FinancePlatformClient.js +0 -240
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +910 -1056
- package/sdk/platform/Finance/FinancePlatformModel.js +884 -1070
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +1 -38
- package/sdk/platform/Finance/FinancePlatformValidator.js +0 -38
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +28 -38
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +56 -137
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +29 -41
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +21 -33
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +601 -610
- package/sdk/platform/Lead/LeadPlatformModel.js +457 -471
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +1 -11
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +1 -93
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +22 -143
- package/sdk/platform/Order/OrderPlatformClient.js +160 -1190
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4451 -5275
- package/sdk/platform/Order/OrderPlatformModel.js +4039 -4994
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +21 -257
- package/sdk/platform/Order/OrderPlatformValidator.js +15 -216
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
- package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +13 -119
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +40 -750
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +7 -143
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +6 -133
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +1 -1
- package/sdk/platform/Payment/PaymentPlatformClient.js +1 -1
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2067 -2929
- package/sdk/platform/Payment/PaymentPlatformModel.js +1427 -2090
- package/sdk/platform/PlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/PlatformApplicationClient.js +4 -4
- package/sdk/platform/PlatformClient.d.ts +2 -4
- package/sdk/platform/PlatformClient.js +4 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
- package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +66 -142
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +147 -645
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +63 -131
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +47 -126
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +105 -217
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +349 -1138
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +989 -1588
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +977 -1695
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +133 -382
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +102 -266
- package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
- package/sdk/platform/Share/SharePlatformModel.js +139 -139
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +1 -11
- package/sdk/platform/Theme/ThemePlatformClient.js +3 -87
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +765 -1133
- package/sdk/platform/Theme/ThemePlatformModel.js +561 -1009
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +4 -28
- package/sdk/platform/Theme/ThemePlatformValidator.js +2 -21
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +1 -116
- package/sdk/platform/User/UserPlatformApplicationClient.js +86 -932
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -224
- package/sdk/platform/User/UserPlatformApplicationValidator.js +5 -173
- package/sdk/platform/User/UserPlatformModel.d.ts +428 -765
- package/sdk/platform/User/UserPlatformModel.js +428 -679
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +37 -45
- package/sdk/platform/Webhook/WebhookPlatformClient.js +57 -61
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +403 -448
- package/sdk/platform/Webhook/WebhookPlatformModel.js +309 -369
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +10 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +6 -6
- package/sdk/platform/index.d.ts +1 -1
- package/sdk/platform/index.js +2 -2
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
- package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
- package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
- package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
- package/sdk/public/Partner/PartnerPublicModel.js +113 -113
- package/sdk/public/PublicClient.d.ts +0 -4
- package/sdk/public/PublicClient.js +0 -8
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +0 -33
- package/sdk/public/Webhook/WebhookPublicClient.js +0 -242
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +15 -161
- package/sdk/public/Webhook/WebhookPublicModel.js +13 -189
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +1 -23
- package/sdk/public/Webhook/WebhookPublicValidator.js +0 -31
- package/sdk/public/index.d.ts +0 -2
- package/sdk/public/index.js +0 -4
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -125
- package/sdk/partner/Lead/LeadPartnerClient.js +0 -785
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +0 -1127
- package/sdk/partner/Lead/LeadPartnerModel.js +0 -896
- package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -12
- package/sdk/partner/Lead/LeadPartnerValidator.js +0 -67
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +0 -155
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +0 -1195
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +0 -372
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +0 -442
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +0 -16
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +0 -123
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +0 -99
- package/sdk/partner/Webhook/WebhookPartnerClient.js +0 -753
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +0 -566
- package/sdk/partner/Webhook/WebhookPartnerModel.js +0 -583
- package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +0 -12
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +0 -74
- package/sdk/platform/Content/ContentPlatformClient.d.ts +0 -277
- package/sdk/platform/Content/ContentPlatformClient.js +0 -2011
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +0 -247
- package/sdk/platform/Content/ContentPlatformValidator.js +0 -319
- package/sdk/public/Billing/BillingPublicClient.d.ts +0 -23
- package/sdk/public/Billing/BillingPublicClient.js +0 -116
- package/sdk/public/Billing/BillingPublicModel.d.ts +0 -92
- package/sdk/public/Billing/BillingPublicModel.js +0 -96
- package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -18
- package/sdk/public/Billing/BillingPublicValidator.js +0 -19
- package/sdk/public/Content/ContentPublicClient.d.ts +0 -22
- package/sdk/public/Content/ContentPublicClient.js +0 -114
- package/sdk/public/Content/ContentPublicModel.d.ts +0 -53
- package/sdk/public/Content/ContentPublicModel.js +0 -60
- package/sdk/public/Content/ContentPublicValidator.d.ts +0 -18
- package/sdk/public/Content/ContentPublicValidator.js +0 -19
|
@@ -588,87 +588,6 @@ class Payment {
|
|
|
588
588
|
return response;
|
|
589
589
|
}
|
|
590
590
|
|
|
591
|
-
/**
|
|
592
|
-
* @param {PaymentPlatformApplicationValidator.CreatePaymentOrderParam} arg
|
|
593
|
-
* - Arg object
|
|
594
|
-
*
|
|
595
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
596
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
597
|
-
* @returns {Promise<PaymentPlatformModel.PaymentOrderResponse>} - Success response
|
|
598
|
-
* @name createPaymentOrder
|
|
599
|
-
* @summary: Create Order
|
|
600
|
-
* @description: Use this API to create a order and payment on aggregator side - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/createPaymentOrder/).
|
|
601
|
-
*/
|
|
602
|
-
async createPaymentOrder(
|
|
603
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
604
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
605
|
-
) {
|
|
606
|
-
const {
|
|
607
|
-
error,
|
|
608
|
-
} = PaymentPlatformApplicationValidator.createPaymentOrder().validate(
|
|
609
|
-
{
|
|
610
|
-
body,
|
|
611
|
-
},
|
|
612
|
-
{ abortEarly: false, allowUnknown: true }
|
|
613
|
-
);
|
|
614
|
-
if (error) {
|
|
615
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
// Showing warrnings if extra unknown parameters are found
|
|
619
|
-
const {
|
|
620
|
-
error: warrning,
|
|
621
|
-
} = PaymentPlatformApplicationValidator.createPaymentOrder().validate(
|
|
622
|
-
{
|
|
623
|
-
body,
|
|
624
|
-
},
|
|
625
|
-
{ abortEarly: false, allowUnknown: false }
|
|
626
|
-
);
|
|
627
|
-
if (warrning) {
|
|
628
|
-
Logger({
|
|
629
|
-
level: "WARN",
|
|
630
|
-
message: `Parameter Validation warrnings for platform > Payment > createPaymentOrder \n ${warrning}`,
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
const query_params = {};
|
|
635
|
-
|
|
636
|
-
const response = await PlatformAPIClient.execute(
|
|
637
|
-
this.config,
|
|
638
|
-
"post",
|
|
639
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment-orders/`,
|
|
640
|
-
query_params,
|
|
641
|
-
body,
|
|
642
|
-
requestHeaders,
|
|
643
|
-
{ responseHeaders }
|
|
644
|
-
);
|
|
645
|
-
|
|
646
|
-
let responseData = response;
|
|
647
|
-
if (responseHeaders) {
|
|
648
|
-
responseData = response[0];
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
const {
|
|
652
|
-
error: res_error,
|
|
653
|
-
} = PaymentPlatformModel.PaymentOrderResponse().validate(responseData, {
|
|
654
|
-
abortEarly: false,
|
|
655
|
-
allowUnknown: true,
|
|
656
|
-
});
|
|
657
|
-
|
|
658
|
-
if (res_error) {
|
|
659
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
660
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
661
|
-
} else {
|
|
662
|
-
Logger({
|
|
663
|
-
level: "WARN",
|
|
664
|
-
message: `Response Validation Warnings for platform > Payment > createPaymentOrder \n ${res_error}`,
|
|
665
|
-
});
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
return response;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
591
|
/**
|
|
673
592
|
* @param {PaymentPlatformApplicationValidator.EdcAggregatorsAndModelListParam} arg
|
|
674
593
|
* - Arg object
|
|
@@ -1170,114 +1089,13 @@ class Payment {
|
|
|
1170
1089
|
return response;
|
|
1171
1090
|
}
|
|
1172
1091
|
|
|
1173
|
-
/**
|
|
1174
|
-
* @param {PaymentPlatformApplicationValidator.GetMerchantAggregatorAppVersionParam} arg
|
|
1175
|
-
* - Arg object
|
|
1176
|
-
*
|
|
1177
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1178
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1179
|
-
* @returns {Promise<PaymentPlatformModel.AggregatorVersionResponse>} -
|
|
1180
|
-
* Success response
|
|
1181
|
-
* @name getMerchantAggregatorAppVersion
|
|
1182
|
-
* @summary: Get app version required for Payment Mode.
|
|
1183
|
-
* @description: This api provide read operations on the app version required for Payment Mode or sub payment mode for an Aggregator. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getMerchantAggregatorAppVersion/).
|
|
1184
|
-
*/
|
|
1185
|
-
async getMerchantAggregatorAppVersion(
|
|
1186
|
-
{
|
|
1187
|
-
aggregatorId,
|
|
1188
|
-
businessUnit,
|
|
1189
|
-
device,
|
|
1190
|
-
paymentModeId,
|
|
1191
|
-
subPaymentMode,
|
|
1192
|
-
requestHeaders,
|
|
1193
|
-
} = { requestHeaders: {} },
|
|
1194
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1195
|
-
) {
|
|
1196
|
-
const {
|
|
1197
|
-
error,
|
|
1198
|
-
} = PaymentPlatformApplicationValidator.getMerchantAggregatorAppVersion().validate(
|
|
1199
|
-
{
|
|
1200
|
-
aggregatorId,
|
|
1201
|
-
businessUnit,
|
|
1202
|
-
device,
|
|
1203
|
-
paymentModeId,
|
|
1204
|
-
subPaymentMode,
|
|
1205
|
-
},
|
|
1206
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1207
|
-
);
|
|
1208
|
-
if (error) {
|
|
1209
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1213
|
-
const {
|
|
1214
|
-
error: warrning,
|
|
1215
|
-
} = PaymentPlatformApplicationValidator.getMerchantAggregatorAppVersion().validate(
|
|
1216
|
-
{
|
|
1217
|
-
aggregatorId,
|
|
1218
|
-
businessUnit,
|
|
1219
|
-
device,
|
|
1220
|
-
paymentModeId,
|
|
1221
|
-
subPaymentMode,
|
|
1222
|
-
},
|
|
1223
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1224
|
-
);
|
|
1225
|
-
if (warrning) {
|
|
1226
|
-
Logger({
|
|
1227
|
-
level: "WARN",
|
|
1228
|
-
message: `Parameter Validation warrnings for platform > Payment > getMerchantAggregatorAppVersion \n ${warrning}`,
|
|
1229
|
-
});
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
const query_params = {};
|
|
1233
|
-
query_params["business_unit"] = businessUnit;
|
|
1234
|
-
query_params["device"] = device;
|
|
1235
|
-
query_params["payment_mode_id"] = paymentModeId;
|
|
1236
|
-
query_params["sub_payment_mode"] = subPaymentMode;
|
|
1237
|
-
|
|
1238
|
-
const response = await PlatformAPIClient.execute(
|
|
1239
|
-
this.config,
|
|
1240
|
-
"get",
|
|
1241
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/aggregators/${aggregatorId}/version`,
|
|
1242
|
-
query_params,
|
|
1243
|
-
undefined,
|
|
1244
|
-
requestHeaders,
|
|
1245
|
-
{ responseHeaders }
|
|
1246
|
-
);
|
|
1247
|
-
|
|
1248
|
-
let responseData = response;
|
|
1249
|
-
if (responseHeaders) {
|
|
1250
|
-
responseData = response[0];
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
const {
|
|
1254
|
-
error: res_error,
|
|
1255
|
-
} = PaymentPlatformModel.AggregatorVersionResponse().validate(
|
|
1256
|
-
responseData,
|
|
1257
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1258
|
-
);
|
|
1259
|
-
|
|
1260
|
-
if (res_error) {
|
|
1261
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1262
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1263
|
-
} else {
|
|
1264
|
-
Logger({
|
|
1265
|
-
level: "WARN",
|
|
1266
|
-
message: `Response Validation Warnings for platform > Payment > getMerchantAggregatorAppVersion \n ${res_error}`,
|
|
1267
|
-
});
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
return response;
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
1092
|
/**
|
|
1275
1093
|
* @param {PaymentPlatformApplicationValidator.GetMerchantAggregatorPaymentModeDetailsParam} arg
|
|
1276
1094
|
* - Arg object
|
|
1277
1095
|
*
|
|
1278
1096
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1279
1097
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1280
|
-
* @returns {Promise<PaymentPlatformModel.
|
|
1098
|
+
* @returns {Promise<PaymentPlatformModel.MerchnatPaymentModeResponse>} -
|
|
1281
1099
|
* Success response
|
|
1282
1100
|
* @name getMerchantAggregatorPaymentModeDetails
|
|
1283
1101
|
* @summary: Get Aggregator, payment mode and sub payment mode.
|
|
@@ -1342,7 +1160,7 @@ class Payment {
|
|
|
1342
1160
|
|
|
1343
1161
|
const {
|
|
1344
1162
|
error: res_error,
|
|
1345
|
-
} = PaymentPlatformModel.
|
|
1163
|
+
} = PaymentPlatformModel.MerchnatPaymentModeResponse().validate(
|
|
1346
1164
|
responseData,
|
|
1347
1165
|
{ abortEarly: false, allowUnknown: true }
|
|
1348
1166
|
);
|
|
@@ -1367,7 +1185,7 @@ class Payment {
|
|
|
1367
1185
|
*
|
|
1368
1186
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1369
1187
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1370
|
-
* @returns {Promise<PaymentPlatformModel.
|
|
1188
|
+
* @returns {Promise<PaymentPlatformModel.MerchnatPaymentModeResponse>} -
|
|
1371
1189
|
* Success response
|
|
1372
1190
|
* @name getMerchantPaymentOption
|
|
1373
1191
|
* @summary: Get Payment modes and COD details.
|
|
@@ -1420,7 +1238,7 @@ class Payment {
|
|
|
1420
1238
|
|
|
1421
1239
|
const {
|
|
1422
1240
|
error: res_error,
|
|
1423
|
-
} = PaymentPlatformModel.
|
|
1241
|
+
} = PaymentPlatformModel.MerchnatPaymentModeResponse().validate(
|
|
1424
1242
|
responseData,
|
|
1425
1243
|
{ abortEarly: false, allowUnknown: true }
|
|
1426
1244
|
);
|
|
@@ -1528,7 +1346,7 @@ class Payment {
|
|
|
1528
1346
|
*
|
|
1529
1347
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1530
1348
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1531
|
-
* @returns {Promise<PaymentPlatformModel.
|
|
1349
|
+
* @returns {Promise<PaymentPlatformModel.MerchnatPaymentModeResponse>} -
|
|
1532
1350
|
* Success response
|
|
1533
1351
|
* @name getPGConfigAggregators
|
|
1534
1352
|
* @summary: Get Aggregators available to be added as PG.
|
|
@@ -1581,7 +1399,7 @@ class Payment {
|
|
|
1581
1399
|
|
|
1582
1400
|
const {
|
|
1583
1401
|
error: res_error,
|
|
1584
|
-
} = PaymentPlatformModel.
|
|
1402
|
+
} = PaymentPlatformModel.MerchnatPaymentModeResponse().validate(
|
|
1585
1403
|
responseData,
|
|
1586
1404
|
{ abortEarly: false, allowUnknown: true }
|
|
1587
1405
|
);
|
|
@@ -1724,265 +1542,7 @@ class Payment {
|
|
|
1724
1542
|
const response = await PlatformAPIClient.execute(
|
|
1725
1543
|
this.config,
|
|
1726
1544
|
"get",
|
|
1727
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/create-payment-link/`,
|
|
1728
|
-
query_params,
|
|
1729
|
-
undefined,
|
|
1730
|
-
requestHeaders,
|
|
1731
|
-
{ responseHeaders }
|
|
1732
|
-
);
|
|
1733
|
-
|
|
1734
|
-
let responseData = response;
|
|
1735
|
-
if (responseHeaders) {
|
|
1736
|
-
responseData = response[0];
|
|
1737
|
-
}
|
|
1738
|
-
|
|
1739
|
-
const {
|
|
1740
|
-
error: res_error,
|
|
1741
|
-
} = PaymentPlatformModel.GetPaymentLinkResponse().validate(responseData, {
|
|
1742
|
-
abortEarly: false,
|
|
1743
|
-
allowUnknown: true,
|
|
1744
|
-
});
|
|
1745
|
-
|
|
1746
|
-
if (res_error) {
|
|
1747
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1748
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1749
|
-
} else {
|
|
1750
|
-
Logger({
|
|
1751
|
-
level: "WARN",
|
|
1752
|
-
message: `Response Validation Warnings for platform > Payment > getPaymentLink \n ${res_error}`,
|
|
1753
|
-
});
|
|
1754
|
-
}
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1757
|
-
return response;
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
/**
|
|
1761
|
-
* @param {PaymentPlatformApplicationValidator.GetPaymentModeControlRoutesParam} arg
|
|
1762
|
-
* - Arg object
|
|
1763
|
-
*
|
|
1764
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1765
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1766
|
-
* @returns {Promise<PaymentPlatformModel.PlatformPaymentModeResponse>} -
|
|
1767
|
-
* Success response
|
|
1768
|
-
* @name getPaymentModeControlRoutes
|
|
1769
|
-
* @summary: Get details for the given offline / advance payment mode for merchant
|
|
1770
|
-
* @description: Use this API to get details for the given offline / advance payment mode for merchant - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPaymentModeControlRoutes/).
|
|
1771
|
-
*/
|
|
1772
|
-
async getPaymentModeControlRoutes(
|
|
1773
|
-
{ mode, requestHeaders } = { requestHeaders: {} },
|
|
1774
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1775
|
-
) {
|
|
1776
|
-
const {
|
|
1777
|
-
error,
|
|
1778
|
-
} = PaymentPlatformApplicationValidator.getPaymentModeControlRoutes().validate(
|
|
1779
|
-
{
|
|
1780
|
-
mode,
|
|
1781
|
-
},
|
|
1782
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1783
|
-
);
|
|
1784
|
-
if (error) {
|
|
1785
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1789
|
-
const {
|
|
1790
|
-
error: warrning,
|
|
1791
|
-
} = PaymentPlatformApplicationValidator.getPaymentModeControlRoutes().validate(
|
|
1792
|
-
{
|
|
1793
|
-
mode,
|
|
1794
|
-
},
|
|
1795
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1796
|
-
);
|
|
1797
|
-
if (warrning) {
|
|
1798
|
-
Logger({
|
|
1799
|
-
level: "WARN",
|
|
1800
|
-
message: `Parameter Validation warrnings for platform > Payment > getPaymentModeControlRoutes \n ${warrning}`,
|
|
1801
|
-
});
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
const query_params = {};
|
|
1805
|
-
|
|
1806
|
-
const response = await PlatformAPIClient.execute(
|
|
1807
|
-
this.config,
|
|
1808
|
-
"get",
|
|
1809
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/modes/${mode}`,
|
|
1810
|
-
query_params,
|
|
1811
|
-
undefined,
|
|
1812
|
-
requestHeaders,
|
|
1813
|
-
{ responseHeaders }
|
|
1814
|
-
);
|
|
1815
|
-
|
|
1816
|
-
let responseData = response;
|
|
1817
|
-
if (responseHeaders) {
|
|
1818
|
-
responseData = response[0];
|
|
1819
|
-
}
|
|
1820
|
-
|
|
1821
|
-
const {
|
|
1822
|
-
error: res_error,
|
|
1823
|
-
} = PaymentPlatformModel.PlatformPaymentModeResponse().validate(
|
|
1824
|
-
responseData,
|
|
1825
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1826
|
-
);
|
|
1827
|
-
|
|
1828
|
-
if (res_error) {
|
|
1829
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1830
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1831
|
-
} else {
|
|
1832
|
-
Logger({
|
|
1833
|
-
level: "WARN",
|
|
1834
|
-
message: `Response Validation Warnings for platform > Payment > getPaymentModeControlRoutes \n ${res_error}`,
|
|
1835
|
-
});
|
|
1836
|
-
}
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
return response;
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
/**
|
|
1843
|
-
* @param {PaymentPlatformApplicationValidator.GetPaymentModeCustomConfigParam} arg
|
|
1844
|
-
* - Arg object
|
|
1845
|
-
*
|
|
1846
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1847
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1848
|
-
* @returns {Promise<PaymentPlatformModel.PaymentCustomConfigResponseSchema>}
|
|
1849
|
-
* - Success response
|
|
1850
|
-
*
|
|
1851
|
-
* @name getPaymentModeCustomConfig
|
|
1852
|
-
* @summary: Get details of advance payment custom configurations of merchant
|
|
1853
|
-
* @description: Use this API to Get details of advance payment custom configurations of merchant - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPaymentModeCustomConfig/).
|
|
1854
|
-
*/
|
|
1855
|
-
async getPaymentModeCustomConfig(
|
|
1856
|
-
{ mode, requestHeaders } = { requestHeaders: {} },
|
|
1857
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1858
|
-
) {
|
|
1859
|
-
const {
|
|
1860
|
-
error,
|
|
1861
|
-
} = PaymentPlatformApplicationValidator.getPaymentModeCustomConfig().validate(
|
|
1862
|
-
{
|
|
1863
|
-
mode,
|
|
1864
|
-
},
|
|
1865
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1866
|
-
);
|
|
1867
|
-
if (error) {
|
|
1868
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1872
|
-
const {
|
|
1873
|
-
error: warrning,
|
|
1874
|
-
} = PaymentPlatformApplicationValidator.getPaymentModeCustomConfig().validate(
|
|
1875
|
-
{
|
|
1876
|
-
mode,
|
|
1877
|
-
},
|
|
1878
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1879
|
-
);
|
|
1880
|
-
if (warrning) {
|
|
1881
|
-
Logger({
|
|
1882
|
-
level: "WARN",
|
|
1883
|
-
message: `Parameter Validation warrnings for platform > Payment > getPaymentModeCustomConfig \n ${warrning}`,
|
|
1884
|
-
});
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1887
|
-
const query_params = {};
|
|
1888
|
-
|
|
1889
|
-
const response = await PlatformAPIClient.execute(
|
|
1890
|
-
this.config,
|
|
1891
|
-
"get",
|
|
1892
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/modes/${mode}/custom-config`,
|
|
1893
|
-
query_params,
|
|
1894
|
-
undefined,
|
|
1895
|
-
requestHeaders,
|
|
1896
|
-
{ responseHeaders }
|
|
1897
|
-
);
|
|
1898
|
-
|
|
1899
|
-
let responseData = response;
|
|
1900
|
-
if (responseHeaders) {
|
|
1901
|
-
responseData = response[0];
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
const {
|
|
1905
|
-
error: res_error,
|
|
1906
|
-
} = PaymentPlatformModel.PaymentCustomConfigResponseSchema().validate(
|
|
1907
|
-
responseData,
|
|
1908
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1909
|
-
);
|
|
1910
|
-
|
|
1911
|
-
if (res_error) {
|
|
1912
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1913
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1914
|
-
} else {
|
|
1915
|
-
Logger({
|
|
1916
|
-
level: "WARN",
|
|
1917
|
-
message: `Response Validation Warnings for platform > Payment > getPaymentModeCustomConfig \n ${res_error}`,
|
|
1918
|
-
});
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
|
-
return response;
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
/**
|
|
1926
|
-
* @param {PaymentPlatformApplicationValidator.GetPaymentModeRoutesParam} arg
|
|
1927
|
-
* - Arg object
|
|
1928
|
-
*
|
|
1929
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1930
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1931
|
-
* @returns {Promise<PaymentPlatformModel.PaymentOptionsResponse>} - Success response
|
|
1932
|
-
* @name getPaymentModeRoutes
|
|
1933
|
-
* @summary: Get All Valid Payment Options
|
|
1934
|
-
* @description: Use this API to get Get All Valid Payment Options for making payment - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPaymentModeRoutes/).
|
|
1935
|
-
*/
|
|
1936
|
-
async getPaymentModeRoutes(
|
|
1937
|
-
{ refresh, requestType, orderId, shipmentId, requestHeaders } = {
|
|
1938
|
-
requestHeaders: {},
|
|
1939
|
-
},
|
|
1940
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1941
|
-
) {
|
|
1942
|
-
const {
|
|
1943
|
-
error,
|
|
1944
|
-
} = PaymentPlatformApplicationValidator.getPaymentModeRoutes().validate(
|
|
1945
|
-
{
|
|
1946
|
-
refresh,
|
|
1947
|
-
requestType,
|
|
1948
|
-
orderId,
|
|
1949
|
-
shipmentId,
|
|
1950
|
-
},
|
|
1951
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1952
|
-
);
|
|
1953
|
-
if (error) {
|
|
1954
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1955
|
-
}
|
|
1956
|
-
|
|
1957
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1958
|
-
const {
|
|
1959
|
-
error: warrning,
|
|
1960
|
-
} = PaymentPlatformApplicationValidator.getPaymentModeRoutes().validate(
|
|
1961
|
-
{
|
|
1962
|
-
refresh,
|
|
1963
|
-
requestType,
|
|
1964
|
-
orderId,
|
|
1965
|
-
shipmentId,
|
|
1966
|
-
},
|
|
1967
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1968
|
-
);
|
|
1969
|
-
if (warrning) {
|
|
1970
|
-
Logger({
|
|
1971
|
-
level: "WARN",
|
|
1972
|
-
message: `Parameter Validation warrnings for platform > Payment > getPaymentModeRoutes \n ${warrning}`,
|
|
1973
|
-
});
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
const query_params = {};
|
|
1977
|
-
query_params["refresh"] = refresh;
|
|
1978
|
-
query_params["request_type"] = requestType;
|
|
1979
|
-
query_params["order_id"] = orderId;
|
|
1980
|
-
query_params["shipment_id"] = shipmentId;
|
|
1981
|
-
|
|
1982
|
-
const response = await PlatformAPIClient.execute(
|
|
1983
|
-
this.config,
|
|
1984
|
-
"get",
|
|
1985
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options`,
|
|
1545
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/create-payment-link/`,
|
|
1986
1546
|
query_params,
|
|
1987
1547
|
undefined,
|
|
1988
1548
|
requestHeaders,
|
|
@@ -1996,7 +1556,7 @@ class Payment {
|
|
|
1996
1556
|
|
|
1997
1557
|
const {
|
|
1998
1558
|
error: res_error,
|
|
1999
|
-
} = PaymentPlatformModel.
|
|
1559
|
+
} = PaymentPlatformModel.GetPaymentLinkResponse().validate(responseData, {
|
|
2000
1560
|
abortEarly: false,
|
|
2001
1561
|
allowUnknown: true,
|
|
2002
1562
|
});
|
|
@@ -2007,7 +1567,7 @@ class Payment {
|
|
|
2007
1567
|
} else {
|
|
2008
1568
|
Logger({
|
|
2009
1569
|
level: "WARN",
|
|
2010
|
-
message: `Response Validation Warnings for platform > Payment >
|
|
1570
|
+
message: `Response Validation Warnings for platform > Payment > getPaymentLink \n ${res_error}`,
|
|
2011
1571
|
});
|
|
2012
1572
|
}
|
|
2013
1573
|
}
|
|
@@ -2016,27 +1576,26 @@ class Payment {
|
|
|
2016
1576
|
}
|
|
2017
1577
|
|
|
2018
1578
|
/**
|
|
2019
|
-
* @param {PaymentPlatformApplicationValidator.
|
|
1579
|
+
* @param {PaymentPlatformApplicationValidator.GetPaymentModeRoutesParam} arg
|
|
2020
1580
|
* - Arg object
|
|
2021
1581
|
*
|
|
2022
1582
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2023
1583
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2024
|
-
* @returns {Promise<PaymentPlatformModel.
|
|
2025
|
-
*
|
|
2026
|
-
* @
|
|
2027
|
-
* @
|
|
2028
|
-
* @description: Use this API to fetch the payment session details for given order ID or Transaction ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPaymentSession/).
|
|
1584
|
+
* @returns {Promise<PaymentPlatformModel.PaymentOptionsResponse>} - Success response
|
|
1585
|
+
* @name getPaymentModeRoutes
|
|
1586
|
+
* @summary: Get All Valid Payment Options
|
|
1587
|
+
* @description: Use this API to get Get All Valid Payment Options for making payment - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPaymentModeRoutes/).
|
|
2029
1588
|
*/
|
|
2030
|
-
async
|
|
2031
|
-
{
|
|
1589
|
+
async getPaymentModeRoutes(
|
|
1590
|
+
{ refresh, requestType, requestHeaders } = { requestHeaders: {} },
|
|
2032
1591
|
{ responseHeaders } = { responseHeaders: false }
|
|
2033
1592
|
) {
|
|
2034
1593
|
const {
|
|
2035
1594
|
error,
|
|
2036
|
-
} = PaymentPlatformApplicationValidator.
|
|
1595
|
+
} = PaymentPlatformApplicationValidator.getPaymentModeRoutes().validate(
|
|
2037
1596
|
{
|
|
2038
|
-
|
|
2039
|
-
|
|
1597
|
+
refresh,
|
|
1598
|
+
requestType,
|
|
2040
1599
|
},
|
|
2041
1600
|
{ abortEarly: false, allowUnknown: true }
|
|
2042
1601
|
);
|
|
@@ -2047,27 +1606,28 @@ class Payment {
|
|
|
2047
1606
|
// Showing warrnings if extra unknown parameters are found
|
|
2048
1607
|
const {
|
|
2049
1608
|
error: warrning,
|
|
2050
|
-
} = PaymentPlatformApplicationValidator.
|
|
1609
|
+
} = PaymentPlatformApplicationValidator.getPaymentModeRoutes().validate(
|
|
2051
1610
|
{
|
|
2052
|
-
|
|
2053
|
-
|
|
1611
|
+
refresh,
|
|
1612
|
+
requestType,
|
|
2054
1613
|
},
|
|
2055
1614
|
{ abortEarly: false, allowUnknown: false }
|
|
2056
1615
|
);
|
|
2057
1616
|
if (warrning) {
|
|
2058
1617
|
Logger({
|
|
2059
1618
|
level: "WARN",
|
|
2060
|
-
message: `Parameter Validation warrnings for platform > Payment >
|
|
1619
|
+
message: `Parameter Validation warrnings for platform > Payment > getPaymentModeRoutes \n ${warrning}`,
|
|
2061
1620
|
});
|
|
2062
1621
|
}
|
|
2063
1622
|
|
|
2064
1623
|
const query_params = {};
|
|
2065
|
-
query_params["
|
|
1624
|
+
query_params["refresh"] = refresh;
|
|
1625
|
+
query_params["request_type"] = requestType;
|
|
2066
1626
|
|
|
2067
1627
|
const response = await PlatformAPIClient.execute(
|
|
2068
1628
|
this.config,
|
|
2069
1629
|
"get",
|
|
2070
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/
|
|
1630
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options`,
|
|
2071
1631
|
query_params,
|
|
2072
1632
|
undefined,
|
|
2073
1633
|
requestHeaders,
|
|
@@ -2081,7 +1641,7 @@ class Payment {
|
|
|
2081
1641
|
|
|
2082
1642
|
const {
|
|
2083
1643
|
error: res_error,
|
|
2084
|
-
} = PaymentPlatformModel.
|
|
1644
|
+
} = PaymentPlatformModel.PaymentOptionsResponse().validate(responseData, {
|
|
2085
1645
|
abortEarly: false,
|
|
2086
1646
|
allowUnknown: true,
|
|
2087
1647
|
});
|
|
@@ -2092,7 +1652,7 @@ class Payment {
|
|
|
2092
1652
|
} else {
|
|
2093
1653
|
Logger({
|
|
2094
1654
|
level: "WARN",
|
|
2095
|
-
message: `Response Validation Warnings for platform > Payment >
|
|
1655
|
+
message: `Response Validation Warnings for platform > Payment > getPaymentModeRoutes \n ${res_error}`,
|
|
2096
1656
|
});
|
|
2097
1657
|
}
|
|
2098
1658
|
}
|
|
@@ -2106,8 +1666,7 @@ class Payment {
|
|
|
2106
1666
|
*
|
|
2107
1667
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2108
1668
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2109
|
-
* @returns {Promise<PaymentPlatformModel.
|
|
2110
|
-
* Success response
|
|
1669
|
+
* @returns {Promise<PaymentPlatformModel.PaymentOptionsResponse>} - Success response
|
|
2111
1670
|
* @name getPosPaymentModeRoutes
|
|
2112
1671
|
* @summary: Get All Valid Payment Options
|
|
2113
1672
|
* @description: Use this API to get Get All Valid Payment Options for making payment - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPosPaymentModeRoutes/).
|
|
@@ -2115,17 +1674,13 @@ class Payment {
|
|
|
2115
1674
|
async getPosPaymentModeRoutes(
|
|
2116
1675
|
{
|
|
2117
1676
|
amount,
|
|
2118
|
-
pincode,
|
|
2119
|
-
orderType,
|
|
2120
1677
|
cartId,
|
|
1678
|
+
pincode,
|
|
2121
1679
|
checkoutMode,
|
|
1680
|
+
orderType,
|
|
2122
1681
|
refresh,
|
|
2123
|
-
orderId,
|
|
2124
1682
|
cardReference,
|
|
2125
1683
|
userDetails,
|
|
2126
|
-
displaySplit,
|
|
2127
|
-
advancePayment,
|
|
2128
|
-
shipmentId,
|
|
2129
1684
|
requestHeaders,
|
|
2130
1685
|
} = { requestHeaders: {} },
|
|
2131
1686
|
{ responseHeaders } = { responseHeaders: false }
|
|
@@ -2135,17 +1690,13 @@ class Payment {
|
|
|
2135
1690
|
} = PaymentPlatformApplicationValidator.getPosPaymentModeRoutes().validate(
|
|
2136
1691
|
{
|
|
2137
1692
|
amount,
|
|
2138
|
-
pincode,
|
|
2139
|
-
orderType,
|
|
2140
1693
|
cartId,
|
|
1694
|
+
pincode,
|
|
2141
1695
|
checkoutMode,
|
|
1696
|
+
orderType,
|
|
2142
1697
|
refresh,
|
|
2143
|
-
orderId,
|
|
2144
1698
|
cardReference,
|
|
2145
1699
|
userDetails,
|
|
2146
|
-
displaySplit,
|
|
2147
|
-
advancePayment,
|
|
2148
|
-
shipmentId,
|
|
2149
1700
|
},
|
|
2150
1701
|
{ abortEarly: false, allowUnknown: true }
|
|
2151
1702
|
);
|
|
@@ -2159,17 +1710,13 @@ class Payment {
|
|
|
2159
1710
|
} = PaymentPlatformApplicationValidator.getPosPaymentModeRoutes().validate(
|
|
2160
1711
|
{
|
|
2161
1712
|
amount,
|
|
2162
|
-
pincode,
|
|
2163
|
-
orderType,
|
|
2164
1713
|
cartId,
|
|
1714
|
+
pincode,
|
|
2165
1715
|
checkoutMode,
|
|
1716
|
+
orderType,
|
|
2166
1717
|
refresh,
|
|
2167
|
-
orderId,
|
|
2168
1718
|
cardReference,
|
|
2169
1719
|
userDetails,
|
|
2170
|
-
displaySplit,
|
|
2171
|
-
advancePayment,
|
|
2172
|
-
shipmentId,
|
|
2173
1720
|
},
|
|
2174
1721
|
{ abortEarly: false, allowUnknown: false }
|
|
2175
1722
|
);
|
|
@@ -2186,13 +1733,9 @@ class Payment {
|
|
|
2186
1733
|
query_params["pincode"] = pincode;
|
|
2187
1734
|
query_params["checkout_mode"] = checkoutMode;
|
|
2188
1735
|
query_params["refresh"] = refresh;
|
|
2189
|
-
query_params["order_id"] = orderId;
|
|
2190
1736
|
query_params["card_reference"] = cardReference;
|
|
2191
1737
|
query_params["order_type"] = orderType;
|
|
2192
1738
|
query_params["user_details"] = userDetails;
|
|
2193
|
-
query_params["display_split"] = displaySplit;
|
|
2194
|
-
query_params["advance_payment"] = advancePayment;
|
|
2195
|
-
query_params["shipment_id"] = shipmentId;
|
|
2196
1739
|
|
|
2197
1740
|
const response = await PlatformAPIClient.execute(
|
|
2198
1741
|
this.config,
|
|
@@ -2211,7 +1754,7 @@ class Payment {
|
|
|
2211
1754
|
|
|
2212
1755
|
const {
|
|
2213
1756
|
error: res_error,
|
|
2214
|
-
} = PaymentPlatformModel.
|
|
1757
|
+
} = PaymentPlatformModel.PaymentOptionsResponse().validate(responseData, {
|
|
2215
1758
|
abortEarly: false,
|
|
2216
1759
|
allowUnknown: true,
|
|
2217
1760
|
});
|
|
@@ -2730,7 +2273,7 @@ class Payment {
|
|
|
2730
2273
|
*
|
|
2731
2274
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2732
2275
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2733
|
-
* @returns {Promise<PaymentPlatformModel.
|
|
2276
|
+
* @returns {Promise<PaymentPlatformModel.MerchnatPaymentModeResponse>} -
|
|
2734
2277
|
* Success response
|
|
2735
2278
|
* @name patchMerchantAggregatorPaymentModeDetails
|
|
2736
2279
|
* @summary: Update Aggregator, payment mode and sub payment mode.
|
|
@@ -2789,7 +2332,7 @@ class Payment {
|
|
|
2789
2332
|
|
|
2790
2333
|
const {
|
|
2791
2334
|
error: res_error,
|
|
2792
|
-
} = PaymentPlatformModel.
|
|
2335
|
+
} = PaymentPlatformModel.MerchnatPaymentModeResponse().validate(
|
|
2793
2336
|
responseData,
|
|
2794
2337
|
{ abortEarly: false, allowUnknown: true }
|
|
2795
2338
|
);
|
|
@@ -2814,7 +2357,7 @@ class Payment {
|
|
|
2814
2357
|
*
|
|
2815
2358
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2816
2359
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2817
|
-
* @returns {Promise<PaymentPlatformModel.
|
|
2360
|
+
* @returns {Promise<PaymentPlatformModel.MerchnatPaymentModeResponse>} -
|
|
2818
2361
|
* Success response
|
|
2819
2362
|
* @name patchMerchantPaymentOption
|
|
2820
2363
|
* @summary: Update Payment modes and COD details.
|
|
@@ -2871,7 +2414,7 @@ class Payment {
|
|
|
2871
2414
|
|
|
2872
2415
|
const {
|
|
2873
2416
|
error: res_error,
|
|
2874
|
-
} = PaymentPlatformModel.
|
|
2417
|
+
} = PaymentPlatformModel.MerchnatPaymentModeResponse().validate(
|
|
2875
2418
|
responseData,
|
|
2876
2419
|
{ abortEarly: false, allowUnknown: true }
|
|
2877
2420
|
);
|
|
@@ -2890,90 +2433,6 @@ class Payment {
|
|
|
2890
2433
|
return response;
|
|
2891
2434
|
}
|
|
2892
2435
|
|
|
2893
|
-
/**
|
|
2894
|
-
* @param {PaymentPlatformApplicationValidator.PatchMerchantPaymentOptionVersionParam} arg
|
|
2895
|
-
* - Arg object
|
|
2896
|
-
*
|
|
2897
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2898
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2899
|
-
* @returns {Promise<PaymentPlatformModel.PlatformPaymentModeResponse>} -
|
|
2900
|
-
* Success response
|
|
2901
|
-
* @name patchMerchantPaymentOptionVersion
|
|
2902
|
-
* @summary: Update app version required for Payment Mode.
|
|
2903
|
-
* @description: This api provide wrote operations on the app version required for Payment Mode or sub payment mode for an Aggregator. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/patchMerchantPaymentOptionVersion/).
|
|
2904
|
-
*/
|
|
2905
|
-
async patchMerchantPaymentOptionVersion(
|
|
2906
|
-
{ aggregatorId, body, requestHeaders } = { requestHeaders: {} },
|
|
2907
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
2908
|
-
) {
|
|
2909
|
-
const {
|
|
2910
|
-
error,
|
|
2911
|
-
} = PaymentPlatformApplicationValidator.patchMerchantPaymentOptionVersion().validate(
|
|
2912
|
-
{
|
|
2913
|
-
aggregatorId,
|
|
2914
|
-
body,
|
|
2915
|
-
},
|
|
2916
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2917
|
-
);
|
|
2918
|
-
if (error) {
|
|
2919
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2920
|
-
}
|
|
2921
|
-
|
|
2922
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2923
|
-
const {
|
|
2924
|
-
error: warrning,
|
|
2925
|
-
} = PaymentPlatformApplicationValidator.patchMerchantPaymentOptionVersion().validate(
|
|
2926
|
-
{
|
|
2927
|
-
aggregatorId,
|
|
2928
|
-
body,
|
|
2929
|
-
},
|
|
2930
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2931
|
-
);
|
|
2932
|
-
if (warrning) {
|
|
2933
|
-
Logger({
|
|
2934
|
-
level: "WARN",
|
|
2935
|
-
message: `Parameter Validation warrnings for platform > Payment > patchMerchantPaymentOptionVersion \n ${warrning}`,
|
|
2936
|
-
});
|
|
2937
|
-
}
|
|
2938
|
-
|
|
2939
|
-
const query_params = {};
|
|
2940
|
-
|
|
2941
|
-
const response = await PlatformAPIClient.execute(
|
|
2942
|
-
this.config,
|
|
2943
|
-
"patch",
|
|
2944
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/aggregators/${aggregatorId}/version`,
|
|
2945
|
-
query_params,
|
|
2946
|
-
body,
|
|
2947
|
-
requestHeaders,
|
|
2948
|
-
{ responseHeaders }
|
|
2949
|
-
);
|
|
2950
|
-
|
|
2951
|
-
let responseData = response;
|
|
2952
|
-
if (responseHeaders) {
|
|
2953
|
-
responseData = response[0];
|
|
2954
|
-
}
|
|
2955
|
-
|
|
2956
|
-
const {
|
|
2957
|
-
error: res_error,
|
|
2958
|
-
} = PaymentPlatformModel.PlatformPaymentModeResponse().validate(
|
|
2959
|
-
responseData,
|
|
2960
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2961
|
-
);
|
|
2962
|
-
|
|
2963
|
-
if (res_error) {
|
|
2964
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
2965
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2966
|
-
} else {
|
|
2967
|
-
Logger({
|
|
2968
|
-
level: "WARN",
|
|
2969
|
-
message: `Response Validation Warnings for platform > Payment > patchMerchantPaymentOptionVersion \n ${res_error}`,
|
|
2970
|
-
});
|
|
2971
|
-
}
|
|
2972
|
-
}
|
|
2973
|
-
|
|
2974
|
-
return response;
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
2436
|
/**
|
|
2978
2437
|
* @param {PaymentPlatformApplicationValidator.PaymentStatusBulkParam} arg
|
|
2979
2438
|
* - Arg object
|
|
@@ -3544,175 +3003,6 @@ class Payment {
|
|
|
3544
3003
|
return response;
|
|
3545
3004
|
}
|
|
3546
3005
|
|
|
3547
|
-
/**
|
|
3548
|
-
* @param {PaymentPlatformApplicationValidator.SetMerchantModeControlRoutesParam} arg
|
|
3549
|
-
* - Arg object
|
|
3550
|
-
*
|
|
3551
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3552
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3553
|
-
* @returns {Promise<PaymentPlatformModel.PlatformPaymentModeResponse>} -
|
|
3554
|
-
* Success response
|
|
3555
|
-
* @name setMerchantModeControlRoutes
|
|
3556
|
-
* @summary: Update offline payment mode details for the merchant
|
|
3557
|
-
* @description: Use this API to update given offline / advance payment mode details for the merchant - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/setMerchantModeControlRoutes/).
|
|
3558
|
-
*/
|
|
3559
|
-
async setMerchantModeControlRoutes(
|
|
3560
|
-
{ mode, body, requestHeaders } = { requestHeaders: {} },
|
|
3561
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
3562
|
-
) {
|
|
3563
|
-
const {
|
|
3564
|
-
error,
|
|
3565
|
-
} = PaymentPlatformApplicationValidator.setMerchantModeControlRoutes().validate(
|
|
3566
|
-
{
|
|
3567
|
-
mode,
|
|
3568
|
-
body,
|
|
3569
|
-
},
|
|
3570
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3571
|
-
);
|
|
3572
|
-
if (error) {
|
|
3573
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3574
|
-
}
|
|
3575
|
-
|
|
3576
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3577
|
-
const {
|
|
3578
|
-
error: warrning,
|
|
3579
|
-
} = PaymentPlatformApplicationValidator.setMerchantModeControlRoutes().validate(
|
|
3580
|
-
{
|
|
3581
|
-
mode,
|
|
3582
|
-
body,
|
|
3583
|
-
},
|
|
3584
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3585
|
-
);
|
|
3586
|
-
if (warrning) {
|
|
3587
|
-
Logger({
|
|
3588
|
-
level: "WARN",
|
|
3589
|
-
message: `Parameter Validation warrnings for platform > Payment > setMerchantModeControlRoutes \n ${warrning}`,
|
|
3590
|
-
});
|
|
3591
|
-
}
|
|
3592
|
-
|
|
3593
|
-
const query_params = {};
|
|
3594
|
-
|
|
3595
|
-
const response = await PlatformAPIClient.execute(
|
|
3596
|
-
this.config,
|
|
3597
|
-
"patch",
|
|
3598
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/modes/${mode}`,
|
|
3599
|
-
query_params,
|
|
3600
|
-
body,
|
|
3601
|
-
requestHeaders,
|
|
3602
|
-
{ responseHeaders }
|
|
3603
|
-
);
|
|
3604
|
-
|
|
3605
|
-
let responseData = response;
|
|
3606
|
-
if (responseHeaders) {
|
|
3607
|
-
responseData = response[0];
|
|
3608
|
-
}
|
|
3609
|
-
|
|
3610
|
-
const {
|
|
3611
|
-
error: res_error,
|
|
3612
|
-
} = PaymentPlatformModel.PlatformPaymentModeResponse().validate(
|
|
3613
|
-
responseData,
|
|
3614
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3615
|
-
);
|
|
3616
|
-
|
|
3617
|
-
if (res_error) {
|
|
3618
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
3619
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3620
|
-
} else {
|
|
3621
|
-
Logger({
|
|
3622
|
-
level: "WARN",
|
|
3623
|
-
message: `Response Validation Warnings for platform > Payment > setMerchantModeControlRoutes \n ${res_error}`,
|
|
3624
|
-
});
|
|
3625
|
-
}
|
|
3626
|
-
}
|
|
3627
|
-
|
|
3628
|
-
return response;
|
|
3629
|
-
}
|
|
3630
|
-
|
|
3631
|
-
/**
|
|
3632
|
-
* @param {PaymentPlatformApplicationValidator.SetPaymentModeCustomConfigParam} arg
|
|
3633
|
-
* - Arg object
|
|
3634
|
-
*
|
|
3635
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3636
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3637
|
-
* @returns {Promise<PaymentPlatformModel.PaymentCustomConfigResponseSchema>}
|
|
3638
|
-
* - Success response
|
|
3639
|
-
*
|
|
3640
|
-
* @name setPaymentModeCustomConfig
|
|
3641
|
-
* @summary: Update details of advance payment custom configurations of merchant
|
|
3642
|
-
* @description: Use this API to update given details of advance payment custom configurations of merchant - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/setPaymentModeCustomConfig/).
|
|
3643
|
-
*/
|
|
3644
|
-
async setPaymentModeCustomConfig(
|
|
3645
|
-
{ mode, body, requestHeaders } = { requestHeaders: {} },
|
|
3646
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
3647
|
-
) {
|
|
3648
|
-
const {
|
|
3649
|
-
error,
|
|
3650
|
-
} = PaymentPlatformApplicationValidator.setPaymentModeCustomConfig().validate(
|
|
3651
|
-
{
|
|
3652
|
-
mode,
|
|
3653
|
-
body,
|
|
3654
|
-
},
|
|
3655
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3656
|
-
);
|
|
3657
|
-
if (error) {
|
|
3658
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3659
|
-
}
|
|
3660
|
-
|
|
3661
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3662
|
-
const {
|
|
3663
|
-
error: warrning,
|
|
3664
|
-
} = PaymentPlatformApplicationValidator.setPaymentModeCustomConfig().validate(
|
|
3665
|
-
{
|
|
3666
|
-
mode,
|
|
3667
|
-
body,
|
|
3668
|
-
},
|
|
3669
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3670
|
-
);
|
|
3671
|
-
if (warrning) {
|
|
3672
|
-
Logger({
|
|
3673
|
-
level: "WARN",
|
|
3674
|
-
message: `Parameter Validation warrnings for platform > Payment > setPaymentModeCustomConfig \n ${warrning}`,
|
|
3675
|
-
});
|
|
3676
|
-
}
|
|
3677
|
-
|
|
3678
|
-
const query_params = {};
|
|
3679
|
-
|
|
3680
|
-
const response = await PlatformAPIClient.execute(
|
|
3681
|
-
this.config,
|
|
3682
|
-
"patch",
|
|
3683
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/modes/${mode}/custom-config`,
|
|
3684
|
-
query_params,
|
|
3685
|
-
body,
|
|
3686
|
-
requestHeaders,
|
|
3687
|
-
{ responseHeaders }
|
|
3688
|
-
);
|
|
3689
|
-
|
|
3690
|
-
let responseData = response;
|
|
3691
|
-
if (responseHeaders) {
|
|
3692
|
-
responseData = response[0];
|
|
3693
|
-
}
|
|
3694
|
-
|
|
3695
|
-
const {
|
|
3696
|
-
error: res_error,
|
|
3697
|
-
} = PaymentPlatformModel.PaymentCustomConfigResponseSchema().validate(
|
|
3698
|
-
responseData,
|
|
3699
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3700
|
-
);
|
|
3701
|
-
|
|
3702
|
-
if (res_error) {
|
|
3703
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
3704
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3705
|
-
} else {
|
|
3706
|
-
Logger({
|
|
3707
|
-
level: "WARN",
|
|
3708
|
-
message: `Response Validation Warnings for platform > Payment > setPaymentModeCustomConfig \n ${res_error}`,
|
|
3709
|
-
});
|
|
3710
|
-
}
|
|
3711
|
-
}
|
|
3712
|
-
|
|
3713
|
-
return response;
|
|
3714
|
-
}
|
|
3715
|
-
|
|
3716
3006
|
/**
|
|
3717
3007
|
* @param {PaymentPlatformApplicationValidator.SetUserCODlimitRoutesParam} arg
|
|
3718
3008
|
* - Arg object
|