@tonder.io/ionic-lite-sdk 0.0.35-beta.8 → 0.0.36-beta.1

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 (87) hide show
  1. package/.gitlab-ci.yml +28 -28
  2. package/README.md +221 -202
  3. package/dist/classes/errorResponse.d.ts +1 -1
  4. package/dist/classes/liteCheckout.d.ts +32 -56
  5. package/dist/data/api.d.ts +1 -1
  6. package/dist/helpers/utils.d.ts +4 -8
  7. package/dist/index.d.ts +1 -2
  8. package/dist/index.js +1 -1
  9. package/dist/types/commons.d.ts +0 -37
  10. package/dist/types/requests.d.ts +3 -12
  11. package/dist/types/responses.d.ts +3 -0
  12. package/jest.config.ts +14 -14
  13. package/package.json +38 -38
  14. package/rollup.config.js +16 -16
  15. package/src/classes/3dsHandler.ts +237 -237
  16. package/src/classes/errorResponse.ts +16 -16
  17. package/src/classes/liteCheckout.ts +575 -598
  18. package/src/data/api.ts +20 -20
  19. package/src/helpers/constants.ts +63 -63
  20. package/src/helpers/mercadopago.ts +15 -15
  21. package/src/helpers/utils.ts +320 -120
  22. package/src/index.ts +4 -10
  23. package/src/types/commons.ts +83 -125
  24. package/src/types/requests.ts +105 -114
  25. package/src/types/responses.ts +193 -189
  26. package/src/types/skyflow.ts +17 -17
  27. package/tests/classes/liteCheckout.test.ts +57 -57
  28. package/tests/methods/createOrder.test.ts +142 -142
  29. package/tests/methods/createPayment.test.ts +122 -122
  30. package/tests/methods/customerRegister.test.ts +119 -119
  31. package/tests/methods/getBusiness.test.ts +115 -115
  32. package/tests/methods/getCustomerCards.test.ts +119 -113
  33. package/tests/methods/getOpenpayDeviceSessionID.test.ts +95 -0
  34. package/tests/methods/getSkyflowToken.test.ts +155 -0
  35. package/tests/methods/getVaultToken.test.ts +107 -0
  36. package/tests/methods/registerCustomerCard.test.ts +117 -117
  37. package/tests/methods/startCheckoutRouter.test.ts +119 -119
  38. package/tests/methods/startCheckoutRouterFull.test.ts +138 -138
  39. package/tests/utils/defaultMock.ts +20 -21
  40. package/tests/utils/mockClasses.ts +656 -659
  41. package/tsconfig.json +18 -18
  42. package/.idea/aws.xml +0 -17
  43. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  44. package/.idea/prettier.xml +0 -6
  45. package/.idea/vcs.xml +0 -6
  46. package/.idea/workspace.xml +0 -133
  47. package/dist/classes/BaseInlineCheckout.d.ts +0 -45
  48. package/dist/data/businessApi.d.ts +0 -2
  49. package/dist/data/cardApi.d.ts +0 -4
  50. package/dist/data/checkoutApi.d.ts +0 -4
  51. package/dist/data/customerApi.d.ts +0 -2
  52. package/dist/data/openPayApi.d.ts +0 -1
  53. package/dist/data/paymentMethodApi.d.ts +0 -5
  54. package/dist/data/skyflowApi.d.ts +0 -1
  55. package/dist/helpers/skyflow.d.ts +0 -3
  56. package/dist/helpers/validations.d.ts +0 -6
  57. package/dist/shared/catalog/paymentMethodsCatalog.d.ts +0 -1
  58. package/dist/shared/constants/messages.d.ts +0 -11
  59. package/dist/shared/constants/paymentMethodAPM.d.ts +0 -62
  60. package/dist/shared/constants/tonderUrl.d.ts +0 -7
  61. package/dist/types/card.d.ts +0 -29
  62. package/dist/types/checkout.d.ts +0 -103
  63. package/dist/types/customer.d.ts +0 -12
  64. package/dist/types/paymentMethod.d.ts +0 -22
  65. package/dist/types/transaction.d.ts +0 -101
  66. package/src/classes/BaseInlineCheckout.ts +0 -356
  67. package/src/data/businessApi.ts +0 -18
  68. package/src/data/cardApi.ts +0 -89
  69. package/src/data/checkoutApi.ts +0 -87
  70. package/src/data/customerApi.ts +0 -31
  71. package/src/data/openPayApi.ts +0 -12
  72. package/src/data/paymentMethodApi.ts +0 -37
  73. package/src/data/skyflowApi.ts +0 -20
  74. package/src/helpers/skyflow.ts +0 -91
  75. package/src/helpers/validations.ts +0 -55
  76. package/src/shared/catalog/paymentMethodsCatalog.ts +0 -248
  77. package/src/shared/constants/messages.ts +0 -11
  78. package/src/shared/constants/paymentMethodAPM.ts +0 -63
  79. package/src/shared/constants/tonderUrl.ts +0 -8
  80. package/src/types/card.ts +0 -34
  81. package/src/types/checkout.ts +0 -118
  82. package/src/types/customer.ts +0 -12
  83. package/src/types/index.d.ts +0 -10
  84. package/src/types/liteInlineCheckout.d.ts +0 -191
  85. package/src/types/paymentMethod.ts +0 -24
  86. package/src/types/transaction.ts +0 -101
  87. package/src/types/validations.d.ts +0 -11
package/.gitlab-ci.yml CHANGED
@@ -1,29 +1,29 @@
1
- image: grupoapok/awscli:18
2
-
3
- stages:
4
- - test
5
- - deploy
6
-
7
- test:
8
- stage: test
9
- only:
10
- - development
11
- before_script:
12
- - npm install
13
- script:
14
- - npm run test
15
-
16
- deploy:
17
- stage: deploy
18
- only:
19
- - tags
20
- before_script:
21
- - |
22
- {
23
- echo "@tonder.io:registry=https://registry.npmjs.org/"
24
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
25
- } | tee -a .npmrc
26
- script:
27
- - npm install
28
- - npm run build
1
+ image: grupoapok/awscli:18
2
+
3
+ stages:
4
+ - test
5
+ - deploy
6
+
7
+ test:
8
+ stage: test
9
+ only:
10
+ - development
11
+ before_script:
12
+ - npm install
13
+ script:
14
+ - npm run test
15
+
16
+ deploy:
17
+ stage: deploy
18
+ only:
19
+ - tags
20
+ before_script:
21
+ - |
22
+ {
23
+ echo "@tonder.io:registry=https://registry.npmjs.org/"
24
+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
25
+ } | tee -a .npmrc
26
+ script:
27
+ - npm install
28
+ - npm run build
29
29
  - npm publish --access=public
package/README.md CHANGED
@@ -1,202 +1,221 @@
1
- # Tonder SDK
2
-
3
- Tonder SDK Lite to integrate REST service
4
-
5
- ## Installation
6
-
7
- You can install using NPM
8
- ```bash
9
- npm i @tonder.io/ionic-lite-sdk
10
- ```
11
-
12
- Add dependencies to the root of the app (index.html)
13
- ```html
14
- <script src=https://openpay.s3.amazonaws.com/openpay.v1.min.js></script>
15
- <script src=https://openpay.s3.amazonaws.com/openpay-data.v1.min.js></script>
16
- ```
17
-
18
- ## Usage
19
- ## Import LiteCheckout class
20
- ```javascript
21
- import { LiteCheckout } from "@tonder.io/ionic-lite-sdk"
22
- ```
23
- ## Create instance
24
-
25
- ```javascript
26
- const liteCheckout = new LiteCheckout({
27
- signal,
28
- baseUrlTonder,
29
- apiKeyTonder
30
- })
31
-
32
- // To verify a 3ds transaction you can use the following method
33
- // It should be called after the injectCheckout method
34
- // The response status will be one of the following
35
- // ['Declined', 'Cancelled', 'Failed', 'Success', 'Pending', 'Authorized']
36
-
37
- inlineCheckout.verify3dsTransaction().then(response => {
38
- console.log('Verify 3ds response', response)
39
- })
40
- ```
41
-
42
- | Property | Type | Description |
43
- |:---------------:|:-------------:|:-----------------------------------------------------------------------:|
44
- | signal | AborSignal | Signal from AbortController instance if it need cancel request |
45
- | baseUrlTonder | string | Live server: http://stage.tonder.io |
46
- | | | Mock Server: https://stoplight.io/mocks/tonder/tonder-api-v1-2/3152148 |
47
- | apiKeyTonder | string | You can take this from you Tonder Dashboard |
48
- | | | |
49
-
50
- # Class methods
51
-
52
- # Checkout router
53
-
54
- ```typescript
55
-
56
- const returnUrl = "http://localhost:8100/payment/success";
57
-
58
- let checkoutData = {
59
- customer: {
60
- name: "Jhon",
61
- lastname: "Doe",
62
- email: "john.c.calhoun@examplepetstore.com",
63
- phone: "+58452258525"
64
- },
65
- order: {
66
- items: [
67
- {
68
- description: "Test product description",
69
- quantity: 1,
70
- price_unit: 25,
71
- discount: 1,
72
- taxes: 12,
73
- product_reference: 89456123,
74
- name: "Test product",
75
- amount_total: 25
76
- }
77
- ]
78
- },
79
- return_url: returnUrl,
80
- total: 25,
81
- isSandbox: true,
82
- metadata: {},
83
- currency: "MXN",
84
- skyflowTokens: {
85
- cardholder_name: "",
86
- card_number: "",
87
- expiration_year: "",
88
- expiration_month: "",
89
- cvv: "",
90
- skyflow_id: ""
91
- }
92
- }
93
-
94
- ```
95
-
96
- <font size="4">It is required get the skyflow tokens to add it to the checkout router method, the values of the variable skyflowFields come from your html form</font>
97
-
98
- ```typescript
99
-
100
- const merchantData: any = await liteCheckout.getBusiness();
101
-
102
- const { vault_id, vault_url } = merchantData;
103
-
104
- const skyflowFields = {
105
- card_number: this.paymentForm.value.cardNumber,
106
- cvv: this.paymentForm.value.cvv,
107
- expiration_month: this.paymentForm.value.month,
108
- expiration_year: this.paymentForm.value.expirationYear,
109
- cardholder_name: this.paymentForm.value.name
110
- }
111
-
112
- const skyflowTokens = await liteCheckout.getSkyflowTokens({
113
- vault_id: vault_id,
114
- vault_url: vault_url,
115
- data: skyflowFields
116
- })
117
-
118
- checkoutData.skyflowTokens = skyflowTokens;
119
-
120
- const jsonResponseRouter: any = await liteCheckout.startCheckoutRouterFull(
121
- checkoutData
122
- );
123
-
124
- ```
125
-
126
- <font size="4">Take actions on base to the checkout router response</font>
127
-
128
- # Customer Cards(Register)
129
-
130
- ## Register customer card
131
-
132
- ```typescript
133
-
134
- customer_auth_token: string;
135
-
136
- data: {
137
- skyflow_id: string;
138
- };
139
-
140
- const jsonResponseOrder = await liteCheckout.registerCustomerCard(
141
- customer_auth_token,
142
- data
143
- );
144
- ```
145
-
146
- ## Return register customer card
147
- ```typescript
148
- {
149
- skyflow_id: string;
150
- user_id: number;
151
- }
152
- ```
153
-
154
- # Customer Cards(Get)
155
-
156
- ## Get customer cards
157
-
158
- ```typescript
159
-
160
- customer_auth_token: string;
161
-
162
- query: string = "?ordering=<string>&search=<string>";
163
-
164
- const jsonResponseOrder = await liteCheckout.getCustomerCards(
165
- customer_auth_token,
166
- query
167
- );
168
- ```
169
-
170
- ## Return get customer cards
171
- ```typescript
172
- {
173
- user_id: number,
174
- cards: [
175
- {
176
- fields: {
177
- card_number: string,
178
- cardholder_name: string,
179
- cvv: string,
180
- expiration_month: string,
181
- expiration_year: string,
182
- skyflow_id: string
183
- }
184
- }
185
- ]
186
- }
187
- ```
188
-
189
- ## Delete customer card
190
-
191
- ```typescript
192
-
193
- const deleted: boolean = await liteCheckout.deleteCustomerCard(
194
- customer_auth_token,
195
- skyflow_id
196
- );
197
-
198
- ```
199
-
200
- ## License
201
-
202
- [MIT](https://choosealicense.com/licenses/mit/)
1
+ # Tonder SDK
2
+
3
+ Tonder SDK Lite to integrate REST service
4
+
5
+ ## Installation
6
+
7
+ You can install using NPM
8
+ ```bash
9
+ npm i @tonder.io/ionic-lite-sdk
10
+ ```
11
+
12
+ Add dependencies to the root of the app (index.html)
13
+ ```html
14
+ <script src=https://openpay.s3.amazonaws.com/openpay.v1.min.js></script>
15
+ <script src=https://openpay.s3.amazonaws.com/openpay-data.v1.min.js></script>
16
+ ```
17
+
18
+ ## Usage
19
+ ## Import LiteCheckout class
20
+ ```javascript
21
+ import { LiteCheckout } from "@tonder.io/ionic-lite-sdk"
22
+ ```
23
+ ## Create instance
24
+
25
+ ```javascript
26
+ const liteCheckout = new LiteCheckout({
27
+ signal,
28
+ baseUrlTonder,
29
+ publicApiKeyTonder
30
+ })
31
+
32
+ // To verify a 3ds transaction you can use the following method
33
+ // It should be called after the injectCheckout method
34
+ // The response status will be one of the following
35
+ // ['Declined', 'Cancelled', 'Failed', 'Success', 'Pending', 'Authorized']
36
+
37
+ inlineCheckout.verify3dsTransaction().then(response => {
38
+ console.log('Verify 3ds response', response)
39
+ })
40
+ ```
41
+
42
+ | Property | Type | Description |
43
+ |:---------------:|:-------------:|:-----------------------------------------------------------------------:|
44
+ | signal | AborSignal | Signal from AbortController instance if it need cancel request |
45
+ | baseUrlTonder | string | Live server: http://stage.tonder.io |
46
+ | | | Mock Server: https://stoplight.io/mocks/tonder/tonder-api-v1-2/3152148 |
47
+ | publicApiKeyTonder | string | You can take this from you Tonder Dashboard |
48
+ | | | |
49
+
50
+ # Class methods
51
+
52
+ # Checkout router
53
+
54
+ ```typescript
55
+
56
+ const returnUrl = "http://localhost:8100/payment/success";
57
+
58
+ let checkoutData = {
59
+ customer: {
60
+ name: "Jhon",
61
+ lastname: "Doe",
62
+ email: "john.c.calhoun@examplepetstore.com",
63
+ phone: "+58452258525"
64
+ },
65
+ order: {
66
+ items: [
67
+ {
68
+ description: "Test product description",
69
+ quantity: 1,
70
+ price_unit: 25,
71
+ discount: 1,
72
+ taxes: 12,
73
+ product_reference: 89456123,
74
+ name: "Test product",
75
+ amount_total: 25
76
+ }
77
+ ]
78
+ },
79
+ return_url: returnUrl,
80
+ total: 25,
81
+ isSandbox: true,
82
+ metadata: {},
83
+ currency: "MXN",
84
+ skyflowTokens: {
85
+ cardholder_name: "",
86
+ card_number: "",
87
+ expiration_year: "",
88
+ expiration_month: "",
89
+ cvv: "",
90
+ skyflow_id: ""
91
+ }
92
+ }
93
+
94
+ ```
95
+
96
+ <font size="4">It is required get the skyflow tokens to add it to the checkout router method, the values of the variable skyflowFields come from your html form</font>
97
+
98
+ ```typescript
99
+
100
+ const merchantData: any = await liteCheckout.getBusiness();
101
+
102
+ const { vault_id, vault_url } = merchantData;
103
+
104
+ const skyflowFields = {
105
+ card_number: this.paymentForm.value.cardNumber,
106
+ cvv: this.paymentForm.value.cvv,
107
+ expiration_month: this.paymentForm.value.month,
108
+ expiration_year: this.paymentForm.value.expirationYear,
109
+ cardholder_name: this.paymentForm.value.name
110
+ }
111
+
112
+ const skyflowTokens = await liteCheckout.getSkyflowTokens({
113
+ vault_id: vault_id,
114
+ vault_url: vault_url,
115
+ data: skyflowFields
116
+ })
117
+
118
+ checkoutData.skyflowTokens = skyflowTokens;
119
+
120
+ const jsonResponseRouter: any = await liteCheckout.startCheckoutRouterFull(
121
+ checkoutData
122
+ );
123
+
124
+ ```
125
+
126
+ <font size="4">Take actions on base to the checkout router response</font>
127
+
128
+ # Customer Cards(Register)
129
+
130
+ ## Request secure token
131
+
132
+ ```typescript
133
+
134
+ const jsonResponse = await liteCheckout.getSecureToken(
135
+ secretApiKey //You can take this from you Tonder Dashboard
136
+ );
137
+
138
+ ```
139
+
140
+ ## Return secure token
141
+
142
+ ```typescript
143
+ {
144
+ access: string;
145
+ }
146
+ ```
147
+
148
+ ## Register customer card
149
+
150
+ ```typescript
151
+
152
+ customer_auth_token: string;
153
+
154
+ data: {
155
+ skyflow_id: string;
156
+ };
157
+
158
+ const jsonResponseOrder = await liteCheckout.registerCustomerCard(
159
+ secureToken
160
+ customer_auth_token,
161
+ data
162
+ );
163
+ ```
164
+
165
+ ## Return register customer card
166
+ ```typescript
167
+ {
168
+ skyflow_id: string;
169
+ user_id: number;
170
+ }
171
+ ```
172
+
173
+ # Customer Cards(Get)
174
+
175
+ ## Get customer cards
176
+
177
+ ```typescript
178
+
179
+ customer_auth_token: string;
180
+
181
+ query: string = "?ordering=<string>&search=<string>";
182
+
183
+ const jsonResponseOrder = await liteCheckout.getCustomerCards(
184
+ customer_auth_token,
185
+ query
186
+ );
187
+ ```
188
+
189
+ ## Return get customer cards
190
+ ```typescript
191
+ {
192
+ user_id: number,
193
+ cards: [
194
+ {
195
+ fields: {
196
+ card_number: string,
197
+ cardholder_name: string,
198
+ cvv: string,
199
+ expiration_month: string,
200
+ expiration_year: string,
201
+ skyflow_id: string
202
+ }
203
+ }
204
+ ]
205
+ }
206
+ ```
207
+
208
+ ## Delete customer card
209
+
210
+ ```typescript
211
+
212
+ const deleted: boolean = await liteCheckout.deleteCustomerCard(
213
+ customer_auth_token,
214
+ skyflow_id
215
+ );
216
+
217
+ ```
218
+
219
+ ## License
220
+
221
+ [MIT](https://choosealicense.com/licenses/mit/)
@@ -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,71 +1,47 @@
1
+ import CollectContainer from "skyflow-js/types/core/external/collect/collect-container";
2
+ import { APM, Business } from "../types/commons";
3
+ import { CreateOrderRequest, CreatePaymentRequest, RegisterCustomerCardRequest, StartCheckoutRequest, TokensRequest, StartCheckoutFullRequest, StartCheckoutIdRequest } from "../types/requests";
4
+ import { GetSecureTokenResponse, GetBusinessResponse, CustomerRegisterResponse, CreateOrderResponse, CreatePaymentResponse, StartCheckoutResponse, GetCustomerCardsResponse, RegisterCustomerCardResponse } from "../types/responses";
1
5
  import { ErrorResponse } from "./errorResponse";
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";
6
+ import { ThreeDSHandler } from "./3dsHandler";
4
7
  declare global {
5
8
  interface Window {
6
9
  OpenPay: any;
7
10
  }
8
11
  }
9
- export interface LiteCheckoutConstructor extends IInlineCheckoutBaseOptions {
10
- }
11
- export declare class LiteCheckout extends BaseInlineCheckout {
12
+ export type LiteCheckoutConstructor = {
13
+ signal: AbortSignal;
14
+ baseUrlTonder: string;
15
+ publicApiKeyTonder: string;
16
+ };
17
+ export declare class LiteCheckout implements LiteCheckoutConstructor {
18
+ #private;
19
+ signal: AbortSignal;
20
+ baseUrlTonder: string;
21
+ publicApiKeyTonder: string;
22
+ process3ds: ThreeDSHandler;
12
23
  activeAPMs: APM[];
13
- constructor({ apiKey, mode, returnUrl, callBack }: LiteCheckoutConstructor);
14
- injectCheckout(): Promise<void>;
15
- getCustomerCards(): Promise<ICustomerCardsResponse>;
16
- saveCustomerCard(card: ISaveCardRequest): Promise<ISaveCardResponse>;
17
- removeCustomerCard(skyflowId: string): Promise<string>;
18
- getCustomerPaymentMethods(): Promise<IPaymentMethod[]>;
19
- getBusiness(): Promise<GetBusinessResponse>;
20
- getSkyflowTokens({ vault_id, vault_url, data, }: TokensRequest): Promise<any | ErrorResponse>;
21
- _setCartTotal(total: string): void;
22
- _checkout({ card, payment_method, isSandbox, }: {
23
- card?: ICardFields | string;
24
- payment_method?: string;
25
- isSandbox?: boolean;
26
- }): Promise<any>;
27
- /**
28
- * @deprecated This method is deprecated and will be removed in a future release.
29
- * It is no longer necessary to use this method as customer registration is now automatically handled
30
- * during the payment process or when using card management methods.
31
- */
24
+ merchantData?: Business | ErrorResponse;
25
+ constructor({ signal, baseUrlTonder, publicApiKeyTonder, }: LiteCheckoutConstructor);
26
+ getOpenpayDeviceSessionID(merchant_id: string, public_key: string, is_sandbox: boolean): Promise<string | ErrorResponse>;
27
+ getBusiness(): Promise<GetBusinessResponse | ErrorResponse>;
28
+ verify3dsTransaction(): Promise<false | StartCheckoutResponse | ErrorResponse | undefined>;
29
+ resumeCheckout(response: any): Promise<any>;
30
+ handle3dsRedirect(response: ErrorResponse | StartCheckoutResponse | false | undefined): Promise<false | StartCheckoutResponse | ErrorResponse | undefined>;
32
31
  customerRegister(email: string): Promise<CustomerRegisterResponse | ErrorResponse>;
33
- /**
34
- * @deprecated This method is deprecated and will be removed in a future release.
35
- * It is no longer necessary to use this method as order creation is now automatically
36
- * handled when making a payment through the `payment` function.
37
- */
38
32
  createOrder(orderItems: CreateOrderRequest): Promise<CreateOrderResponse | ErrorResponse>;
39
- /**
40
- * @deprecated This method is deprecated and will be removed in a future release.
41
- * It is no longer necessary to use this method as payment creation is now automatically
42
- * handled when making a payment through the `payment` function.
43
- */
44
33
  createPayment(paymentItems: CreatePaymentRequest): Promise<CreatePaymentResponse | ErrorResponse>;
45
- /**
46
- * @deprecated This method is deprecated and will be removed in a future release.
47
- * Use the {@link payment} method
48
- */
34
+ handleCheckoutRouter(routerData: StartCheckoutRequest | StartCheckoutIdRequest): Promise<StartCheckoutResponse>;
49
35
  startCheckoutRouter(routerData: StartCheckoutRequest | StartCheckoutIdRequest): Promise<StartCheckoutResponse | ErrorResponse | undefined>;
50
- init3DSRedirect(checkoutResult: ErrorResponse | StartCheckoutResponse): Promise<false | ErrorResponse | StartCheckoutResponse | undefined>;
51
- /**
52
- * @deprecated This method is deprecated and will be removed in a future release.
53
- * Use the {@link payment} method
54
- */
55
36
  startCheckoutRouterFull(routerFullData: StartCheckoutFullRequest): Promise<StartCheckoutResponse | ErrorResponse | undefined>;
56
- /**
57
- * @deprecated This method is deprecated and will be removed in a future release.
58
- * Use the {@link saveCustomerCard} method
59
- */
60
- registerCustomerCard(customerToken: string, data: RegisterCustomerCardRequest): Promise<RegisterCustomerCardResponse | ErrorResponse>;
61
- /**
62
- * @deprecated This method is deprecated and will be removed in a future release.
63
- * Use the {@link removeCustomerCard} method
64
- */
37
+ init3DSRedirect(checkoutResult: ErrorResponse | StartCheckoutResponse): Promise<false | StartCheckoutResponse | ErrorResponse | undefined>;
38
+ getSkyflowTokens({ vault_id, vault_url, data, }: TokensRequest): Promise<any | ErrorResponse>;
39
+ getVaultToken(): Promise<string>;
40
+ getFieldsPromise(data: any, collectContainer: CollectContainer): Promise<Promise<boolean>[]>;
41
+ registerCustomerCard(secureToken: string, customerToken: string, data: RegisterCustomerCardRequest): Promise<RegisterCustomerCardResponse | ErrorResponse>;
42
+ getCustomerCards(customerToken: string, bearerToken: string): Promise<GetCustomerCardsResponse | ErrorResponse>;
65
43
  deleteCustomerCard(customerToken: string, skyflowId?: string): Promise<Boolean | ErrorResponse>;
66
- /**
67
- * @deprecated This method is deprecated and will be removed in a future release.
68
- * Use the {@link getCustomerPaymentMethods} method
69
- */
44
+ private getFields;
70
45
  getActiveAPMs(): Promise<APM[]>;
46
+ getSecureToken(token: string): Promise<GetSecureTokenResponse | ErrorResponse>;
71
47
  }
@@ -1 +1 @@
1
- export declare function getCustomerAPMs(baseUrlTonder: string, apiKeyTonder: string, query?: string, signal?: AbortSignal | null | undefined): Promise<any>;
1
+ export declare function getCustomerAPMs(baseUrlTonder: string, publicApiKeyTonder: string, query?: string, signal?: AbortSignal | null | undefined): Promise<any>;
@@ -11,12 +11,8 @@ export declare const getBrowserInfo: () => {
11
11
  export declare const getBusinessId: (merchantData: any) => any;
12
12
  declare const buildErrorResponseFromCatch: (e: any) => ErrorResponse;
13
13
  declare const buildErrorResponse: (response: Response, stack?: string | undefined) => Promise<ErrorResponse>;
14
- declare function formatPublicErrorResponse(data: Record<string, any>, error: any): {
15
- status: string;
16
- code: number;
17
- message: string;
18
- detail: any;
14
+ declare const getPaymentMethodDetails: (scheme_data: string) => {
15
+ icon: string;
16
+ label: string;
19
17
  };
20
- declare const clearSpace: (text: string) => string;
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, };
18
+ export { buildErrorResponseFromCatch, buildErrorResponse, getPaymentMethodDetails };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  import { LiteCheckout } from './classes/liteCheckout';
2
- import { validateCVV, validateCardNumber, validateExpirationMonth, validateCardholderName, validateExpirationYear } from './helpers/validations';
3
- export { LiteCheckout, validateCVV, validateCardNumber, validateCardholderName, validateExpirationMonth, validateExpirationYear };
2
+ export { LiteCheckout };