@tonder.io/ionic-lite-sdk 0.0.32-beta → 0.0.33-beta

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 (34) hide show
  1. package/.gitlab-ci.yml +28 -28
  2. package/README.md +202 -193
  3. package/dist/classes/3dsHandler.d.ts +36 -0
  4. package/dist/classes/liteCheckout.d.ts +13 -4
  5. package/dist/index.js +1 -1
  6. package/dist/types/requests.d.ts +3 -0
  7. package/dist/types/responses.d.ts +1 -0
  8. package/jest.config.ts +14 -14
  9. package/package.json +38 -38
  10. package/rollup.config.js +16 -16
  11. package/src/classes/3dsHandler.ts +254 -0
  12. package/src/classes/errorResponse.ts +16 -16
  13. package/src/classes/liteCheckout.ts +535 -462
  14. package/src/helpers/utils.ts +12 -12
  15. package/src/index.ts +4 -4
  16. package/src/types/commons.ts +62 -62
  17. package/src/types/requests.ts +93 -89
  18. package/src/types/responses.ts +188 -187
  19. package/src/types/skyflow.ts +17 -17
  20. package/tests/classes/liteCheckout.test.ts +57 -57
  21. package/tests/methods/createOrder.test.ts +142 -142
  22. package/tests/methods/createPayment.test.ts +122 -122
  23. package/tests/methods/customerRegister.test.ts +119 -119
  24. package/tests/methods/getBusiness.test.ts +115 -115
  25. package/tests/methods/getCustomerCards.test.ts +117 -117
  26. package/tests/methods/getOpenpayDeviceSessionID.test.ts +94 -94
  27. package/tests/methods/getSkyflowToken.test.ts +154 -154
  28. package/tests/methods/getVaultToken.test.ts +106 -106
  29. package/tests/methods/registerCustomerCard.test.ts +117 -117
  30. package/tests/methods/startCheckoutRouter.test.ts +119 -119
  31. package/tests/methods/startCheckoutRouterFull.test.ts +138 -138
  32. package/tests/utils/defaultMock.ts +20 -20
  33. package/tests/utils/mockClasses.ts +651 -649
  34. package/tsconfig.json +18 -18
@@ -1,12 +1,12 @@
1
- export const getBrowserInfo = () => {
2
- const browserInfo = {
3
- javascript_enabled: true, // Assumed since JavaScript is running
4
- time_zone: new Date().getTimezoneOffset(),
5
- language: navigator.language || 'en-US', // Fallback to 'en-US'
6
- color_depth: window.screen ? window.screen.colorDepth : null,
7
- screen_width: window.screen ? window.screen.width * window.devicePixelRatio || window.screen.width : null,
8
- screen_height: window.screen ? window.screen.height * window.devicePixelRatio || window.screen.height : null,
9
- user_agent: navigator.userAgent,
10
- };
11
- return browserInfo;
12
- }
1
+ export const getBrowserInfo = () => {
2
+ const browserInfo = {
3
+ javascript_enabled: true, // Assumed since JavaScript is running
4
+ time_zone: new Date().getTimezoneOffset(),
5
+ language: navigator.language || 'en-US', // Fallback to 'en-US'
6
+ color_depth: window.screen ? window.screen.colorDepth : null,
7
+ screen_width: window.screen ? window.screen.width * window.devicePixelRatio || window.screen.width : null,
8
+ screen_height: window.screen ? window.screen.height * window.devicePixelRatio || window.screen.height : null,
9
+ user_agent: navigator.userAgent,
10
+ };
11
+ return browserInfo;
12
+ }
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { LiteCheckout } from './classes/liteCheckout'
2
-
3
- export {
4
- LiteCheckout
1
+ import { LiteCheckout } from './classes/liteCheckout'
2
+
3
+ export {
4
+ LiteCheckout
5
5
  }
@@ -1,62 +1,62 @@
1
- export type Business = {
2
- business: {
3
- pk: number;
4
- name: string;
5
- categories: {
6
- pk: number;
7
- name: string;
8
- }[];
9
- web: string;
10
- logo: string;
11
- full_logo_url: string;
12
- background_color: string;
13
- primary_color: string;
14
- checkout_mode: boolean;
15
- textCheckoutColor: string;
16
- textDetailsColor: string;
17
- checkout_logo: string;
18
- };
19
- openpay_keys: {
20
- merchant_id: string;
21
- public_key: string;
22
- };
23
- fintoc_keys: {
24
- public_key: string;
25
- };
26
- vault_id: string;
27
- vault_url: string;
28
- reference: number;
29
- is_installments_available: boolean;
30
- };
31
-
32
- export type Customer = {
33
- firstName: string;
34
- lastName: string;
35
- country: string;
36
- street: string;
37
- city: string;
38
- state: string;
39
- postCode: string;
40
- email: string;
41
- phone: string;
42
- };
43
-
44
- export type OrderItem = {
45
- description: string;
46
- quantity: number;
47
- price_unit: number;
48
- discount: number;
49
- taxes: number;
50
- product_reference: number;
51
- name: string;
52
- amount_total: number;
53
- };
54
-
55
- export type PaymentData = {
56
- customer: Customer;
57
- currency: string;
58
- cart: {
59
- total: string | number;
60
- items: OrderItem[];
61
- };
62
- };
1
+ export type Business = {
2
+ business: {
3
+ pk: number;
4
+ name: string;
5
+ categories: {
6
+ pk: number;
7
+ name: string;
8
+ }[];
9
+ web: string;
10
+ logo: string;
11
+ full_logo_url: string;
12
+ background_color: string;
13
+ primary_color: string;
14
+ checkout_mode: boolean;
15
+ textCheckoutColor: string;
16
+ textDetailsColor: string;
17
+ checkout_logo: string;
18
+ };
19
+ openpay_keys: {
20
+ merchant_id: string;
21
+ public_key: string;
22
+ };
23
+ fintoc_keys: {
24
+ public_key: string;
25
+ };
26
+ vault_id: string;
27
+ vault_url: string;
28
+ reference: number;
29
+ is_installments_available: boolean;
30
+ };
31
+
32
+ export type Customer = {
33
+ firstName: string;
34
+ lastName: string;
35
+ country: string;
36
+ street: string;
37
+ city: string;
38
+ state: string;
39
+ postCode: string;
40
+ email: string;
41
+ phone: string;
42
+ };
43
+
44
+ export type OrderItem = {
45
+ description: string;
46
+ quantity: number;
47
+ price_unit: number;
48
+ discount: number;
49
+ taxes: number;
50
+ product_reference: number;
51
+ name: string;
52
+ amount_total: number;
53
+ };
54
+
55
+ export type PaymentData = {
56
+ customer: Customer;
57
+ currency: string;
58
+ cart: {
59
+ total: string | number;
60
+ items: OrderItem[];
61
+ };
62
+ };
@@ -1,90 +1,94 @@
1
- import { OrderItem } from "./commons";
2
- import { SkyflowRecord } from "./skyflow";
3
-
4
- export interface CreateOrderRequest {
5
- business: string,
6
- client: string,
7
- billing_address_id?: number | null,
8
- shipping_address_id?: number | null,
9
- amount: number,
10
- status?: string,
11
- reference: string | number,
12
- is_oneclick: boolean,
13
- items: OrderItem[]
14
- }
15
-
16
- export type CreatePaymentRequest = {
17
- business_pk?: string | number,
18
- amount: number,
19
- date?: string,
20
- order_id?: string | number
21
- client_id?: string | number
22
- }
23
-
24
- export type StartCheckoutRequest = {
25
- card: any,
26
- name: any,
27
- last_name: string,
28
- email_client: any,
29
- phone_number: any,
30
- return_url?: string,
31
- id_product: string,
32
- quantity_product: number,
33
- id_ship: string,
34
- instance_id_ship: string,
35
- amount: any,
36
- title_ship: string,
37
- description: string,
38
- device_session_id: any,
39
- token_id: string,
40
- order_id: any,
41
- business_id: any,
42
- payment_id: any,
43
- source: string,
44
- browser_info?: any,
45
- metadata: any,
46
- currency: string
47
- }
48
-
49
- export interface VaultRequest extends SkyflowRecord {
50
- records: SkyflowRecord[],
51
- continueOnError?: boolean,
52
- byot?: "DISABLE" | "ENABLE" | "ENABLE_STRICT"
53
- }
54
-
55
- export type RegisterCustomerCardRequest = {
56
- skyflow_id: string;
57
- }
58
-
59
- export type TokensRequest = {
60
- vault_id: string,
61
- vault_url: string,
62
- data: {
63
- [key: string]: any;
64
- }
65
- }
66
-
67
- export type StartCheckoutFullRequest = {
68
- order: {
69
- items: OrderItem[];
70
- };
71
- total: number;
72
- customer: {
73
- name: string;
74
- lastname: string;
75
- email: string;
76
- phone: string;
77
- };
78
- skyflowTokens: {
79
- cardholder_name: string;
80
- card_number: string;
81
- cvv: string;
82
- expiration_year: string;
83
- expiration_month: string;
84
- skyflow_id: string;
85
- };
86
- return_url: string;
87
- isSandbox: boolean;
88
- metadata: any;
89
- currency: string;
1
+ import { OrderItem } from "./commons";
2
+ import { SkyflowRecord } from "./skyflow";
3
+
4
+ export interface CreateOrderRequest {
5
+ business: string,
6
+ client: string,
7
+ billing_address_id?: number | null,
8
+ shipping_address_id?: number | null,
9
+ amount: number,
10
+ status?: string,
11
+ reference: string | number,
12
+ is_oneclick: boolean,
13
+ items: OrderItem[]
14
+ }
15
+
16
+ export type CreatePaymentRequest = {
17
+ business_pk?: string | number,
18
+ amount: number,
19
+ date?: string,
20
+ order_id?: string | number
21
+ client_id?: string | number
22
+ }
23
+
24
+ export type StartCheckoutRequest = {
25
+ card: any,
26
+ name: any,
27
+ last_name: string,
28
+ email_client: any,
29
+ phone_number: any,
30
+ return_url?: string,
31
+ id_product: string,
32
+ quantity_product: number,
33
+ id_ship: string,
34
+ instance_id_ship: string,
35
+ amount: any,
36
+ title_ship: string,
37
+ description: string,
38
+ device_session_id: any,
39
+ token_id: string,
40
+ order_id: any,
41
+ business_id: any,
42
+ payment_id: any,
43
+ source: string,
44
+ browser_info?: any,
45
+ metadata: any,
46
+ currency: string
47
+ }
48
+
49
+ export type StartCheckoutIdRequest = {
50
+ checkout_id: any
51
+ }
52
+
53
+ export interface VaultRequest extends SkyflowRecord {
54
+ records: SkyflowRecord[],
55
+ continueOnError?: boolean,
56
+ byot?: "DISABLE" | "ENABLE" | "ENABLE_STRICT"
57
+ }
58
+
59
+ export type RegisterCustomerCardRequest = {
60
+ skyflow_id: string;
61
+ }
62
+
63
+ export type TokensRequest = {
64
+ vault_id: string,
65
+ vault_url: string,
66
+ data: {
67
+ [key: string]: any;
68
+ }
69
+ }
70
+
71
+ export type StartCheckoutFullRequest = {
72
+ order: {
73
+ items: OrderItem[];
74
+ };
75
+ total: number;
76
+ customer: {
77
+ name: string;
78
+ lastname: string;
79
+ email: string;
80
+ phone: string;
81
+ };
82
+ skyflowTokens: {
83
+ cardholder_name: string;
84
+ card_number: string;
85
+ cvv: string;
86
+ expiration_year: string;
87
+ expiration_month: string;
88
+ skyflow_id: string;
89
+ };
90
+ return_url: string;
91
+ isSandbox: boolean;
92
+ metadata: any;
93
+ currency: string;
90
94
  }