@tonder.io/ionic-lite-sdk 0.0.35-beta.23 → 0.0.35-beta.24
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.
- package/.idea/workspace.xml +20 -3
- package/README.md +403 -112
- package/dist/classes/BaseInlineCheckout.d.ts +4 -5
- package/dist/classes/liteCheckout.d.ts +6 -42
- package/dist/index.js +1 -1
- package/dist/types/commons.d.ts +2 -0
- package/dist/types/liteInlineCheckout.d.ts +147 -0
- package/package.json +1 -1
- package/src/classes/BaseInlineCheckout.ts +6 -5
- package/src/classes/liteCheckout.ts +7 -43
- package/src/types/commons.ts +3 -0
- package/src/types/{liteInlineCheckout.d.ts → liteInlineCheckout.ts} +4 -7
- package/tests/classes/liteCheckout.test.ts +2 -2
- package/tests/methods/createOrder.test.ts +3 -4
- package/tests/methods/createPayment.test.ts +2 -3
- package/tests/methods/customerRegister.test.ts +3 -4
- package/tests/methods/getBusiness.test.ts +2 -3
- package/tests/methods/getCustomerCards.test.ts +2 -3
- package/tests/methods/registerCustomerCard.test.ts +2 -2
- package/tests/methods/startCheckoutRouter.test.ts +2 -2
- package/tests/methods/startCheckoutRouterFull.test.ts +2 -2
package/src/types/commons.ts
CHANGED
|
@@ -111,6 +111,9 @@ export interface IInlineCheckoutBaseOptions {
|
|
|
111
111
|
callBack?: (response: IStartCheckoutResponse | Record<string, any>) => void;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
export interface IInlineLiteCheckoutOptions
|
|
115
|
+
extends IInlineCheckoutBaseOptions {}
|
|
116
|
+
|
|
114
117
|
|
|
115
118
|
export interface IApiError {
|
|
116
119
|
code: string;
|
|
@@ -27,8 +27,7 @@ import {
|
|
|
27
27
|
StartCheckoutResponse,
|
|
28
28
|
} from "./responses";
|
|
29
29
|
|
|
30
|
-
export
|
|
31
|
-
constructor(options: IInlineLiteCheckoutOptions);
|
|
30
|
+
export interface ILiteCheckout {
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
33
|
* 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.
|
|
@@ -62,10 +61,10 @@ export class LiteCheckout {
|
|
|
62
61
|
|
|
63
62
|
/**
|
|
64
63
|
* Verifies the 3DS transaction status.
|
|
65
|
-
* @returns {Promise<import("./index").ITransaction | void>} The result of the 3DS verification and checkout resumption.
|
|
64
|
+
* @returns {Promise<import("./index").ITransaction | import("./index").IStartCheckoutResponse | void>} The result of the 3DS verification and checkout resumption.
|
|
66
65
|
* @public
|
|
67
66
|
*/
|
|
68
|
-
verify3dsTransaction(): Promise<ITransaction | void>;
|
|
67
|
+
verify3dsTransaction(): Promise<ITransaction | IStartCheckoutResponse | void>;
|
|
69
68
|
|
|
70
69
|
/**
|
|
71
70
|
* Retrieves the list of cards associated with a customer.
|
|
@@ -189,7 +188,7 @@ export class LiteCheckout {
|
|
|
189
188
|
|
|
190
189
|
/**
|
|
191
190
|
* @deprecated This method is deprecated and will be removed in a future release.
|
|
192
|
-
* It is no longer necessary to use this method as
|
|
191
|
+
* It is no longer necessary to use this method as card registration or as checkout is now automatically handled
|
|
193
192
|
* during the payment process or when using card management methods.
|
|
194
193
|
*/
|
|
195
194
|
getSkyflowTokens({
|
|
@@ -210,5 +209,3 @@ export class LiteCheckout {
|
|
|
210
209
|
): Promise<string | ErrorResponse>;
|
|
211
210
|
}
|
|
212
211
|
|
|
213
|
-
export interface IInlineLiteCheckoutOptions
|
|
214
|
-
extends IInlineCheckoutBaseOptions {}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../utils/defaultMock";
|
|
2
2
|
import { LiteCheckout } from "../../src";
|
|
3
|
-
import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
|
|
4
3
|
import { constructorFields } from "../utils/defaultMock";
|
|
4
|
+
import {IInlineLiteCheckoutOptions} from "../../src/types/commons";
|
|
5
5
|
|
|
6
6
|
declare global {
|
|
7
7
|
interface Window {
|
|
@@ -11,7 +11,7 @@ declare global {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
describe("LiteCheckout", () => {
|
|
14
|
-
let checkoutConstructor:
|
|
14
|
+
let checkoutConstructor: IInlineLiteCheckoutOptions,
|
|
15
15
|
liteCheckout: LiteCheckout,
|
|
16
16
|
fetchSpy: jest.SpyInstance,
|
|
17
17
|
liteCheckoutSpy: jest.SpyInstance;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "../utils/defaultMock";
|
|
2
2
|
import { LiteCheckout } from "../../src";
|
|
3
3
|
import { ErrorResponse } from "../../src/classes/errorResponse";
|
|
4
|
-
import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
|
|
5
|
-
import { IErrorResponse } from "../../src/types/responses";
|
|
6
4
|
import { constructorFields } from "../utils/defaultMock";
|
|
7
|
-
import { OrderResponseClass, OrderClass,
|
|
5
|
+
import { OrderResponseClass, OrderClass, OrderEmptyValuesResponse } from "../utils/mockClasses";
|
|
6
|
+
import {IInlineLiteCheckoutOptions} from "../../src/types/commons";
|
|
8
7
|
|
|
9
8
|
declare global {
|
|
10
9
|
interface Window {
|
|
@@ -14,7 +13,7 @@ declare global {
|
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
describe("createOrder", () => {
|
|
17
|
-
let checkoutConstructor:
|
|
16
|
+
let checkoutConstructor: IInlineLiteCheckoutOptions,
|
|
18
17
|
liteCheckout: LiteCheckout,
|
|
19
18
|
fetchSpy: jest.SpyInstance,
|
|
20
19
|
liteCheckoutSpy: jest.SpyInstance;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "../utils/defaultMock";
|
|
2
2
|
import { LiteCheckout } from "../../src";
|
|
3
3
|
import { ErrorResponse } from "../../src/classes/errorResponse";
|
|
4
|
-
import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
|
|
5
|
-
import { IErrorResponse } from "../../src/types/responses";
|
|
6
4
|
import { constructorFields } from "../utils/defaultMock";
|
|
7
5
|
import { CreatePaymentResponseClass, CreatePaymentRequestClass } from "../utils/mockClasses";
|
|
6
|
+
import {IInlineLiteCheckoutOptions} from "../../src/types/commons";
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
declare global {
|
|
@@ -15,7 +14,7 @@ declare global {
|
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
describe("createPayment", () => {
|
|
18
|
-
let checkoutConstructor:
|
|
17
|
+
let checkoutConstructor: IInlineLiteCheckoutOptions,
|
|
19
18
|
liteCheckout: LiteCheckout,
|
|
20
19
|
fetchSpy: jest.SpyInstance,
|
|
21
20
|
liteCheckoutSpy: jest.SpyInstance;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "../utils/defaultMock";
|
|
2
2
|
import { LiteCheckout } from "../../src";
|
|
3
3
|
import { ErrorResponse } from "../../src/classes/errorResponse";
|
|
4
|
-
import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
|
|
5
|
-
import { IErrorResponse } from "../../src/types/responses";
|
|
6
4
|
import { constructorFields } from "../utils/defaultMock";
|
|
7
|
-
import {
|
|
5
|
+
import { CustomerRegisterClass } from "../utils/mockClasses";
|
|
6
|
+
import {IInlineLiteCheckoutOptions} from "../../src/types/commons";
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
declare global {
|
|
@@ -15,7 +14,7 @@ declare global {
|
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
describe("customerRegister", () => {
|
|
18
|
-
let checkoutConstructor:
|
|
17
|
+
let checkoutConstructor: IInlineLiteCheckoutOptions,
|
|
19
18
|
liteCheckout: LiteCheckout,
|
|
20
19
|
fetchSpy: jest.SpyInstance,
|
|
21
20
|
liteCheckoutSpy: jest.SpyInstance;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "../utils/defaultMock";
|
|
2
2
|
import { LiteCheckout } from "../../src";
|
|
3
3
|
import { ErrorResponse } from "../../src/classes/errorResponse";
|
|
4
|
-
import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
|
|
5
|
-
import { IErrorResponse } from "../../src/types/responses";
|
|
6
4
|
import { constructorFields } from "../utils/defaultMock";
|
|
7
5
|
import { BusinessClass } from "../utils/mockClasses";
|
|
6
|
+
import {IInlineLiteCheckoutOptions} from "../../src/types/commons";
|
|
8
7
|
|
|
9
8
|
declare global {
|
|
10
9
|
interface Window {
|
|
@@ -14,7 +13,7 @@ declare global {
|
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
describe("getBusiness", () => {
|
|
17
|
-
let checkoutConstructor:
|
|
16
|
+
let checkoutConstructor: IInlineLiteCheckoutOptions,
|
|
18
17
|
liteCheckout: LiteCheckout,
|
|
19
18
|
fetchSpy: jest.SpyInstance,
|
|
20
19
|
liteCheckoutSpy: jest.SpyInstance;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "../utils/defaultMock";
|
|
2
2
|
import { LiteCheckout } from "../../src";
|
|
3
3
|
import { ErrorResponse } from "../../src/classes/errorResponse";
|
|
4
|
-
import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
|
|
5
|
-
import { IErrorResponse } from "../../src/types/responses";
|
|
6
4
|
import { constructorFields } from "../utils/defaultMock";
|
|
7
5
|
import { GetCustomerCardsResponseClass } from "../utils/mockClasses";
|
|
6
|
+
import {IInlineLiteCheckoutOptions} from "../../src/types/commons";
|
|
8
7
|
|
|
9
8
|
declare global {
|
|
10
9
|
interface Window {
|
|
@@ -14,7 +13,7 @@ declare global {
|
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
describe("getCustomerCards", () => {
|
|
17
|
-
let checkoutConstructor:
|
|
16
|
+
let checkoutConstructor: IInlineLiteCheckoutOptions,
|
|
18
17
|
liteCheckout: LiteCheckout,
|
|
19
18
|
fetchSpy: jest.SpyInstance,
|
|
20
19
|
liteCheckoutSpy: jest.SpyInstance;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../utils/defaultMock";
|
|
2
2
|
import { LiteCheckout } from "../../src";
|
|
3
|
-
import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
|
|
4
3
|
import { constructorFields } from "../utils/defaultMock";
|
|
5
4
|
import { RegisterCustomerCardRequestClass, RegisterCustomerCardResponseClass } from "../utils/mockClasses";
|
|
6
5
|
import { ErrorResponse } from "../../src/classes/errorResponse";
|
|
7
6
|
import { IErrorResponse } from "../../src/types/responses";
|
|
7
|
+
import {IInlineLiteCheckoutOptions} from "../../src/types/commons";
|
|
8
8
|
|
|
9
9
|
declare global {
|
|
10
10
|
interface Window {
|
|
@@ -14,7 +14,7 @@ declare global {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
describe("registerCustomerCard", () => {
|
|
17
|
-
let checkoutConstructor:
|
|
17
|
+
let checkoutConstructor: IInlineLiteCheckoutOptions,
|
|
18
18
|
liteCheckout: LiteCheckout,
|
|
19
19
|
fetchSpy: jest.SpyInstance,
|
|
20
20
|
liteCheckoutSpy: jest.SpyInstance;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../utils/defaultMock";
|
|
2
2
|
import { LiteCheckout } from "../../src";
|
|
3
3
|
import { ErrorResponse } from "../../src/classes/errorResponse";
|
|
4
|
-
import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
|
|
5
4
|
import { IErrorResponse } from "../../src/types/responses";
|
|
6
5
|
import { constructorFields } from "../utils/defaultMock";
|
|
7
6
|
import { StartCheckoutResponseClass, StartCheckoutRequestClass, CreatePaymentRequestClass } from "../utils/mockClasses";
|
|
7
|
+
import {IInlineLiteCheckoutOptions} from "../../src/types/commons";
|
|
8
8
|
|
|
9
9
|
declare global {
|
|
10
10
|
interface Window {
|
|
@@ -14,7 +14,7 @@ declare global {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
describe("startCheckoutRouter", () => {
|
|
17
|
-
let checkoutConstructor:
|
|
17
|
+
let checkoutConstructor: IInlineLiteCheckoutOptions,
|
|
18
18
|
liteCheckout: LiteCheckout,
|
|
19
19
|
fetchSpy: jest.SpyInstance,
|
|
20
20
|
liteCheckoutSpy: jest.SpyInstance;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../utils/defaultMock";
|
|
2
2
|
import { LiteCheckout } from "../../src";
|
|
3
3
|
import { ErrorResponse } from "../../src/classes/errorResponse";
|
|
4
|
-
import { LiteCheckoutConstructor } from "../../src/classes/liteCheckout";
|
|
5
4
|
import { IErrorResponse } from "../../src/types/responses";
|
|
6
5
|
import { constructorFields } from "../utils/defaultMock";
|
|
7
6
|
import { StartCheckoutResponseClass, StartCheckoutFullRequestClass, BusinessClass, CustomerRegisterClass, OrderResponseClass, CreatePaymentResponseClass } from "../utils/mockClasses";
|
|
7
|
+
import {IInlineLiteCheckoutOptions} from "../../src/types/commons";
|
|
8
8
|
|
|
9
9
|
declare global {
|
|
10
10
|
interface Window {
|
|
@@ -14,7 +14,7 @@ declare global {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
describe("startCheckoutRouterFull", () => {
|
|
17
|
-
let checkoutConstructor:
|
|
17
|
+
let checkoutConstructor: IInlineLiteCheckoutOptions,
|
|
18
18
|
liteCheckout: LiteCheckout,
|
|
19
19
|
fetchSpy: jest.SpyInstance,
|
|
20
20
|
liteCheckoutSpy: jest.SpyInstance;
|