@fiado/api-invoker 1.2.53 → 1.2.54
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 +64 -64
- package/bin/centralPayments/CentralPaymentsConnectorApi.d.ts +1 -0
- package/bin/centralPayments/CentralPaymentsConnectorApi.js +4 -0
- package/bin/centralPayments/interfaces/ICentralPaymentsConnectorApi.d.ts +1 -0
- package/package.json +27 -27
- package/src/account-beneficiary/AccountBeneficiaryApi.ts +18 -18
- package/src/account-beneficiary/index.ts +2 -2
- package/src/account-beneficiary/interfaces/IAccountBeneficiaryApi.ts +7 -7
- package/src/account-fiadoinc/AccountFiadoIncApi.ts +73 -73
- package/src/account-fiadoinc/index.ts +1 -1
- package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +36 -36
- package/src/account-fiadosa/AccountFiadoSAApi.ts +37 -37
- package/src/account-fiadosa/index.ts +1 -1
- package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +15 -15
- package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +46 -46
- package/src/account-pagoconfiado/index.ts +2 -2
- package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +24 -24
- package/src/activity-business/ActivityApi.ts +36 -36
- package/src/activity-business/index.ts +5 -5
- package/src/activity-business/interfaces/IActivityApi.ts +13 -13
- package/src/activity-business/queue/ActivityPublisher.ts +28 -28
- package/src/activity-business/queue/IActivityPublisher.ts +4 -4
- package/src/address/AddressApi.ts +46 -46
- package/src/address/index.ts +3 -3
- package/src/address/interfaces/IAddressApi.ts +30 -30
- package/src/authentication/AuthenticationApi.ts +16 -16
- package/src/authentication/index.ts +4 -4
- package/src/authentication/interfaces/IAuthenticationApi.ts +5 -5
- package/src/bankAccount/BankAccountApi.ts +48 -48
- package/src/bankAccount/index.ts +1 -1
- package/src/bankAccount/interfaces/IBankAccountApi.ts +6 -6
- package/src/bbvaRst/api/BBVARstApi.ts +16 -16
- package/src/bbvaRst/api/interfaces/IBBVARstApi.ts +4 -4
- package/src/bbvaRst/index.ts +1 -1
- package/src/blacklist/BlackListApi.ts +19 -19
- package/src/blacklist/index.ts +2 -2
- package/src/blacklist/interfaces/IBlackListApi.ts +20 -20
- package/src/card/CardApi.ts +53 -53
- package/src/card/index.ts +3 -3
- package/src/card/interfaces/ICardApi.ts +16 -16
- package/src/centralPayments/CentralPaymentsConnectorApi.ts +177 -172
- package/src/centralPayments/index.ts +1 -1
- package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +83 -81
- package/src/cnbv-business/CnbvApi.ts +22 -22
- package/src/cnbv-business/index.ts +4 -4
- package/src/cnbv-business/interfaces/ICnbvApi.ts +6 -6
- package/src/cognitoConnector/CognitoConnectorApi.ts +106 -106
- package/src/cognitoConnector/CognitoConnectorV2.ts +81 -81
- package/src/cognitoConnector/index.ts +11 -11
- package/src/cognitoConnector/interfaces/ICognitoConnectorApi.ts +15 -15
- package/src/cognitoConnector/interfaces/ICognitoV2Api.ts +58 -58
- package/src/collector/CollectorApi.ts +25 -25
- package/src/collector/index.ts +2 -2
- package/src/collector/interfaces/ICollectorApi.ts +21 -21
- package/src/contactInformation/ContactInformationApi.ts +20 -20
- package/src/contactInformation/index.ts +2 -2
- package/src/contactInformation/interface/IContactInformationApi.ts +8 -8
- package/src/container.config.ts +126 -126
- package/src/contract-generator/ContractGeneratorApi.ts +18 -18
- package/src/contract-generator/index.ts +2 -2
- package/src/contract-generator/interfaces/IContractGeneratorApi.ts +16 -16
- package/src/device/DeviceApi.ts +23 -23
- package/src/device/index.ts +2 -2
- package/src/device/interfaces/IDeviceApi.ts +24 -24
- package/src/directories/DirectoriesApi.ts +53 -53
- package/src/directories/index.ts +3 -3
- package/src/directories/interfaces/IDirectoriesApi.ts +16 -16
- package/src/directory/DirectoryApi.ts +150 -150
- package/src/directory/index.ts +3 -3
- package/src/directory/interfaces/IDirectoryApi.ts +69 -69
- package/src/disputes/DisputesApi.ts +50 -50
- package/src/disputes/index.ts +2 -2
- package/src/disputes/interfaces/IDisputesApi.ts +54 -54
- package/src/exchangeRates/ExchangeRatesApi.ts +27 -27
- package/src/exchangeRates/index.ts +1 -1
- package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +8 -8
- package/src/fiadoMessages/api/FiadoMessagesApi.ts +20 -20
- package/src/fiadoMessages/api/interfaces/IFiadoMessagesApi.ts +2 -2
- package/src/fiadoMessages/index.ts +1 -1
- package/src/fraudPreventionEngine/api/FraudPreventionEngineApi.ts +22 -22
- package/src/fraudPreventionEngine/api/interfaces/IFraudPreventionEngineApi.ts +7 -7
- package/src/fraudPreventionEngine/index.ts +1 -1
- package/src/group/GroupApi.ts +24 -24
- package/src/group/index.ts +1 -1
- package/src/group/interfaces/IGroupApi.ts +23 -23
- package/src/identity/IdentityApi.ts +78 -78
- package/src/identity/index.ts +3 -3
- package/src/identity/interfaces/IIdentityApi.ts +38 -38
- package/src/index.ts +41 -41
- package/src/legalDocument/api/LegalDocumentApi.ts +26 -26
- package/src/legalDocument/api/interfaces/ILegalDocumentApi.ts +6 -6
- package/src/legalDocument/index.ts +3 -3
- package/src/notificationMessages/index.ts +1 -1
- package/src/notificationMessages/queue/NotificationMessagePublisher.ts +22 -22
- package/src/notificationMessages/queue/interfaces/INotificationMessagesPublisher.ts +4 -4
- package/src/observations/ObservationsApi.ts +23 -23
- package/src/observations/index.ts +3 -3
- package/src/observations/interfaces/IObservationsApi.ts +9 -9
- package/src/p2pContact/api/P2pContactApi.ts +19 -19
- package/src/p2pContact/api/interfaces/IP2pContactApi.ts +4 -4
- package/src/p2pContact/index.ts +1 -1
- package/src/pomelo/api/PomeloApi.ts +99 -99
- package/src/pomelo/api/interfaces/IPomeloApi.ts +27 -27
- package/src/pomelo/index.ts +1 -1
- package/src/pomeloProcessor/api/PomeloProcessorApi.ts +17 -17
- package/src/pomeloProcessor/api/interfaces/IPomeloProcessorApi.ts +2 -2
- package/src/pomeloProcessor/index.ts +2 -2
- package/src/product-catalog/ProductCatalogApi.ts +17 -17
- package/src/product-catalog/index.ts +1 -1
- package/src/product-catalog/interfaces/IProductCatalogApi.ts +6 -6
- package/src/riskProfile/api/RiskProfileApi.ts +39 -39
- package/src/riskProfile/api/TransactionAlertApi.ts +22 -22
- package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +14 -14
- package/src/riskProfile/api/interfaces/ITransactionAlertApi.ts +7 -7
- package/src/riskProfile/index.ts +7 -7
- package/src/riskProfile/queue/TransactionAlarmPublisher.ts +24 -24
- package/src/riskProfile/queue/interfaces/ITransactionAlarmPublisher.ts +4 -4
- package/src/service-business/ServiceApi.ts +60 -60
- package/src/service-business/index.ts +2 -2
- package/src/service-business/interfaces/IServiceApi.ts +44 -44
- package/src/sessionActivity/index.ts +2 -2
- package/src/sessionActivity/queue/SessionActivityPublisher.ts +22 -22
- package/src/sessionActivity/queue/interfaces/ISessionActivityPublisher.ts +4 -4
- package/src/stpAccount/api/STPAccountApi.ts +111 -111
- package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +7 -7
- package/src/stpAccount/index.ts +1 -1
- package/src/stpServicePayment/api/StpServicePaymentApi.ts +40 -40
- package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +13 -13
- package/src/stpServicePayment/index.ts +1 -1
- package/src/stpSpei/api/StpSpeiApi.ts +32 -32
- package/src/stpSpei/api/interfaces/IStpSpeiApi.ts +6 -6
- package/src/stpSpei/index.ts +1 -1
- package/src/tern/api/TernApi.ts +137 -137
- package/src/tern/api/interfaces/ITernApi.ts +38 -38
- package/src/tern/index.ts +1 -1
- package/src/transaction/api/TransactionApi.ts +92 -92
- package/src/transaction/api/interfaces/ITransactionApi.ts +35 -35
- package/src/transaction/index.ts +5 -5
- package/src/transaction/queue/TransactionPublisher.ts +24 -24
- package/src/transaction/queue/interfaces/ITransactionPublisher.ts +4 -4
- package/src/transactionProcessor/api/TransactionProcessorApi.ts +42 -42
- package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +18 -18
- package/src/transactionProcessor/index.ts +1 -1
- package/src/utils/InvokerUtils.ts +18 -18
- package/src/zendesk/ZendeskApi.ts +24 -24
- package/src/zendesk/index.ts +3 -3
- package/src/zendesk/interfaces/IZendeskApi.ts +10 -10
- package/tsconfig.json +21 -21
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +0 -46
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +0 -2
|
@@ -1,173 +1,178 @@
|
|
|
1
|
-
import { ICentralPaymentsConnectorApi } from "./interfaces/ICentralPaymentsConnectorApi";
|
|
2
|
-
import { inject, injectable } from "inversify";
|
|
3
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
-
import {
|
|
5
|
-
CreateBankAccountUserRequest,
|
|
6
|
-
CreateBankAccountUserResponse,
|
|
7
|
-
GetBankAccountUserResponse,
|
|
8
|
-
UpdateBankAccountUserRequest
|
|
9
|
-
} from "@fiado/type-kit/bin/account";
|
|
10
|
-
import {
|
|
11
|
-
CentralPaymentsDocumentUploadRequest,
|
|
12
|
-
HealthcheckResponse,
|
|
13
|
-
OOWQuestionsResponse,
|
|
14
|
-
SubmitOOWQuestionAnswersRequest
|
|
15
|
-
} from "@fiado/type-kit/bin/centralPayments";
|
|
16
|
-
import {
|
|
17
|
-
ActivateBankAccountCardRequest,
|
|
18
|
-
ActivateBankAccountCardResponse,
|
|
19
|
-
CardBatchRequest,
|
|
20
|
-
CardBatchResponse,
|
|
21
|
-
CardStatementListResponse,
|
|
22
|
-
GetBankAccountCardBalanceResponse,
|
|
23
|
-
GetBankAccountCardResponse,
|
|
24
|
-
StatementDocumentResponse,
|
|
25
|
-
UpdateBankAccountCardRequest,
|
|
26
|
-
UpdateBankAccountCardResponse
|
|
27
|
-
} from "@fiado/type-kit/bin/card";
|
|
28
|
-
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
29
|
-
import {
|
|
30
|
-
CentralPaymentsQueryParams,
|
|
31
|
-
CentralPaymentsTransactionItem,
|
|
32
|
-
TransactionListResponse
|
|
33
|
-
} from "@fiado/type-kit/bin/transaction";
|
|
34
|
-
import { InvokerUtils } from "../utils/InvokerUtils";
|
|
35
|
-
|
|
36
|
-
@injectable()
|
|
37
|
-
export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
|
|
38
|
-
private readonly baseUrl = process.env.CENTRAL_PAYMENTS_LAMBDA_URL || "";
|
|
39
|
-
|
|
40
|
-
constructor(
|
|
41
|
-
@inject("IHttpRequest") private readonly httpRequest: IHttpRequest,
|
|
42
|
-
@inject("InvokerUtils") private readonly _invokerUtils: InvokerUtils,
|
|
43
|
-
) {
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* HEALTHCHECK */
|
|
47
|
-
async healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>> {
|
|
48
|
-
const url = `${this.baseUrl}/healthcheck`;
|
|
49
|
-
return await this.httpRequest.get(url);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/* CARDHOLDERS */
|
|
53
|
-
|
|
54
|
-
async createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>> {
|
|
55
|
-
const url = `${this.baseUrl}/cardholders`;
|
|
56
|
-
return await this.httpRequest.post(url, request);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>> {
|
|
60
|
-
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
61
|
-
return await this.httpRequest.get(url);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async updateCardholder(externalUserId: string, request: UpdateBankAccountUserRequest): Promise<FiadoApiResponse<GetBankAccountUserResponse>> {
|
|
65
|
-
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
66
|
-
return await this.httpRequest.put(url, request);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
async deleteCardholder(externalUserId: string): Promise<FiadoApiResponse<null>> {
|
|
70
|
-
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
71
|
-
return await this.httpRequest.delete(url);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* KYC DOCUMENTS */
|
|
75
|
-
async getOOWQuestions(externalUserId: string): Promise<FiadoApiResponse<OOWQuestionsResponse[]>> {
|
|
76
|
-
const url = `${this.baseUrl}/kyc/${externalUserId}/oow/questions`;
|
|
77
|
-
return await this.httpRequest.get(url);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
async submitOOWQuestionAnswers(externalUserId: string, request: SubmitOOWQuestionAnswersRequest[]): Promise<FiadoApiResponse<GetBankAccountUserResponse>> {
|
|
81
|
-
const url = `${this.baseUrl}/kyc/${externalUserId}/oow/questions`;
|
|
82
|
-
return await this.httpRequest.post(url, request);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
async uploadDocuments(externalUserId: string, request: CentralPaymentsDocumentUploadRequest): Promise<FiadoApiResponse<null>> {
|
|
86
|
-
const url = `${this.baseUrl}/kyc/${externalUserId}/documents/upload`;
|
|
87
|
-
return await this.httpRequest.post(url, request);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/* CARDS */
|
|
91
|
-
async changePin(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<UpdateBankAccountCardResponse>> {
|
|
92
|
-
const url = `${this.baseUrl}/cards/pin/change`;
|
|
93
|
-
return await this.httpRequest.post(url, request);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
async getCardsById(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
97
|
-
const url = `${this.baseUrl}/cards/${externalCardId}`;
|
|
98
|
-
return await this.httpRequest.get(url);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
async getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
102
|
-
const url = `${this.baseUrl}/cards/${externalCardId}/sensitive`;
|
|
103
|
-
return await this.httpRequest.get(url);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
async activateCard(request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>> {
|
|
107
|
-
const url = `${this.baseUrl}/cards/${request.externalCardId}/activate`;
|
|
108
|
-
return await this.httpRequest.post(url, request);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
async getCardBalance(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardBalanceResponse>> {
|
|
112
|
-
const url = `${this.baseUrl}/cards/${externalCardId}/balance`;
|
|
113
|
-
return await this.httpRequest.get(url);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
async updateCard(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
117
|
-
const url = `${this.baseUrl}/cards/${request.cardId}/status/${request.status}`;
|
|
118
|
-
return await this.httpRequest.put(url);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
async updateCardProgram(externalCardId: string, programId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
122
|
-
const url = `${this.baseUrl}/cards/${externalCardId}/programs/${programId}`;
|
|
123
|
-
return await this.httpRequest.put(url);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
async orderPhysicalCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
127
|
-
const url = `${this.baseUrl}/cards/physical/order/${externalUserId}`;
|
|
128
|
-
return await this.httpRequest.put(url);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
async
|
|
132
|
-
const url = `${this.baseUrl}/cards/cardholders/${externalUserId}`;
|
|
133
|
-
return await this.httpRequest.
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
async
|
|
137
|
-
const url = `${this.baseUrl}/cards/
|
|
138
|
-
return await this.httpRequest.
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
async
|
|
142
|
-
const url = `${this.baseUrl}/cards/batch
|
|
143
|
-
return await this.httpRequest.
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
async
|
|
147
|
-
const url = `${this.baseUrl}/cards/batch/${batchId}`;
|
|
148
|
-
return await this.httpRequest.
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
async
|
|
158
|
-
const url = `${this.baseUrl}/statements/
|
|
159
|
-
return await this.httpRequest.get(url);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const url = `${this.baseUrl}/transactions/${
|
|
171
|
-
return await this.httpRequest.get(url);
|
|
172
|
-
}
|
|
1
|
+
import { ICentralPaymentsConnectorApi } from "./interfaces/ICentralPaymentsConnectorApi";
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
import {
|
|
5
|
+
CreateBankAccountUserRequest,
|
|
6
|
+
CreateBankAccountUserResponse,
|
|
7
|
+
GetBankAccountUserResponse,
|
|
8
|
+
UpdateBankAccountUserRequest
|
|
9
|
+
} from "@fiado/type-kit/bin/account";
|
|
10
|
+
import {
|
|
11
|
+
CentralPaymentsDocumentUploadRequest,
|
|
12
|
+
HealthcheckResponse,
|
|
13
|
+
OOWQuestionsResponse,
|
|
14
|
+
SubmitOOWQuestionAnswersRequest
|
|
15
|
+
} from "@fiado/type-kit/bin/centralPayments";
|
|
16
|
+
import {
|
|
17
|
+
ActivateBankAccountCardRequest,
|
|
18
|
+
ActivateBankAccountCardResponse,
|
|
19
|
+
CardBatchRequest,
|
|
20
|
+
CardBatchResponse,
|
|
21
|
+
CardStatementListResponse,
|
|
22
|
+
GetBankAccountCardBalanceResponse,
|
|
23
|
+
GetBankAccountCardResponse,
|
|
24
|
+
StatementDocumentResponse,
|
|
25
|
+
UpdateBankAccountCardRequest,
|
|
26
|
+
UpdateBankAccountCardResponse
|
|
27
|
+
} from "@fiado/type-kit/bin/card";
|
|
28
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
29
|
+
import {
|
|
30
|
+
CentralPaymentsQueryParams,
|
|
31
|
+
CentralPaymentsTransactionItem,
|
|
32
|
+
TransactionListResponse
|
|
33
|
+
} from "@fiado/type-kit/bin/transaction";
|
|
34
|
+
import { InvokerUtils } from "../utils/InvokerUtils";
|
|
35
|
+
|
|
36
|
+
@injectable()
|
|
37
|
+
export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
|
|
38
|
+
private readonly baseUrl = process.env.CENTRAL_PAYMENTS_LAMBDA_URL || "";
|
|
39
|
+
|
|
40
|
+
constructor(
|
|
41
|
+
@inject("IHttpRequest") private readonly httpRequest: IHttpRequest,
|
|
42
|
+
@inject("InvokerUtils") private readonly _invokerUtils: InvokerUtils,
|
|
43
|
+
) {
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* HEALTHCHECK */
|
|
47
|
+
async healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>> {
|
|
48
|
+
const url = `${this.baseUrl}/healthcheck`;
|
|
49
|
+
return await this.httpRequest.get(url);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* CARDHOLDERS */
|
|
53
|
+
|
|
54
|
+
async createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>> {
|
|
55
|
+
const url = `${this.baseUrl}/cardholders`;
|
|
56
|
+
return await this.httpRequest.post(url, request);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>> {
|
|
60
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
61
|
+
return await this.httpRequest.get(url);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async updateCardholder(externalUserId: string, request: UpdateBankAccountUserRequest): Promise<FiadoApiResponse<GetBankAccountUserResponse>> {
|
|
65
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
66
|
+
return await this.httpRequest.put(url, request);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async deleteCardholder(externalUserId: string): Promise<FiadoApiResponse<null>> {
|
|
70
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
71
|
+
return await this.httpRequest.delete(url);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* KYC DOCUMENTS */
|
|
75
|
+
async getOOWQuestions(externalUserId: string): Promise<FiadoApiResponse<OOWQuestionsResponse[]>> {
|
|
76
|
+
const url = `${this.baseUrl}/kyc/${externalUserId}/oow/questions`;
|
|
77
|
+
return await this.httpRequest.get(url);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async submitOOWQuestionAnswers(externalUserId: string, request: SubmitOOWQuestionAnswersRequest[]): Promise<FiadoApiResponse<GetBankAccountUserResponse>> {
|
|
81
|
+
const url = `${this.baseUrl}/kyc/${externalUserId}/oow/questions`;
|
|
82
|
+
return await this.httpRequest.post(url, request);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async uploadDocuments(externalUserId: string, request: CentralPaymentsDocumentUploadRequest): Promise<FiadoApiResponse<null>> {
|
|
86
|
+
const url = `${this.baseUrl}/kyc/${externalUserId}/documents/upload`;
|
|
87
|
+
return await this.httpRequest.post(url, request);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* CARDS */
|
|
91
|
+
async changePin(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<UpdateBankAccountCardResponse>> {
|
|
92
|
+
const url = `${this.baseUrl}/cards/pin/change`;
|
|
93
|
+
return await this.httpRequest.post(url, request);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async getCardsById(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
97
|
+
const url = `${this.baseUrl}/cards/${externalCardId}`;
|
|
98
|
+
return await this.httpRequest.get(url);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
102
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/sensitive`;
|
|
103
|
+
return await this.httpRequest.get(url);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async activateCard(request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>> {
|
|
107
|
+
const url = `${this.baseUrl}/cards/${request.externalCardId}/activate`;
|
|
108
|
+
return await this.httpRequest.post(url, request);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async getCardBalance(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardBalanceResponse>> {
|
|
112
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/balance`;
|
|
113
|
+
return await this.httpRequest.get(url);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async updateCard(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
117
|
+
const url = `${this.baseUrl}/cards/${request.cardId}/status/${request.status}`;
|
|
118
|
+
return await this.httpRequest.put(url);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async updateCardProgram(externalCardId: string, programId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
122
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/programs/${programId}`;
|
|
123
|
+
return await this.httpRequest.put(url);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async orderPhysicalCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
127
|
+
const url = `${this.baseUrl}/cards/physical/order/${externalUserId}`;
|
|
128
|
+
return await this.httpRequest.put(url);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async createSecondaryCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
132
|
+
const url = `${this.baseUrl}/cards/cardholders/${externalUserId}/secondary`;
|
|
133
|
+
return await this.httpRequest.put(url);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
async getCardsByUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
137
|
+
const url = `${this.baseUrl}/cards/cardholders/${externalUserId}`;
|
|
138
|
+
return await this.httpRequest.get(url);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
async generateCardsInBatch(request: CardBatchRequest): Promise<FiadoApiResponse<CardBatchResponse>> {
|
|
142
|
+
const url = `${this.baseUrl}/cards/batch`;
|
|
143
|
+
return await this.httpRequest.post(url, request);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async getCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>> {
|
|
147
|
+
const url = `${this.baseUrl}/cards/batch/${batchId}`;
|
|
148
|
+
return await this.httpRequest.get(url);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async deleteCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>> {
|
|
152
|
+
const url = `${this.baseUrl}/cards/batch/${batchId}`;
|
|
153
|
+
return await this.httpRequest.delete(url);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* STATEMENTS */
|
|
157
|
+
async getStatementsList(externalCardId: string): Promise<FiadoApiResponse<CardStatementListResponse[]>> {
|
|
158
|
+
const url = `${this.baseUrl}/statements/cards/${externalCardId}`;
|
|
159
|
+
return await this.httpRequest.get(url);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
async getStatementDocument(statementId: string): Promise<FiadoApiResponse<StatementDocumentResponse>> {
|
|
163
|
+
const url = `${this.baseUrl}/statements/document-url/${statementId}`;
|
|
164
|
+
return await this.httpRequest.get(url);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* TRANSACTIONS */
|
|
168
|
+
async getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>> {
|
|
169
|
+
const queryParams: string = this._invokerUtils.toQueryStringParameters(params);
|
|
170
|
+
const url = `${this.baseUrl}/transactions/history/${externalCardId}?${queryParams}`;
|
|
171
|
+
return await this.httpRequest.get(url);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
async getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>> {
|
|
175
|
+
const url = `${this.baseUrl}/transactions/${externalTransactionId}`;
|
|
176
|
+
return await this.httpRequest.get(url);
|
|
177
|
+
}
|
|
173
178
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './interfaces/ICentralPaymentsConnectorApi';
|
|
1
|
+
export * from './interfaces/ICentralPaymentsConnectorApi';
|
|
2
2
|
export * from './CentralPaymentsConnectorApi';
|
|
@@ -1,82 +1,84 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CreateBankAccountUserRequest,
|
|
3
|
-
CreateBankAccountUserResponse,
|
|
4
|
-
GetBankAccountUserResponse,
|
|
5
|
-
UpdateBankAccountUserRequest
|
|
6
|
-
} from "@fiado/type-kit/bin/account";
|
|
7
|
-
import {
|
|
8
|
-
CentralPaymentsDocumentUploadRequest,
|
|
9
|
-
HealthcheckResponse,
|
|
10
|
-
OOWQuestionsResponse,
|
|
11
|
-
SubmitOOWQuestionAnswersRequest
|
|
12
|
-
} from "@fiado/type-kit/bin/centralPayments";
|
|
13
|
-
import {
|
|
14
|
-
ActivateBankAccountCardRequest,
|
|
15
|
-
ActivateBankAccountCardResponse,
|
|
16
|
-
CardBatchRequest,
|
|
17
|
-
CardBatchResponse,
|
|
18
|
-
CardStatementListResponse,
|
|
19
|
-
GetBankAccountCardBalanceResponse,
|
|
20
|
-
GetBankAccountCardResponse,
|
|
21
|
-
StatementDocumentResponse,
|
|
22
|
-
UpdateBankAccountCardRequest,
|
|
23
|
-
UpdateBankAccountCardResponse
|
|
24
|
-
} from "@fiado/type-kit/bin/card";
|
|
25
|
-
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
26
|
-
import {
|
|
27
|
-
CentralPaymentsQueryParams,
|
|
28
|
-
CentralPaymentsTransactionItem,
|
|
29
|
-
TransactionListResponse
|
|
30
|
-
} from "@fiado/type-kit/bin/transaction";
|
|
31
|
-
|
|
32
|
-
export interface ICentralPaymentsConnectorApi {
|
|
33
|
-
healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
|
|
34
|
-
|
|
35
|
-
createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
36
|
-
|
|
37
|
-
getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
38
|
-
|
|
39
|
-
updateCardholder(externalUserId: string, request: UpdateBankAccountUserRequest): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
40
|
-
|
|
41
|
-
deleteCardholder(externalUserId: string): Promise<FiadoApiResponse<null>>;
|
|
42
|
-
|
|
43
|
-
getOOWQuestions(externalUserId: string): Promise<FiadoApiResponse<OOWQuestionsResponse[]>>;
|
|
44
|
-
|
|
45
|
-
submitOOWQuestionAnswers(externalUserId: string, request: SubmitOOWQuestionAnswersRequest[]): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
46
|
-
|
|
47
|
-
uploadDocuments(externalUserId: string, request: CentralPaymentsDocumentUploadRequest): Promise<FiadoApiResponse<null>>;
|
|
48
|
-
|
|
49
|
-
changePin(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<UpdateBankAccountCardResponse>>;
|
|
50
|
-
|
|
51
|
-
getCardsById(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
52
|
-
|
|
53
|
-
getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
54
|
-
|
|
55
|
-
activateCard(request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>>;
|
|
56
|
-
|
|
57
|
-
getCardBalance(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardBalanceResponse>>;
|
|
58
|
-
|
|
59
|
-
updateCard(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
60
|
-
|
|
61
|
-
updateCardProgram(externalCardId: string, programId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
62
|
-
|
|
63
|
-
orderPhysicalCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
import {
|
|
2
|
+
CreateBankAccountUserRequest,
|
|
3
|
+
CreateBankAccountUserResponse,
|
|
4
|
+
GetBankAccountUserResponse,
|
|
5
|
+
UpdateBankAccountUserRequest
|
|
6
|
+
} from "@fiado/type-kit/bin/account";
|
|
7
|
+
import {
|
|
8
|
+
CentralPaymentsDocumentUploadRequest,
|
|
9
|
+
HealthcheckResponse,
|
|
10
|
+
OOWQuestionsResponse,
|
|
11
|
+
SubmitOOWQuestionAnswersRequest
|
|
12
|
+
} from "@fiado/type-kit/bin/centralPayments";
|
|
13
|
+
import {
|
|
14
|
+
ActivateBankAccountCardRequest,
|
|
15
|
+
ActivateBankAccountCardResponse,
|
|
16
|
+
CardBatchRequest,
|
|
17
|
+
CardBatchResponse,
|
|
18
|
+
CardStatementListResponse,
|
|
19
|
+
GetBankAccountCardBalanceResponse,
|
|
20
|
+
GetBankAccountCardResponse,
|
|
21
|
+
StatementDocumentResponse,
|
|
22
|
+
UpdateBankAccountCardRequest,
|
|
23
|
+
UpdateBankAccountCardResponse
|
|
24
|
+
} from "@fiado/type-kit/bin/card";
|
|
25
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
26
|
+
import {
|
|
27
|
+
CentralPaymentsQueryParams,
|
|
28
|
+
CentralPaymentsTransactionItem,
|
|
29
|
+
TransactionListResponse
|
|
30
|
+
} from "@fiado/type-kit/bin/transaction";
|
|
31
|
+
|
|
32
|
+
export interface ICentralPaymentsConnectorApi {
|
|
33
|
+
healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
|
|
34
|
+
|
|
35
|
+
createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
36
|
+
|
|
37
|
+
getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
38
|
+
|
|
39
|
+
updateCardholder(externalUserId: string, request: UpdateBankAccountUserRequest): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
40
|
+
|
|
41
|
+
deleteCardholder(externalUserId: string): Promise<FiadoApiResponse<null>>;
|
|
42
|
+
|
|
43
|
+
getOOWQuestions(externalUserId: string): Promise<FiadoApiResponse<OOWQuestionsResponse[]>>;
|
|
44
|
+
|
|
45
|
+
submitOOWQuestionAnswers(externalUserId: string, request: SubmitOOWQuestionAnswersRequest[]): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
46
|
+
|
|
47
|
+
uploadDocuments(externalUserId: string, request: CentralPaymentsDocumentUploadRequest): Promise<FiadoApiResponse<null>>;
|
|
48
|
+
|
|
49
|
+
changePin(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<UpdateBankAccountCardResponse>>;
|
|
50
|
+
|
|
51
|
+
getCardsById(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
52
|
+
|
|
53
|
+
getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
54
|
+
|
|
55
|
+
activateCard(request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>>;
|
|
56
|
+
|
|
57
|
+
getCardBalance(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardBalanceResponse>>;
|
|
58
|
+
|
|
59
|
+
updateCard(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
60
|
+
|
|
61
|
+
updateCardProgram(externalCardId: string, programId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
62
|
+
|
|
63
|
+
orderPhysicalCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
64
|
+
|
|
65
|
+
createSecondaryCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
66
|
+
|
|
67
|
+
getCardsByUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
68
|
+
|
|
69
|
+
generateCardsInBatch(request: CardBatchRequest): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
70
|
+
|
|
71
|
+
getCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
72
|
+
|
|
73
|
+
deleteCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
74
|
+
|
|
75
|
+
getStatementsList(externalCardId: string): Promise<FiadoApiResponse<CardStatementListResponse[]>>;
|
|
76
|
+
|
|
77
|
+
getStatementDocument(statementId: string): Promise<FiadoApiResponse<StatementDocumentResponse>>;
|
|
78
|
+
|
|
79
|
+
getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>>;
|
|
80
|
+
|
|
81
|
+
getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
|
|
82
|
+
|
|
83
|
+
// TODO CREATE VIRTUAL CARD
|
|
82
84
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { inject, injectable } from "inversify";
|
|
3
|
-
import { ICnbvApi } from "./interfaces/ICnbvApi";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@injectable()
|
|
8
|
-
export default class CnbvApi implements ICnbvApi {
|
|
9
|
-
|
|
10
|
-
private readonly baseUrl = process.env.CNBV_LAMBDA_URL || "";
|
|
11
|
-
|
|
12
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
async validateConcidence(fullName: string, yearOfBirth: string): Promise<any> {
|
|
16
|
-
|
|
17
|
-
const url = `${this.baseUrl}?value=${yearOfBirth}¶m=YEAR_OF_BIRTH&fullName=${fullName}`;
|
|
18
|
-
|
|
19
|
-
return await this.httpRequest.get(url);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { ICnbvApi } from "./interfaces/ICnbvApi";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export default class CnbvApi implements ICnbvApi {
|
|
9
|
+
|
|
10
|
+
private readonly baseUrl = process.env.CNBV_LAMBDA_URL || "";
|
|
11
|
+
|
|
12
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
async validateConcidence(fullName: string, yearOfBirth: string): Promise<any> {
|
|
16
|
+
|
|
17
|
+
const url = `${this.baseUrl}?value=${yearOfBirth}¶m=YEAR_OF_BIRTH&fullName=${fullName}`;
|
|
18
|
+
|
|
19
|
+
return await this.httpRequest.get(url);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from './interfaces/ICnbvApi';
|
|
4
|
-
export * from './CnbvApi';
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export * from './interfaces/ICnbvApi';
|
|
4
|
+
export * from './CnbvApi';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface ICnbvApi {
|
|
4
|
-
|
|
5
|
-
validateConcidence(fullName:string, yearOfBirth: string): Promise<any>
|
|
6
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export interface ICnbvApi {
|
|
4
|
+
|
|
5
|
+
validateConcidence(fullName:string, yearOfBirth: string): Promise<any>
|
|
6
|
+
|
|
7
7
|
}
|