@tonder.io/ionic-lite-sdk 0.0.35-beta.16 → 0.0.35-beta.17

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.
@@ -9,9 +9,17 @@
9
9
  <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
10
10
  <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
11
11
  <change beforePath="$PROJECT_DIR$/src/classes/BaseInlineCheckout.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/BaseInlineCheckout.ts" afterDir="false" />
12
+ <change beforePath="$PROJECT_DIR$/src/classes/errorResponse.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/errorResponse.ts" afterDir="false" />
12
13
  <change beforePath="$PROJECT_DIR$/src/classes/liteCheckout.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/liteCheckout.ts" afterDir="false" />
14
+ <change beforePath="$PROJECT_DIR$/src/data/businessApi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/data/businessApi.ts" afterDir="false" />
15
+ <change beforePath="$PROJECT_DIR$/src/data/cardApi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/data/cardApi.ts" afterDir="false" />
16
+ <change beforePath="$PROJECT_DIR$/src/data/checkoutApi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/data/checkoutApi.ts" afterDir="false" />
17
+ <change beforePath="$PROJECT_DIR$/src/data/customerApi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/data/customerApi.ts" afterDir="false" />
13
18
  <change beforePath="$PROJECT_DIR$/src/data/paymentMethodApi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/data/paymentMethodApi.ts" afterDir="false" />
19
+ <change beforePath="$PROJECT_DIR$/src/helpers/skyflow.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/helpers/skyflow.ts" afterDir="false" />
20
+ <change beforePath="$PROJECT_DIR$/src/helpers/utils.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/helpers/utils.ts" afterDir="false" />
14
21
  <change beforePath="$PROJECT_DIR$/src/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.ts" afterDir="false" />
22
+ <change beforePath="$PROJECT_DIR$/src/types/index.d.ts" beforeDir="false" />
15
23
  </list>
16
24
  <option name="SHOW_DIALOG" value="false" />
17
25
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -35,23 +43,27 @@
35
43
  <option name="hideEmptyMiddlePackages" value="true" />
36
44
  <option name="showLibraryContents" value="true" />
37
45
  </component>
38
- <component name="PropertiesComponent">{
39
- &quot;keyToString&quot;: {
40
- &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
41
- &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
42
- &quot;git-widget-placeholder&quot;: &quot;main&quot;,
43
- &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
44
- &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
45
- &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
46
- &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
47
- &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
48
- &quot;prettierjs.PrettierConfiguration.Package&quot;: &quot;/Users/davidhernandezalmagro/.nvm/versions/node/v21.2.0/lib/node_modules/prettier&quot;,
49
- &quot;settings.editor.selected.configurable&quot;: &quot;settings.javascript.prettier&quot;,
50
- &quot;ts.external.directory.path&quot;: &quot;/Users/davidhernandezalmagro/Desktop/Tonder/ionic-lite/node_modules/typescript/lib&quot;,
51
- &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
46
+ <component name="PropertiesComponent"><![CDATA[{
47
+ "keyToString": {
48
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
49
+ "RunOnceActivity.ShowReadmeOnStart": "true",
50
+ "git-widget-placeholder": "main",
51
+ "last_opened_file_path": "/Users/davidhernandezalmagro/Desktop/Tonder/ionic-lite/src/types",
52
+ "node.js.detected.package.eslint": "true",
53
+ "node.js.detected.package.tslint": "true",
54
+ "node.js.selected.package.eslint": "(autodetect)",
55
+ "node.js.selected.package.tslint": "(autodetect)",
56
+ "nodejs_package_manager_path": "npm",
57
+ "prettierjs.PrettierConfiguration.Package": "/Users/davidhernandezalmagro/.nvm/versions/node/v21.2.0/lib/node_modules/prettier",
58
+ "settings.editor.selected.configurable": "settings.javascript.prettier",
59
+ "ts.external.directory.path": "/Users/davidhernandezalmagro/Desktop/Tonder/ionic-lite/node_modules/typescript/lib",
60
+ "vue.rearranger.settings.migration": "true"
52
61
  }
53
- }</component>
62
+ }]]></component>
54
63
  <component name="RecentsManager">
64
+ <key name="CopyFile.RECENT_KEYS">
65
+ <recent name="$PROJECT_DIR$/src/types" />
66
+ </key>
55
67
  <key name="MoveFile.RECENT_KEYS">
56
68
  <recent name="$PROJECT_DIR$/src" />
57
69
  <recent name="$PROJECT_DIR$" />
@@ -70,7 +82,7 @@
70
82
  <workItem from="1725305433705" duration="21026000" />
71
83
  <workItem from="1725333899382" duration="2939000" />
72
84
  <workItem from="1725337022494" duration="3671000" />
73
- <workItem from="1725378545854" duration="7455000" />
85
+ <workItem from="1725378545854" duration="10208000" />
74
86
  </task>
75
87
  <servers />
76
88
  </component>
@@ -93,7 +105,7 @@
93
105
  <breakpoints>
94
106
  <line-breakpoint enabled="true" type="javascript">
95
107
  <url>file://$PROJECT_DIR$/src/classes/liteCheckout.ts</url>
96
- <line>227</line>
108
+ <line>219</line>
97
109
  <option name="timeStamp" value="16" />
98
110
  </line-breakpoint>
99
111
  <line-breakpoint enabled="true" type="javascript">
@@ -103,7 +115,7 @@
103
115
  </line-breakpoint>
104
116
  <line-breakpoint enabled="true" type="javascript">
105
117
  <url>file://$PROJECT_DIR$/src/classes/liteCheckout.ts</url>
106
- <line>231</line>
118
+ <line>223</line>
107
119
  <option name="timeStamp" value="18" />
108
120
  </line-breakpoint>
109
121
  </breakpoints>
@@ -1,6 +1,11 @@
1
1
  import { ThreeDSHandler } from "./3dsHandler";
2
2
  import { ErrorResponse } from "./errorResponse";
3
- import { Business, ICustomer, IItem, IInlineCheckoutBaseOptions, IConfigureCheckout, IProcessPaymentRequest, IStartCheckoutResponse, StartCheckoutResponse, ICustomerCardsResponse, ISaveCardResponse, ISaveCardSkyflowRequest, IPaymentMethodResponse } from "../types";
3
+ import { Business, IConfigureCheckout, IInlineCheckoutBaseOptions } from "../types/commons";
4
+ import { ICustomer } from "../types/customer";
5
+ import { IItem, IProcessPaymentRequest, IStartCheckoutResponse } from "../types/checkout";
6
+ import { ICustomerCardsResponse, ISaveCardResponse, ISaveCardSkyflowRequest } from "../types/card";
7
+ import { IPaymentMethodResponse } from "../types/paymentMethod";
8
+ import { StartCheckoutResponse } from "../types/responses";
4
9
  export declare class BaseInlineCheckout {
5
10
  #private;
6
11
  baseUrl: string;
@@ -21,7 +26,7 @@ export declare class BaseInlineCheckout {
21
26
  currency?: string;
22
27
  constructor({ mode, apiKey, apiKeyTonder, returnUrl, callBack, }: IInlineCheckoutBaseOptions);
23
28
  configureCheckout(data: IConfigureCheckout): void;
24
- verify3dsTransaction(): Promise<false | ErrorResponse | StartCheckoutResponse | undefined>;
29
+ verify3dsTransaction(): Promise<false | StartCheckoutResponse | ErrorResponse | undefined>;
25
30
  payment(data: IProcessPaymentRequest): Promise<IStartCheckoutResponse>;
26
31
  _initializeCheckout(): Promise<void>;
27
32
  _checkout(data: any): Promise<any>;
@@ -38,5 +43,5 @@ export declare class BaseInlineCheckout {
38
43
  _saveCustomerCard(authToken: string, businessId: string | number, skyflowTokens: ISaveCardSkyflowRequest): Promise<ISaveCardResponse>;
39
44
  _removeCustomerCard(authToken: string, businessId: string | number, skyflowId: string): Promise<string>;
40
45
  _fetchCustomerPaymentMethods(): Promise<IPaymentMethodResponse>;
41
- _handle3dsRedirect(response: ErrorResponse | StartCheckoutResponse | false | undefined): Promise<false | ErrorResponse | StartCheckoutResponse | undefined>;
46
+ _handle3dsRedirect(response: ErrorResponse | StartCheckoutResponse | false | undefined): Promise<false | StartCheckoutResponse | ErrorResponse | undefined>;
42
47
  }
@@ -1,4 +1,4 @@
1
- import { IErrorResponse } from "../types";
1
+ import { IErrorResponse } from "../types/responses";
2
2
  export declare class ErrorResponse implements IErrorResponse {
3
3
  code?: string | undefined;
4
4
  body?: string | undefined;
@@ -1,6 +1,11 @@
1
1
  import { ErrorResponse } from "./errorResponse";
2
2
  import { BaseInlineCheckout } from "./BaseInlineCheckout";
3
- import { APM, IInlineCheckoutBaseOptions, RegisterCustomerCardResponse, ISaveCardRequest, ICustomerCardsResponse, ISaveCardResponse, IPaymentMethod, GetBusinessResponse, TokensRequest, ICardFields, CustomerRegisterResponse, StartCheckoutFullRequest, CreateOrderRequest, CreatePaymentRequest, StartCheckoutRequest, StartCheckoutResponse, StartCheckoutIdRequest, CreatePaymentResponse, CreateOrderResponse, RegisterCustomerCardRequest } from "../types";
3
+ import { APM, IInlineCheckoutBaseOptions } from "../types/commons";
4
+ import { ICustomerCardsResponse, ISaveCardRequest, ISaveCardResponse } from "../types/card";
5
+ import { IPaymentMethod } from "../types/paymentMethod";
6
+ import { CreateOrderResponse, CreatePaymentResponse, CustomerRegisterResponse, GetBusinessResponse, RegisterCustomerCardResponse, StartCheckoutResponse } from "../types/responses";
7
+ import { CreateOrderRequest, CreatePaymentRequest, RegisterCustomerCardRequest, StartCheckoutFullRequest, StartCheckoutIdRequest, StartCheckoutRequest, TokensRequest } from "../types/requests";
8
+ import { ICardFields } from "../types/checkout";
4
9
  declare global {
5
10
  interface Window {
6
11
  OpenPay: any;
@@ -48,7 +53,7 @@ export declare class LiteCheckout extends BaseInlineCheckout {
48
53
  * Use the {@link payment} method
49
54
  */
50
55
  startCheckoutRouter(routerData: StartCheckoutRequest | StartCheckoutIdRequest): Promise<StartCheckoutResponse | ErrorResponse | undefined>;
51
- init3DSRedirect(checkoutResult: ErrorResponse | StartCheckoutResponse): Promise<false | ErrorResponse | StartCheckoutResponse | undefined>;
56
+ init3DSRedirect(checkoutResult: ErrorResponse | StartCheckoutResponse): Promise<false | StartCheckoutResponse | ErrorResponse | undefined>;
52
57
  /**
53
58
  * @deprecated This method is deprecated and will be removed in a future release.
54
59
  * Use the {@link payment} method
@@ -1,2 +1,2 @@
1
- import { GetBusinessResponse } from "../types";
1
+ import { GetBusinessResponse } from "../types/responses";
2
2
  export declare function fetchBusiness(baseUrl: string, apiKey: string, signal: AbortSignal): Promise<GetBusinessResponse>;
@@ -1,4 +1,4 @@
1
- import { ICustomerCardsResponse, ISaveCardResponse, ISaveCardSkyflowRequest } from "../types";
1
+ import { ICustomerCardsResponse, ISaveCardResponse, ISaveCardSkyflowRequest } from "../types/card";
2
2
  export declare function fetchCustomerCards(baseUrl: string, customerToken: string, businessId: string | number, signal?: null): Promise<ICustomerCardsResponse>;
3
3
  export declare function saveCustomerCard(baseUrl: string, customerToken: string, businessId: string | number, data: ISaveCardSkyflowRequest): Promise<ISaveCardResponse>;
4
4
  export declare function removeCustomerCard(baseUrl: string, customerToken: string, skyflowId: string | undefined, businessId: string | number): Promise<string>;
@@ -1,4 +1,5 @@
1
- import { CreateOrderRequest, CreatePaymentRequest, IStartCheckoutIdRequest, IStartCheckoutRequest } from "../types";
1
+ import { CreateOrderRequest, CreatePaymentRequest } from "../types/requests";
2
+ import { IStartCheckoutIdRequest, IStartCheckoutRequest } from "../types/checkout";
2
3
  export declare function createOrder(baseUrl: string, apiKey: string, orderItems: CreateOrderRequest): Promise<any>;
3
4
  export declare function createPayment(baseUrl: string, apiKey: string, paymentItems: CreatePaymentRequest): Promise<any>;
4
5
  export declare function startCheckoutRouter(baseUrl: string, apiKey: string, routerItems: IStartCheckoutRequest | IStartCheckoutIdRequest): Promise<any>;
@@ -1,2 +1,2 @@
1
- import { CustomerRegisterResponse } from "../types";
1
+ import { CustomerRegisterResponse } from "../types/responses";
2
2
  export declare function registerOrFetchCustomer(baseUrl: string, apiKey: string, customer: Record<string, any>, signal?: AbortSignal | null): Promise<CustomerRegisterResponse>;
@@ -1,4 +1,4 @@
1
- import { IPaymentMethodResponse } from "../types";
1
+ import { IPaymentMethodResponse } from "../types/paymentMethod";
2
2
  export declare function fetchCustomerPaymentMethods(baseUrl: string, apiKey: string, params?: {
3
3
  status: string;
4
4
  pagesize: string;
@@ -1,3 +1,3 @@
1
1
  import { ErrorResponse } from "../classes/errorResponse";
2
- import { TokensSkyflowRequest } from "../types";
2
+ import { TokensSkyflowRequest } from "../types/requests";
3
3
  export declare function getSkyflowTokens({ baseUrl, apiKey, vault_id, vault_url, data, }: TokensSkyflowRequest): Promise<any | ErrorResponse>;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@tonder.io/ionic-lite-sdk",
3
- "version": "0.0.35-beta.16",
3
+ "version": "0.0.35-beta.17",
4
4
  "description": "Tonder ionic lite SDK",
5
5
  "main": "dist/index.js",
6
- "types": "src/types/index.d.ts",
6
+ "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc -noEmit && rollup --config",
9
9
  "test": "jest",
@@ -11,21 +11,6 @@ import {
11
11
  import { getOpenpayDeviceSessionID } from "../data/openPayApi";
12
12
  import { getBrowserInfo } from "../helpers/utils";
13
13
  import { registerOrFetchCustomer } from "../data/customerApi";
14
- import {
15
- Business,
16
- ICustomer,
17
- IItem,
18
- IInlineCheckoutBaseOptions,
19
- IConfigureCheckout,
20
- IProcessPaymentRequest,
21
- IStartCheckoutResponse,
22
- StartCheckoutResponse,
23
- ICardFields,
24
- ICustomerCardsResponse,
25
- ISaveCardResponse,
26
- ISaveCardSkyflowRequest,
27
- IPaymentMethodResponse,
28
- } from "../types";
29
14
  import { get } from "lodash";
30
15
  import {
31
16
  fetchCustomerCards,
@@ -33,6 +18,12 @@ import {
33
18
  saveCustomerCard,
34
19
  } from "../data/cardApi";
35
20
  import { fetchCustomerPaymentMethods } from "../data/paymentMethodApi";
21
+ import {Business, IConfigureCheckout, IInlineCheckoutBaseOptions} from "../types/commons";
22
+ import {ICustomer} from "../types/customer";
23
+ import {ICardFields, IItem, IProcessPaymentRequest, IStartCheckoutResponse} from "../types/checkout";
24
+ import {ICustomerCardsResponse, ISaveCardResponse, ISaveCardSkyflowRequest} from "../types/card";
25
+ import {IPaymentMethodResponse} from "../types/paymentMethod";
26
+ import {StartCheckoutResponse} from "../types/responses";
36
27
  export class BaseInlineCheckout {
37
28
  baseUrl = "";
38
29
  cartTotal = "0";
@@ -1,4 +1,4 @@
1
- import { IErrorResponse } from "../types";
1
+ import {IErrorResponse} from "../types/responses";
2
2
 
3
3
  export class ErrorResponse implements IErrorResponse {
4
4
  code?: string | undefined;
@@ -17,31 +17,23 @@ import { getSkyflowTokens } from "../helpers/skyflow";
17
17
  import { startCheckoutRouter } from "../data/checkoutApi";
18
18
  import { getOpenpayDeviceSessionID } from "../data/openPayApi";
19
19
  import { getPaymentMethodDetails } from "../shared/catalog/paymentMethodsCatalog";
20
+ import {APM, IInlineCheckoutBaseOptions, TonderAPM} from "../types/commons";
21
+ import {ICustomerCardsResponse, ISaveCardRequest, ISaveCardResponse, ISaveCardSkyflowRequest} from "../types/card";
22
+ import {IPaymentMethod} from "../types/paymentMethod";
20
23
  import {
21
- APM,
22
- IInlineCheckoutBaseOptions,
23
- TonderAPM,
24
- RegisterCustomerCardResponse,
25
- ISaveCardRequest,
26
- ICustomerCardsResponse,
27
- ISaveCardResponse,
28
- IPaymentMethod,
29
- GetBusinessResponse,
30
- TokensRequest,
31
- ICardFields,
24
+ CreateOrderResponse,
25
+ CreatePaymentResponse,
32
26
  CustomerRegisterResponse,
33
- StartCheckoutFullRequest,
27
+ GetBusinessResponse, IErrorResponse, RegisterCustomerCardResponse, StartCheckoutResponse
28
+ } from "../types/responses";
29
+ import {
34
30
  CreateOrderRequest,
35
- CreatePaymentRequest,
36
- StartCheckoutRequest,
37
- IErrorResponse,
38
- StartCheckoutResponse,
31
+ CreatePaymentRequest, RegisterCustomerCardRequest, StartCheckoutFullRequest,
39
32
  StartCheckoutIdRequest,
40
- CreatePaymentResponse,
41
- CreateOrderResponse,
42
- RegisterCustomerCardRequest,
43
- ISaveCardSkyflowRequest,
44
- } from "../types";
33
+ StartCheckoutRequest,
34
+ TokensRequest
35
+ } from "../types/requests";
36
+ import {ICardFields} from "../types/checkout";
45
37
 
46
38
  declare global {
47
39
  interface Window {
@@ -1,4 +1,4 @@
1
- import { GetBusinessResponse } from "../types";
1
+ import {GetBusinessResponse} from "../types/responses";
2
2
 
3
3
  export async function fetchBusiness(
4
4
  baseUrl: string,
@@ -2,12 +2,8 @@ import {
2
2
  buildErrorResponse,
3
3
  buildErrorResponseFromCatch,
4
4
  } from "../helpers/utils";
5
- import {
6
- ICustomerCardsResponse,
7
- ISaveCardResponse,
8
- ISaveCardSkyflowRequest,
9
- } from "../types";
10
5
  import { MESSAGES } from "../shared/constants/messages";
6
+ import {ICustomerCardsResponse, ISaveCardResponse, ISaveCardSkyflowRequest} from "../types/card";
11
7
 
12
8
  export async function fetchCustomerCards(
13
9
  baseUrl: string,
@@ -1,11 +1,8 @@
1
+ import {CreateOrderRequest, CreatePaymentRequest} from "../types/requests";
2
+ import {IStartCheckoutIdRequest, IStartCheckoutRequest} from "../types/checkout";
3
+
1
4
  declare const MP_DEVICE_SESSION_ID: string | undefined;
2
5
 
3
- import {
4
- CreateOrderRequest,
5
- CreatePaymentRequest,
6
- IStartCheckoutIdRequest,
7
- IStartCheckoutRequest,
8
- } from "../types";
9
6
 
10
7
  export async function createOrder(
11
8
  baseUrl: string,
@@ -1,4 +1,4 @@
1
- import { CustomerRegisterResponse } from "../types";
1
+ import {CustomerRegisterResponse} from "../types/responses";
2
2
 
3
3
  export async function registerOrFetchCustomer(
4
4
  baseUrl: string,
@@ -2,7 +2,7 @@ import {
2
2
  buildErrorResponse,
3
3
  buildErrorResponseFromCatch,
4
4
  } from "../helpers/utils";
5
- import { IPaymentMethodResponse } from "../types";
5
+ import {IPaymentMethodResponse} from "../types/paymentMethod";
6
6
 
7
7
  export async function fetchCustomerPaymentMethods(
8
8
  baseUrl: string,
@@ -4,7 +4,7 @@ import CollectContainer from "skyflow-js/types/core/external/collect/collect-con
4
4
  import {buildErrorResponseFromCatch} from "./utils";
5
5
  import CollectElement from "skyflow-js/types/core/external/collect/collect-element";
6
6
  import {getVaultToken} from "../data/skyflowApi";
7
- import {TokensSkyflowRequest} from "../types";
7
+ import {TokensSkyflowRequest} from "../types/requests";
8
8
 
9
9
  export async function getSkyflowTokens({
10
10
  baseUrl,
@@ -1,5 +1,5 @@
1
1
  import { ErrorResponse } from "../classes/errorResponse";
2
- import { IErrorResponse } from "../types";
2
+ import {IErrorResponse} from "../types/responses";
3
3
 
4
4
  export const getBrowserInfo = () => {
5
5
  const browserInfo = {
@@ -1,10 +0,0 @@
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
-