@tonder.io/ionic-lite-sdk 0.0.35-beta.1 → 0.0.35-beta.3
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/prettier.xml +6 -0
- package/.idea/workspace.xml +6 -15
- package/dist/classes/BaseInlineCheckout.d.ts +5 -8
- package/dist/classes/errorResponse.d.ts +1 -1
- package/dist/classes/liteCheckout.d.ts +5 -11
- package/dist/data/businessApi.d.ts +1 -1
- package/dist/data/cardApi.d.ts +1 -1
- package/dist/data/checkoutApi.d.ts +1 -2
- package/dist/data/customerApi.d.ts +1 -1
- package/dist/data/paymentMethodApi.d.ts +1 -1
- package/dist/helpers/utils.d.ts +1 -1
- package/dist/types/commons.d.ts +6 -1
- package/package.json +1 -1
- package/src/classes/BaseInlineCheckout.ts +341 -303
- package/src/classes/errorResponse.ts +1 -1
- package/src/classes/liteCheckout.ts +260 -204
- package/src/data/businessApi.ts +17 -13
- package/src/data/cardApi.ts +70 -63
- package/src/data/checkoutApi.ts +75 -59
- package/src/data/customerApi.ts +27 -27
- package/src/data/openPayApi.ts +12 -7
- package/src/data/paymentMethodApi.ts +32 -29
- package/src/data/skyflowApi.ts +18 -14
- package/src/helpers/mercadopago.ts +14 -14
- package/src/helpers/skyflow.ts +34 -28
- package/src/helpers/utils.ts +51 -39
- package/src/helpers/validations.ts +35 -35
- package/src/shared/catalog/paymentMethodsCatalog.ts +8 -8
- package/src/shared/constants/paymentMethodAPM.ts +59 -59
- package/src/shared/constants/tonderUrl.ts +4 -4
- package/src/types/commons.ts +6 -1
package/.idea/workspace.xml
CHANGED
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
<change afterPath="$PROJECT_DIR$/src/types/validations.d.ts" afterDir="false" />
|
|
33
33
|
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
|
|
34
34
|
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
35
|
+
<change beforePath="$PROJECT_DIR$/src/classes/errorResponse.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/errorResponse.ts" afterDir="false" />
|
|
35
36
|
<change beforePath="$PROJECT_DIR$/src/classes/liteCheckout.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/liteCheckout.ts" afterDir="false" />
|
|
37
|
+
<change beforePath="$PROJECT_DIR$/src/helpers/mercadopago.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/helpers/mercadopago.ts" afterDir="false" />
|
|
36
38
|
<change beforePath="$PROJECT_DIR$/src/helpers/utils.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/helpers/utils.ts" afterDir="false" />
|
|
37
39
|
<change beforePath="$PROJECT_DIR$/src/types/commons.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/commons.ts" afterDir="false" />
|
|
38
40
|
<change beforePath="$PROJECT_DIR$/src/types/requests.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/requests.ts" afterDir="false" />
|
|
@@ -77,7 +79,8 @@
|
|
|
77
79
|
"node.js.selected.package.eslint": "(autodetect)",
|
|
78
80
|
"node.js.selected.package.tslint": "(autodetect)",
|
|
79
81
|
"nodejs_package_manager_path": "npm",
|
|
80
|
-
"
|
|
82
|
+
"prettierjs.PrettierConfiguration.Package": "/Users/davidhernandezalmagro/Desktop/Tonder/ionic-lite/node_modules/prettier",
|
|
83
|
+
"settings.editor.selected.configurable": "settings.javascript.prettier",
|
|
81
84
|
"ts.external.directory.path": "/Users/davidhernandezalmagro/Desktop/Tonder/ionic-lite/node_modules/typescript/lib",
|
|
82
85
|
"vue.rearranger.settings.migration": "true"
|
|
83
86
|
}
|
|
@@ -92,7 +95,7 @@
|
|
|
92
95
|
<updated>1724776429568</updated>
|
|
93
96
|
<workItem from="1724776430626" duration="1847000" />
|
|
94
97
|
<workItem from="1724790840744" duration="239000" />
|
|
95
|
-
<workItem from="1725305433705" duration="
|
|
98
|
+
<workItem from="1725305433705" duration="18188000" />
|
|
96
99
|
</task>
|
|
97
100
|
<servers />
|
|
98
101
|
</component>
|
|
@@ -113,21 +116,9 @@
|
|
|
113
116
|
<component name="XDebuggerManager">
|
|
114
117
|
<breakpoint-manager>
|
|
115
118
|
<breakpoints>
|
|
116
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
117
|
-
<url>file://$PROJECT_DIR$/src/classes/BaseInlineCheckout.ts</url>
|
|
118
|
-
<line>123</line>
|
|
119
|
-
<properties lambdaOrdinal="-1" />
|
|
120
|
-
<option name="timeStamp" value="6" />
|
|
121
|
-
</line-breakpoint>
|
|
122
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
123
|
-
<url>file://$PROJECT_DIR$/src/data/cardApi.ts</url>
|
|
124
|
-
<line>8</line>
|
|
125
|
-
<properties lambdaOrdinal="-1" />
|
|
126
|
-
<option name="timeStamp" value="9" />
|
|
127
|
-
</line-breakpoint>
|
|
128
119
|
<line-breakpoint enabled="true" type="javascript">
|
|
129
120
|
<url>file://$PROJECT_DIR$/src/classes/liteCheckout.ts</url>
|
|
130
|
-
<line>
|
|
121
|
+
<line>221</line>
|
|
131
122
|
<properties lambdaOrdinal="-1" />
|
|
132
123
|
<option name="timeStamp" value="16" />
|
|
133
124
|
</line-breakpoint>
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { ThreeDSHandler } from "./3dsHandler";
|
|
2
|
-
import { Business, IConfigureCheckout, IInlineCheckoutBaseOptions } from "../types/commons";
|
|
3
2
|
import { ErrorResponse } from "./errorResponse";
|
|
4
|
-
import { IItem, IProcessPaymentRequest, IStartCheckoutResponse } from "../types
|
|
5
|
-
import { StartCheckoutResponse } from "../types/responses";
|
|
6
|
-
import { ICustomer } from "../types/customer";
|
|
3
|
+
import { Business, ICustomer, IItem, IInlineCheckoutBaseOptions, IConfigureCheckout, IProcessPaymentRequest, IStartCheckoutResponse, StartCheckoutResponse } from "../types";
|
|
7
4
|
export declare class BaseInlineCheckout {
|
|
8
5
|
#private;
|
|
9
6
|
baseUrl: string;
|
|
@@ -29,20 +26,20 @@ export declare class BaseInlineCheckout {
|
|
|
29
26
|
metadata: {};
|
|
30
27
|
card?: {} | undefined;
|
|
31
28
|
currency?: string;
|
|
32
|
-
constructor({ mode, apiKey, apiKeyTonder, returnUrl, callBack }: IInlineCheckoutBaseOptions);
|
|
29
|
+
constructor({ mode, apiKey, apiKeyTonder, returnUrl, callBack, }: IInlineCheckoutBaseOptions);
|
|
33
30
|
configureCheckout(data: IConfigureCheckout): void;
|
|
34
|
-
verify3dsTransaction(): Promise<false |
|
|
31
|
+
verify3dsTransaction(): Promise<false | ErrorResponse | StartCheckoutResponse | undefined>;
|
|
35
32
|
payment(data: IProcessPaymentRequest): Promise<IStartCheckoutResponse>;
|
|
36
33
|
_initializeCheckout(): Promise<void>;
|
|
37
34
|
_checkout(data: any): Promise<any>;
|
|
38
35
|
_setCartTotal(total: string | number): void;
|
|
39
36
|
_getCustomer(signal?: AbortSignal | null): Promise<Record<string, any>>;
|
|
40
|
-
_handleCheckout({ card, payment_method, customer, isSandbox }: {
|
|
37
|
+
_handleCheckout({ card, payment_method, customer, isSandbox, }: {
|
|
41
38
|
card?: string;
|
|
42
39
|
payment_method?: string;
|
|
43
40
|
customer: Record<string, any>;
|
|
44
41
|
isSandbox?: boolean;
|
|
45
42
|
}): Promise<any>;
|
|
46
43
|
_fetchMerchantData(): Promise<Business | undefined>;
|
|
47
|
-
_handle3dsRedirect(response: ErrorResponse | StartCheckoutResponse | false | undefined): Promise<false |
|
|
44
|
+
_handle3dsRedirect(response: ErrorResponse | StartCheckoutResponse | false | undefined): Promise<false | ErrorResponse | StartCheckoutResponse | undefined>;
|
|
48
45
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import { APM, IInlineCheckoutBaseOptions } from "../types/commons";
|
|
2
|
-
import { CreateOrderRequest, CreatePaymentRequest, RegisterCustomerCardRequest, StartCheckoutRequest, StartCheckoutFullRequest, StartCheckoutIdRequest, TokensRequest } from "../types/requests";
|
|
3
|
-
import { CustomerRegisterResponse, CreateOrderResponse, CreatePaymentResponse, StartCheckoutResponse, RegisterCustomerCardResponse, GetBusinessResponse } from "../types/responses";
|
|
4
1
|
import { ErrorResponse } from "./errorResponse";
|
|
5
2
|
import { BaseInlineCheckout } from "./BaseInlineCheckout";
|
|
6
|
-
import {
|
|
7
|
-
import { IPaymentMethod } from "../types/paymentMethod";
|
|
8
|
-
import { ICardFields } from "../types/checkout";
|
|
9
|
-
import { ILiteInlineCheckout } from "../types/liteInlineCheckout";
|
|
3
|
+
import { APM, IInlineCheckoutBaseOptions, ILiteInlineCheckout, RegisterCustomerCardResponse, ISaveCardRequest, ICustomerCardsResponse, ISaveCardResponse, IPaymentMethod, GetBusinessResponse, TokensRequest, ICardFields, CustomerRegisterResponse, StartCheckoutFullRequest, CreateOrderRequest, CreatePaymentRequest, StartCheckoutRequest, StartCheckoutResponse, StartCheckoutIdRequest, CreatePaymentResponse, CreateOrderResponse, RegisterCustomerCardRequest } from "../types";
|
|
10
4
|
declare global {
|
|
11
5
|
interface Window {
|
|
12
6
|
OpenPay: any;
|
|
@@ -17,16 +11,16 @@ export interface LiteCheckoutConstructor extends IInlineCheckoutBaseOptions {
|
|
|
17
11
|
export declare class LiteCheckout extends BaseInlineCheckout implements ILiteInlineCheckout {
|
|
18
12
|
#private;
|
|
19
13
|
activeAPMs: APM[];
|
|
20
|
-
constructor({ apiKey, mode, returnUrl, callBack
|
|
14
|
+
constructor({ apiKey, mode, returnUrl, callBack }: LiteCheckoutConstructor);
|
|
21
15
|
injectCheckout(): Promise<void>;
|
|
22
16
|
getCustomerCards(): Promise<ICustomerCardsResponse>;
|
|
23
17
|
saveCustomerCard(card: ISaveCardRequest): Promise<ISaveCardResponse>;
|
|
24
18
|
removeCustomerCard(skyflowId: string): Promise<string>;
|
|
25
19
|
getCustomerPaymentMethods(): Promise<IPaymentMethod[]>;
|
|
26
20
|
getBusiness(): Promise<GetBusinessResponse>;
|
|
27
|
-
getSkyflowTokens({ vault_id, vault_url, data }: TokensRequest): Promise<any | ErrorResponse>;
|
|
21
|
+
getSkyflowTokens({ vault_id, vault_url, data, }: TokensRequest): Promise<any | ErrorResponse>;
|
|
28
22
|
_setCartTotal(total: string): void;
|
|
29
|
-
_checkout({ card, payment_method, isSandbox }: {
|
|
23
|
+
_checkout({ card, payment_method, isSandbox, }: {
|
|
30
24
|
card?: ICardFields | string;
|
|
31
25
|
payment_method?: string;
|
|
32
26
|
isSandbox?: boolean;
|
|
@@ -54,7 +48,7 @@ export declare class LiteCheckout extends BaseInlineCheckout implements ILiteInl
|
|
|
54
48
|
* Use the {@link payment} method
|
|
55
49
|
*/
|
|
56
50
|
startCheckoutRouter(routerData: StartCheckoutRequest | StartCheckoutIdRequest): Promise<StartCheckoutResponse | ErrorResponse | undefined>;
|
|
57
|
-
init3DSRedirect(checkoutResult: ErrorResponse | StartCheckoutResponse): Promise<false |
|
|
51
|
+
init3DSRedirect(checkoutResult: ErrorResponse | StartCheckoutResponse): Promise<false | ErrorResponse | StartCheckoutResponse | undefined>;
|
|
58
52
|
/**
|
|
59
53
|
* @deprecated This method is deprecated and will be removed in a future release.
|
|
60
54
|
* Use the {@link payment} method
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GetBusinessResponse } from "../types
|
|
1
|
+
import { GetBusinessResponse } from "../types";
|
|
2
2
|
export declare function fetchBusiness(baseUrl: string, apiKey: string, signal: AbortSignal): Promise<GetBusinessResponse>;
|
package/dist/data/cardApi.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICustomerCardsResponse, ISaveCardResponse, ISaveCardSkyflowRequest } from "../types
|
|
1
|
+
import { ICustomerCardsResponse, ISaveCardResponse, ISaveCardSkyflowRequest } from "../types";
|
|
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,5 +1,4 @@
|
|
|
1
|
-
import { CreateOrderRequest, CreatePaymentRequest } from "../types
|
|
2
|
-
import { IStartCheckoutIdRequest, IStartCheckoutRequest } from "../types/checkout";
|
|
1
|
+
import { CreateOrderRequest, CreatePaymentRequest, IStartCheckoutIdRequest, IStartCheckoutRequest } from "../types";
|
|
3
2
|
export declare function createOrder(baseUrl: string, apiKey: string, orderItems: CreateOrderRequest): Promise<any>;
|
|
4
3
|
export declare function createPayment(baseUrl: string, apiKey: string, paymentItems: CreatePaymentRequest): Promise<any>;
|
|
5
4
|
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";
|
|
2
2
|
export declare function registerOrFetchCustomer(baseUrl: string, apiKey: string, customer: Record<string, any>, signal?: AbortSignal | null): Promise<CustomerRegisterResponse>;
|
package/dist/helpers/utils.d.ts
CHANGED
|
@@ -19,4 +19,4 @@ declare function formatPublicErrorResponse(data: Record<string, any>, error: any
|
|
|
19
19
|
};
|
|
20
20
|
declare const clearSpace: (text: string) => string;
|
|
21
21
|
declare const getCardType: (scheme: string) => "https://d35a75syrgujp0.cloudfront.net/cards/visa.png" | "https://d35a75syrgujp0.cloudfront.net/cards/mastercard.png" | "https://d35a75syrgujp0.cloudfront.net/cards/american_express.png" | "https://d35a75syrgujp0.cloudfront.net/cards/default_card.png";
|
|
22
|
-
export { buildErrorResponseFromCatch, buildErrorResponse, getCardType, formatPublicErrorResponse, clearSpace };
|
|
22
|
+
export { buildErrorResponseFromCatch, buildErrorResponse, getCardType, formatPublicErrorResponse, clearSpace, };
|
package/dist/types/commons.d.ts
CHANGED
|
@@ -87,12 +87,17 @@ export interface IInlineCheckoutBaseOptions {
|
|
|
87
87
|
* `baseUrlTonder` is no longer required.
|
|
88
88
|
*/
|
|
89
89
|
baseUrlTonder?: string;
|
|
90
|
-
apiKey: string;
|
|
91
90
|
/**
|
|
92
91
|
* @deprecated This property is deprecated and will be removed in a future release.
|
|
93
92
|
* Use `apiKey` instead, as `apiKeyTonder` is no longer required.
|
|
94
93
|
*/
|
|
95
94
|
apiKeyTonder?: string;
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated This property is deprecated and will be removed in a future release.
|
|
97
|
+
* `signal` is no longer required.
|
|
98
|
+
*/
|
|
99
|
+
signal?: AbortSignal;
|
|
100
|
+
apiKey: string;
|
|
96
101
|
returnUrl: string;
|
|
97
102
|
callBack?: (response: any) => void;
|
|
98
103
|
}
|