@gofynd/fdk-client-javascript 3.4.2 → 3.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +28 -8
- package/sdk/platform/Catalog/CatalogPlatformModel.js +13 -5
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +10 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.js +4 -0
- 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 +1 -61
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +0 -72
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +1 -324
- package/sdk/platform/Payment/PaymentPlatformModel.js +0 -221
|
@@ -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
|
|
@@ -217,10 +198,6 @@ export = PaymentPlatformApplicationValidator;
|
|
|
217
198
|
* @typedef SetUserCODlimitRoutesParam
|
|
218
199
|
* @property {PaymentPlatformModel.SetCODForUserCreation} body
|
|
219
200
|
*/
|
|
220
|
-
/**
|
|
221
|
-
* @typedef UpdateEdcDeviceParam
|
|
222
|
-
* @property {PaymentPlatformModel.EdcAddCreation} body
|
|
223
|
-
*/
|
|
224
201
|
/**
|
|
225
202
|
* @typedef UpdateMerchantRefundPriorityParam
|
|
226
203
|
* @property {string} configType - Configuration for merchant or customer
|
|
@@ -251,8 +228,6 @@ export = PaymentPlatformApplicationValidator;
|
|
|
251
228
|
* @property {PaymentPlatformModel.ValidateCustomerCreation} body
|
|
252
229
|
*/
|
|
253
230
|
declare class PaymentPlatformApplicationValidator {
|
|
254
|
-
/** @returns {AddEdcDeviceParam} */
|
|
255
|
-
static addEdcDevice(): AddEdcDeviceParam;
|
|
256
231
|
/** @returns {AddRefundBankAccountUsingOTPParam} */
|
|
257
232
|
static addRefundBankAccountUsingOTP(): AddRefundBankAccountUsingOTPParam;
|
|
258
233
|
/** @returns {CancelPaymentLinkParam} */
|
|
@@ -267,18 +242,10 @@ declare class PaymentPlatformApplicationValidator {
|
|
|
267
242
|
static createPaymentLink(): CreatePaymentLinkParam;
|
|
268
243
|
/** @returns {CreatePaymentOrderParam} */
|
|
269
244
|
static createPaymentOrder(): CreatePaymentOrderParam;
|
|
270
|
-
/** @returns {EdcAggregatorsAndModelListParam} */
|
|
271
|
-
static edcAggregatorsAndModelList(): any;
|
|
272
|
-
/** @returns {EdcDeviceListParam} */
|
|
273
|
-
static edcDeviceList(): EdcDeviceListParam;
|
|
274
|
-
/** @returns {EdcDeviceStatsParam} */
|
|
275
|
-
static edcDeviceStats(): any;
|
|
276
245
|
/** @returns {GetBankAccountDetailsOpenAPIParam} */
|
|
277
246
|
static getBankAccountDetailsOpenAPI(): GetBankAccountDetailsOpenAPIParam;
|
|
278
247
|
/** @returns {GetBrandPaymentGatewayConfigParam} */
|
|
279
248
|
static getBrandPaymentGatewayConfig(): GetBrandPaymentGatewayConfigParam;
|
|
280
|
-
/** @returns {GetEdcDeviceParam} */
|
|
281
|
-
static getEdcDevice(): GetEdcDeviceParam;
|
|
282
249
|
/** @returns {GetMerchantAggregatorAppVersionParam} */
|
|
283
250
|
static getMerchantAggregatorAppVersion(): GetMerchantAggregatorAppVersionParam;
|
|
284
251
|
/** @returns {GetMerchantAggregatorPaymentModeDetailsParam} */
|
|
@@ -341,8 +308,6 @@ declare class PaymentPlatformApplicationValidator {
|
|
|
341
308
|
static setPaymentModeCustomConfig(): SetPaymentModeCustomConfigParam;
|
|
342
309
|
/** @returns {SetUserCODlimitRoutesParam} */
|
|
343
310
|
static setUserCODlimitRoutes(): SetUserCODlimitRoutesParam;
|
|
344
|
-
/** @returns {UpdateEdcDeviceParam} */
|
|
345
|
-
static updateEdcDevice(): UpdateEdcDeviceParam;
|
|
346
311
|
/** @returns {UpdateMerchantRefundPriorityParam} */
|
|
347
312
|
static updateMerchantRefundPriority(): UpdateMerchantRefundPriorityParam;
|
|
348
313
|
/** @returns {UpdatePaymentSessionParam} */
|
|
@@ -355,15 +320,8 @@ declare class PaymentPlatformApplicationValidator {
|
|
|
355
320
|
static verifyCustomerForPayment(): VerifyCustomerForPaymentParam;
|
|
356
321
|
}
|
|
357
322
|
declare namespace PaymentPlatformApplicationValidator {
|
|
358
|
-
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 };
|
|
359
324
|
}
|
|
360
|
-
type AddEdcDeviceParam = {
|
|
361
|
-
/**
|
|
362
|
-
* - Terminal unique identifier
|
|
363
|
-
*/
|
|
364
|
-
terminalUniqueIdentifier: string;
|
|
365
|
-
body: PaymentPlatformModel.EdcUpdate;
|
|
366
|
-
};
|
|
367
325
|
type AddRefundBankAccountUsingOTPParam = {
|
|
368
326
|
body: PaymentPlatformModel.AddBeneficiaryDetailsOTPCreation;
|
|
369
327
|
};
|
|
@@ -389,13 +347,6 @@ type CreatePaymentLinkParam = {
|
|
|
389
347
|
type CreatePaymentOrderParam = {
|
|
390
348
|
body: PaymentPlatformModel.PaymentOrderCreation;
|
|
391
349
|
};
|
|
392
|
-
type EdcDeviceListParam = {
|
|
393
|
-
pageNo?: number;
|
|
394
|
-
pageSize?: number;
|
|
395
|
-
isActive?: boolean;
|
|
396
|
-
storeId?: number;
|
|
397
|
-
deviceTag?: string;
|
|
398
|
-
};
|
|
399
350
|
type GetBankAccountDetailsOpenAPIParam = {
|
|
400
351
|
orderId: string;
|
|
401
352
|
requestHash?: string;
|
|
@@ -407,12 +358,6 @@ type GetBrandPaymentGatewayConfigParam = {
|
|
|
407
358
|
aggregator: string;
|
|
408
359
|
configType?: string;
|
|
409
360
|
};
|
|
410
|
-
type GetEdcDeviceParam = {
|
|
411
|
-
/**
|
|
412
|
-
* - Terminal unique identifier
|
|
413
|
-
*/
|
|
414
|
-
terminalUniqueIdentifier: string;
|
|
415
|
-
};
|
|
416
361
|
type GetMerchantAggregatorAppVersionParam = {
|
|
417
362
|
/**
|
|
418
363
|
* - Aggregators Id
|
|
@@ -629,9 +574,6 @@ type SetPaymentModeCustomConfigParam = {
|
|
|
629
574
|
type SetUserCODlimitRoutesParam = {
|
|
630
575
|
body: PaymentPlatformModel.SetCODForUserCreation;
|
|
631
576
|
};
|
|
632
|
-
type UpdateEdcDeviceParam = {
|
|
633
|
-
body: PaymentPlatformModel.EdcAddCreation;
|
|
634
|
-
};
|
|
635
577
|
type UpdateMerchantRefundPriorityParam = {
|
|
636
578
|
/**
|
|
637
579
|
* - Configuration for merchant or customer
|
|
@@ -668,8 +610,6 @@ type ValidateCustomerAndCreditSummaryParam = {
|
|
|
668
610
|
type VerifyCustomerForPaymentParam = {
|
|
669
611
|
body: PaymentPlatformModel.ValidateCustomerCreation;
|
|
670
612
|
};
|
|
671
|
-
type EdcAggregatorsAndModelListParam = any;
|
|
672
|
-
type EdcDeviceStatsParam = any;
|
|
673
613
|
type GetMerchantPaymentOptionParam = any;
|
|
674
614
|
type GetPGConfigAggregatorsParam = any;
|
|
675
615
|
type GetPaymentCodeOptionParam = any;
|