@gofynd/fdk-client-javascript 3.4.1 → 3.4.3
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 +23 -26
- package/package.json +1 -1
- package/sdk/application/ApplicationClient.d.ts +3 -2
- package/sdk/application/ApplicationClient.js +25 -19
- package/sdk/common/utils.js +6 -3
- package/sdk/partner/PartnerClient.d.ts +5 -2
- package/sdk/partner/PartnerClient.js +21 -7
- package/sdk/platform/Cart/CartPlatformModel.d.ts +2 -81
- package/sdk/platform/Cart/CartPlatformModel.js +2 -239
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +39 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +256 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +59 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +45 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +31 -3
- package/sdk/platform/Catalog/CatalogPlatformModel.js +29 -2
- package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -0
- package/sdk/platform/Order/OrderPlatformModel.js +3 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +0 -64
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +0 -487
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -68
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +3 -76
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +1 -420
- package/sdk/platform/Payment/PaymentPlatformModel.js +0 -494
- package/sdk/platform/PlatformClient.d.ts +5 -2
- package/sdk/platform/PlatformClient.js +32 -18
- package/sdk/public/PublicClient.d.ts +3 -2
- package/sdk/public/PublicClient.js +13 -7
|
@@ -15,87 +15,6 @@ class Payment {
|
|
|
15
15
|
this.applicationId = applicationId;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* @param {PaymentPlatformApplicationValidator.AddEdcDeviceParam} arg - Arg object
|
|
20
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
21
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
22
|
-
* @returns {Promise<PaymentPlatformModel.EdcDeviceUpdateDetails>} - Success response
|
|
23
|
-
* @name addEdcDevice
|
|
24
|
-
* @summary: Create an EDC device
|
|
25
|
-
* @description: Registration and addition of a new EDC device to the system - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/payment/addEdcDevice/).
|
|
26
|
-
*/
|
|
27
|
-
async addEdcDevice(
|
|
28
|
-
{ terminalUniqueIdentifier, body, requestHeaders } = { requestHeaders: {} },
|
|
29
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
30
|
-
) {
|
|
31
|
-
const {
|
|
32
|
-
error,
|
|
33
|
-
} = PaymentPlatformApplicationValidator.addEdcDevice().validate(
|
|
34
|
-
{
|
|
35
|
-
terminalUniqueIdentifier,
|
|
36
|
-
body,
|
|
37
|
-
},
|
|
38
|
-
{ abortEarly: false, allowUnknown: true }
|
|
39
|
-
);
|
|
40
|
-
if (error) {
|
|
41
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Showing warrnings if extra unknown parameters are found
|
|
45
|
-
const {
|
|
46
|
-
error: warrning,
|
|
47
|
-
} = PaymentPlatformApplicationValidator.addEdcDevice().validate(
|
|
48
|
-
{
|
|
49
|
-
terminalUniqueIdentifier,
|
|
50
|
-
body,
|
|
51
|
-
},
|
|
52
|
-
{ abortEarly: false, allowUnknown: false }
|
|
53
|
-
);
|
|
54
|
-
if (warrning) {
|
|
55
|
-
Logger({
|
|
56
|
-
level: "WARN",
|
|
57
|
-
message: `Parameter Validation warrnings for platform > Payment > addEdcDevice \n ${warrning}`,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const query_params = {};
|
|
62
|
-
|
|
63
|
-
const response = await PlatformAPIClient.execute(
|
|
64
|
-
this.config,
|
|
65
|
-
"put",
|
|
66
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device/${terminalUniqueIdentifier}`,
|
|
67
|
-
query_params,
|
|
68
|
-
body,
|
|
69
|
-
requestHeaders,
|
|
70
|
-
{ responseHeaders }
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
let responseData = response;
|
|
74
|
-
if (responseHeaders) {
|
|
75
|
-
responseData = response[0];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const {
|
|
79
|
-
error: res_error,
|
|
80
|
-
} = PaymentPlatformModel.EdcDeviceUpdateDetails().validate(responseData, {
|
|
81
|
-
abortEarly: false,
|
|
82
|
-
allowUnknown: true,
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
if (res_error) {
|
|
86
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
87
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
88
|
-
} else {
|
|
89
|
-
Logger({
|
|
90
|
-
level: "WARN",
|
|
91
|
-
message: `Response Validation Warnings for platform > Payment > addEdcDevice \n ${res_error}`,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return response;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
18
|
/**
|
|
100
19
|
* @param {PaymentPlatformApplicationValidator.AddRefundBankAccountUsingOTPParam} arg
|
|
101
20
|
* - Arg object
|
|
@@ -667,254 +586,6 @@ class Payment {
|
|
|
667
586
|
return response;
|
|
668
587
|
}
|
|
669
588
|
|
|
670
|
-
/**
|
|
671
|
-
* @param {PaymentPlatformApplicationValidator.EdcAggregatorsAndModelListParam} arg
|
|
672
|
-
* - Arg object
|
|
673
|
-
*
|
|
674
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
675
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
676
|
-
* @returns {Promise<PaymentPlatformModel.EdcAggregatorAndModelListDetails>}
|
|
677
|
-
* - Success response
|
|
678
|
-
*
|
|
679
|
-
* @name edcAggregatorsAndModelList
|
|
680
|
-
* @summary: EDC aggregators and model list
|
|
681
|
-
* @description: Retrieve a list of EDC (Electronic Data Capture) aggregators and models. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/payment/edcAggregatorsAndModelList/).
|
|
682
|
-
*/
|
|
683
|
-
async edcAggregatorsAndModelList(
|
|
684
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
685
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
686
|
-
) {
|
|
687
|
-
const {
|
|
688
|
-
error,
|
|
689
|
-
} = PaymentPlatformApplicationValidator.edcAggregatorsAndModelList().validate(
|
|
690
|
-
{},
|
|
691
|
-
{ abortEarly: false, allowUnknown: true }
|
|
692
|
-
);
|
|
693
|
-
if (error) {
|
|
694
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
// Showing warrnings if extra unknown parameters are found
|
|
698
|
-
const {
|
|
699
|
-
error: warrning,
|
|
700
|
-
} = PaymentPlatformApplicationValidator.edcAggregatorsAndModelList().validate(
|
|
701
|
-
{},
|
|
702
|
-
{ abortEarly: false, allowUnknown: false }
|
|
703
|
-
);
|
|
704
|
-
if (warrning) {
|
|
705
|
-
Logger({
|
|
706
|
-
level: "WARN",
|
|
707
|
-
message: `Parameter Validation warrnings for platform > Payment > edcAggregatorsAndModelList \n ${warrning}`,
|
|
708
|
-
});
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
const query_params = {};
|
|
712
|
-
|
|
713
|
-
const response = await PlatformAPIClient.execute(
|
|
714
|
-
this.config,
|
|
715
|
-
"get",
|
|
716
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-aggregator-list`,
|
|
717
|
-
query_params,
|
|
718
|
-
undefined,
|
|
719
|
-
requestHeaders,
|
|
720
|
-
{ responseHeaders }
|
|
721
|
-
);
|
|
722
|
-
|
|
723
|
-
let responseData = response;
|
|
724
|
-
if (responseHeaders) {
|
|
725
|
-
responseData = response[0];
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
const {
|
|
729
|
-
error: res_error,
|
|
730
|
-
} = PaymentPlatformModel.EdcAggregatorAndModelListDetails().validate(
|
|
731
|
-
responseData,
|
|
732
|
-
{ abortEarly: false, allowUnknown: true }
|
|
733
|
-
);
|
|
734
|
-
|
|
735
|
-
if (res_error) {
|
|
736
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
737
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
738
|
-
} else {
|
|
739
|
-
Logger({
|
|
740
|
-
level: "WARN",
|
|
741
|
-
message: `Response Validation Warnings for platform > Payment > edcAggregatorsAndModelList \n ${res_error}`,
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
return response;
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
/**
|
|
750
|
-
* @param {PaymentPlatformApplicationValidator.EdcDeviceListParam} arg - Arg object
|
|
751
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
752
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
753
|
-
* @returns {Promise<PaymentPlatformModel.EdcDeviceListDetails>} - Success response
|
|
754
|
-
* @name edcDeviceList
|
|
755
|
-
* @summary: List EDC devices
|
|
756
|
-
* @description: Retrieves a list of available Electronic Data Capture (EDC) devices. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/payment/edcDeviceList/).
|
|
757
|
-
*/
|
|
758
|
-
async edcDeviceList(
|
|
759
|
-
{ pageNo, pageSize, isActive, storeId, deviceTag, requestHeaders } = {
|
|
760
|
-
requestHeaders: {},
|
|
761
|
-
},
|
|
762
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
763
|
-
) {
|
|
764
|
-
const {
|
|
765
|
-
error,
|
|
766
|
-
} = PaymentPlatformApplicationValidator.edcDeviceList().validate(
|
|
767
|
-
{
|
|
768
|
-
pageNo,
|
|
769
|
-
pageSize,
|
|
770
|
-
isActive,
|
|
771
|
-
storeId,
|
|
772
|
-
deviceTag,
|
|
773
|
-
},
|
|
774
|
-
{ abortEarly: false, allowUnknown: true }
|
|
775
|
-
);
|
|
776
|
-
if (error) {
|
|
777
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
// Showing warrnings if extra unknown parameters are found
|
|
781
|
-
const {
|
|
782
|
-
error: warrning,
|
|
783
|
-
} = PaymentPlatformApplicationValidator.edcDeviceList().validate(
|
|
784
|
-
{
|
|
785
|
-
pageNo,
|
|
786
|
-
pageSize,
|
|
787
|
-
isActive,
|
|
788
|
-
storeId,
|
|
789
|
-
deviceTag,
|
|
790
|
-
},
|
|
791
|
-
{ abortEarly: false, allowUnknown: false }
|
|
792
|
-
);
|
|
793
|
-
if (warrning) {
|
|
794
|
-
Logger({
|
|
795
|
-
level: "WARN",
|
|
796
|
-
message: `Parameter Validation warrnings for platform > Payment > edcDeviceList \n ${warrning}`,
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
const query_params = {};
|
|
801
|
-
query_params["page_no"] = pageNo;
|
|
802
|
-
query_params["page_size"] = pageSize;
|
|
803
|
-
query_params["is_active"] = isActive;
|
|
804
|
-
query_params["store_id"] = storeId;
|
|
805
|
-
query_params["device_tag"] = deviceTag;
|
|
806
|
-
|
|
807
|
-
const response = await PlatformAPIClient.execute(
|
|
808
|
-
this.config,
|
|
809
|
-
"get",
|
|
810
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device-list`,
|
|
811
|
-
query_params,
|
|
812
|
-
undefined,
|
|
813
|
-
requestHeaders,
|
|
814
|
-
{ responseHeaders }
|
|
815
|
-
);
|
|
816
|
-
|
|
817
|
-
let responseData = response;
|
|
818
|
-
if (responseHeaders) {
|
|
819
|
-
responseData = response[0];
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
const {
|
|
823
|
-
error: res_error,
|
|
824
|
-
} = PaymentPlatformModel.EdcDeviceListDetails().validate(responseData, {
|
|
825
|
-
abortEarly: false,
|
|
826
|
-
allowUnknown: true,
|
|
827
|
-
});
|
|
828
|
-
|
|
829
|
-
if (res_error) {
|
|
830
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
831
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
832
|
-
} else {
|
|
833
|
-
Logger({
|
|
834
|
-
level: "WARN",
|
|
835
|
-
message: `Response Validation Warnings for platform > Payment > edcDeviceList \n ${res_error}`,
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
return response;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
/**
|
|
844
|
-
* @param {PaymentPlatformApplicationValidator.EdcDeviceStatsParam} arg - Arg object
|
|
845
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
846
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
847
|
-
* @returns {Promise<PaymentPlatformModel.EdcDeviceStatsDetails>} - Success response
|
|
848
|
-
* @name edcDeviceStats
|
|
849
|
-
* @summary: EDC device stats
|
|
850
|
-
* @description: Information about EDC (Electronic Data Capture) devices linked to a specific application within a company. It provides statistics such as the count of active and inactive devices. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/payment/edcDeviceStats/).
|
|
851
|
-
*/
|
|
852
|
-
async edcDeviceStats(
|
|
853
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
854
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
855
|
-
) {
|
|
856
|
-
const {
|
|
857
|
-
error,
|
|
858
|
-
} = PaymentPlatformApplicationValidator.edcDeviceStats().validate(
|
|
859
|
-
{},
|
|
860
|
-
{ abortEarly: false, allowUnknown: true }
|
|
861
|
-
);
|
|
862
|
-
if (error) {
|
|
863
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
// Showing warrnings if extra unknown parameters are found
|
|
867
|
-
const {
|
|
868
|
-
error: warrning,
|
|
869
|
-
} = PaymentPlatformApplicationValidator.edcDeviceStats().validate(
|
|
870
|
-
{},
|
|
871
|
-
{ abortEarly: false, allowUnknown: false }
|
|
872
|
-
);
|
|
873
|
-
if (warrning) {
|
|
874
|
-
Logger({
|
|
875
|
-
level: "WARN",
|
|
876
|
-
message: `Parameter Validation warrnings for platform > Payment > edcDeviceStats \n ${warrning}`,
|
|
877
|
-
});
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
const query_params = {};
|
|
881
|
-
|
|
882
|
-
const response = await PlatformAPIClient.execute(
|
|
883
|
-
this.config,
|
|
884
|
-
"get",
|
|
885
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device-stats`,
|
|
886
|
-
query_params,
|
|
887
|
-
undefined,
|
|
888
|
-
requestHeaders,
|
|
889
|
-
{ responseHeaders }
|
|
890
|
-
);
|
|
891
|
-
|
|
892
|
-
let responseData = response;
|
|
893
|
-
if (responseHeaders) {
|
|
894
|
-
responseData = response[0];
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
const {
|
|
898
|
-
error: res_error,
|
|
899
|
-
} = PaymentPlatformModel.EdcDeviceStatsDetails().validate(responseData, {
|
|
900
|
-
abortEarly: false,
|
|
901
|
-
allowUnknown: true,
|
|
902
|
-
});
|
|
903
|
-
|
|
904
|
-
if (res_error) {
|
|
905
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
906
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
907
|
-
} else {
|
|
908
|
-
Logger({
|
|
909
|
-
level: "WARN",
|
|
910
|
-
message: `Response Validation Warnings for platform > Payment > edcDeviceStats \n ${res_error}`,
|
|
911
|
-
});
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
return response;
|
|
916
|
-
}
|
|
917
|
-
|
|
918
589
|
/**
|
|
919
590
|
* @param {PaymentPlatformApplicationValidator.GetBankAccountDetailsOpenAPIParam} arg
|
|
920
591
|
* - Arg object
|
|
@@ -1088,85 +759,6 @@ class Payment {
|
|
|
1088
759
|
return response;
|
|
1089
760
|
}
|
|
1090
761
|
|
|
1091
|
-
/**
|
|
1092
|
-
* @param {PaymentPlatformApplicationValidator.GetEdcDeviceParam} arg - Arg object
|
|
1093
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1094
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1095
|
-
* @returns {Promise<PaymentPlatformModel.EdcDeviceDetails>} - Success response
|
|
1096
|
-
* @name getEdcDevice
|
|
1097
|
-
* @summary: Get an EDC device
|
|
1098
|
-
* @description: Retrieve comprehensive details regarding an Electronic Data Capture (EDC) device associated with a particular terminal unique identifier within a company's application.Upon success, it returns the detailed information of the EDC device, including terminal serial number, EDC device serial number, merchant store POS code, store ID, aggregator ID and name, device tag, activation status, and EDC model. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/payment/getEdcDevice/).
|
|
1099
|
-
*/
|
|
1100
|
-
async getEdcDevice(
|
|
1101
|
-
{ terminalUniqueIdentifier, requestHeaders } = { requestHeaders: {} },
|
|
1102
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1103
|
-
) {
|
|
1104
|
-
const {
|
|
1105
|
-
error,
|
|
1106
|
-
} = PaymentPlatformApplicationValidator.getEdcDevice().validate(
|
|
1107
|
-
{
|
|
1108
|
-
terminalUniqueIdentifier,
|
|
1109
|
-
},
|
|
1110
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1111
|
-
);
|
|
1112
|
-
if (error) {
|
|
1113
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1117
|
-
const {
|
|
1118
|
-
error: warrning,
|
|
1119
|
-
} = PaymentPlatformApplicationValidator.getEdcDevice().validate(
|
|
1120
|
-
{
|
|
1121
|
-
terminalUniqueIdentifier,
|
|
1122
|
-
},
|
|
1123
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1124
|
-
);
|
|
1125
|
-
if (warrning) {
|
|
1126
|
-
Logger({
|
|
1127
|
-
level: "WARN",
|
|
1128
|
-
message: `Parameter Validation warrnings for platform > Payment > getEdcDevice \n ${warrning}`,
|
|
1129
|
-
});
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
const query_params = {};
|
|
1133
|
-
|
|
1134
|
-
const response = await PlatformAPIClient.execute(
|
|
1135
|
-
this.config,
|
|
1136
|
-
"get",
|
|
1137
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device/${terminalUniqueIdentifier}`,
|
|
1138
|
-
query_params,
|
|
1139
|
-
undefined,
|
|
1140
|
-
requestHeaders,
|
|
1141
|
-
{ responseHeaders }
|
|
1142
|
-
);
|
|
1143
|
-
|
|
1144
|
-
let responseData = response;
|
|
1145
|
-
if (responseHeaders) {
|
|
1146
|
-
responseData = response[0];
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
const {
|
|
1150
|
-
error: res_error,
|
|
1151
|
-
} = PaymentPlatformModel.EdcDeviceDetails().validate(responseData, {
|
|
1152
|
-
abortEarly: false,
|
|
1153
|
-
allowUnknown: true,
|
|
1154
|
-
});
|
|
1155
|
-
|
|
1156
|
-
if (res_error) {
|
|
1157
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1158
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1159
|
-
} else {
|
|
1160
|
-
Logger({
|
|
1161
|
-
level: "WARN",
|
|
1162
|
-
message: `Response Validation Warnings for platform > Payment > getEdcDevice \n ${res_error}`,
|
|
1163
|
-
});
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
return response;
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
762
|
/**
|
|
1171
763
|
* @param {PaymentPlatformApplicationValidator.GetMerchantAggregatorAppVersionParam} arg
|
|
1172
764
|
* - Arg object
|
|
@@ -3798,85 +3390,6 @@ class Payment {
|
|
|
3798
3390
|
return response;
|
|
3799
3391
|
}
|
|
3800
3392
|
|
|
3801
|
-
/**
|
|
3802
|
-
* @param {PaymentPlatformApplicationValidator.UpdateEdcDeviceParam} arg - Arg object
|
|
3803
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3804
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3805
|
-
* @returns {Promise<PaymentPlatformModel.EdcDeviceAddDetails>} - Success response
|
|
3806
|
-
* @name updateEdcDevice
|
|
3807
|
-
* @summary: Update EDC device
|
|
3808
|
-
* @description: Enables the modification of settings and details associated with an Electronic Data Capture (EDC) device linked to a specific application within a company. Upon success, it returns the updated information of the EDC device. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/payment/updateEdcDevice/).
|
|
3809
|
-
*/
|
|
3810
|
-
async updateEdcDevice(
|
|
3811
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3812
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
3813
|
-
) {
|
|
3814
|
-
const {
|
|
3815
|
-
error,
|
|
3816
|
-
} = PaymentPlatformApplicationValidator.updateEdcDevice().validate(
|
|
3817
|
-
{
|
|
3818
|
-
body,
|
|
3819
|
-
},
|
|
3820
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3821
|
-
);
|
|
3822
|
-
if (error) {
|
|
3823
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3824
|
-
}
|
|
3825
|
-
|
|
3826
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3827
|
-
const {
|
|
3828
|
-
error: warrning,
|
|
3829
|
-
} = PaymentPlatformApplicationValidator.updateEdcDevice().validate(
|
|
3830
|
-
{
|
|
3831
|
-
body,
|
|
3832
|
-
},
|
|
3833
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3834
|
-
);
|
|
3835
|
-
if (warrning) {
|
|
3836
|
-
Logger({
|
|
3837
|
-
level: "WARN",
|
|
3838
|
-
message: `Parameter Validation warrnings for platform > Payment > updateEdcDevice \n ${warrning}`,
|
|
3839
|
-
});
|
|
3840
|
-
}
|
|
3841
|
-
|
|
3842
|
-
const query_params = {};
|
|
3843
|
-
|
|
3844
|
-
const response = await PlatformAPIClient.execute(
|
|
3845
|
-
this.config,
|
|
3846
|
-
"post",
|
|
3847
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device`,
|
|
3848
|
-
query_params,
|
|
3849
|
-
body,
|
|
3850
|
-
requestHeaders,
|
|
3851
|
-
{ responseHeaders }
|
|
3852
|
-
);
|
|
3853
|
-
|
|
3854
|
-
let responseData = response;
|
|
3855
|
-
if (responseHeaders) {
|
|
3856
|
-
responseData = response[0];
|
|
3857
|
-
}
|
|
3858
|
-
|
|
3859
|
-
const {
|
|
3860
|
-
error: res_error,
|
|
3861
|
-
} = PaymentPlatformModel.EdcDeviceAddDetails().validate(responseData, {
|
|
3862
|
-
abortEarly: false,
|
|
3863
|
-
allowUnknown: true,
|
|
3864
|
-
});
|
|
3865
|
-
|
|
3866
|
-
if (res_error) {
|
|
3867
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
3868
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3869
|
-
} else {
|
|
3870
|
-
Logger({
|
|
3871
|
-
level: "WARN",
|
|
3872
|
-
message: `Response Validation Warnings for platform > Payment > updateEdcDevice \n ${res_error}`,
|
|
3873
|
-
});
|
|
3874
|
-
}
|
|
3875
|
-
}
|
|
3876
|
-
|
|
3877
|
-
return response;
|
|
3878
|
-
}
|
|
3879
|
-
|
|
3880
3393
|
/**
|
|
3881
3394
|
* @param {PaymentPlatformApplicationValidator.UpdateMerchantRefundPriorityParam} arg
|
|
3882
3395
|
* - Arg object
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export = PaymentPlatformApplicationValidator;
|
|
2
|
-
/**
|
|
3
|
-
* @typedef AddEdcDeviceParam
|
|
4
|
-
* @property {string} terminalUniqueIdentifier - Terminal unique identifier
|
|
5
|
-
* @property {PaymentPlatformModel.EdcUpdate} body
|
|
6
|
-
*/
|
|
7
2
|
/**
|
|
8
3
|
* @typedef AddRefundBankAccountUsingOTPParam
|
|
9
4
|
* @property {PaymentPlatformModel.AddBeneficiaryDetailsOTPCreation} body
|
|
@@ -33,16 +28,6 @@ export = PaymentPlatformApplicationValidator;
|
|
|
33
28
|
* @typedef CreatePaymentOrderParam
|
|
34
29
|
* @property {PaymentPlatformModel.PaymentOrderCreation} body
|
|
35
30
|
*/
|
|
36
|
-
/** @typedef EdcAggregatorsAndModelListParam */
|
|
37
|
-
/**
|
|
38
|
-
* @typedef EdcDeviceListParam
|
|
39
|
-
* @property {number} [pageNo]
|
|
40
|
-
* @property {number} [pageSize]
|
|
41
|
-
* @property {boolean} [isActive]
|
|
42
|
-
* @property {number} [storeId]
|
|
43
|
-
* @property {string} [deviceTag]
|
|
44
|
-
*/
|
|
45
|
-
/** @typedef EdcDeviceStatsParam */
|
|
46
31
|
/**
|
|
47
32
|
* @typedef GetBankAccountDetailsOpenAPIParam
|
|
48
33
|
* @property {string} orderId
|
|
@@ -53,10 +38,6 @@ export = PaymentPlatformApplicationValidator;
|
|
|
53
38
|
* @property {string} aggregator - Aggregator slug
|
|
54
39
|
* @property {string} [configType]
|
|
55
40
|
*/
|
|
56
|
-
/**
|
|
57
|
-
* @typedef GetEdcDeviceParam
|
|
58
|
-
* @property {string} terminalUniqueIdentifier - Terminal unique identifier
|
|
59
|
-
*/
|
|
60
41
|
/**
|
|
61
42
|
* @typedef GetMerchantAggregatorAppVersionParam
|
|
62
43
|
* @property {number} aggregatorId - Aggregators Id
|
|
@@ -114,9 +95,8 @@ export = PaymentPlatformApplicationValidator;
|
|
|
114
95
|
*/
|
|
115
96
|
/**
|
|
116
97
|
* @typedef GetPosPaymentModeRoutesParam
|
|
117
|
-
* @property {
|
|
118
|
-
*
|
|
119
|
-
* payment options for business unit.
|
|
98
|
+
* @property {string} [xOrderingSource] - Optional header to identify the
|
|
99
|
+
* ordering source used to determine\ applicable payment options for business unit.
|
|
120
100
|
* @property {number} amount - Payable amount.
|
|
121
101
|
* @property {string} [cartId] - Identifier of the cart.
|
|
122
102
|
* @property {string} pincode - The PIN Code of the destination address, e.g. 400059
|
|
@@ -218,10 +198,6 @@ export = PaymentPlatformApplicationValidator;
|
|
|
218
198
|
* @typedef SetUserCODlimitRoutesParam
|
|
219
199
|
* @property {PaymentPlatformModel.SetCODForUserCreation} body
|
|
220
200
|
*/
|
|
221
|
-
/**
|
|
222
|
-
* @typedef UpdateEdcDeviceParam
|
|
223
|
-
* @property {PaymentPlatformModel.EdcAddCreation} body
|
|
224
|
-
*/
|
|
225
201
|
/**
|
|
226
202
|
* @typedef UpdateMerchantRefundPriorityParam
|
|
227
203
|
* @property {string} configType - Configuration for merchant or customer
|
|
@@ -252,8 +228,6 @@ export = PaymentPlatformApplicationValidator;
|
|
|
252
228
|
* @property {PaymentPlatformModel.ValidateCustomerCreation} body
|
|
253
229
|
*/
|
|
254
230
|
declare class PaymentPlatformApplicationValidator {
|
|
255
|
-
/** @returns {AddEdcDeviceParam} */
|
|
256
|
-
static addEdcDevice(): AddEdcDeviceParam;
|
|
257
231
|
/** @returns {AddRefundBankAccountUsingOTPParam} */
|
|
258
232
|
static addRefundBankAccountUsingOTP(): AddRefundBankAccountUsingOTPParam;
|
|
259
233
|
/** @returns {CancelPaymentLinkParam} */
|
|
@@ -268,18 +242,10 @@ declare class PaymentPlatformApplicationValidator {
|
|
|
268
242
|
static createPaymentLink(): CreatePaymentLinkParam;
|
|
269
243
|
/** @returns {CreatePaymentOrderParam} */
|
|
270
244
|
static createPaymentOrder(): CreatePaymentOrderParam;
|
|
271
|
-
/** @returns {EdcAggregatorsAndModelListParam} */
|
|
272
|
-
static edcAggregatorsAndModelList(): any;
|
|
273
|
-
/** @returns {EdcDeviceListParam} */
|
|
274
|
-
static edcDeviceList(): EdcDeviceListParam;
|
|
275
|
-
/** @returns {EdcDeviceStatsParam} */
|
|
276
|
-
static edcDeviceStats(): any;
|
|
277
245
|
/** @returns {GetBankAccountDetailsOpenAPIParam} */
|
|
278
246
|
static getBankAccountDetailsOpenAPI(): GetBankAccountDetailsOpenAPIParam;
|
|
279
247
|
/** @returns {GetBrandPaymentGatewayConfigParam} */
|
|
280
248
|
static getBrandPaymentGatewayConfig(): GetBrandPaymentGatewayConfigParam;
|
|
281
|
-
/** @returns {GetEdcDeviceParam} */
|
|
282
|
-
static getEdcDevice(): GetEdcDeviceParam;
|
|
283
249
|
/** @returns {GetMerchantAggregatorAppVersionParam} */
|
|
284
250
|
static getMerchantAggregatorAppVersion(): GetMerchantAggregatorAppVersionParam;
|
|
285
251
|
/** @returns {GetMerchantAggregatorPaymentModeDetailsParam} */
|
|
@@ -342,8 +308,6 @@ declare class PaymentPlatformApplicationValidator {
|
|
|
342
308
|
static setPaymentModeCustomConfig(): SetPaymentModeCustomConfigParam;
|
|
343
309
|
/** @returns {SetUserCODlimitRoutesParam} */
|
|
344
310
|
static setUserCODlimitRoutes(): SetUserCODlimitRoutesParam;
|
|
345
|
-
/** @returns {UpdateEdcDeviceParam} */
|
|
346
|
-
static updateEdcDevice(): UpdateEdcDeviceParam;
|
|
347
311
|
/** @returns {UpdateMerchantRefundPriorityParam} */
|
|
348
312
|
static updateMerchantRefundPriority(): UpdateMerchantRefundPriorityParam;
|
|
349
313
|
/** @returns {UpdatePaymentSessionParam} */
|
|
@@ -356,15 +320,8 @@ declare class PaymentPlatformApplicationValidator {
|
|
|
356
320
|
static verifyCustomerForPayment(): VerifyCustomerForPaymentParam;
|
|
357
321
|
}
|
|
358
322
|
declare namespace PaymentPlatformApplicationValidator {
|
|
359
|
-
export {
|
|
323
|
+
export { AddRefundBankAccountUsingOTPParam, CancelPaymentLinkParam, CheckAndUpdatePaymentStatusParam, ConfirmPaymentParam, CreateMerchantRefundPriorityParam, CreatePaymentLinkParam, CreatePaymentOrderParam, GetBankAccountDetailsOpenAPIParam, GetBrandPaymentGatewayConfigParam, 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, UpdateMerchantRefundPriorityParam, UpdatePaymentSessionParam, UpdateRefundSessionParam, ValidateCustomerAndCreditSummaryParam, VerifyCustomerForPaymentParam };
|
|
360
324
|
}
|
|
361
|
-
type AddEdcDeviceParam = {
|
|
362
|
-
/**
|
|
363
|
-
* - Terminal unique identifier
|
|
364
|
-
*/
|
|
365
|
-
terminalUniqueIdentifier: string;
|
|
366
|
-
body: PaymentPlatformModel.EdcUpdate;
|
|
367
|
-
};
|
|
368
325
|
type AddRefundBankAccountUsingOTPParam = {
|
|
369
326
|
body: PaymentPlatformModel.AddBeneficiaryDetailsOTPCreation;
|
|
370
327
|
};
|
|
@@ -390,13 +347,6 @@ type CreatePaymentLinkParam = {
|
|
|
390
347
|
type CreatePaymentOrderParam = {
|
|
391
348
|
body: PaymentPlatformModel.PaymentOrderCreation;
|
|
392
349
|
};
|
|
393
|
-
type EdcDeviceListParam = {
|
|
394
|
-
pageNo?: number;
|
|
395
|
-
pageSize?: number;
|
|
396
|
-
isActive?: boolean;
|
|
397
|
-
storeId?: number;
|
|
398
|
-
deviceTag?: string;
|
|
399
|
-
};
|
|
400
350
|
type GetBankAccountDetailsOpenAPIParam = {
|
|
401
351
|
orderId: string;
|
|
402
352
|
requestHash?: string;
|
|
@@ -408,12 +358,6 @@ type GetBrandPaymentGatewayConfigParam = {
|
|
|
408
358
|
aggregator: string;
|
|
409
359
|
configType?: string;
|
|
410
360
|
};
|
|
411
|
-
type GetEdcDeviceParam = {
|
|
412
|
-
/**
|
|
413
|
-
* - Terminal unique identifier
|
|
414
|
-
*/
|
|
415
|
-
terminalUniqueIdentifier: string;
|
|
416
|
-
};
|
|
417
361
|
type GetMerchantAggregatorAppVersionParam = {
|
|
418
362
|
/**
|
|
419
363
|
* - Aggregators Id
|
|
@@ -496,11 +440,10 @@ type GetPaymentSessionParam = {
|
|
|
496
440
|
};
|
|
497
441
|
type GetPosPaymentModeRoutesParam = {
|
|
498
442
|
/**
|
|
499
|
-
* - Optional
|
|
500
|
-
*
|
|
501
|
-
* payment options for business unit.
|
|
443
|
+
* - Optional header to identify the
|
|
444
|
+
* ordering source used to determine\ applicable payment options for business unit.
|
|
502
445
|
*/
|
|
503
|
-
xOrderingSource?:
|
|
446
|
+
xOrderingSource?: string;
|
|
504
447
|
/**
|
|
505
448
|
* - Payable amount.
|
|
506
449
|
*/
|
|
@@ -631,9 +574,6 @@ type SetPaymentModeCustomConfigParam = {
|
|
|
631
574
|
type SetUserCODlimitRoutesParam = {
|
|
632
575
|
body: PaymentPlatformModel.SetCODForUserCreation;
|
|
633
576
|
};
|
|
634
|
-
type UpdateEdcDeviceParam = {
|
|
635
|
-
body: PaymentPlatformModel.EdcAddCreation;
|
|
636
|
-
};
|
|
637
577
|
type UpdateMerchantRefundPriorityParam = {
|
|
638
578
|
/**
|
|
639
579
|
* - Configuration for merchant or customer
|
|
@@ -670,8 +610,6 @@ type ValidateCustomerAndCreditSummaryParam = {
|
|
|
670
610
|
type VerifyCustomerForPaymentParam = {
|
|
671
611
|
body: PaymentPlatformModel.ValidateCustomerCreation;
|
|
672
612
|
};
|
|
673
|
-
type EdcAggregatorsAndModelListParam = any;
|
|
674
|
-
type EdcDeviceStatsParam = any;
|
|
675
613
|
type GetMerchantPaymentOptionParam = any;
|
|
676
614
|
type GetPGConfigAggregatorsParam = any;
|
|
677
615
|
type GetPaymentCodeOptionParam = any;
|