@tonder.io/ionic-lite-sdk 0.0.35-beta.4 → 0.0.35-beta.6

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/.idea/workspace.xml +4 -8
  2. package/dist/{src/classes → classes}/BaseInlineCheckout.d.ts +1 -1
  3. package/dist/{src/classes → classes}/errorResponse.d.ts +1 -1
  4. package/dist/{src/classes → classes}/liteCheckout.d.ts +2 -3
  5. package/dist/{src/data → data}/businessApi.d.ts +1 -1
  6. package/dist/{src/data → data}/cardApi.d.ts +1 -1
  7. package/dist/{src/data → data}/checkoutApi.d.ts +1 -1
  8. package/dist/{src/data → data}/customerApi.d.ts +1 -1
  9. package/dist/{src/data → data}/paymentMethodApi.d.ts +1 -1
  10. package/dist/{src/helpers → helpers}/skyflow.d.ts +1 -1
  11. package/dist/index.js +1 -1
  12. package/package.json +2 -2
  13. package/src/classes/BaseInlineCheckout.ts +1 -1
  14. package/src/classes/errorResponse.ts +1 -1
  15. package/src/classes/liteCheckout.ts +2 -7
  16. package/src/data/businessApi.ts +1 -1
  17. package/src/data/cardApi.ts +1 -1
  18. package/src/data/checkoutApi.ts +1 -1
  19. package/src/data/customerApi.ts +1 -1
  20. package/src/data/paymentMethodApi.ts +1 -1
  21. package/src/helpers/skyflow.ts +1 -1
  22. package/src/helpers/utils.ts +1 -1
  23. package/src/types/card.ts +34 -0
  24. package/src/types/checkout.ts +118 -0
  25. package/src/types/commons.ts +125 -0
  26. package/src/types/customer.ts +12 -0
  27. package/src/types/index.d.ts +10 -0
  28. package/src/types/liteInlineCheckout.d.ts +191 -0
  29. package/src/types/paymentMethod.ts +24 -0
  30. package/src/types/requests.ts +115 -0
  31. package/src/types/responses.ts +189 -0
  32. package/src/types/skyflow.ts +17 -0
  33. package/src/types/validations.d.ts +11 -0
  34. package/tests/methods/createOrder.test.ts +1 -1
  35. package/tests/methods/createPayment.test.ts +1 -1
  36. package/tests/methods/customerRegister.test.ts +1 -1
  37. package/tests/methods/getBusiness.test.ts +1 -1
  38. package/tests/methods/getCustomerCards.test.ts +1 -1
  39. package/tests/methods/registerCustomerCard.test.ts +1 -1
  40. package/tests/methods/startCheckoutRouter.test.ts +1 -1
  41. package/tests/methods/startCheckoutRouterFull.test.ts +1 -1
  42. package/tests/utils/mockClasses.ts +3 -3
  43. /package/dist/{src/classes → classes}/3dsHandler.d.ts +0 -0
  44. /package/dist/{src/data → data}/api.d.ts +0 -0
  45. /package/dist/{src/data → data}/openPayApi.d.ts +0 -0
  46. /package/dist/{src/data → data}/skyflowApi.d.ts +0 -0
  47. /package/dist/{src/helpers → helpers}/constants.d.ts +0 -0
  48. /package/dist/{src/helpers → helpers}/mercadopago.d.ts +0 -0
  49. /package/dist/{src/helpers → helpers}/utils.d.ts +0 -0
  50. /package/dist/{src/helpers → helpers}/validations.d.ts +0 -0
  51. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  52. /package/dist/{src/shared → shared}/catalog/paymentMethodsCatalog.d.ts +0 -0
  53. /package/dist/{src/shared → shared}/constants/messages.d.ts +0 -0
  54. /package/dist/{src/shared → shared}/constants/paymentMethodAPM.d.ts +0 -0
  55. /package/dist/{src/shared → shared}/constants/tonderUrl.d.ts +0 -0
@@ -0,0 +1,125 @@
1
+ import {ICustomer} from "./customer";
2
+
3
+ export type Business = {
4
+ business: {
5
+ pk: number;
6
+ name: string;
7
+ categories: {
8
+ pk: number;
9
+ name: string;
10
+ }[];
11
+ web: string;
12
+ logo: string;
13
+ full_logo_url: string;
14
+ background_color: string;
15
+ primary_color: string;
16
+ checkout_mode: boolean;
17
+ textCheckoutColor: string;
18
+ textDetailsColor: string;
19
+ checkout_logo: string;
20
+ };
21
+ openpay_keys: {
22
+ merchant_id: string;
23
+ public_key: string;
24
+ };
25
+ fintoc_keys: {
26
+ public_key: string;
27
+ };
28
+ mercado_pago: {
29
+ active: boolean;
30
+ };
31
+ vault_id: string;
32
+ vault_url: string;
33
+ reference: number;
34
+ is_installments_available: boolean;
35
+ };
36
+
37
+ export type Customer = {
38
+ firstName: string;
39
+ lastName: string;
40
+ country: string;
41
+ street: string;
42
+ city: string;
43
+ state: string;
44
+ postCode: string;
45
+ email: string;
46
+ phone: string;
47
+ };
48
+
49
+ export type OrderItem = {
50
+ description: string;
51
+ quantity: number;
52
+ price_unit: number;
53
+ discount: number;
54
+ taxes: number;
55
+ product_reference: number;
56
+ name: string;
57
+ amount_total: number;
58
+ };
59
+
60
+ export type PaymentData = {
61
+ customer: Customer;
62
+ currency: string;
63
+ cart: {
64
+ total: string | number;
65
+ items: OrderItem[];
66
+ };
67
+ };
68
+
69
+ export type TonderAPM = {
70
+ pk: string;
71
+ payment_method: string;
72
+ priority: number;
73
+ category: string;
74
+ unavailable_countries: string[];
75
+ status: string;
76
+ }
77
+
78
+ export type APM = {
79
+ id: string;
80
+ payment_method: string;
81
+ priority: number;
82
+ category: string;
83
+ icon: string;
84
+ label: string;
85
+ }
86
+
87
+
88
+ export interface IConfigureCheckout {
89
+ customer: ICustomer;
90
+ }
91
+
92
+ export interface IInlineCheckoutBaseOptions {
93
+ mode?: "production" | "sandbox" | "stage" | "development";
94
+ /**
95
+ * @deprecated This property is deprecated and will be removed in a future release.
96
+ * `baseUrlTonder` is no longer required.
97
+ */
98
+ baseUrlTonder?: string;
99
+ /**
100
+ * @deprecated This property is deprecated and will be removed in a future release.
101
+ * Use `apiKey` instead, as `apiKeyTonder` is no longer required.
102
+ */
103
+ apiKeyTonder?: string;
104
+ /**
105
+ * @deprecated This property is deprecated and will be removed in a future release.
106
+ * `signal` is no longer required.
107
+ */
108
+ signal?: AbortSignal;
109
+ apiKey: string;
110
+ returnUrl: string;
111
+ callBack?: (response: any) => void;
112
+ }
113
+ export interface IApiError {
114
+ code: string;
115
+ body: Record<string, string> | string;
116
+ name: string;
117
+ message: string;
118
+ }
119
+
120
+ export interface IPublicError {
121
+ status: string;
122
+ code: number;
123
+ message: string;
124
+ detail: Record<string, any> | string;
125
+ }
@@ -0,0 +1,12 @@
1
+ export type ICustomer = {
2
+ firstName: string;
3
+ lastName: string;
4
+ country?: string;
5
+ street?: string;
6
+ city?: string;
7
+ state?: string;
8
+ postCode?: string;
9
+ email: string;
10
+ phone?: string;
11
+ address?: string;
12
+ };
@@ -0,0 +1,10 @@
1
+ export * from './card';
2
+ export * from './checkout';
3
+ export * from './commons';
4
+ export * from './customer';
5
+ export * from './paymentMethod';
6
+ export * from './liteInlineCheckout';
7
+ export * from './validations';
8
+ export * from './responses';
9
+ export * from './requests';
10
+
@@ -0,0 +1,191 @@
1
+ import {IConfigureCheckout, IInlineCheckoutBaseOptions} from "./common";
2
+ import {ICustomerCardsResponse, ISaveCardRequest, ISaveCardResponse} from "./card";
3
+ import {IPaymentMethod} from "./paymentMethod";
4
+ import {IProcessPaymentRequest, IStartCheckoutResponse} from "./checkout";
5
+ import {ITransaction} from "./transaction";
6
+ import {APM} from "./commons";
7
+ import {ErrorResponse} from "../classes/errorResponse";
8
+ import {
9
+ CreateOrderRequest,
10
+ CreatePaymentRequest,
11
+ RegisterCustomerCardRequest,
12
+ StartCheckoutFullRequest,
13
+ StartCheckoutIdRequest,
14
+ StartCheckoutRequest, TokensRequest
15
+ } from "./requests";
16
+ import {
17
+ CreateOrderResponse,
18
+ CreatePaymentResponse, CustomerRegisterResponse, GetBusinessResponse,
19
+ RegisterCustomerCardResponse,
20
+ StartCheckoutResponse
21
+ } from "./responses";
22
+
23
+ export class LiteCheckout {
24
+ constructor(options: IInlineLiteCheckoutOptions);
25
+
26
+ /**
27
+ * The configureCheckout function allows you to set initial information, such as the customer's email, which is used to retrieve a list of saved cards.
28
+ * @param {import("./index").IConfigureCheckout} data - Configuration data including customer information and potentially other settings.
29
+ * @returns {Promise<void>}.
30
+ * @public
31
+ */
32
+ configureCheckout(data: IConfigureCheckout): void;
33
+
34
+ /**
35
+ * Initializes and prepares the checkout for use.
36
+ * This method set up the initial environment.
37
+ * @returns {Promise<void>} A promise that resolves when the checkout has been initialized.
38
+ * @throws {Error} If there's any problem during the checkout initialization.
39
+ * @public
40
+ */
41
+ injectCheckout(): Promise<void>;
42
+
43
+ /**
44
+ * Processes a payment.
45
+ * @param {import("./index").IProcessPaymentRequest} data - Payment data including customer, cart, and other relevant information.
46
+ * @returns {Promise<import("./index").IStartCheckoutResponse>} A promise that resolves with the payment response or 3DS redirect or is rejected with an error.
47
+ *
48
+ * @throws {Error} Throws an error if the checkout process fails. The error object contains
49
+ * additional `details` property with the response from the server if available.
50
+ * @property {import("./index").IStartCheckoutErrorResponse} error.details - The response body from the server when an error occurs.
51
+ *
52
+ * @public
53
+ */
54
+ payment(data: IProcessPaymentRequest): Promise<IStartCheckoutResponse>;
55
+
56
+ /**
57
+ * Verifies the 3DS transaction status.
58
+ * @returns {Promise<import("./index").ITransaction | void>} The result of the 3DS verification and checkout resumption.
59
+ * @public
60
+ */
61
+ verify3dsTransaction(): Promise<ITransaction | void>;
62
+
63
+ /**
64
+ * Retrieves the list of cards associated with a customer.
65
+ * @returns {Promise<import("./index").ICustomerCardsResponse>} A promise that resolves with the customer's card data.
66
+ *
67
+ * @throws {import("./index").IPublicError} Throws an error object if the operation fails.
68
+ *
69
+ * @public
70
+ */
71
+ getCustomerCards(): Promise<ICustomerCardsResponse>;
72
+
73
+ /**
74
+ * Saves a card to a customer's account. This method can be used to add a new card
75
+ * or update an existing one.
76
+ * @param {import("./index").ISaveCardRequest} card - The card information to be saved.
77
+ * @returns {Promise<import("./index").ISaveCardResponse>} A promise that resolves with the saved card data.
78
+ *
79
+ * @throws {import("./index").IPublicError} Throws an error object if the operation fails.
80
+ *
81
+ * @public
82
+ */
83
+ saveCustomerCard(
84
+ card: ISaveCardRequest,
85
+ ): Promise<ISaveCardResponse>;
86
+
87
+ /**
88
+ * Removes a card from a customer's account.
89
+ * @param {string} skyflowId - The unique identifier of the card to be deleted.
90
+ * @returns {Promise<string>} A promise that resolves when the card is successfully deleted.
91
+ *
92
+ * @throws {import("./index").IPublicError} Throws an error object if the operation fails.
93
+ *
94
+ * @public
95
+ */
96
+ removeCustomerCard(
97
+ skyflowId: string,
98
+ ): Promise<string>;
99
+
100
+ /**
101
+ * Retrieves the list of available Alternative Payment Methods (APMs).
102
+ * @returns {Promise<import("./index").IPaymentMethod[]>} A promise that resolves with the list of APMs.
103
+ *
104
+ * @throws {import("./index").IPublicError} Throws an error object if the operation fails.
105
+ *
106
+ * @public
107
+ */
108
+ getCustomerPaymentMethods(): Promise<IPaymentMethod[]>;
109
+
110
+ /**
111
+ * Retrieves the business information.
112
+ * @returns {Promise<import("./index").GetBusinessResponse>} A promise that resolves with the business information.
113
+ *
114
+ * @throws {import("./index").IPublicError} Throws an error object if the operation fails.
115
+ *
116
+ * @public
117
+ */
118
+ getBusiness(): Promise<GetBusinessResponse>;
119
+
120
+
121
+ // TODO: DEPRECATED
122
+ /**
123
+ * @deprecated This method is deprecated and will be removed in a future release.
124
+ * It is no longer necessary to use this method as customer registration is now automatically handled
125
+ * during the payment process or when using card management methods.
126
+ */
127
+ async customerRegister(email: string): Promise<CustomerRegisterResponse | ErrorResponse>
128
+
129
+ // TODO: DEPRECATED
130
+ /**
131
+ * @deprecated This method is deprecated and will be removed in a future release.
132
+ * It is no longer necessary to use this method as order creation is now automatically
133
+ * handled when making a payment through the `payment` function.
134
+ */
135
+ async createOrder(orderItems: CreateOrderRequest): Promise<CreateOrderResponse | ErrorResponse>
136
+
137
+ // TODO: DEPRECATED
138
+ /**
139
+ * @deprecated This method is deprecated and will be removed in a future release.
140
+ * It is no longer necessary to use this method as payment creation is now automatically
141
+ * handled when making a payment through the `payment` function.
142
+ */
143
+ async createPayment(paymentItems: CreatePaymentRequest): Promise<CreatePaymentResponse | ErrorResponse>
144
+
145
+ // TODO: DEPRECATED
146
+ /**
147
+ * @deprecated This method is deprecated and will be removed in a future release.
148
+ * Use the {@link payment} method
149
+ */
150
+ async startCheckoutRouter(routerData: StartCheckoutRequest | StartCheckoutIdRequest): Promise<StartCheckoutResponse | ErrorResponse | undefined>
151
+
152
+ // TODO: DEPRECATED
153
+ /**
154
+ * @deprecated This method is deprecated and will be removed in a future release.
155
+ * Use the {@link payment} method
156
+ */
157
+ async startCheckoutRouterFull(routerFullData: StartCheckoutFullRequest): Promise<StartCheckoutResponse | ErrorResponse | undefined>
158
+
159
+ // TODO: DEPRECATED
160
+ /**
161
+ * @deprecated This method is deprecated and will be removed in a future release.
162
+ * Use the {@link saveCustomerCard} method
163
+ */
164
+ async registerCustomerCard(customerToken: string, data: RegisterCustomerCardRequest): Promise<RegisterCustomerCardResponse | ErrorResponse>
165
+
166
+
167
+ // TODO: DEPRECATED
168
+ /**
169
+ * @deprecated This method is deprecated and will be removed in a future release.
170
+ * Use the {@link removeCustomerCard} method
171
+ */
172
+ async deleteCustomerCard(customerToken: string, skyflowId: string = ""): Promise<Boolean | ErrorResponse>
173
+
174
+ // TODO: DEPRECATED
175
+ /**
176
+ * @deprecated This method is deprecated and will be removed in a future release.
177
+ * Use the {@link getCustomerPaymentMethods} method
178
+ */
179
+ async getActiveAPMs(): Promise<APM[]>;
180
+
181
+ // TODO: DEPRECATED
182
+ /**
183
+ * @deprecated This method is deprecated and will be removed in a future release.
184
+ * It is no longer necessary to use this method as customer registration is now automatically handled
185
+ * during the payment process or when using card management methods.
186
+ */
187
+ async getSkyflowTokens({vault_id, vault_url, data}: TokensRequest): Promise<any | ErrorResponse>
188
+ }
189
+
190
+
191
+ export interface IInlineLiteCheckoutOptions extends IInlineCheckoutBaseOptions {}
@@ -0,0 +1,24 @@
1
+ export interface IPaymentMethodResponse {
2
+ count: number;
3
+ next: string | null;
4
+ previous: string | null;
5
+ results: ITonderPaymentMethod[];
6
+ }
7
+
8
+ export interface ITonderPaymentMethod {
9
+ pk: string;
10
+ payment_method: string;
11
+ priority: number;
12
+ category: string;
13
+ unavailable_countries: string[];
14
+ status: string;
15
+ }
16
+
17
+ export interface IPaymentMethod {
18
+ id: string;
19
+ payment_method: string;
20
+ priority: number;
21
+ category: string;
22
+ icon: string;
23
+ label: string;
24
+ }
@@ -0,0 +1,115 @@
1
+ import { SkyflowRecord } from "./skyflow";
2
+ import {IItem} from "./checkout";
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: IItem[]
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 StartCheckoutRequestBase = {
25
+ name: any,
26
+ last_name: string,
27
+ email_client: any,
28
+ phone_number: any,
29
+ return_url?: string,
30
+ id_product: string,
31
+ quantity_product: number,
32
+ id_ship: string,
33
+ instance_id_ship: string,
34
+ amount: any,
35
+ title_ship: string,
36
+ description: string,
37
+ device_session_id: any,
38
+ token_id: string,
39
+ order_id: any,
40
+ business_id: any,
41
+ payment_id: any,
42
+ source: string,
43
+ browser_info?: any,
44
+ metadata: any,
45
+ currency: string,
46
+ }
47
+
48
+ export type StartCheckoutRequestWithCard = StartCheckoutRequestBase & {
49
+ card: any,
50
+ payment_method?: never,
51
+ }
52
+
53
+ export type StartCheckoutRequestWithPaymentMethod = StartCheckoutRequestBase & {
54
+ card?: never,
55
+ payment_method: string,
56
+ }
57
+
58
+ export type StartCheckoutRequest = StartCheckoutRequestWithCard | StartCheckoutRequestWithPaymentMethod;
59
+
60
+ export type StartCheckoutIdRequest = {
61
+ checkout_id: any
62
+ }
63
+
64
+ export interface VaultRequest extends SkyflowRecord {
65
+ records: SkyflowRecord[],
66
+ continueOnError?: boolean,
67
+ byot?: "DISABLE" | "ENABLE" | "ENABLE_STRICT"
68
+ }
69
+
70
+ export type RegisterCustomerCardRequest = {
71
+ skyflow_id: string;
72
+ }
73
+
74
+ export type TokensSkyflowRequest = {
75
+ baseUrl: string;
76
+ apiKey: string;
77
+ vault_id: string,
78
+ vault_url: string,
79
+ data: {
80
+ [key: string]: any;
81
+ }
82
+ }
83
+ export type TokensRequest = {
84
+ vault_id: string,
85
+ vault_url: string,
86
+ data: {
87
+ [key: string]: any;
88
+ }
89
+ }
90
+
91
+ export type StartCheckoutFullRequest = {
92
+ order: {
93
+ items: IItem[];
94
+ };
95
+ total: number;
96
+ customer: {
97
+ name: string;
98
+ lastname: string;
99
+ email: string;
100
+ phone: string;
101
+ };
102
+ skyflowTokens: {
103
+ cardholder_name: string;
104
+ card_number: string;
105
+ cvv: string;
106
+ expiration_year: string;
107
+ expiration_month: string;
108
+ skyflow_id: string;
109
+ };
110
+ return_url: string;
111
+ isSandbox: boolean;
112
+ metadata: any;
113
+ currency: string;
114
+ payment_method?: string;
115
+ }
@@ -0,0 +1,189 @@
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
+ is_route_finished: Boolean;
143
+ transaction_status: string;
144
+ transaction_id: number;
145
+ payment_id: number;
146
+ provider: string;
147
+ next_action: {
148
+ redirect_to_url: {
149
+ url: string;
150
+ return_url: string;
151
+ verify_transaction_status_url: string;
152
+ };
153
+ iframe_resources?: {
154
+ iframe: string;
155
+ };
156
+ };
157
+ actions: {
158
+ name: string;
159
+ url: string;
160
+ method: string;
161
+ }[];
162
+ };
163
+
164
+ export type TokensResponse = {
165
+ vaultID: string;
166
+ responses: {
167
+ [key: string]: string;
168
+ }[];
169
+ };
170
+
171
+ export type GetCustomerCardsResponse = {
172
+ user_id: number;
173
+ cards: {
174
+ fields: {
175
+ card_scheme: string;
176
+ card_number: string;
177
+ cardholder_name: string;
178
+ cvv: string;
179
+ expiration_month: string;
180
+ expiration_year: string;
181
+ skyflow_id: string;
182
+ };
183
+ }[];
184
+ };
185
+
186
+ export type RegisterCustomerCardResponse = {
187
+ skyflow_id: string;
188
+ user_id: number;
189
+ };
@@ -0,0 +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
+ }
@@ -0,0 +1,11 @@
1
+ export declare function validateCardNumber(cardNumber: string): boolean;
2
+
3
+ export declare function validateCardholderName(name: string): boolean;
4
+
5
+ export declare function validateCVV(cvv: string): boolean;
6
+
7
+ export declare function validateExpirationMonth(month: string): boolean;
8
+
9
+ export declare function validateExpirationYear(year: string): boolean;
10
+
11
+ export declare function validateExpirationDateParts(month: string, year: string): boolean;
@@ -2,7 +2,7 @@ import "../utils/defaultMock";
2
2
  import { LiteCheckout } from "../../src";
3
3
  import { ErrorResponse } from "../../src/classes/errorResponse";
4
4
  import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
5
- import { IErrorResponse } from "../../types/responses";
5
+ import { IErrorResponse } from "../../src/types/responses";
6
6
  import { constructorFields } from "../utils/defaultMock";
7
7
  import { OrderResponseClass, OrderClass, OrderClassEmptyValues, OrderEmptyValuesResponse } from "../utils/mockClasses";
8
8