@tonder.io/ionic-lite-sdk 0.0.42-beta.1 → 0.0.42-beta.3

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.
Files changed (55) hide show
  1. package/.gitlab-ci.yml +28 -28
  2. package/README.md +532 -532
  3. package/dist/classes/BaseInlineCheckout.d.ts +1 -1
  4. package/dist/classes/liteCheckout.d.ts +1 -1
  5. package/dist/data/cardApi.d.ts +3 -3
  6. package/dist/index.js +1 -1
  7. package/dist/types/liteInlineCheckout.d.ts +1 -1
  8. package/jest.config.ts +14 -14
  9. package/package.json +41 -41
  10. package/rollup.config.js +16 -16
  11. package/src/classes/3dsHandler.ts +347 -347
  12. package/src/classes/BaseInlineCheckout.ts +424 -424
  13. package/src/classes/errorResponse.ts +16 -16
  14. package/src/classes/liteCheckout.ts +589 -591
  15. package/src/data/api.ts +20 -20
  16. package/src/data/businessApi.ts +18 -18
  17. package/src/data/cardApi.ts +91 -87
  18. package/src/data/checkoutApi.ts +84 -84
  19. package/src/data/customerApi.ts +31 -31
  20. package/src/data/openPayApi.ts +12 -12
  21. package/src/data/paymentMethodApi.ts +37 -37
  22. package/src/data/skyflowApi.ts +20 -20
  23. package/src/helpers/constants.ts +63 -63
  24. package/src/helpers/mercadopago.ts +15 -15
  25. package/src/helpers/skyflow.ts +91 -91
  26. package/src/helpers/utils.ts +120 -120
  27. package/src/helpers/validations.ts +55 -55
  28. package/src/index.ts +12 -12
  29. package/src/shared/catalog/paymentMethodsCatalog.ts +247 -247
  30. package/src/shared/constants/messages.ts +10 -10
  31. package/src/shared/constants/paymentMethodAPM.ts +63 -63
  32. package/src/shared/constants/tonderUrl.ts +8 -8
  33. package/src/types/card.ts +35 -35
  34. package/src/types/checkout.ts +123 -123
  35. package/src/types/commons.ts +143 -143
  36. package/src/types/customer.ts +22 -22
  37. package/src/types/liteInlineCheckout.ts +216 -216
  38. package/src/types/paymentMethod.ts +23 -23
  39. package/src/types/requests.ts +114 -114
  40. package/src/types/responses.ts +192 -192
  41. package/src/types/skyflow.ts +17 -17
  42. package/src/types/transaction.ts +101 -101
  43. package/src/types/validations.d.ts +11 -11
  44. package/tests/classes/liteCheckout.test.ts +57 -57
  45. package/tests/methods/createOrder.test.ts +141 -141
  46. package/tests/methods/createPayment.test.ts +121 -121
  47. package/tests/methods/customerRegister.test.ts +118 -118
  48. package/tests/methods/getBusiness.test.ts +114 -114
  49. package/tests/methods/getCustomerCards.test.ts +112 -112
  50. package/tests/methods/registerCustomerCard.test.ts +117 -117
  51. package/tests/methods/startCheckoutRouter.test.ts +119 -119
  52. package/tests/methods/startCheckoutRouterFull.test.ts +138 -138
  53. package/tests/utils/defaultMock.ts +21 -21
  54. package/tests/utils/mockClasses.ts +659 -659
  55. package/tsconfig.json +18 -18
@@ -1,143 +1,143 @@
1
- import { ICustomer } from "./customer";
2
- import {IStartCheckoutResponse} from "./checkout";
3
-
4
- export type Business = {
5
- business: {
6
- pk: number;
7
- name: string;
8
- categories: {
9
- pk: number;
10
- name: string;
11
- }[];
12
- web: string;
13
- logo: string;
14
- full_logo_url: string;
15
- background_color: string;
16
- primary_color: string;
17
- checkout_mode: boolean;
18
- textCheckoutColor: string;
19
- textDetailsColor: string;
20
- checkout_logo: string;
21
- };
22
- openpay_keys: {
23
- merchant_id: string;
24
- public_key: string;
25
- };
26
- fintoc_keys: {
27
- public_key: string;
28
- };
29
- mercado_pago: {
30
- active: boolean;
31
- };
32
- vault_id: string;
33
- vault_url: string;
34
- reference: number;
35
- is_installments_available: boolean;
36
- };
37
-
38
- export type Customer = {
39
- firstName: string;
40
- lastName: string;
41
- country: string;
42
- street: string;
43
- city: string;
44
- state: string;
45
- postCode: string;
46
- email: string;
47
- phone: string;
48
- };
49
-
50
- export type OrderItem = {
51
- description: string;
52
- quantity: number;
53
- price_unit: number;
54
- discount: number;
55
- taxes: number;
56
- product_reference: number;
57
- name: string;
58
- amount_total: number;
59
- };
60
-
61
- export type PaymentData = {
62
- customer: Customer;
63
- currency: string;
64
- cart: {
65
- total: string | number;
66
- items: OrderItem[];
67
- };
68
- };
69
-
70
- export type TonderAPM = {
71
- pk: string;
72
- payment_method: string;
73
- priority: number;
74
- category: string;
75
- unavailable_countries: string[];
76
- status: string;
77
- };
78
-
79
- export type APM = {
80
- id: string;
81
- payment_method: string;
82
- priority: number;
83
- category: string;
84
- icon: string;
85
- label: string;
86
- };
87
-
88
- export interface IConfigureCheckout {
89
- customer: ICustomer | { email: string };
90
- secureToken: string
91
- }
92
-
93
- export interface IInlineCheckoutBaseOptions {
94
- mode?: "production" | "sandbox" | "stage" | "development";
95
- /**
96
- * @deprecated This property is deprecated and will be removed in a future release.
97
- * `baseUrlTonder` is no longer required.
98
- */
99
- baseUrlTonder?: string;
100
- /**
101
- * @deprecated This property is deprecated and will be removed in a future release.
102
- * Use `apiKey` instead, as `apiKeyTonder` is no longer required.
103
- */
104
- apiKeyTonder?: string;
105
- /**
106
- * @deprecated This property is deprecated and will be removed in a future release.
107
- * `signal` is no longer required.
108
- */
109
- signal?: AbortSignal;
110
- apiKey: string;
111
- returnUrl?: string;
112
- callBack?: (response: IStartCheckoutResponse | Record<string, any>) => void;
113
- customization?: CustomizationOptions;
114
- tdsIframeId?: string,
115
- tonderPayButtonId?: string
116
- }
117
-
118
- export interface IInlineLiteCheckoutOptions
119
- extends IInlineCheckoutBaseOptions {}
120
-
121
-
122
- export interface IApiError {
123
- code: string;
124
- body: Record<string, string> | string;
125
- name: string;
126
- message: string;
127
- }
128
-
129
- export interface IPublicError {
130
- status: string;
131
- code: number;
132
- message: string;
133
- detail: Record<string, any> | string;
134
- }
135
-
136
- export type CustomizationOptions = {
137
- saveCards?: {
138
- showSaveCardOption?: boolean;
139
- showSaved?: boolean;
140
- autoSave?: boolean;
141
- },
142
- redirectOnComplete?: boolean
143
- }
1
+ import { ICustomer } from "./customer";
2
+ import {IStartCheckoutResponse} from "./checkout";
3
+
4
+ export type Business = {
5
+ business: {
6
+ pk: number;
7
+ name: string;
8
+ categories: {
9
+ pk: number;
10
+ name: string;
11
+ }[];
12
+ web: string;
13
+ logo: string;
14
+ full_logo_url: string;
15
+ background_color: string;
16
+ primary_color: string;
17
+ checkout_mode: boolean;
18
+ textCheckoutColor: string;
19
+ textDetailsColor: string;
20
+ checkout_logo: string;
21
+ };
22
+ openpay_keys: {
23
+ merchant_id: string;
24
+ public_key: string;
25
+ };
26
+ fintoc_keys: {
27
+ public_key: string;
28
+ };
29
+ mercado_pago: {
30
+ active: boolean;
31
+ };
32
+ vault_id: string;
33
+ vault_url: string;
34
+ reference: number;
35
+ is_installments_available: boolean;
36
+ };
37
+
38
+ export type Customer = {
39
+ firstName: string;
40
+ lastName: string;
41
+ country: string;
42
+ street: string;
43
+ city: string;
44
+ state: string;
45
+ postCode: string;
46
+ email: string;
47
+ phone: string;
48
+ };
49
+
50
+ export type OrderItem = {
51
+ description: string;
52
+ quantity: number;
53
+ price_unit: number;
54
+ discount: number;
55
+ taxes: number;
56
+ product_reference: number;
57
+ name: string;
58
+ amount_total: number;
59
+ };
60
+
61
+ export type PaymentData = {
62
+ customer: Customer;
63
+ currency: string;
64
+ cart: {
65
+ total: string | number;
66
+ items: OrderItem[];
67
+ };
68
+ };
69
+
70
+ export type TonderAPM = {
71
+ pk: string;
72
+ payment_method: string;
73
+ priority: number;
74
+ category: string;
75
+ unavailable_countries: string[];
76
+ status: string;
77
+ };
78
+
79
+ export type APM = {
80
+ id: string;
81
+ payment_method: string;
82
+ priority: number;
83
+ category: string;
84
+ icon: string;
85
+ label: string;
86
+ };
87
+
88
+ export interface IConfigureCheckout {
89
+ customer: ICustomer | { email: string };
90
+ secureToken: string
91
+ }
92
+
93
+ export interface IInlineCheckoutBaseOptions {
94
+ mode?: "production" | "sandbox" | "stage" | "development";
95
+ /**
96
+ * @deprecated This property is deprecated and will be removed in a future release.
97
+ * `baseUrlTonder` is no longer required.
98
+ */
99
+ baseUrlTonder?: string;
100
+ /**
101
+ * @deprecated This property is deprecated and will be removed in a future release.
102
+ * Use `apiKey` instead, as `apiKeyTonder` is no longer required.
103
+ */
104
+ apiKeyTonder?: string;
105
+ /**
106
+ * @deprecated This property is deprecated and will be removed in a future release.
107
+ * `signal` is no longer required.
108
+ */
109
+ signal?: AbortSignal;
110
+ apiKey: string;
111
+ returnUrl?: string;
112
+ callBack?: (response: IStartCheckoutResponse | Record<string, any>) => void;
113
+ customization?: CustomizationOptions;
114
+ tdsIframeId?: string,
115
+ tonderPayButtonId?: string
116
+ }
117
+
118
+ export interface IInlineLiteCheckoutOptions
119
+ extends IInlineCheckoutBaseOptions {}
120
+
121
+
122
+ export interface IApiError {
123
+ code: string;
124
+ body: Record<string, string> | string;
125
+ name: string;
126
+ message: string;
127
+ }
128
+
129
+ export interface IPublicError {
130
+ status: string;
131
+ code: number;
132
+ message: string;
133
+ detail: Record<string, any> | string;
134
+ }
135
+
136
+ export type CustomizationOptions = {
137
+ saveCards?: {
138
+ showSaveCardOption?: boolean;
139
+ showSaved?: boolean;
140
+ autoSave?: boolean;
141
+ },
142
+ redirectOnComplete?: boolean
143
+ }
@@ -1,22 +1,22 @@
1
- export type ICustomer = {
2
- /**
3
- * @deprecated This property is deprecated and will be removed in a future release.
4
- * Use `firstName` instead, as `name` is no longer required.
5
- */
6
- name?: string;
7
- /**
8
- * @deprecated This property is deprecated and will be removed in a future release.
9
- * Use `lastName` instead, as `lastname` is no longer required.
10
- */
11
- lastname?: string;
12
- firstName: string;
13
- lastName: string;
14
- country?: string;
15
- street?: string;
16
- city?: string;
17
- state?: string;
18
- postCode?: string;
19
- email: string;
20
- phone?: string;
21
- address?: string;
22
- };
1
+ export type ICustomer = {
2
+ /**
3
+ * @deprecated This property is deprecated and will be removed in a future release.
4
+ * Use `firstName` instead, as `name` is no longer required.
5
+ */
6
+ name?: string;
7
+ /**
8
+ * @deprecated This property is deprecated and will be removed in a future release.
9
+ * Use `lastName` instead, as `lastname` is no longer required.
10
+ */
11
+ lastname?: string;
12
+ firstName: string;
13
+ lastName: string;
14
+ country?: string;
15
+ street?: string;
16
+ city?: string;
17
+ state?: string;
18
+ postCode?: string;
19
+ email: string;
20
+ phone?: string;
21
+ address?: string;
22
+ };