@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.
- package/.gitlab-ci.yml +28 -28
- package/README.md +532 -532
- package/dist/classes/BaseInlineCheckout.d.ts +1 -1
- package/dist/classes/liteCheckout.d.ts +1 -1
- package/dist/data/cardApi.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/types/liteInlineCheckout.d.ts +1 -1
- package/jest.config.ts +14 -14
- package/package.json +41 -41
- package/rollup.config.js +16 -16
- package/src/classes/3dsHandler.ts +347 -347
- package/src/classes/BaseInlineCheckout.ts +424 -424
- package/src/classes/errorResponse.ts +16 -16
- package/src/classes/liteCheckout.ts +589 -591
- package/src/data/api.ts +20 -20
- package/src/data/businessApi.ts +18 -18
- package/src/data/cardApi.ts +91 -87
- package/src/data/checkoutApi.ts +84 -84
- package/src/data/customerApi.ts +31 -31
- package/src/data/openPayApi.ts +12 -12
- package/src/data/paymentMethodApi.ts +37 -37
- package/src/data/skyflowApi.ts +20 -20
- package/src/helpers/constants.ts +63 -63
- package/src/helpers/mercadopago.ts +15 -15
- package/src/helpers/skyflow.ts +91 -91
- package/src/helpers/utils.ts +120 -120
- package/src/helpers/validations.ts +55 -55
- package/src/index.ts +12 -12
- package/src/shared/catalog/paymentMethodsCatalog.ts +247 -247
- package/src/shared/constants/messages.ts +10 -10
- package/src/shared/constants/paymentMethodAPM.ts +63 -63
- package/src/shared/constants/tonderUrl.ts +8 -8
- package/src/types/card.ts +35 -35
- package/src/types/checkout.ts +123 -123
- package/src/types/commons.ts +143 -143
- package/src/types/customer.ts +22 -22
- package/src/types/liteInlineCheckout.ts +216 -216
- package/src/types/paymentMethod.ts +23 -23
- package/src/types/requests.ts +114 -114
- package/src/types/responses.ts +192 -192
- package/src/types/skyflow.ts +17 -17
- package/src/types/transaction.ts +101 -101
- package/src/types/validations.d.ts +11 -11
- package/tests/classes/liteCheckout.test.ts +57 -57
- package/tests/methods/createOrder.test.ts +141 -141
- package/tests/methods/createPayment.test.ts +121 -121
- package/tests/methods/customerRegister.test.ts +118 -118
- package/tests/methods/getBusiness.test.ts +114 -114
- package/tests/methods/getCustomerCards.test.ts +112 -112
- package/tests/methods/registerCustomerCard.test.ts +117 -117
- package/tests/methods/startCheckoutRouter.test.ts +119 -119
- package/tests/methods/startCheckoutRouterFull.test.ts +138 -138
- package/tests/utils/defaultMock.ts +21 -21
- package/tests/utils/mockClasses.ts +659 -659
- package/tsconfig.json +18 -18
package/src/types/commons.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/types/customer.ts
CHANGED
|
@@ -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
|
+
};
|