@jugarhoy/api 1.1.51 → 1.1.55

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.
@@ -22,6 +22,7 @@ import type {
22
22
  ErrorResponse,
23
23
  GetMercadoPagoAuthUrl200Response,
24
24
  SetAuthCodeDto,
25
+ SetCucuruCredentialsRequest,
25
26
  SuccessResponse,
26
27
  } from '../models/index';
27
28
  import {
@@ -39,6 +40,8 @@ import {
39
40
  GetMercadoPagoAuthUrl200ResponseToJSON,
40
41
  SetAuthCodeDtoFromJSON,
41
42
  SetAuthCodeDtoToJSON,
43
+ SetCucuruCredentialsRequestFromJSON,
44
+ SetCucuruCredentialsRequestToJSON,
42
45
  SuccessResponseFromJSON,
43
46
  SuccessResponseToJSON,
44
47
  } from '../models/index';
@@ -59,6 +62,11 @@ export interface SetAuthCodeRequest {
59
62
  setAuthCodeDto: SetAuthCodeDto;
60
63
  }
61
64
 
65
+ export interface SetCucuruCredentialsOperationRequest {
66
+ id: string;
67
+ setCucuruCredentialsRequest: SetCucuruCredentialsRequest;
68
+ }
69
+
62
70
  export interface UpdatePaymentConfigRequest {
63
71
  id: string;
64
72
  customerPaymentConfigDto: CustomerPaymentConfigDto;
@@ -341,6 +349,56 @@ export class AdminPaymentConfigsApi extends runtime.BaseAPI {
341
349
  return await response.value();
342
350
  }
343
351
 
352
+ /**
353
+ * Set Cucuru API credentials on a TRANSFER_CUCURU payment configuration
354
+ */
355
+ async setCucuruCredentialsRaw(requestParameters: SetCucuruCredentialsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
356
+ if (requestParameters['id'] == null) {
357
+ throw new runtime.RequiredError(
358
+ 'id',
359
+ 'Required parameter "id" was null or undefined when calling setCucuruCredentials().'
360
+ );
361
+ }
362
+
363
+ if (requestParameters['setCucuruCredentialsRequest'] == null) {
364
+ throw new runtime.RequiredError(
365
+ 'setCucuruCredentialsRequest',
366
+ 'Required parameter "setCucuruCredentialsRequest" was null or undefined when calling setCucuruCredentials().'
367
+ );
368
+ }
369
+
370
+ const queryParameters: any = {};
371
+
372
+ const headerParameters: runtime.HTTPHeaders = {};
373
+
374
+ headerParameters['Content-Type'] = 'application/json';
375
+
376
+ if (this.configuration && this.configuration.accessToken) {
377
+ const token = this.configuration.accessToken;
378
+ const tokenString = await token("bearerAuth", []);
379
+
380
+ if (tokenString) {
381
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
382
+ }
383
+ }
384
+ const response = await this.request({
385
+ path: `/api/admin/payment-configs/{id}/cucuru-credentials`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
386
+ method: 'POST',
387
+ headers: headerParameters,
388
+ query: queryParameters,
389
+ body: SetCucuruCredentialsRequestToJSON(requestParameters['setCucuruCredentialsRequest']),
390
+ }, initOverrides);
391
+
392
+ return new runtime.VoidApiResponse(response);
393
+ }
394
+
395
+ /**
396
+ * Set Cucuru API credentials on a TRANSFER_CUCURU payment configuration
397
+ */
398
+ async setCucuruCredentials(requestParameters: SetCucuruCredentialsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
399
+ await this.setCucuruCredentialsRaw(requestParameters, initOverrides);
400
+ }
401
+
344
402
  /**
345
403
  * Update an existing customer payment configuration
346
404
  */
@@ -0,0 +1,263 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Jugar Hoy - API
5
+ * API documentation for Jugar Hoy application
6
+ *
7
+ * The version of the OpenAPI document: 1.5.0
8
+ *
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 * as runtime from '../runtime';
17
+ import type {
18
+ AdminCreatePaymentMethodRequest,
19
+ AdminUpdatePaymentMethodRequest,
20
+ PaymentMethodInfoDto,
21
+ } from '../models/index';
22
+ import {
23
+ AdminCreatePaymentMethodRequestFromJSON,
24
+ AdminCreatePaymentMethodRequestToJSON,
25
+ AdminUpdatePaymentMethodRequestFromJSON,
26
+ AdminUpdatePaymentMethodRequestToJSON,
27
+ PaymentMethodInfoDtoFromJSON,
28
+ PaymentMethodInfoDtoToJSON,
29
+ } from '../models/index';
30
+
31
+ export interface AdminCreatePaymentMethodOperationRequest {
32
+ adminCreatePaymentMethodRequest: AdminCreatePaymentMethodRequest;
33
+ }
34
+
35
+ export interface AdminDeletePaymentMethodRequest {
36
+ id: string;
37
+ }
38
+
39
+ export interface AdminGetPaymentMethodRequest {
40
+ id: string;
41
+ }
42
+
43
+ export interface AdminUpdatePaymentMethodOperationRequest {
44
+ id: string;
45
+ adminUpdatePaymentMethodRequest: AdminUpdatePaymentMethodRequest;
46
+ }
47
+
48
+ /**
49
+ *
50
+ */
51
+ export class AdminPaymentsApi extends runtime.BaseAPI {
52
+
53
+ /**
54
+ * Create a new payment method info row
55
+ */
56
+ async adminCreatePaymentMethodRaw(requestParameters: AdminCreatePaymentMethodOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaymentMethodInfoDto>> {
57
+ if (requestParameters['adminCreatePaymentMethodRequest'] == null) {
58
+ throw new runtime.RequiredError(
59
+ 'adminCreatePaymentMethodRequest',
60
+ 'Required parameter "adminCreatePaymentMethodRequest" was null or undefined when calling adminCreatePaymentMethod().'
61
+ );
62
+ }
63
+
64
+ const queryParameters: any = {};
65
+
66
+ const headerParameters: runtime.HTTPHeaders = {};
67
+
68
+ headerParameters['Content-Type'] = 'application/json';
69
+
70
+ if (this.configuration && this.configuration.accessToken) {
71
+ const token = this.configuration.accessToken;
72
+ const tokenString = await token("bearerAuth", []);
73
+
74
+ if (tokenString) {
75
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
76
+ }
77
+ }
78
+ const response = await this.request({
79
+ path: `/api/admin/payment-methods`,
80
+ method: 'POST',
81
+ headers: headerParameters,
82
+ query: queryParameters,
83
+ body: AdminCreatePaymentMethodRequestToJSON(requestParameters['adminCreatePaymentMethodRequest']),
84
+ }, initOverrides);
85
+
86
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaymentMethodInfoDtoFromJSON(jsonValue));
87
+ }
88
+
89
+ /**
90
+ * Create a new payment method info row
91
+ */
92
+ async adminCreatePaymentMethod(requestParameters: AdminCreatePaymentMethodOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaymentMethodInfoDto> {
93
+ const response = await this.adminCreatePaymentMethodRaw(requestParameters, initOverrides);
94
+ return await response.value();
95
+ }
96
+
97
+ /**
98
+ * Delete a payment method info row
99
+ */
100
+ async adminDeletePaymentMethodRaw(requestParameters: AdminDeletePaymentMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
101
+ if (requestParameters['id'] == null) {
102
+ throw new runtime.RequiredError(
103
+ 'id',
104
+ 'Required parameter "id" was null or undefined when calling adminDeletePaymentMethod().'
105
+ );
106
+ }
107
+
108
+ const queryParameters: any = {};
109
+
110
+ const headerParameters: runtime.HTTPHeaders = {};
111
+
112
+ if (this.configuration && this.configuration.accessToken) {
113
+ const token = this.configuration.accessToken;
114
+ const tokenString = await token("bearerAuth", []);
115
+
116
+ if (tokenString) {
117
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
118
+ }
119
+ }
120
+ const response = await this.request({
121
+ path: `/api/admin/payment-methods/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
122
+ method: 'DELETE',
123
+ headers: headerParameters,
124
+ query: queryParameters,
125
+ }, initOverrides);
126
+
127
+ return new runtime.VoidApiResponse(response);
128
+ }
129
+
130
+ /**
131
+ * Delete a payment method info row
132
+ */
133
+ async adminDeletePaymentMethod(requestParameters: AdminDeletePaymentMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
134
+ await this.adminDeletePaymentMethodRaw(requestParameters, initOverrides);
135
+ }
136
+
137
+ /**
138
+ * Get a payment method by ID
139
+ */
140
+ async adminGetPaymentMethodRaw(requestParameters: AdminGetPaymentMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaymentMethodInfoDto>> {
141
+ if (requestParameters['id'] == null) {
142
+ throw new runtime.RequiredError(
143
+ 'id',
144
+ 'Required parameter "id" was null or undefined when calling adminGetPaymentMethod().'
145
+ );
146
+ }
147
+
148
+ const queryParameters: any = {};
149
+
150
+ const headerParameters: runtime.HTTPHeaders = {};
151
+
152
+ if (this.configuration && this.configuration.accessToken) {
153
+ const token = this.configuration.accessToken;
154
+ const tokenString = await token("bearerAuth", []);
155
+
156
+ if (tokenString) {
157
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
158
+ }
159
+ }
160
+ const response = await this.request({
161
+ path: `/api/admin/payment-methods/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
162
+ method: 'GET',
163
+ headers: headerParameters,
164
+ query: queryParameters,
165
+ }, initOverrides);
166
+
167
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaymentMethodInfoDtoFromJSON(jsonValue));
168
+ }
169
+
170
+ /**
171
+ * Get a payment method by ID
172
+ */
173
+ async adminGetPaymentMethod(requestParameters: AdminGetPaymentMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaymentMethodInfoDto> {
174
+ const response = await this.adminGetPaymentMethodRaw(requestParameters, initOverrides);
175
+ return await response.value();
176
+ }
177
+
178
+ /**
179
+ * List all payment methods (including disabled)
180
+ */
181
+ async adminListPaymentMethodsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PaymentMethodInfoDto>>> {
182
+ const queryParameters: any = {};
183
+
184
+ const headerParameters: runtime.HTTPHeaders = {};
185
+
186
+ if (this.configuration && this.configuration.accessToken) {
187
+ const token = this.configuration.accessToken;
188
+ const tokenString = await token("bearerAuth", []);
189
+
190
+ if (tokenString) {
191
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
192
+ }
193
+ }
194
+ const response = await this.request({
195
+ path: `/api/admin/payment-methods`,
196
+ method: 'GET',
197
+ headers: headerParameters,
198
+ query: queryParameters,
199
+ }, initOverrides);
200
+
201
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PaymentMethodInfoDtoFromJSON));
202
+ }
203
+
204
+ /**
205
+ * List all payment methods (including disabled)
206
+ */
207
+ async adminListPaymentMethods(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PaymentMethodInfoDto>> {
208
+ const response = await this.adminListPaymentMethodsRaw(initOverrides);
209
+ return await response.value();
210
+ }
211
+
212
+ /**
213
+ * Update a payment method info row
214
+ */
215
+ async adminUpdatePaymentMethodRaw(requestParameters: AdminUpdatePaymentMethodOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaymentMethodInfoDto>> {
216
+ if (requestParameters['id'] == null) {
217
+ throw new runtime.RequiredError(
218
+ 'id',
219
+ 'Required parameter "id" was null or undefined when calling adminUpdatePaymentMethod().'
220
+ );
221
+ }
222
+
223
+ if (requestParameters['adminUpdatePaymentMethodRequest'] == null) {
224
+ throw new runtime.RequiredError(
225
+ 'adminUpdatePaymentMethodRequest',
226
+ 'Required parameter "adminUpdatePaymentMethodRequest" was null or undefined when calling adminUpdatePaymentMethod().'
227
+ );
228
+ }
229
+
230
+ const queryParameters: any = {};
231
+
232
+ const headerParameters: runtime.HTTPHeaders = {};
233
+
234
+ headerParameters['Content-Type'] = 'application/json';
235
+
236
+ if (this.configuration && this.configuration.accessToken) {
237
+ const token = this.configuration.accessToken;
238
+ const tokenString = await token("bearerAuth", []);
239
+
240
+ if (tokenString) {
241
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
242
+ }
243
+ }
244
+ const response = await this.request({
245
+ path: `/api/admin/payment-methods/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
246
+ method: 'PUT',
247
+ headers: headerParameters,
248
+ query: queryParameters,
249
+ body: AdminUpdatePaymentMethodRequestToJSON(requestParameters['adminUpdatePaymentMethodRequest']),
250
+ }, initOverrides);
251
+
252
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaymentMethodInfoDtoFromJSON(jsonValue));
253
+ }
254
+
255
+ /**
256
+ * Update a payment method info row
257
+ */
258
+ async adminUpdatePaymentMethod(requestParameters: AdminUpdatePaymentMethodOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaymentMethodInfoDto> {
259
+ const response = await this.adminUpdatePaymentMethodRaw(requestParameters, initOverrides);
260
+ return await response.value();
261
+ }
262
+
263
+ }
@@ -0,0 +1,93 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Jugar Hoy - API
5
+ * API documentation for Jugar Hoy application
6
+ *
7
+ * The version of the OpenAPI document: 1.5.0
8
+ *
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 * as runtime from '../runtime';
17
+ import type {
18
+ PaymentMethodInfoDto,
19
+ } from '../models/index';
20
+ import {
21
+ PaymentMethodInfoDtoFromJSON,
22
+ PaymentMethodInfoDtoToJSON,
23
+ } from '../models/index';
24
+
25
+ export interface GetPaymentMethodByCodeRequest {
26
+ code: string;
27
+ }
28
+
29
+ /**
30
+ *
31
+ */
32
+ export class PublicPaymentsApi extends runtime.BaseAPI {
33
+
34
+ /**
35
+ * Get a payment method by its code
36
+ */
37
+ async getPaymentMethodByCodeRaw(requestParameters: GetPaymentMethodByCodeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaymentMethodInfoDto>> {
38
+ if (requestParameters['code'] == null) {
39
+ throw new runtime.RequiredError(
40
+ 'code',
41
+ 'Required parameter "code" was null or undefined when calling getPaymentMethodByCode().'
42
+ );
43
+ }
44
+
45
+ const queryParameters: any = {};
46
+
47
+ const headerParameters: runtime.HTTPHeaders = {};
48
+
49
+ const response = await this.request({
50
+ path: `/api/payment/methods/{code}`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters['code']))),
51
+ method: 'GET',
52
+ headers: headerParameters,
53
+ query: queryParameters,
54
+ }, initOverrides);
55
+
56
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaymentMethodInfoDtoFromJSON(jsonValue));
57
+ }
58
+
59
+ /**
60
+ * Get a payment method by its code
61
+ */
62
+ async getPaymentMethodByCode(requestParameters: GetPaymentMethodByCodeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaymentMethodInfoDto> {
63
+ const response = await this.getPaymentMethodByCodeRaw(requestParameters, initOverrides);
64
+ return await response.value();
65
+ }
66
+
67
+ /**
68
+ * List all enabled payment methods with descriptions
69
+ */
70
+ async listPaymentMethodsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PaymentMethodInfoDto>>> {
71
+ const queryParameters: any = {};
72
+
73
+ const headerParameters: runtime.HTTPHeaders = {};
74
+
75
+ const response = await this.request({
76
+ path: `/api/payment/methods`,
77
+ method: 'GET',
78
+ headers: headerParameters,
79
+ query: queryParameters,
80
+ }, initOverrides);
81
+
82
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PaymentMethodInfoDtoFromJSON));
83
+ }
84
+
85
+ /**
86
+ * List all enabled payment methods with descriptions
87
+ */
88
+ async listPaymentMethods(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PaymentMethodInfoDto>> {
89
+ const response = await this.listPaymentMethodsRaw(initOverrides);
90
+ return await response.value();
91
+ }
92
+
93
+ }
@@ -19,6 +19,7 @@ import type {
19
19
  CustomerDto,
20
20
  GenerateCode500Response,
21
21
  Location,
22
+ PaymentMethod,
22
23
  ProcessEmailMessageRequest,
23
24
  ReservationParams,
24
25
  Reserve,
@@ -33,6 +34,8 @@ import {
33
34
  GenerateCode500ResponseToJSON,
34
35
  LocationFromJSON,
35
36
  LocationToJSON,
37
+ PaymentMethodFromJSON,
38
+ PaymentMethodToJSON,
36
39
  ProcessEmailMessageRequestFromJSON,
37
40
  ProcessEmailMessageRequestToJSON,
38
41
  ReservationParamsFromJSON,
@@ -45,6 +48,8 @@ import {
45
48
 
46
49
  export interface CalculateServiceFeeRequest {
47
50
  playSpotPriceId: string;
51
+ paymentMethod?: PaymentMethod;
52
+ locationId?: string;
48
53
  }
49
54
 
50
55
  export interface CancelUserReservationRequest {
@@ -97,6 +102,14 @@ export class ReservesApi extends runtime.BaseAPI {
97
102
  queryParameters['playSpotPriceId'] = requestParameters['playSpotPriceId'];
98
103
  }
99
104
 
105
+ if (requestParameters['paymentMethod'] != null) {
106
+ queryParameters['paymentMethod'] = requestParameters['paymentMethod'];
107
+ }
108
+
109
+ if (requestParameters['locationId'] != null) {
110
+ queryParameters['locationId'] = requestParameters['locationId'];
111
+ }
112
+
100
113
  const headerParameters: runtime.HTTPHeaders = {};
101
114
 
102
115
  if (this.configuration && this.configuration.accessToken) {