@tonder.io/ionic-lite-sdk 0.0.14 → 0.0.17-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.
@@ -1,185 +1,185 @@
1
- import { Business } from "./commons";
2
-
3
- export interface IErrorResponse extends Error {
4
- code?: string;
5
- body?: string;
6
- }
7
-
8
- export interface GetBusinessResponse extends Business { }
9
-
10
- export type GetVaultTokenResponse = {
11
- token: string;
12
- };
13
-
14
- export type CustomerRegisterResponse = {
15
- id: number | string;
16
- email: string;
17
- auth_token: string;
18
- };
19
-
20
- export type CreateOrderResponse = {
21
- id: number | string;
22
- created: string;
23
- amount: string;
24
- status: string;
25
- payment_method?: string;
26
- reference?: string;
27
- is_oneclick: boolean;
28
- items: {
29
- description: string;
30
- product_reference: string;
31
- quantity: string;
32
- price_unit: string;
33
- discount: string;
34
- taxes: string;
35
- amount_total: string;
36
- }[];
37
- billing_address?: string;
38
- shipping_address?: string;
39
- client: {
40
- email: string;
41
- name: string;
42
- first_name: string;
43
- last_name: string;
44
- client_profile: {
45
- gender: string;
46
- date_birth?: string;
47
- terms: boolean;
48
- phone: string;
49
- };
50
- };
51
- };
52
-
53
- export type CreatePaymentResponse = {
54
- pk: number | string;
55
- order?: string;
56
- amount: string;
57
- status: string;
58
- date: string;
59
- paid_date?: string;
60
- shipping_address: {
61
- street: string;
62
- number: string;
63
- suburb: string;
64
- city: {
65
- name: string;
66
- };
67
- state: {
68
- name: string;
69
- country: {
70
- name: string;
71
- };
72
- };
73
- zip_code: string;
74
- };
75
- shipping_address_id?: string;
76
- billing_address: {
77
- street: string;
78
- number: string;
79
- suburb: string;
80
- city: {
81
- name: string;
82
- };
83
- state: {
84
- name: string;
85
- country: {
86
- name: string;
87
- };
88
- };
89
- zip_code: string;
90
- };
91
- billing_address_id?: string;
92
- client?: string;
93
- customer_order_reference?: string;
94
- };
95
-
96
- export type StartCheckoutResponse = {
97
- status: number;
98
- message: string;
99
- psp_response: {
100
- id: string;
101
- authorization: number;
102
- operation_type: string;
103
- transaction_type: string;
104
- status: string;
105
- conciliated: boolean;
106
- creation_date: string;
107
- operation_date: string;
108
- description: string;
109
- error_message?: string;
110
- order_id?: string;
111
- card: {
112
- type: string;
113
- brand: string;
114
- address?: string;
115
- card_number: string;
116
- holder_name: string;
117
- expiration_year: string;
118
- expiration_month: string;
119
- allows_charges: boolean;
120
- allows_payouts: boolean;
121
- bank_name: string;
122
- points_type: string;
123
- points_card: boolean;
124
- bank_code: number;
125
- };
126
- customer_id: string;
127
- gateway_card_present: string;
128
- amount: number;
129
- fee: {
130
- amount: number;
131
- tax: number;
132
- currency: string;
133
- };
134
- payment_method: {
135
- type: string;
136
- url: string;
137
- };
138
- currency: string;
139
- method: string;
140
- object: string;
141
- };
142
- transaction_status: string;
143
- transaction_id: number;
144
- payment_id: number;
145
- provider: string;
146
- next_action: {
147
- redirect_to_url: {
148
- url: string;
149
- return_url: string;
150
- verify_transaction_status_url: string;
151
- };
152
- };
153
- actions: {
154
- name: string;
155
- url: string;
156
- method: string;
157
- }[];
158
- };
159
-
160
- export type TokensResponse = {
161
- vaultID: string;
162
- responses: {
163
- [key: string]: string;
164
- }[];
165
- };
166
-
167
- export type GetCustomerCardsResponse = {
168
- user_id: number;
169
- cards: {
170
- fields: {
171
- card_scheme: string;
172
- card_number: string;
173
- cardholder_name: string;
174
- cvv: string;
175
- expiration_month: string;
176
- expiration_year: string;
177
- skyflow_id: string;
178
- };
179
- }[];
180
- };
181
-
182
- export type RegisterCustomerCardResponse = {
183
- skyflow_id: string;
184
- user_id: number;
185
- };
1
+ import { Business } from "./commons";
2
+
3
+ export interface IErrorResponse extends Error {
4
+ code?: string;
5
+ body?: string;
6
+ }
7
+
8
+ export interface GetBusinessResponse extends Business { }
9
+
10
+ export type GetVaultTokenResponse = {
11
+ token: string;
12
+ };
13
+
14
+ export type CustomerRegisterResponse = {
15
+ id: number | string;
16
+ email: string;
17
+ auth_token: string;
18
+ };
19
+
20
+ export type CreateOrderResponse = {
21
+ id: number | string;
22
+ created: string;
23
+ amount: string;
24
+ status: string;
25
+ payment_method?: string;
26
+ reference?: string;
27
+ is_oneclick: boolean;
28
+ items: {
29
+ description: string;
30
+ product_reference: string;
31
+ quantity: string;
32
+ price_unit: string;
33
+ discount: string;
34
+ taxes: string;
35
+ amount_total: string;
36
+ }[];
37
+ billing_address?: string;
38
+ shipping_address?: string;
39
+ client: {
40
+ email: string;
41
+ name: string;
42
+ first_name: string;
43
+ last_name: string;
44
+ client_profile: {
45
+ gender: string;
46
+ date_birth?: string;
47
+ terms: boolean;
48
+ phone: string;
49
+ };
50
+ };
51
+ };
52
+
53
+ export type CreatePaymentResponse = {
54
+ pk: number | string;
55
+ order?: string;
56
+ amount: string;
57
+ status: string;
58
+ date: string;
59
+ paid_date?: string;
60
+ shipping_address: {
61
+ street: string;
62
+ number: string;
63
+ suburb: string;
64
+ city: {
65
+ name: string;
66
+ };
67
+ state: {
68
+ name: string;
69
+ country: {
70
+ name: string;
71
+ };
72
+ };
73
+ zip_code: string;
74
+ };
75
+ shipping_address_id?: string;
76
+ billing_address: {
77
+ street: string;
78
+ number: string;
79
+ suburb: string;
80
+ city: {
81
+ name: string;
82
+ };
83
+ state: {
84
+ name: string;
85
+ country: {
86
+ name: string;
87
+ };
88
+ };
89
+ zip_code: string;
90
+ };
91
+ billing_address_id?: string;
92
+ client?: string;
93
+ customer_order_reference?: string;
94
+ };
95
+
96
+ export type StartCheckoutResponse = {
97
+ status: number;
98
+ message: string;
99
+ psp_response: {
100
+ id: string;
101
+ authorization: number;
102
+ operation_type: string;
103
+ transaction_type: string;
104
+ status: string;
105
+ conciliated: boolean;
106
+ creation_date: string;
107
+ operation_date: string;
108
+ description: string;
109
+ error_message?: string;
110
+ order_id?: string;
111
+ card: {
112
+ type: string;
113
+ brand: string;
114
+ address?: string;
115
+ card_number: string;
116
+ holder_name: string;
117
+ expiration_year: string;
118
+ expiration_month: string;
119
+ allows_charges: boolean;
120
+ allows_payouts: boolean;
121
+ bank_name: string;
122
+ points_type: string;
123
+ points_card: boolean;
124
+ bank_code: number;
125
+ };
126
+ customer_id: string;
127
+ gateway_card_present: string;
128
+ amount: number;
129
+ fee: {
130
+ amount: number;
131
+ tax: number;
132
+ currency: string;
133
+ };
134
+ payment_method: {
135
+ type: string;
136
+ url: string;
137
+ };
138
+ currency: string;
139
+ method: string;
140
+ object: string;
141
+ };
142
+ transaction_status: string;
143
+ transaction_id: number;
144
+ payment_id: number;
145
+ provider: string;
146
+ next_action: {
147
+ redirect_to_url: {
148
+ url: string;
149
+ return_url: string;
150
+ verify_transaction_status_url: string;
151
+ };
152
+ };
153
+ actions: {
154
+ name: string;
155
+ url: string;
156
+ method: string;
157
+ }[];
158
+ };
159
+
160
+ export type TokensResponse = {
161
+ vaultID: string;
162
+ responses: {
163
+ [key: string]: string;
164
+ }[];
165
+ };
166
+
167
+ export type GetCustomerCardsResponse = {
168
+ user_id: number;
169
+ cards: {
170
+ fields: {
171
+ card_scheme: string;
172
+ card_number: string;
173
+ cardholder_name: string;
174
+ cvv: string;
175
+ expiration_month: string;
176
+ expiration_year: string;
177
+ skyflow_id: string;
178
+ };
179
+ }[];
180
+ };
181
+
182
+ export type RegisterCustomerCardResponse = {
183
+ skyflow_id: string;
184
+ user_id: number;
185
+ };
@@ -1,17 +1,17 @@
1
- export type SkyflowRecord = {
2
- method: string;
3
- quorum?: boolean;
4
- tableName: string;
5
- fields?: {
6
- [key: string]: string;
7
- },
8
- ID?: string,
9
- tokenization?: boolean,
10
- batchID?: string,
11
- redaction?: "DEFAULT" | "REDACTED" | "MASKED" | "PLAIN_TEXT",
12
- downloadURL?: boolean,
13
- upsert?: string,
14
- tokens?: {
15
- [key: string]: string;
16
- }
17
- }
1
+ export type SkyflowRecord = {
2
+ method: string;
3
+ quorum?: boolean;
4
+ tableName: string;
5
+ fields?: {
6
+ [key: string]: string;
7
+ },
8
+ ID?: string,
9
+ tokenization?: boolean,
10
+ batchID?: string,
11
+ redaction?: "DEFAULT" | "REDACTED" | "MASKED" | "PLAIN_TEXT",
12
+ downloadURL?: boolean,
13
+ upsert?: string,
14
+ tokens?: {
15
+ [key: string]: string;
16
+ }
17
+ }
@@ -1,57 +1,57 @@
1
- import "../utils/defaultMock";
2
- import { LiteCheckout } from "../../src";
3
- import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
4
- import { constructorFields } from "../utils/defaultMock";
5
-
6
- declare global {
7
- interface Window {
8
- OpenPay: any;
9
- Skyflow: any;
10
- }
11
- }
12
-
13
- describe("LiteCheckout", () => {
14
- let checkoutConstructor: LiteCheckoutConstructor,
15
- liteCheckout: LiteCheckout,
16
- fetchSpy: jest.SpyInstance,
17
- liteCheckoutSpy: jest.SpyInstance;
18
-
19
- beforeEach(async () => {
20
- window.fetch = jest.fn();
21
-
22
- checkoutConstructor = {
23
- ...constructorFields,
24
- };
25
-
26
- liteCheckout = new LiteCheckout(constructorFields);
27
-
28
- fetchSpy = jest.spyOn(global, "fetch");
29
- });
30
-
31
- afterEach(() => {
32
- jest.restoreAllMocks();
33
- });
34
-
35
- it("Has required properties", () => {
36
- expect(checkoutConstructor).toEqual(constructorFields);
37
- });
38
-
39
- it("Can instance LiteCheckout", () => {
40
- expect(liteCheckout).toBeInstanceOf(LiteCheckout);
41
- expect(liteCheckout.apiKeyTonder).toEqual(constructorFields.apiKeyTonder);
42
- expect(liteCheckout.baseUrlTonder).toEqual(constructorFields.baseUrlTonder);
43
- expect(liteCheckout.signal).toEqual(constructorFields.signal);
44
- });
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
- });
1
+ import "../utils/defaultMock";
2
+ import { LiteCheckout } from "../../src";
3
+ import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
4
+ import { constructorFields } from "../utils/defaultMock";
5
+
6
+ declare global {
7
+ interface Window {
8
+ OpenPay: any;
9
+ Skyflow: any;
10
+ }
11
+ }
12
+
13
+ describe("LiteCheckout", () => {
14
+ let checkoutConstructor: LiteCheckoutConstructor,
15
+ liteCheckout: LiteCheckout,
16
+ fetchSpy: jest.SpyInstance,
17
+ liteCheckoutSpy: jest.SpyInstance;
18
+
19
+ beforeEach(async () => {
20
+ window.fetch = jest.fn();
21
+
22
+ checkoutConstructor = {
23
+ ...constructorFields,
24
+ };
25
+
26
+ liteCheckout = new LiteCheckout(constructorFields);
27
+
28
+ fetchSpy = jest.spyOn(global, "fetch");
29
+ });
30
+
31
+ afterEach(() => {
32
+ jest.restoreAllMocks();
33
+ });
34
+
35
+ it("Has required properties", () => {
36
+ expect(checkoutConstructor).toEqual(constructorFields);
37
+ });
38
+
39
+ it("Can instance LiteCheckout", () => {
40
+ expect(liteCheckout).toBeInstanceOf(LiteCheckout);
41
+ expect(liteCheckout.apiKeyTonder).toEqual(constructorFields.apiKeyTonder);
42
+ expect(liteCheckout.baseUrlTonder).toEqual(constructorFields.baseUrlTonder);
43
+ expect(liteCheckout.signal).toEqual(constructorFields.signal);
44
+ });
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+ });