@enfuce/nextgen-sdk 0.0.3 → 0.0.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.
@@ -0,0 +1,615 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Exchange Rates API
5
+ * Endpoint for querying FX rates of payment scheme (including benchmark to ECB FX rates). API enables the issuer to comply with regulation (EU) 2019/518) and provide the cardholder with a better user experience by providing real-time visibility to scheme FX rates that are used for card transactions.
6
+ *
7
+ * The version of the OpenAPI document: 1
8
+ * Contact: info@enfuce.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from './configuration';
17
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from './common';
22
+ import type { RequestArgs } from './base';
23
+ // @ts-ignore
24
+ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
25
+
26
+ export interface ErrorResponse {
27
+ /**
28
+ * An error code indicating what kind of error. I.e. HTTP error code
29
+ */
30
+ 'code'?: string;
31
+ /**
32
+ * Error message in human-readable format
33
+ */
34
+ 'message'?: string;
35
+ /**
36
+ * Unique error identifier
37
+ */
38
+ 'id'?: string;
39
+ /**
40
+ * Enfuce code for a specific error type
41
+ */
42
+ 'errorCode'?: string;
43
+ /**
44
+ * Error type
45
+ */
46
+ 'errorType'?: ErrorResponseErrorTypeEnum;
47
+ /**
48
+ * Free-form text explaining the error reason
49
+ */
50
+ 'errorReason'?: string;
51
+ /**
52
+ * Datetime when error occurred
53
+ */
54
+ 'timestamp'?: string;
55
+ }
56
+
57
+ export const ErrorResponseErrorTypeEnum = {
58
+ StaticValidationError: 'STATIC_VALIDATION_ERROR',
59
+ DynamicValidationError: 'DYNAMIC_VALIDATION_ERROR',
60
+ IntegrationError: 'INTEGRATION_ERROR',
61
+ SecurityError: 'SECURITY_ERROR',
62
+ UnexpectedError: 'UNEXPECTED_ERROR',
63
+ } as const;
64
+
65
+ export type ErrorResponseErrorTypeEnum = typeof ErrorResponseErrorTypeEnum[keyof typeof ErrorResponseErrorTypeEnum];
66
+
67
+ export interface GetEcbRateV1Response {
68
+ /**
69
+ * Returns the ECB exchange rate.
70
+ */
71
+ 'rate'?: number;
72
+ }
73
+ export interface GetFxRatesV2Request {
74
+ /**
75
+ * The transaction amount in the foreign currency that the end user requests to convert
76
+ */
77
+ 'fromAmount': number;
78
+ /**
79
+ * The foreign currency that the end user requests to convert. Currency is given with a ISO 4217 currency code and needs to be a European Central Bank (\"ECB\") supported currency.
80
+ */
81
+ 'fromCurrency': string;
82
+ /**
83
+ * The card\'s settlement currency. Currency is given with a ISO 4217 currency code and needs to be a ECB supported currency.
84
+ */
85
+ 'toCurrency': string;
86
+ /**
87
+ * The issuer\'s mark-up percentage that is applied to foreign currency purchases
88
+ */
89
+ 'issuerMarkupPercentage': number;
90
+ }
91
+ export interface GetFxRatesV2Response {
92
+ /**
93
+ * The transaction amount in the foreign currency that the end user requests to convert
94
+ */
95
+ 'fromAmount'?: number;
96
+ /**
97
+ * The foreign currency that the end user requests to convert. Currency is given with a ISO 4217 currency code and needs to be a European Central Bank (\"ECB\") supported currency.
98
+ */
99
+ 'fromCurrency'?: string;
100
+ /**
101
+ * The card\'s settlement currency. Currency is given with a ISO 4217 currency code and needs to be a ECB supported currency.
102
+ */
103
+ 'toCurrency'?: string;
104
+ /**
105
+ * The transaction amount in the card\'s settlement currency converted with the payment scheme\'s rate but not considering the issuer mark-up. Derived by converting the fromAmount using payment scheme rates between from and to currency pairs. Mark-up rate is not included in the calculations. Exchange rates used for conversion will be the latest rates available. The value is always rounded to two (2) decimal places.
106
+ */
107
+ 'toAmountWithSchemeRate'?: number;
108
+ /**
109
+ * The transaction amount in the card\'s settlement currency converted with payment scheme\'s rate considering the issuer mark-up. Derived by converting the fromAmount using ECB rates between from and to currency pairs. Additional rate is not included in the calculations. Exchange rates used for conversion will be the latest rates available. The value is always rounded to two (2) decimal places.
110
+ */
111
+ 'toAmountWithMarkup'?: number;
112
+ /**
113
+ * The transaction amount in the card\'s settlement currency converted with the ECB\'s rate but not considering the issuer mark-up. Derived by converting the fromAmount using ECB rates between from and to currency pairs. Mark-up rate is not included in the calculations. Exchange rates used for conversion will be the latest rates available. The value is always rounded to two (2) decimal places.
114
+ */
115
+ 'toAmountWithEcbRate'?: number;
116
+ /**
117
+ * Payment scheme exchange rate for the fromCurrency and toCurrency currency pair. This rate will not include any issuer mark-up. The value is always rounded to four (4) decimal places. As of 12/2022, Visa and Mastercard update their exchange rates on business days at 1 AM (GMT) and at 6 PM (GMT) respectively. Please note that the times at which payment schemes update their rates is subject to change without advance notice. However, the exchange rate applied and provided by Enfuce is always the latest one at any given time.
118
+ */
119
+ 'fxRatePaymentScheme'?: number;
120
+ /**
121
+ * Payment scheme exchange rate for the fromCurrency and toCurrency currency pair. This rate will not include any issuer mark-up. The value is always rounded to eight (8) decimal places. As of 12/2022, Visa and Mastercard update their exchange rates on business days at 1 AM (GMT) and at 6 PM (GMT) respectively. Please note that the times at which payment schemes update their rates is subject to change without advance notice. However, the exchange rate applied and provided by Enfuce is always the latest one at any given time.
122
+ */
123
+ 'fxRatePaymentSchemeRaw'?: number;
124
+ /**
125
+ * Applicable exchange rate for the customer, i.e. payment scheme exchange rate between the fromCurrency and toCurrency currency pair including issuer mark-up. The value is always rounded to four (4) decimal places.
126
+ */
127
+ 'fxRateWithMarkup'?: number;
128
+ /**
129
+ * Applicable exchange rate for the customer, i.e. payment scheme exchange rate between the fromCurrency and toCurrency currency pair including issuer mark-up. The value is always rounded to eight (8) decimal places.
130
+ */
131
+ 'fxRateWithMarkupRaw'?: number;
132
+ /**
133
+ * ECB exchange rate between the fromCurrency and toCurrency currency pair including issuer mark-up. The value is always rounded to four (4) decimal places. As of 12/2022, the ECB updates exchange rates once per business day around 2 PM (GMT). Please note that the times at which the ECB updates its rates is subject to change without advance notice. However, the exchange rate applied and provided by Enfuce is always the latest one at any given time.
134
+ */
135
+ 'fxRateEcb'?: number;
136
+ /**
137
+ * ECB exchange rate between the fromCurrency and toCurrency currency pair including issuer mark-up. The value is always rounded to decimal (8) decimal places. As of 12/2022, the ECB updates exchange rates once per business day around 2 PM (GMT). Please note that the times at which the ECB updates its rates is subject to change without advance notice. However, the exchange rate applied and provided by Enfuce is always the latest one at any given time.
138
+ */
139
+ 'fxRateEcbRaw'?: number;
140
+ /**
141
+ * Comparison of the customer applicable rate (payment scheme rate plus issuer mark-up) versus the ECB rate expressed as a percentage. A positive value represents in percentages how much higher the customer applicable rate is compared to the ECB rate.
142
+ */
143
+ 'markupPercentageOverEcb'?: number;
144
+ }
145
+ export interface GetVisaFxRatesV1Request {
146
+ /**
147
+ * From Amount also known as transaction amount that will be converted from the \"fromCurrency\" and to the \"toCurrency\"
148
+ */
149
+ 'fromAmount': number;
150
+ /**
151
+ * Any ECB supported currency with valid ISO 4217 currency code
152
+ */
153
+ 'fromCurrency': string;
154
+ /**
155
+ * Any ECB supported currency with valid ISO 4217 currency code
156
+ */
157
+ 'toCurrency': string;
158
+ }
159
+ export interface GetVisaFxRatesV1Response {
160
+ /**
161
+ * From Amount also known as transaction amount that will be converted from the \"fromCurrency\" to the \"toCurrency\".
162
+ */
163
+ 'fromAmount'?: number;
164
+ /**
165
+ * Any ECB supported currency with valid ISO 4217 currency code
166
+ */
167
+ 'fromCurrency'?: string;
168
+ /**
169
+ * Any ECB supported currency with valid ISO 4217 currency code
170
+ */
171
+ 'toCurrency'?: string;
172
+ /**
173
+ * To Amount also referred to as Cardholder Billing amount without additionalRate. Derived by converting the fromAmount using Visa Treasury Rates between from and to currency pairs. Additional rate is not included in the calculations. Visa treasury rates used for conversion will be as of the last rates available.
174
+ */
175
+ 'toAmountWithVisaRate'?: number;
176
+ /**
177
+ * Also referred to as Cardholder Billing amount with additional rate. Derived by converting the fromAmount using Visa Treasury Rates between fromCurrency and toCurrency currency pairs. additionalRate is included in the calculations. Visa treasury rates used for conversion will be as of the last rates available.
178
+ */
179
+ 'toAmountWithAdditionalFee'?: number;
180
+ /**
181
+ * Visa Treasury Exchange Rate for the fromCurrency and toCurrency currency pair. This rate will not include any additionalRate
182
+ */
183
+ 'fxRateVisa'?: number;
184
+ /**
185
+ * Applicable Exchange Rate between the fromCurrency and toCurrency currency pair including additionalRate.
186
+ */
187
+ 'fxRateWithAdditionalFee'?: number;
188
+ /**
189
+ * ISO-8601 date when the Visa Treasury rates were last updated for calculations.
190
+ */
191
+ 'visaRateLastUpdatedTimestamp'?: string;
192
+ 'benchmarks'?: Array<GetVisaFxRatesV1ResponseBenchmarksInner>;
193
+ }
194
+ /**
195
+ * Will return all the benchmark properties that apply to the fromCurrency and toCurrency pair in the Visa system. The API is built to support several benchmarks but ECB is the only available benchmark for now.
196
+ */
197
+ export interface GetVisaFxRatesV1ResponseBenchmarksInner {
198
+ /**
199
+ * The benchmark system used for getting the benchmark properties. For example will be ECB for ECB benchmark rate system. All benchmark rates and any markups are calculated based on the last available benchmark rates (from the standard rate system - in this case ECB) and Visa treasury rates
200
+ */
201
+ 'benchmarkSystem'?: string;
202
+ /**
203
+ * Derived by converting the fromAmount using Benchmark Rates between fromCurrency and toCurrency currency pairs. additionalRate is not included in the calculations. Benchmark rates used for conversion will be as of the last rates available on the benchmark system for example ECB.
204
+ */
205
+ 'toAmountWithBenchmarkRate'?: number;
206
+ /**
207
+ * Markup calculated between the toAmountWithAdditionalFee and toAmountWithBenchmarkRate. Calculated as (toAmountWithAdditionalFee - toAmountWithBenchmarkRate)/toAmountWithBenchmarkRate.
208
+ */
209
+ 'markupWithAdditionalFee'?: number;
210
+ /**
211
+ * Exchange rate between the \"from\" and \"to\" currency pair using the benchmark rates
212
+ */
213
+ 'benchmarkFxRate'?: number;
214
+ /**
215
+ * ISO-8601 date when the benchmark rates were last updated for calculations.
216
+ */
217
+ 'benchmarkRateLastUpdatedTimestamp'?: string;
218
+ }
219
+ /**
220
+ * Indicates the applicable payment scheme
221
+ */
222
+
223
+ export const PaymentScheme = {
224
+ Visa: 'VISA',
225
+ Mc: 'MC',
226
+ } as const;
227
+
228
+ export type PaymentScheme = typeof PaymentScheme[keyof typeof PaymentScheme];
229
+
230
+
231
+
232
+ /**
233
+ * GetECBExchangeRateApi - axios parameter creator
234
+ */
235
+ export const GetECBExchangeRateApiAxiosParamCreator = function (configuration?: Configuration) {
236
+ return {
237
+ /**
238
+ * Send a request to this endpoint to get ECB rate for a given “from” and “to” currency pair.
239
+ * @summary ECB Exchange Rates
240
+ * @param {string} fromCurrency
241
+ * @param {string} toCurrency
242
+ * @param {*} [options] Override http request option.
243
+ * @throws {RequiredError}
244
+ */
245
+ getEcbRateV1: async (fromCurrency: string, toCurrency: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
246
+ // verify required parameter 'fromCurrency' is not null or undefined
247
+ assertParamExists('getEcbRateV1', 'fromCurrency', fromCurrency)
248
+ // verify required parameter 'toCurrency' is not null or undefined
249
+ assertParamExists('getEcbRateV1', 'toCurrency', toCurrency)
250
+ const localVarPath = `/v1/ecb/{fromCurrency}/{toCurrency}`
251
+ .replace('{fromCurrency}', encodeURIComponent(String(fromCurrency)))
252
+ .replace('{toCurrency}', encodeURIComponent(String(toCurrency)));
253
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
254
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
255
+ let baseOptions;
256
+ if (configuration) {
257
+ baseOptions = configuration.baseOptions;
258
+ }
259
+
260
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
261
+ const localVarHeaderParameter = {} as any;
262
+ const localVarQueryParameter = {} as any;
263
+
264
+ localVarHeaderParameter['Accept'] = 'application/json';
265
+
266
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
267
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
268
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
269
+
270
+ return {
271
+ url: toPathString(localVarUrlObj),
272
+ options: localVarRequestOptions,
273
+ };
274
+ },
275
+ }
276
+ };
277
+
278
+ /**
279
+ * GetECBExchangeRateApi - functional programming interface
280
+ */
281
+ export const GetECBExchangeRateApiFp = function(configuration?: Configuration) {
282
+ const localVarAxiosParamCreator = GetECBExchangeRateApiAxiosParamCreator(configuration)
283
+ return {
284
+ /**
285
+ * Send a request to this endpoint to get ECB rate for a given “from” and “to” currency pair.
286
+ * @summary ECB Exchange Rates
287
+ * @param {string} fromCurrency
288
+ * @param {string} toCurrency
289
+ * @param {*} [options] Override http request option.
290
+ * @throws {RequiredError}
291
+ */
292
+ async getEcbRateV1(fromCurrency: string, toCurrency: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetEcbRateV1Response>> {
293
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getEcbRateV1(fromCurrency, toCurrency, options);
294
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
295
+ const localVarOperationServerBasePath = operationServerMap['GetECBExchangeRateApi.getEcbRateV1']?.[localVarOperationServerIndex]?.url;
296
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
297
+ },
298
+ }
299
+ };
300
+
301
+ /**
302
+ * GetECBExchangeRateApi - factory interface
303
+ */
304
+ export const GetECBExchangeRateApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
305
+ const localVarFp = GetECBExchangeRateApiFp(configuration)
306
+ return {
307
+ /**
308
+ * Send a request to this endpoint to get ECB rate for a given “from” and “to” currency pair.
309
+ * @summary ECB Exchange Rates
310
+ * @param {string} fromCurrency
311
+ * @param {string} toCurrency
312
+ * @param {*} [options] Override http request option.
313
+ * @throws {RequiredError}
314
+ */
315
+ getEcbRateV1(fromCurrency: string, toCurrency: string, options?: RawAxiosRequestConfig): AxiosPromise<GetEcbRateV1Response> {
316
+ return localVarFp.getEcbRateV1(fromCurrency, toCurrency, options).then((request) => request(axios, basePath));
317
+ },
318
+ };
319
+ };
320
+
321
+ /**
322
+ * GetECBExchangeRateApi - object-oriented interface
323
+ */
324
+ export class GetECBExchangeRateApi extends BaseAPI {
325
+ /**
326
+ * Send a request to this endpoint to get ECB rate for a given “from” and “to” currency pair.
327
+ * @summary ECB Exchange Rates
328
+ * @param {string} fromCurrency
329
+ * @param {string} toCurrency
330
+ * @param {*} [options] Override http request option.
331
+ * @throws {RequiredError}
332
+ */
333
+ public getEcbRateV1(fromCurrency: string, toCurrency: string, options?: RawAxiosRequestConfig) {
334
+ return GetECBExchangeRateApiFp(this.configuration).getEcbRateV1(fromCurrency, toCurrency, options).then((request) => request(this.axios, this.basePath));
335
+ }
336
+ }
337
+
338
+
339
+
340
+ /**
341
+ * GetECBSupportedCurrenciesApi - axios parameter creator
342
+ */
343
+ export const GetECBSupportedCurrenciesApiAxiosParamCreator = function (configuration?: Configuration) {
344
+ return {
345
+ /**
346
+ * Send a request to this endpoint to retrieve the list of currencies that the ECB supports.
347
+ * @summary ECB Supported Currencies
348
+ * @param {*} [options] Override http request option.
349
+ * @throws {RequiredError}
350
+ */
351
+ getEcbSupportedCurrenciesV1: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
352
+ const localVarPath = `/v1/ecb/currencies`;
353
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
354
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
355
+ let baseOptions;
356
+ if (configuration) {
357
+ baseOptions = configuration.baseOptions;
358
+ }
359
+
360
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
361
+ const localVarHeaderParameter = {} as any;
362
+ const localVarQueryParameter = {} as any;
363
+
364
+ localVarHeaderParameter['Accept'] = 'application/json';
365
+
366
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
367
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
368
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
369
+
370
+ return {
371
+ url: toPathString(localVarUrlObj),
372
+ options: localVarRequestOptions,
373
+ };
374
+ },
375
+ }
376
+ };
377
+
378
+ /**
379
+ * GetECBSupportedCurrenciesApi - functional programming interface
380
+ */
381
+ export const GetECBSupportedCurrenciesApiFp = function(configuration?: Configuration) {
382
+ const localVarAxiosParamCreator = GetECBSupportedCurrenciesApiAxiosParamCreator(configuration)
383
+ return {
384
+ /**
385
+ * Send a request to this endpoint to retrieve the list of currencies that the ECB supports.
386
+ * @summary ECB Supported Currencies
387
+ * @param {*} [options] Override http request option.
388
+ * @throws {RequiredError}
389
+ */
390
+ async getEcbSupportedCurrenciesV1(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<string>>> {
391
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getEcbSupportedCurrenciesV1(options);
392
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
393
+ const localVarOperationServerBasePath = operationServerMap['GetECBSupportedCurrenciesApi.getEcbSupportedCurrenciesV1']?.[localVarOperationServerIndex]?.url;
394
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
395
+ },
396
+ }
397
+ };
398
+
399
+ /**
400
+ * GetECBSupportedCurrenciesApi - factory interface
401
+ */
402
+ export const GetECBSupportedCurrenciesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
403
+ const localVarFp = GetECBSupportedCurrenciesApiFp(configuration)
404
+ return {
405
+ /**
406
+ * Send a request to this endpoint to retrieve the list of currencies that the ECB supports.
407
+ * @summary ECB Supported Currencies
408
+ * @param {*} [options] Override http request option.
409
+ * @throws {RequiredError}
410
+ */
411
+ getEcbSupportedCurrenciesV1(options?: RawAxiosRequestConfig): AxiosPromise<Array<string>> {
412
+ return localVarFp.getEcbSupportedCurrenciesV1(options).then((request) => request(axios, basePath));
413
+ },
414
+ };
415
+ };
416
+
417
+ /**
418
+ * GetECBSupportedCurrenciesApi - object-oriented interface
419
+ */
420
+ export class GetECBSupportedCurrenciesApi extends BaseAPI {
421
+ /**
422
+ * Send a request to this endpoint to retrieve the list of currencies that the ECB supports.
423
+ * @summary ECB Supported Currencies
424
+ * @param {*} [options] Override http request option.
425
+ * @throws {RequiredError}
426
+ */
427
+ public getEcbSupportedCurrenciesV1(options?: RawAxiosRequestConfig) {
428
+ return GetECBSupportedCurrenciesApiFp(this.configuration).getEcbSupportedCurrenciesV1(options).then((request) => request(this.axios, this.basePath));
429
+ }
430
+ }
431
+
432
+
433
+
434
+ /**
435
+ * GetFXExchangeRatesApi - axios parameter creator
436
+ */
437
+ export const GetFXExchangeRatesApiAxiosParamCreator = function (configuration?: Configuration) {
438
+ return {
439
+ /**
440
+ * Send a request to this endpoint to retrieve the Visa/Mastercard treasury FX rates for a given “from” and “to” currency pair.
441
+ * @summary FX Exchange Rates for Visa and Mastercard
442
+ * @param {PaymentScheme} paymentScheme Payment scheme
443
+ * @param {GetFxRatesV2Request} getFxRatesV2Request
444
+ * @param {*} [options] Override http request option.
445
+ * @throws {RequiredError}
446
+ */
447
+ getSchemeFxRatesV2: async (paymentScheme: PaymentScheme, getFxRatesV2Request: GetFxRatesV2Request, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
448
+ // verify required parameter 'paymentScheme' is not null or undefined
449
+ assertParamExists('getSchemeFxRatesV2', 'paymentScheme', paymentScheme)
450
+ // verify required parameter 'getFxRatesV2Request' is not null or undefined
451
+ assertParamExists('getSchemeFxRatesV2', 'getFxRatesV2Request', getFxRatesV2Request)
452
+ const localVarPath = `/v2/{paymentScheme}/fx`
453
+ .replace('{paymentScheme}', encodeURIComponent(String(paymentScheme)));
454
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
455
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
456
+ let baseOptions;
457
+ if (configuration) {
458
+ baseOptions = configuration.baseOptions;
459
+ }
460
+
461
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
462
+ const localVarHeaderParameter = {} as any;
463
+ const localVarQueryParameter = {} as any;
464
+
465
+ localVarHeaderParameter['Content-Type'] = 'application/json';
466
+ localVarHeaderParameter['Accept'] = 'application/json';
467
+
468
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
469
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
470
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
471
+ localVarRequestOptions.data = serializeDataIfNeeded(getFxRatesV2Request, localVarRequestOptions, configuration)
472
+
473
+ return {
474
+ url: toPathString(localVarUrlObj),
475
+ options: localVarRequestOptions,
476
+ };
477
+ },
478
+ /**
479
+ * This operation is to get the VISA treasury FX rates for a given “from” and “to” currency pair.
480
+ * @summary VISA FX Exchange Rates
481
+ * @param {GetVisaFxRatesV1Request} getVisaFxRatesV1Request
482
+ * @param {*} [options] Override http request option.
483
+ * @deprecated
484
+ * @throws {RequiredError}
485
+ */
486
+ getVisaFxRatesV1: async (getVisaFxRatesV1Request: GetVisaFxRatesV1Request, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
487
+ // verify required parameter 'getVisaFxRatesV1Request' is not null or undefined
488
+ assertParamExists('getVisaFxRatesV1', 'getVisaFxRatesV1Request', getVisaFxRatesV1Request)
489
+ const localVarPath = `/v1/visa/fx`;
490
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
491
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
492
+ let baseOptions;
493
+ if (configuration) {
494
+ baseOptions = configuration.baseOptions;
495
+ }
496
+
497
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
498
+ const localVarHeaderParameter = {} as any;
499
+ const localVarQueryParameter = {} as any;
500
+
501
+ localVarHeaderParameter['Content-Type'] = 'application/json';
502
+ localVarHeaderParameter['Accept'] = 'application/json';
503
+
504
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
505
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
506
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
507
+ localVarRequestOptions.data = serializeDataIfNeeded(getVisaFxRatesV1Request, localVarRequestOptions, configuration)
508
+
509
+ return {
510
+ url: toPathString(localVarUrlObj),
511
+ options: localVarRequestOptions,
512
+ };
513
+ },
514
+ }
515
+ };
516
+
517
+ /**
518
+ * GetFXExchangeRatesApi - functional programming interface
519
+ */
520
+ export const GetFXExchangeRatesApiFp = function(configuration?: Configuration) {
521
+ const localVarAxiosParamCreator = GetFXExchangeRatesApiAxiosParamCreator(configuration)
522
+ return {
523
+ /**
524
+ * Send a request to this endpoint to retrieve the Visa/Mastercard treasury FX rates for a given “from” and “to” currency pair.
525
+ * @summary FX Exchange Rates for Visa and Mastercard
526
+ * @param {PaymentScheme} paymentScheme Payment scheme
527
+ * @param {GetFxRatesV2Request} getFxRatesV2Request
528
+ * @param {*} [options] Override http request option.
529
+ * @throws {RequiredError}
530
+ */
531
+ async getSchemeFxRatesV2(paymentScheme: PaymentScheme, getFxRatesV2Request: GetFxRatesV2Request, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetFxRatesV2Response>> {
532
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getSchemeFxRatesV2(paymentScheme, getFxRatesV2Request, options);
533
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
534
+ const localVarOperationServerBasePath = operationServerMap['GetFXExchangeRatesApi.getSchemeFxRatesV2']?.[localVarOperationServerIndex]?.url;
535
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
536
+ },
537
+ /**
538
+ * This operation is to get the VISA treasury FX rates for a given “from” and “to” currency pair.
539
+ * @summary VISA FX Exchange Rates
540
+ * @param {GetVisaFxRatesV1Request} getVisaFxRatesV1Request
541
+ * @param {*} [options] Override http request option.
542
+ * @deprecated
543
+ * @throws {RequiredError}
544
+ */
545
+ async getVisaFxRatesV1(getVisaFxRatesV1Request: GetVisaFxRatesV1Request, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetVisaFxRatesV1Response>> {
546
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getVisaFxRatesV1(getVisaFxRatesV1Request, options);
547
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
548
+ const localVarOperationServerBasePath = operationServerMap['GetFXExchangeRatesApi.getVisaFxRatesV1']?.[localVarOperationServerIndex]?.url;
549
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
550
+ },
551
+ }
552
+ };
553
+
554
+ /**
555
+ * GetFXExchangeRatesApi - factory interface
556
+ */
557
+ export const GetFXExchangeRatesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
558
+ const localVarFp = GetFXExchangeRatesApiFp(configuration)
559
+ return {
560
+ /**
561
+ * Send a request to this endpoint to retrieve the Visa/Mastercard treasury FX rates for a given “from” and “to” currency pair.
562
+ * @summary FX Exchange Rates for Visa and Mastercard
563
+ * @param {PaymentScheme} paymentScheme Payment scheme
564
+ * @param {GetFxRatesV2Request} getFxRatesV2Request
565
+ * @param {*} [options] Override http request option.
566
+ * @throws {RequiredError}
567
+ */
568
+ getSchemeFxRatesV2(paymentScheme: PaymentScheme, getFxRatesV2Request: GetFxRatesV2Request, options?: RawAxiosRequestConfig): AxiosPromise<GetFxRatesV2Response> {
569
+ return localVarFp.getSchemeFxRatesV2(paymentScheme, getFxRatesV2Request, options).then((request) => request(axios, basePath));
570
+ },
571
+ /**
572
+ * This operation is to get the VISA treasury FX rates for a given “from” and “to” currency pair.
573
+ * @summary VISA FX Exchange Rates
574
+ * @param {GetVisaFxRatesV1Request} getVisaFxRatesV1Request
575
+ * @param {*} [options] Override http request option.
576
+ * @deprecated
577
+ * @throws {RequiredError}
578
+ */
579
+ getVisaFxRatesV1(getVisaFxRatesV1Request: GetVisaFxRatesV1Request, options?: RawAxiosRequestConfig): AxiosPromise<GetVisaFxRatesV1Response> {
580
+ return localVarFp.getVisaFxRatesV1(getVisaFxRatesV1Request, options).then((request) => request(axios, basePath));
581
+ },
582
+ };
583
+ };
584
+
585
+ /**
586
+ * GetFXExchangeRatesApi - object-oriented interface
587
+ */
588
+ export class GetFXExchangeRatesApi extends BaseAPI {
589
+ /**
590
+ * Send a request to this endpoint to retrieve the Visa/Mastercard treasury FX rates for a given “from” and “to” currency pair.
591
+ * @summary FX Exchange Rates for Visa and Mastercard
592
+ * @param {PaymentScheme} paymentScheme Payment scheme
593
+ * @param {GetFxRatesV2Request} getFxRatesV2Request
594
+ * @param {*} [options] Override http request option.
595
+ * @throws {RequiredError}
596
+ */
597
+ public getSchemeFxRatesV2(paymentScheme: PaymentScheme, getFxRatesV2Request: GetFxRatesV2Request, options?: RawAxiosRequestConfig) {
598
+ return GetFXExchangeRatesApiFp(this.configuration).getSchemeFxRatesV2(paymentScheme, getFxRatesV2Request, options).then((request) => request(this.axios, this.basePath));
599
+ }
600
+
601
+ /**
602
+ * This operation is to get the VISA treasury FX rates for a given “from” and “to” currency pair.
603
+ * @summary VISA FX Exchange Rates
604
+ * @param {GetVisaFxRatesV1Request} getVisaFxRatesV1Request
605
+ * @param {*} [options] Override http request option.
606
+ * @deprecated
607
+ * @throws {RequiredError}
608
+ */
609
+ public getVisaFxRatesV1(getVisaFxRatesV1Request: GetVisaFxRatesV1Request, options?: RawAxiosRequestConfig) {
610
+ return GetFXExchangeRatesApiFp(this.configuration).getVisaFxRatesV1(getVisaFxRatesV1Request, options).then((request) => request(this.axios, this.basePath));
611
+ }
612
+ }
613
+
614
+
615
+
@@ -0,0 +1,62 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Exchange Rates API
5
+ * Endpoint for querying FX rates of payment scheme (including benchmark to ECB FX rates). API enables the issuer to comply with regulation (EU) 2019/518) and provide the cardholder with a better user experience by providing real-time visibility to scheme FX rates that are used for card transactions.
6
+ *
7
+ * The version of the OpenAPI document: 1
8
+ * Contact: info@enfuce.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from './configuration';
17
+ // Some imports not used depending on template conditions
18
+ // @ts-ignore
19
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
20
+ import globalAxios from 'axios';
21
+
22
+ export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
23
+
24
+ export const COLLECTION_FORMATS = {
25
+ csv: ",",
26
+ ssv: " ",
27
+ tsv: "\t",
28
+ pipes: "|",
29
+ };
30
+
31
+ export interface RequestArgs {
32
+ url: string;
33
+ options: RawAxiosRequestConfig;
34
+ }
35
+
36
+ export class BaseAPI {
37
+ protected configuration: Configuration | undefined;
38
+
39
+ constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
40
+ if (configuration) {
41
+ this.configuration = configuration;
42
+ this.basePath = configuration.basePath ?? basePath;
43
+ }
44
+ }
45
+ };
46
+
47
+ export class RequiredError extends Error {
48
+ constructor(public field: string, msg?: string) {
49
+ super(msg);
50
+ this.name = "RequiredError"
51
+ }
52
+ }
53
+
54
+ interface ServerMap {
55
+ [key: string]: {
56
+ url: string,
57
+ description: string,
58
+ }[];
59
+ }
60
+
61
+ export const operationServerMap: ServerMap = {
62
+ }