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

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,18 @@
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/card.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/card.ts" afterDir="false" />
23
+ <change beforePath="$PROJECT_DIR$/src/types/index.d.ts" beforeDir="false" />
15
24
  </list>
16
25
  <option name="SHOW_DIALOG" value="false" />
17
26
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -35,23 +44,27 @@
35
44
  <option name="hideEmptyMiddlePackages" value="true" />
36
45
  <option name="showLibraryContents" value="true" />
37
46
  </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;
47
+ <component name="PropertiesComponent"><![CDATA[{
48
+ "keyToString": {
49
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
50
+ "RunOnceActivity.ShowReadmeOnStart": "true",
51
+ "git-widget-placeholder": "main",
52
+ "last_opened_file_path": "/Users/davidhernandezalmagro/Desktop/Tonder/ionic-lite/src/types",
53
+ "node.js.detected.package.eslint": "true",
54
+ "node.js.detected.package.tslint": "true",
55
+ "node.js.selected.package.eslint": "(autodetect)",
56
+ "node.js.selected.package.tslint": "(autodetect)",
57
+ "nodejs_package_manager_path": "npm",
58
+ "prettierjs.PrettierConfiguration.Package": "/Users/davidhernandezalmagro/.nvm/versions/node/v21.2.0/lib/node_modules/prettier",
59
+ "settings.editor.selected.configurable": "settings.javascript.prettier",
60
+ "ts.external.directory.path": "/Users/davidhernandezalmagro/Desktop/Tonder/ionic-lite/node_modules/typescript/lib",
61
+ "vue.rearranger.settings.migration": "true"
52
62
  }
53
- }</component>
63
+ }]]></component>
54
64
  <component name="RecentsManager">
65
+ <key name="CopyFile.RECENT_KEYS">
66
+ <recent name="$PROJECT_DIR$/src/types" />
67
+ </key>
55
68
  <key name="MoveFile.RECENT_KEYS">
56
69
  <recent name="$PROJECT_DIR$/src" />
57
70
  <recent name="$PROJECT_DIR$" />
@@ -70,7 +83,7 @@
70
83
  <workItem from="1725305433705" duration="21026000" />
71
84
  <workItem from="1725333899382" duration="2939000" />
72
85
  <workItem from="1725337022494" duration="3671000" />
73
- <workItem from="1725378545854" duration="7455000" />
86
+ <workItem from="1725378545854" duration="11692000" />
74
87
  </task>
75
88
  <servers />
76
89
  </component>
@@ -93,7 +106,7 @@
93
106
  <breakpoints>
94
107
  <line-breakpoint enabled="true" type="javascript">
95
108
  <url>file://$PROJECT_DIR$/src/classes/liteCheckout.ts</url>
96
- <line>227</line>
109
+ <line>219</line>
97
110
  <option name="timeStamp" value="16" />
98
111
  </line-breakpoint>
99
112
  <line-breakpoint enabled="true" type="javascript">
@@ -103,7 +116,7 @@
103
116
  </line-breakpoint>
104
117
  <line-breakpoint enabled="true" type="javascript">
105
118
  <url>file://$PROJECT_DIR$/src/classes/liteCheckout.ts</url>
106
- <line>231</line>
119
+ <line>223</line>
107
120
  <option name="timeStamp" value="18" />
108
121
  </line-breakpoint>
109
122
  </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>;
@@ -8,6 +8,7 @@ export interface ICardSkyflowFields {
8
8
  expiration_year: string;
9
9
  skyflow_id: string;
10
10
  card_scheme: string;
11
+ cardholder_name: string;
11
12
  }
12
13
  export interface ICustomerCardsResponse {
13
14
  user_id: number;
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.18",
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 = {
package/src/types/card.ts CHANGED
@@ -9,6 +9,7 @@ export interface ICardSkyflowFields {
9
9
  expiration_year: string;
10
10
  skyflow_id: string;
11
11
  card_scheme: string;
12
+ cardholder_name: string;
12
13
  }
13
14
 
14
15
  export interface ICustomerCardsResponse {
@@ -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
-