@tonder.io/ionic-lite-sdk 0.0.17-beta → 0.0.19

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.
@@ -1,538 +1,538 @@
1
- import { Business, OrderItem } from "../../src/types/commons";
2
- import {
3
- CreateOrderRequest,
4
- CreatePaymentRequest,
5
- RegisterCustomerCardRequest,
6
- StartCheckoutRequest,
7
- TokensRequest,
8
- } from "../../src/types/requests";
9
- import {
10
- CreateOrderResponse,
11
- CreatePaymentResponse,
12
- GetBusinessResponse,
13
- GetCustomerCardsResponse,
14
- RegisterCustomerCardResponse,
15
- StartCheckoutResponse,
16
- } from "../../src/types/responses";
17
-
18
- export class BusinessClass implements Business {
19
- business!: {
20
- pk: number;
21
- name: string;
22
- categories: [{ pk: number; name: string }];
23
- web: string;
24
- logo: string;
25
- full_logo_url: string;
26
- background_color: string;
27
- primary_color: string;
28
- checkout_mode: boolean;
29
- textCheckoutColor: string;
30
- textDetailsColor: string;
31
- checkout_logo: string;
32
- };
33
- openpay_keys!: { merchant_id: string; public_key: string };
34
- fintoc_keys!: { public_key: string };
35
- vault_id!: string;
36
- vault_url!: string;
37
- reference!: number;
38
- is_installments_available!: boolean;
39
-
40
- get mockObject(): GetBusinessResponse {
41
- return {
42
- business: {
43
- pk: 1234, // Número de ejemplo
44
- name: 'Mock Business Name',
45
- categories: [
46
- { pk: 5678, name: 'Mock Category 1' },
47
- { pk: 9012, name: 'Mock Category 2' }
48
- ],
49
- web: 'https://www.mockbusiness.com',
50
- logo: 'assets/images/mock-logo.png',
51
- full_logo_url: 'https://www.mockbusiness.com/logo.png',
52
- background_color: '#f5f5f5',
53
- primary_color: '#007bff',
54
- checkout_mode: true,
55
- textCheckoutColor: '#333333',
56
- textDetailsColor: '#666666',
57
- checkout_logo: 'assets/images/checkout-logo.png',
58
- },
59
- vault_id: 'mock-vault-id-123',
60
- vault_url: 'https://mock-vault.com',
61
- reference: 987654,
62
- is_installments_available: true,
63
- openpay_keys: { merchant_id: "", public_key: "" },
64
- fintoc_keys: { public_key: "" }
65
- }
66
- }
67
- }
68
-
69
- export class OrderClass implements CreateOrderRequest {
70
- business!: string;
71
- client!: string;
72
- billing_address_id!: string;
73
- shipping_address_id!: string;
74
- amount!: number;
75
- status!: string;
76
- reference!: string;
77
- is_oneclick!: boolean;
78
- items!: OrderItem[];
79
-
80
- get mockObject(): CreateOrderRequest {
81
- return {
82
- business: "The business pk",
83
- client: "Client auth token",
84
- billing_address_id: "The billing address",
85
- shipping_address_id: "The shipping address",
86
- amount: 25,
87
- status: "PENDING",
88
- reference: "XXXXXXX",
89
- is_oneclick: false,
90
- items: [
91
- { ...new OrderItemClass() }
92
- ]
93
- }
94
-
95
- }
96
- }
97
-
98
- export class OrderItemClass implements OrderItem {
99
- description!: string;
100
- quantity!: number;
101
- price_unit!: number;
102
- discount!: number;
103
- taxes!: number;
104
- product_reference!: number;
105
- name!: string;
106
- amount_total!: number;
107
-
108
- get mockObject(): OrderItem {
109
- return {
110
- description: "string",
111
- quantity: 0,
112
- price_unit: 0,
113
- discount: 0,
114
- taxes: 0,
115
- product_reference: 0,
116
- name: "string",
117
- amount_total: 0,
118
- }
119
-
120
- }
121
- }
122
-
123
- export class OrderResponseClass implements CreateOrderResponse {
124
- id!: number;
125
- created!: string;
126
- amount!: string;
127
- status!: string;
128
- payment_method?: string | undefined;
129
- reference?: string | undefined;
130
- is_oneclick!: boolean;
131
- items!: [
132
- {
133
- description: string;
134
- product_reference: string;
135
- quantity: string;
136
- price_unit: string;
137
- discount: string;
138
- taxes: string;
139
- amount_total: string;
140
- }
141
- ];
142
- billing_address?: string | undefined;
143
- shipping_address?: string | undefined;
144
- client!: {
145
- email: string;
146
- name: string;
147
- first_name: string;
148
- last_name: string;
149
- client_profile: {
150
- gender: string;
151
- date_birth?: string | undefined;
152
- terms: boolean;
153
- phone: string;
154
- };
155
- };
156
-
157
- get mockObject(): CreateOrderResponse {
158
- return {
159
- id: 12345,
160
- created: '2024-02-01T10:42:00Z',
161
- amount: '123.45',
162
- status: 'APPROVED',
163
- payment_method: 'CREDIT_CARD',
164
- reference: 'PAYMENT_REF_12345',
165
- is_oneclick: true,
166
- items: [
167
- {
168
- description: 'Mock Item 1',
169
- product_reference: 'PRD-123',
170
- quantity: '2',
171
- price_unit: '50.00',
172
- discount: '5.00',
173
- taxes: '10.90',
174
- amount_total: '105.90',
175
- },
176
- {
177
- description: 'Mock Item 2',
178
- product_reference: 'PRD-456',
179
- quantity: '1',
180
- price_unit: '73.45',
181
- discount: '0.00',
182
- taxes: '6.55',
183
- amount_total: '79.00',
184
- },
185
- ],
186
- billing_address: 'Mock Street 123, Mock City',
187
- shipping_address: 'Mock Avenue 456, Mock Town',
188
- client: {
189
- email: 'mockuser@example.com',
190
- name: 'Mock User',
191
- first_name: 'Mock',
192
- last_name: 'User',
193
- client_profile: {
194
- gender: 'M',
195
- date_birth: '1990-01-01',
196
- terms: true,
197
- phone: '+1234567890',
198
- },
199
- },
200
- }
201
- }
202
- }
203
-
204
- export class CreatePaymentRequestClass implements CreatePaymentRequest {
205
- business_pk!: string;
206
- amount!: number;
207
- date!: string;
208
- order!: string;
209
-
210
- get mockObject(): CreatePaymentRequest {
211
- const now = new Date();
212
- const dateString = now.toISOString();
213
- return {
214
- business_pk: "NNNNNNNNNN",
215
- amount: 25,
216
- date: dateString,
217
- order: "XXXXX"
218
- };
219
- }
220
- }
221
-
222
- export class CreatePaymentResponseClass implements CreatePaymentResponse {
223
- pk!: number;
224
- order?: string | undefined;
225
- amount!: string;
226
- status!: string;
227
- date!: string;
228
- paid_date?: string | undefined;
229
- shipping_address!: {
230
- street: string;
231
- number: string;
232
- suburb: string;
233
- city: { name: string };
234
- state: { name: string; country: { name: string } };
235
- zip_code: string;
236
- };
237
- shipping_address_id?: string | undefined;
238
- billing_address!: {
239
- street: string;
240
- number: string;
241
- suburb: string;
242
- city: { name: string };
243
- state: { name: string; country: { name: string } };
244
- zip_code: string;
245
- };
246
- billing_address_id?: string | undefined;
247
- client?: string | undefined;
248
- customer_order_reference?: string | undefined;
249
-
250
- get mockObject(): CreatePaymentResponse {
251
- return {
252
- pk: 45678,
253
- order: "ORDER-98765",
254
- amount: "250.00",
255
- status: "PENDING",
256
- date: "2024-02-01T14:29:05Z",
257
- paid_date: "",
258
- shipping_address: {
259
- street: "Mock Street 123",
260
- number: "10",
261
- suburb: "Mock Suburb",
262
- city: { name: "Mock City" },
263
- state: { name: "Mock State", country: { name: "Mock Country" } },
264
- zip_code: "12345",
265
- },
266
- shipping_address_id: "",
267
- billing_address: {
268
- street: "Mock Street 456",
269
- number: "20",
270
- suburb: "Mock Suburb 2",
271
- city: { name: "Mock City 2" },
272
- state: { name: "Mock State 2", country: { name: "Mock Country 2" } },
273
- zip_code: "54321",
274
- },
275
- billing_address_id: "",
276
- client: "CLIENT-123",
277
- customer_order_reference: "REF-ABC123",
278
- };
279
- }
280
- }
281
-
282
- export class StartCheckoutRequestClass implements StartCheckoutRequest {
283
- card: any;
284
- name: any;
285
- last_name!: string;
286
- email_client: any;
287
- phone_number: any;
288
- return_url!: string;
289
- id_product!: string;
290
- quantity_product!: number;
291
- id_ship!: string;
292
- instance_id_ship!: string;
293
- amount: any;
294
- title_ship!: string;
295
- description!: string;
296
- device_session_id: any;
297
- token_id!: string;
298
- order_id: any;
299
- business_id: any;
300
- payment_id: any;
301
- source!: string;
302
-
303
- get mockObject(): StartCheckoutRequest {
304
- return {
305
- card: " any",
306
- name: " any",
307
- last_name: " string",
308
- email_client: " any",
309
- phone_number: " any",
310
- return_url: " string",
311
- id_product: " string",
312
- quantity_product: 0,
313
- id_ship: " string",
314
- instance_id_ship: " string",
315
- amount: " any",
316
- title_ship: " string",
317
- description: " string",
318
- device_session_id: " any",
319
- token_id: " string",
320
- order_id: " any",
321
- business_id: " any",
322
- payment_id: " any",
323
- source: " string",
324
- };
325
- }
326
- }
327
-
328
- export class StartCheckoutResponseClass implements StartCheckoutResponse {
329
- status!: number;
330
- message!: string;
331
- psp_response!: {
332
- id: string;
333
- authorization: number;
334
- operation_type: string;
335
- transaction_type: string;
336
- status: string;
337
- conciliated: boolean;
338
- creation_date: string;
339
- operation_date: string;
340
- description: string;
341
- error_message?: string;
342
- order_id?: string;
343
- card: {
344
- type: string;
345
- brand: string;
346
- address?: string;
347
- card_number: string;
348
- holder_name: string;
349
- expiration_year: string;
350
- expiration_month: string;
351
- allows_charges: boolean;
352
- allows_payouts: boolean;
353
- bank_name: string;
354
- points_type: string;
355
- points_card: boolean;
356
- bank_code: number;
357
- };
358
- customer_id: string;
359
- gateway_card_present: string;
360
- amount: number;
361
- fee: {
362
- amount: number;
363
- tax: number;
364
- currency: string;
365
- };
366
- payment_method: {
367
- type: string;
368
- url: string;
369
- };
370
- currency: string;
371
- method: string;
372
- object: string;
373
- };
374
- transaction_status!: string;
375
- transaction_id!: number;
376
- payment_id!: number;
377
- provider!: string;
378
- next_action!: {
379
- redirect_to_url: {
380
- url: string;
381
- return_url: string;
382
- verify_transaction_status_url: string;
383
- };
384
- };
385
- actions!: {
386
- name: string;
387
- url: string;
388
- method: string;
389
- }[];
390
-
391
- get mockObject(): StartCheckoutResponse {
392
- return {
393
- status: 200, // Representa un estado exitoso
394
- message: "Payment processing initiated",
395
- transaction_status: "PENDING",
396
- transaction_id: 1234567890,
397
- payment_id: 9876543210,
398
- provider: "STRIPE",
399
- next_action: {
400
- redirect_to_url: {
401
- url: "https://www.mock-payment-provider.com/checkout",
402
- return_url: "https://your-app.com/payment-confirmation",
403
- verify_transaction_status_url:
404
- "https://api.mock-payment-provider.com/transactions/1234567890/status",
405
- },
406
- },
407
- psp_response: {
408
- id: " string",
409
- authorization: 0,
410
- operation_type: " string",
411
- transaction_type: " string",
412
- status: " string",
413
- conciliated: false,
414
- creation_date: " string",
415
- operation_date: " string",
416
- description: " string",
417
- error_message: " string",
418
- order_id: " string",
419
- card: {
420
- type: " string",
421
- brand: " string",
422
- address: " string",
423
- card_number: " string",
424
- holder_name: " string",
425
- expiration_year: " string",
426
- expiration_month: " string",
427
- allows_charges: false,
428
- allows_payouts: false,
429
- bank_name: " string",
430
- points_type: " string",
431
- points_card: false,
432
- bank_code: 0,
433
- },
434
- customer_id: " string",
435
- gateway_card_present: " string",
436
- amount: 0,
437
- fee: {
438
- amount: 0,
439
- tax: 0,
440
- currency: " string",
441
- },
442
- payment_method: {
443
- type: " string",
444
- url: " string",
445
- },
446
- currency: " string",
447
- method: " string",
448
- object: " string",
449
- },
450
- actions: [
451
- {
452
- name: "Check status",
453
- url: "https://api.mock-payment-provider.com/transactions/1234567890/status",
454
- method: "GET",
455
- },
456
- {
457
- name: "Cancel payment",
458
- url: "https://api.mock-payment-provider.com/transactions/1234567890/cancel",
459
- method: "POST",
460
- },
461
- ],
462
- };
463
- }
464
- }
465
-
466
- export class TokensRequestClass implements TokensRequest {
467
- vault_id!: string;
468
- vault_url!: string;
469
- data: { [key: string]: any } = {};
470
-
471
- get mockObject(): TokensRequest {
472
- return {
473
- vault_id: "string",
474
- vault_url: "string",
475
- data: {
476
- fields: [],
477
- },
478
- };
479
- }
480
- }
481
-
482
- export class RegisterCustomerCardResponseClass
483
- implements RegisterCustomerCardResponse {
484
- skyflow_id!: string;
485
- user_id!: number;
486
-
487
- get mockObject(): RegisterCustomerCardResponse {
488
- return {
489
- skyflow_id: "string",
490
- user_id: 0,
491
- };
492
- }
493
- }
494
-
495
- export class RegisterCustomerCardRequestClass
496
- implements RegisterCustomerCardRequest {
497
- skyflow_id!: string;
498
-
499
- get mockObject(): RegisterCustomerCardRequest {
500
- return {
501
- skyflow_id: "",
502
- };
503
- }
504
- }
505
-
506
- export class GetCustomerCardsResponseClass implements GetCustomerCardsResponse {
507
- user_id!: number;
508
- cards!: {
509
- fields: {
510
- card_scheme: string;
511
- card_number: string;
512
- cardholder_name: string;
513
- cvv: string;
514
- expiration_month: string;
515
- expiration_year: string;
516
- skyflow_id: string;
517
- };
518
- }[];
519
-
520
- get mockObject(): GetCustomerCardsResponse {
521
- return {
522
- user_id: 0,
523
- cards: [
524
- {
525
- fields: {
526
- card_scheme: "string",
527
- card_number: "string",
528
- cardholder_name: "string",
529
- cvv: "string",
530
- expiration_month: "string",
531
- expiration_year: "string",
532
- skyflow_id: "string",
533
- },
534
- },
535
- ],
536
- };
537
- }
538
- }
1
+ import { Business, OrderItem } from "../../src/types/commons";
2
+ import {
3
+ CreateOrderRequest,
4
+ CreatePaymentRequest,
5
+ RegisterCustomerCardRequest,
6
+ StartCheckoutRequest,
7
+ TokensRequest,
8
+ } from "../../src/types/requests";
9
+ import {
10
+ CreateOrderResponse,
11
+ CreatePaymentResponse,
12
+ GetBusinessResponse,
13
+ GetCustomerCardsResponse,
14
+ RegisterCustomerCardResponse,
15
+ StartCheckoutResponse,
16
+ } from "../../src/types/responses";
17
+
18
+ export class BusinessClass implements Business {
19
+ business!: {
20
+ pk: number;
21
+ name: string;
22
+ categories: [{ pk: number; name: string }];
23
+ web: string;
24
+ logo: string;
25
+ full_logo_url: string;
26
+ background_color: string;
27
+ primary_color: string;
28
+ checkout_mode: boolean;
29
+ textCheckoutColor: string;
30
+ textDetailsColor: string;
31
+ checkout_logo: string;
32
+ };
33
+ openpay_keys!: { merchant_id: string; public_key: string };
34
+ fintoc_keys!: { public_key: string };
35
+ vault_id!: string;
36
+ vault_url!: string;
37
+ reference!: number;
38
+ is_installments_available!: boolean;
39
+
40
+ get mockObject(): GetBusinessResponse {
41
+ return {
42
+ business: {
43
+ pk: 1234, // Número de ejemplo
44
+ name: 'Mock Business Name',
45
+ categories: [
46
+ { pk: 5678, name: 'Mock Category 1' },
47
+ { pk: 9012, name: 'Mock Category 2' }
48
+ ],
49
+ web: 'https://www.mockbusiness.com',
50
+ logo: 'assets/images/mock-logo.png',
51
+ full_logo_url: 'https://www.mockbusiness.com/logo.png',
52
+ background_color: '#f5f5f5',
53
+ primary_color: '#007bff',
54
+ checkout_mode: true,
55
+ textCheckoutColor: '#333333',
56
+ textDetailsColor: '#666666',
57
+ checkout_logo: 'assets/images/checkout-logo.png',
58
+ },
59
+ vault_id: 'mock-vault-id-123',
60
+ vault_url: 'https://mock-vault.com',
61
+ reference: 987654,
62
+ is_installments_available: true,
63
+ openpay_keys: { merchant_id: "", public_key: "" },
64
+ fintoc_keys: { public_key: "" }
65
+ }
66
+ }
67
+ }
68
+
69
+ export class OrderClass implements CreateOrderRequest {
70
+ business!: string;
71
+ client!: string;
72
+ billing_address_id!: string;
73
+ shipping_address_id!: string;
74
+ amount!: number;
75
+ status!: string;
76
+ reference!: string;
77
+ is_oneclick!: boolean;
78
+ items!: OrderItem[];
79
+
80
+ get mockObject(): CreateOrderRequest {
81
+ return {
82
+ business: "The business pk",
83
+ client: "Client auth token",
84
+ billing_address_id: "The billing address",
85
+ shipping_address_id: "The shipping address",
86
+ amount: 25,
87
+ status: "PENDING",
88
+ reference: "XXXXXXX",
89
+ is_oneclick: false,
90
+ items: [
91
+ { ...new OrderItemClass() }
92
+ ]
93
+ }
94
+
95
+ }
96
+ }
97
+
98
+ export class OrderItemClass implements OrderItem {
99
+ description!: string;
100
+ quantity!: number;
101
+ price_unit!: number;
102
+ discount!: number;
103
+ taxes!: number;
104
+ product_reference!: number;
105
+ name!: string;
106
+ amount_total!: number;
107
+
108
+ get mockObject(): OrderItem {
109
+ return {
110
+ description: "string",
111
+ quantity: 0,
112
+ price_unit: 0,
113
+ discount: 0,
114
+ taxes: 0,
115
+ product_reference: 0,
116
+ name: "string",
117
+ amount_total: 0,
118
+ }
119
+
120
+ }
121
+ }
122
+
123
+ export class OrderResponseClass implements CreateOrderResponse {
124
+ id!: number;
125
+ created!: string;
126
+ amount!: string;
127
+ status!: string;
128
+ payment_method?: string | undefined;
129
+ reference?: string | undefined;
130
+ is_oneclick!: boolean;
131
+ items!: [
132
+ {
133
+ description: string;
134
+ product_reference: string;
135
+ quantity: string;
136
+ price_unit: string;
137
+ discount: string;
138
+ taxes: string;
139
+ amount_total: string;
140
+ }
141
+ ];
142
+ billing_address?: string | undefined;
143
+ shipping_address?: string | undefined;
144
+ client!: {
145
+ email: string;
146
+ name: string;
147
+ first_name: string;
148
+ last_name: string;
149
+ client_profile: {
150
+ gender: string;
151
+ date_birth?: string | undefined;
152
+ terms: boolean;
153
+ phone: string;
154
+ };
155
+ };
156
+
157
+ get mockObject(): CreateOrderResponse {
158
+ return {
159
+ id: 12345,
160
+ created: '2024-02-01T10:42:00Z',
161
+ amount: '123.45',
162
+ status: 'APPROVED',
163
+ payment_method: 'CREDIT_CARD',
164
+ reference: 'PAYMENT_REF_12345',
165
+ is_oneclick: true,
166
+ items: [
167
+ {
168
+ description: 'Mock Item 1',
169
+ product_reference: 'PRD-123',
170
+ quantity: '2',
171
+ price_unit: '50.00',
172
+ discount: '5.00',
173
+ taxes: '10.90',
174
+ amount_total: '105.90',
175
+ },
176
+ {
177
+ description: 'Mock Item 2',
178
+ product_reference: 'PRD-456',
179
+ quantity: '1',
180
+ price_unit: '73.45',
181
+ discount: '0.00',
182
+ taxes: '6.55',
183
+ amount_total: '79.00',
184
+ },
185
+ ],
186
+ billing_address: 'Mock Street 123, Mock City',
187
+ shipping_address: 'Mock Avenue 456, Mock Town',
188
+ client: {
189
+ email: 'mockuser@example.com',
190
+ name: 'Mock User',
191
+ first_name: 'Mock',
192
+ last_name: 'User',
193
+ client_profile: {
194
+ gender: 'M',
195
+ date_birth: '1990-01-01',
196
+ terms: true,
197
+ phone: '+1234567890',
198
+ },
199
+ },
200
+ }
201
+ }
202
+ }
203
+
204
+ export class CreatePaymentRequestClass implements CreatePaymentRequest {
205
+ business_pk!: string;
206
+ amount!: number;
207
+ date!: string;
208
+ order!: string;
209
+
210
+ get mockObject(): CreatePaymentRequest {
211
+ const now = new Date();
212
+ const dateString = now.toISOString();
213
+ return {
214
+ business_pk: "NNNNNNNNNN",
215
+ amount: 25,
216
+ date: dateString,
217
+ order: "XXXXX"
218
+ };
219
+ }
220
+ }
221
+
222
+ export class CreatePaymentResponseClass implements CreatePaymentResponse {
223
+ pk!: number;
224
+ order?: string | undefined;
225
+ amount!: string;
226
+ status!: string;
227
+ date!: string;
228
+ paid_date?: string | undefined;
229
+ shipping_address!: {
230
+ street: string;
231
+ number: string;
232
+ suburb: string;
233
+ city: { name: string };
234
+ state: { name: string; country: { name: string } };
235
+ zip_code: string;
236
+ };
237
+ shipping_address_id?: string | undefined;
238
+ billing_address!: {
239
+ street: string;
240
+ number: string;
241
+ suburb: string;
242
+ city: { name: string };
243
+ state: { name: string; country: { name: string } };
244
+ zip_code: string;
245
+ };
246
+ billing_address_id?: string | undefined;
247
+ client?: string | undefined;
248
+ customer_order_reference?: string | undefined;
249
+
250
+ get mockObject(): CreatePaymentResponse {
251
+ return {
252
+ pk: 45678,
253
+ order: "ORDER-98765",
254
+ amount: "250.00",
255
+ status: "PENDING",
256
+ date: "2024-02-01T14:29:05Z",
257
+ paid_date: "",
258
+ shipping_address: {
259
+ street: "Mock Street 123",
260
+ number: "10",
261
+ suburb: "Mock Suburb",
262
+ city: { name: "Mock City" },
263
+ state: { name: "Mock State", country: { name: "Mock Country" } },
264
+ zip_code: "12345",
265
+ },
266
+ shipping_address_id: "",
267
+ billing_address: {
268
+ street: "Mock Street 456",
269
+ number: "20",
270
+ suburb: "Mock Suburb 2",
271
+ city: { name: "Mock City 2" },
272
+ state: { name: "Mock State 2", country: { name: "Mock Country 2" } },
273
+ zip_code: "54321",
274
+ },
275
+ billing_address_id: "",
276
+ client: "CLIENT-123",
277
+ customer_order_reference: "REF-ABC123",
278
+ };
279
+ }
280
+ }
281
+
282
+ export class StartCheckoutRequestClass implements StartCheckoutRequest {
283
+ card: any;
284
+ name: any;
285
+ last_name!: string;
286
+ email_client: any;
287
+ phone_number: any;
288
+ return_url!: string;
289
+ id_product!: string;
290
+ quantity_product!: number;
291
+ id_ship!: string;
292
+ instance_id_ship!: string;
293
+ amount: any;
294
+ title_ship!: string;
295
+ description!: string;
296
+ device_session_id: any;
297
+ token_id!: string;
298
+ order_id: any;
299
+ business_id: any;
300
+ payment_id: any;
301
+ source!: string;
302
+
303
+ get mockObject(): StartCheckoutRequest {
304
+ return {
305
+ card: " any",
306
+ name: " any",
307
+ last_name: " string",
308
+ email_client: " any",
309
+ phone_number: " any",
310
+ return_url: " string",
311
+ id_product: " string",
312
+ quantity_product: 0,
313
+ id_ship: " string",
314
+ instance_id_ship: " string",
315
+ amount: " any",
316
+ title_ship: " string",
317
+ description: " string",
318
+ device_session_id: " any",
319
+ token_id: " string",
320
+ order_id: " any",
321
+ business_id: " any",
322
+ payment_id: " any",
323
+ source: " string",
324
+ };
325
+ }
326
+ }
327
+
328
+ export class StartCheckoutResponseClass implements StartCheckoutResponse {
329
+ status!: number;
330
+ message!: string;
331
+ psp_response!: {
332
+ id: string;
333
+ authorization: number;
334
+ operation_type: string;
335
+ transaction_type: string;
336
+ status: string;
337
+ conciliated: boolean;
338
+ creation_date: string;
339
+ operation_date: string;
340
+ description: string;
341
+ error_message?: string;
342
+ order_id?: string;
343
+ card: {
344
+ type: string;
345
+ brand: string;
346
+ address?: string;
347
+ card_number: string;
348
+ holder_name: string;
349
+ expiration_year: string;
350
+ expiration_month: string;
351
+ allows_charges: boolean;
352
+ allows_payouts: boolean;
353
+ bank_name: string;
354
+ points_type: string;
355
+ points_card: boolean;
356
+ bank_code: number;
357
+ };
358
+ customer_id: string;
359
+ gateway_card_present: string;
360
+ amount: number;
361
+ fee: {
362
+ amount: number;
363
+ tax: number;
364
+ currency: string;
365
+ };
366
+ payment_method: {
367
+ type: string;
368
+ url: string;
369
+ };
370
+ currency: string;
371
+ method: string;
372
+ object: string;
373
+ };
374
+ transaction_status!: string;
375
+ transaction_id!: number;
376
+ payment_id!: number;
377
+ provider!: string;
378
+ next_action!: {
379
+ redirect_to_url: {
380
+ url: string;
381
+ return_url: string;
382
+ verify_transaction_status_url: string;
383
+ };
384
+ };
385
+ actions!: {
386
+ name: string;
387
+ url: string;
388
+ method: string;
389
+ }[];
390
+
391
+ get mockObject(): StartCheckoutResponse {
392
+ return {
393
+ status: 200, // Representa un estado exitoso
394
+ message: "Payment processing initiated",
395
+ transaction_status: "PENDING",
396
+ transaction_id: 1234567890,
397
+ payment_id: 9876543210,
398
+ provider: "STRIPE",
399
+ next_action: {
400
+ redirect_to_url: {
401
+ url: "https://www.mock-payment-provider.com/checkout",
402
+ return_url: "https://your-app.com/payment-confirmation",
403
+ verify_transaction_status_url:
404
+ "https://api.mock-payment-provider.com/transactions/1234567890/status",
405
+ },
406
+ },
407
+ psp_response: {
408
+ id: " string",
409
+ authorization: 0,
410
+ operation_type: " string",
411
+ transaction_type: " string",
412
+ status: " string",
413
+ conciliated: false,
414
+ creation_date: " string",
415
+ operation_date: " string",
416
+ description: " string",
417
+ error_message: " string",
418
+ order_id: " string",
419
+ card: {
420
+ type: " string",
421
+ brand: " string",
422
+ address: " string",
423
+ card_number: " string",
424
+ holder_name: " string",
425
+ expiration_year: " string",
426
+ expiration_month: " string",
427
+ allows_charges: false,
428
+ allows_payouts: false,
429
+ bank_name: " string",
430
+ points_type: " string",
431
+ points_card: false,
432
+ bank_code: 0,
433
+ },
434
+ customer_id: " string",
435
+ gateway_card_present: " string",
436
+ amount: 0,
437
+ fee: {
438
+ amount: 0,
439
+ tax: 0,
440
+ currency: " string",
441
+ },
442
+ payment_method: {
443
+ type: " string",
444
+ url: " string",
445
+ },
446
+ currency: " string",
447
+ method: " string",
448
+ object: " string",
449
+ },
450
+ actions: [
451
+ {
452
+ name: "Check status",
453
+ url: "https://api.mock-payment-provider.com/transactions/1234567890/status",
454
+ method: "GET",
455
+ },
456
+ {
457
+ name: "Cancel payment",
458
+ url: "https://api.mock-payment-provider.com/transactions/1234567890/cancel",
459
+ method: "POST",
460
+ },
461
+ ],
462
+ };
463
+ }
464
+ }
465
+
466
+ export class TokensRequestClass implements TokensRequest {
467
+ vault_id!: string;
468
+ vault_url!: string;
469
+ data: { [key: string]: any } = {};
470
+
471
+ get mockObject(): TokensRequest {
472
+ return {
473
+ vault_id: "string",
474
+ vault_url: "string",
475
+ data: {
476
+ fields: [],
477
+ },
478
+ };
479
+ }
480
+ }
481
+
482
+ export class RegisterCustomerCardResponseClass
483
+ implements RegisterCustomerCardResponse {
484
+ skyflow_id!: string;
485
+ user_id!: number;
486
+
487
+ get mockObject(): RegisterCustomerCardResponse {
488
+ return {
489
+ skyflow_id: "string",
490
+ user_id: 0,
491
+ };
492
+ }
493
+ }
494
+
495
+ export class RegisterCustomerCardRequestClass
496
+ implements RegisterCustomerCardRequest {
497
+ skyflow_id!: string;
498
+
499
+ get mockObject(): RegisterCustomerCardRequest {
500
+ return {
501
+ skyflow_id: "",
502
+ };
503
+ }
504
+ }
505
+
506
+ export class GetCustomerCardsResponseClass implements GetCustomerCardsResponse {
507
+ user_id!: number;
508
+ cards!: {
509
+ fields: {
510
+ card_scheme: string;
511
+ card_number: string;
512
+ cardholder_name: string;
513
+ cvv: string;
514
+ expiration_month: string;
515
+ expiration_year: string;
516
+ skyflow_id: string;
517
+ };
518
+ }[];
519
+
520
+ get mockObject(): GetCustomerCardsResponse {
521
+ return {
522
+ user_id: 0,
523
+ cards: [
524
+ {
525
+ fields: {
526
+ card_scheme: "string",
527
+ card_number: "string",
528
+ cardholder_name: "string",
529
+ cvv: "string",
530
+ expiration_month: "string",
531
+ expiration_year: "string",
532
+ skyflow_id: "string",
533
+ },
534
+ },
535
+ ],
536
+ };
537
+ }
538
+ }