tonder-web-sdk 1.16.3 → 1.16.6-beta.DEV-1433.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 (106) hide show
  1. package/README.md +22 -25
  2. package/package.json +10 -3
  3. package/types/common.d.ts +4 -0
  4. package/v1/bundle.min.js +1 -18
  5. package/.env-example +0 -1
  6. package/.husky/pre-commit +0 -4
  7. package/.prettierignore +0 -8
  8. package/.prettierrc +0 -10
  9. package/cypress/e2e/1-getting-started/todo.cy.js +0 -143
  10. package/cypress/e2e/2-advanced-examples/actions.cy.js +0 -299
  11. package/cypress/e2e/2-advanced-examples/aliasing.cy.js +0 -39
  12. package/cypress/e2e/2-advanced-examples/assertions.cy.js +0 -176
  13. package/cypress/e2e/2-advanced-examples/connectors.cy.js +0 -98
  14. package/cypress/e2e/2-advanced-examples/cookies.cy.js +0 -118
  15. package/cypress/e2e/2-advanced-examples/cypress_api.cy.js +0 -185
  16. package/cypress/e2e/2-advanced-examples/files.cy.js +0 -85
  17. package/cypress/e2e/2-advanced-examples/location.cy.js +0 -32
  18. package/cypress/e2e/2-advanced-examples/misc.cy.js +0 -104
  19. package/cypress/e2e/2-advanced-examples/navigation.cy.js +0 -56
  20. package/cypress/e2e/2-advanced-examples/network_requests.cy.js +0 -163
  21. package/cypress/e2e/2-advanced-examples/querying.cy.js +0 -114
  22. package/cypress/e2e/2-advanced-examples/spies_stubs_clocks.cy.js +0 -201
  23. package/cypress/e2e/2-advanced-examples/storage.cy.js +0 -110
  24. package/cypress/e2e/2-advanced-examples/traversal.cy.js +0 -121
  25. package/cypress/e2e/2-advanced-examples/utilities.cy.js +0 -108
  26. package/cypress/e2e/2-advanced-examples/viewport.cy.js +0 -58
  27. package/cypress/e2e/2-advanced-examples/waiting.cy.js +0 -30
  28. package/cypress/e2e/2-advanced-examples/window.cy.js +0 -22
  29. package/cypress/fixtures/example.json +0 -5
  30. package/cypress/support/commands.js +0 -25
  31. package/cypress/support/e2e.js +0 -20
  32. package/cypress.config.js +0 -9
  33. package/eslint.config.mjs +0 -15
  34. package/index.js.example +0 -50
  35. package/samples/react/README.md +0 -70
  36. package/samples/react/build/asset-manifest.json +0 -16
  37. package/samples/react/build/favicon.ico +0 -0
  38. package/samples/react/build/index.html +0 -1
  39. package/samples/react/build/logo192.png +0 -0
  40. package/samples/react/build/logo512.png +0 -0
  41. package/samples/react/build/manifest.json +0 -25
  42. package/samples/react/build/robots.txt +0 -3
  43. package/samples/react/build/static/css/main.073c9b0a.css +0 -2
  44. package/samples/react/build/static/css/main.073c9b0a.css.map +0 -1
  45. package/samples/react/build/static/js/787.b83ed06f.chunk.js +0 -2
  46. package/samples/react/build/static/js/787.b83ed06f.chunk.js.map +0 -1
  47. package/samples/react/build/static/js/main.0a848807.js +0 -3
  48. package/samples/react/build/static/js/main.0a848807.js.LICENSE.txt +0 -39
  49. package/samples/react/build/static/js/main.0a848807.js.map +0 -1
  50. package/samples/react/build/static/media/sdk-icons.b491623214b2af4cccdb.png +0 -0
  51. package/samples/react/package-lock.json +0 -28973
  52. package/samples/react/package.json +0 -44
  53. package/samples/react/public/favicon.ico +0 -0
  54. package/samples/react/public/index.html +0 -43
  55. package/samples/react/public/logo192.png +0 -0
  56. package/samples/react/public/logo512.png +0 -0
  57. package/samples/react/public/manifest.json +0 -25
  58. package/samples/react/public/robots.txt +0 -3
  59. package/samples/react/src/App.css +0 -38
  60. package/samples/react/src/App.js +0 -22
  61. package/samples/react/src/App.test.js +0 -8
  62. package/samples/react/src/assets/img/sdk-icons.png +0 -0
  63. package/samples/react/src/components/Cart.js +0 -29
  64. package/samples/react/src/components/ProductCard.js +0 -27
  65. package/samples/react/src/context/CartContext.js +0 -116
  66. package/samples/react/src/index.css +0 -13
  67. package/samples/react/src/index.js +0 -17
  68. package/samples/react/src/logo.svg +0 -1
  69. package/samples/react/src/reportWebVitals.js +0 -13
  70. package/samples/react/src/screens/Checkout.js +0 -82
  71. package/samples/react/src/screens/Store.js +0 -21
  72. package/samples/react/src/setupTests.js +0 -5
  73. package/samples/react/src/storeProducts.js +0 -30
  74. package/src/classes/3dsHandler.js +0 -199
  75. package/src/classes/BaseInlineCheckout.js +0 -303
  76. package/src/classes/LiteInlineCheckout.js +0 -217
  77. package/src/classes/checkout.js +0 -129
  78. package/src/classes/globalLoader.js +0 -31
  79. package/src/classes/inlineCheckout.js +0 -713
  80. package/src/data/apmApi.js +0 -38
  81. package/src/data/businessApi.js +0 -16
  82. package/src/data/cardApi.js +0 -134
  83. package/src/data/checkoutApi.js +0 -92
  84. package/src/data/customerApi.js +0 -32
  85. package/src/data/index.js +0 -17
  86. package/src/data/openPayApi.js +0 -16
  87. package/src/data/skyflowApi.js +0 -16
  88. package/src/helpers/skyflow.js +0 -370
  89. package/src/helpers/styles.js +0 -90
  90. package/src/helpers/template-skeleton.js +0 -59
  91. package/src/helpers/template.js +0 -1104
  92. package/src/helpers/utils.js +0 -257
  93. package/src/helpers/validations.js +0 -53
  94. package/src/index-dev.js +0 -329
  95. package/src/index.html +0 -180
  96. package/src/index.js +0 -21
  97. package/src/shared/catalog/commonLogosCatalog.js +0 -7
  98. package/src/shared/catalog/paymentMethodsCatalog.js +0 -246
  99. package/src/shared/constants/colors.js +0 -15
  100. package/src/shared/constants/displayMode.js +0 -4
  101. package/src/shared/constants/fieldPathNames.js +0 -4
  102. package/src/shared/constants/htmlTonderIds.js +0 -18
  103. package/src/shared/constants/messages.js +0 -11
  104. package/src/shared/constants/paymentMethodAPM.js +0 -63
  105. package/src/shared/constants/tonderUrl.js +0 -8
  106. package/webpack.config.js +0 -77
package/README.md CHANGED
@@ -98,16 +98,16 @@ inlineCheckout.verify3dsTransaction().then((response) => {
98
98
  const response = await inlineCheckout.payment(checkoutData);
99
99
  ```
100
100
 
101
- ### LiteInlineCheckout
101
+ ### LiteCheckout
102
102
 
103
- LiteInlineCheckout allows you to build a custom checkout interface using Tonder's core functionality.
103
+ LiteCheckout allows you to build a custom checkout interface using Tonder's core functionality.
104
104
 
105
105
  ```javascript
106
- import { LiteInlineCheckout } from "tonder-web-sdk";
106
+ import { LiteCheckout } from "tonder-web-sdk";
107
107
  ```
108
108
 
109
109
  ```javascript
110
- const LiteInlineCheckout = new LiteInlineCheckout({
110
+ const liteCheckout = new LiteCheckout({
111
111
  apiKey: "your-api-key", // Your api key getted from Tonder Dashboard
112
112
  returnUrl: "http://your-website.com/checkout",
113
113
  });
@@ -117,37 +117,37 @@ const LiteInlineCheckout = new LiteInlineCheckout({
117
117
  inlineCheckout.configureCheckout({ customer: { email: "example@email.com" } });
118
118
 
119
119
  // Initialize the checkout
120
- await LiteInlineCheckout.injectCheckout();
120
+ await liteCheckout.injectCheckout();
121
121
  ```
122
122
 
123
123
  ```javascript
124
124
  // Retrieve customer's saved cards
125
- const cards = await LiteInlineCheckout.getCustomerCards();
125
+ const cards = await liteCheckout.getCustomerCards();
126
126
  ```
127
127
 
128
128
  ```javascript
129
129
  // Save a new card
130
- const newCard = await LiteInlineCheckout.saveCustomerCard(cardData);
130
+ const newCard = await liteCheckout.saveCustomerCard(cardData);
131
131
  ```
132
132
 
133
133
  ```javascript
134
134
  // Remove a saved card
135
- await LiteInlineCheckout.removeCustomerCard(cardId);
135
+ await liteCheckout.removeCustomerCard(cardId);
136
136
  ```
137
137
 
138
138
  ```javascript
139
139
  // Get available payment methods
140
- const paymentMethods = await LiteInlineCheckout.getCustomerPaymentMethods();
140
+ const paymentMethods = await liteCheckout.getCustomerPaymentMethods();
141
141
  ```
142
142
 
143
143
  ```javascript
144
144
  // Process a payment
145
- const paymentResponse = await LiteInlineCheckout.payment(paymentData);
145
+ const paymentResponse = await liteCheckout.payment(paymentData);
146
146
  ```
147
147
 
148
148
  ```javascript
149
149
  // Verify a 3DS transaction
150
- const verificationResult = await LiteInlineCheckout.verify3dsTransaction();
150
+ const verificationResult = await liteCheckout.verify3dsTransaction();
151
151
  ```
152
152
 
153
153
  ## Configuration
@@ -179,9 +179,6 @@ interface IInlineCheckoutOptions extends IInlineCheckoutBaseOptions {
179
179
  ```
180
180
  </details>
181
181
 
182
- > **Important Note about SaveCard functionality**:
183
- > To properly implement the SaveCard feature, you must use a SecureToken. For detailed implementation instructions and best practices, please refer to our official documentation on [How to use SecureToken for secure card saving](https://docs.tonder.io/integration/sdks/secure-token#how-to-use-securetoken-for-secure-card-saving).
184
-
185
182
  ### Inline Callbacks Structure
186
183
 
187
184
  | Callback | Required | Parameters | Description | Return |
@@ -349,15 +346,15 @@ When calling the `payment` method, use the following data structure:
349
346
 
350
347
  - **metadata**: Object for including any additional information about the transaction. This can be used for internal references or tracking.
351
348
 
352
- - **card**: (for LiteInlineCheckout) Object containing card information. This is used differently depending on whether it's a new card or a saved card:
349
+ - **card**: (for LiteCheckout) Object containing card information. This is used differently depending on whether it's a new card or a saved card:
353
350
 
354
351
  - For a new card: Include `card_number`, `cvv`, `expiration_month`, `expiration_year`, and `cardholder_name`.
355
352
  - For a saved card: Include only the `skyflow_id` of the saved card.
356
353
  - This is only used when not paying with a payment_method.
357
354
 
358
- - **payment_method**: (for LiteInlineCheckout) String indicating the alternative payment method to be used (e.g., "Spei"). This is only used when not paying with a card.
355
+ - **payment_method**: (for LiteCheckout) String indicating the alternative payment method to be used (e.g., "Spei"). This is only used when not paying with a card.
359
356
 
360
- Note: The exact fields required may vary depending on whether you're using InlineCheckout or LiteInlineCheckout, and the specific payment method being used.
357
+ Note: The exact fields required may vary depending on whether you're using InlineCheckout or LiteCheckout, and the specific payment method being used.
361
358
 
362
359
  ```javascript
363
360
  const paymentData = {
@@ -409,7 +406,7 @@ const paymentData = {
409
406
 
410
407
  ## Field Validation Functions
411
408
 
412
- For LiteInlineCheckout implementations, the SDK provides validation functions to ensure the integrity of card data before submitting:
409
+ For LiteCheckout implementations, the SDK provides validation functions to ensure the integrity of card data before submitting:
413
410
 
414
411
  - `validateCardNumber(cardNumber)`: Validates the card number using the Luhn algorithm.
415
412
  - `validateCardholderName(name)`: Checks if the cardholder name is valid.
@@ -454,7 +451,7 @@ if (
454
451
  - `payment(data)`: Process a payment
455
452
  - `verify3dsTransaction()`: Verify a 3DS transaction
456
453
 
457
- ### LiteInlineCheckout Methods
454
+ ### LiteCheckout Methods
458
455
 
459
456
  - `configureCheckout(data)`: Set initial checkout data
460
457
  - `injectCheckout()`: Initialize the checkout
@@ -596,16 +593,16 @@ import { LiteInlineCheckout } from "tonder-web-sdk";
596
593
  const apiKey = "your-api-key";
597
594
  const returnUrl = "http://your-website.com/checkout";
598
595
 
599
- const LiteInlineCheckout = new LiteInlineCheckout({
596
+ const liteCheckout = new LiteInlineCheckout({
600
597
  mode: "development",
601
598
  apiKey,
602
599
  returnUrl,
603
600
  });
604
601
 
605
- LiteInlineCheckout.configureCheckout({ customer: { email: "example@email.com" } });
606
- LiteInlineCheckout.injectCheckout();
602
+ liteCheckout.configureCheckout({ customer: { email: "example@email.com" } });
603
+ liteCheckout.injectCheckout();
607
604
 
608
- LiteInlineCheckout.verify3dsTransaction().then((response) => {
605
+ liteCheckout.verify3dsTransaction().then((response) => {
609
606
  console.log("Verify 3ds response", response);
610
607
  });
611
608
 
@@ -623,7 +620,7 @@ document
623
620
 
624
621
  try {
625
622
  const paymentData = { ...checkoutData, card: cardData };
626
- const response = await LiteInlineCheckout.payment(paymentData);
623
+ const response = await liteCheckout.payment(paymentData);
627
624
  console.log("Payment response:", response);
628
625
  alert("Payment successful");
629
626
  } catch (error) {
@@ -835,7 +832,7 @@ export class TonderService {
835
832
  // Add more functions, for example for lite sdk: get payment methods
836
833
 
837
834
  // getCustomerPaymentMethods(): Promise<IPaymentMethod[]> {
838
- // return this.LiteInlineCheckout.getCustomerPaymentMethods();
835
+ // return this.liteCheckout.getCustomerPaymentMethods();
839
836
  // }
840
837
  }
841
838
 
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "tonder-web-sdk",
3
- "version": "1.16.3",
3
+ "version": "1.16.6-beta.DEV-1433.1",
4
4
  "description": "tonder sdk for integrations",
5
- "main": "src/index.js",
6
5
  "scripts": {
7
6
  "start": "webpack-dev-server",
8
7
  "build": "webpack --config webpack.config.js --mode production",
@@ -12,7 +11,14 @@
12
11
  "lint:fix": "eslint 'src/**/*.js' --fix"
13
12
  },
14
13
  "author": "",
14
+ "main": "v1/bundle.min.js",
15
15
  "types": "types/index.d.ts",
16
+ "files": [
17
+ "v1",
18
+ "types",
19
+ "LICENSE",
20
+ "README.md"
21
+ ],
16
22
  "license": "ISC",
17
23
  "dependencies": {
18
24
  "accordion-js": "^3.4.0",
@@ -38,7 +44,8 @@
38
44
  "terser-webpack-plugin": "^5.3.10",
39
45
  "webpack": "^5.75.0",
40
46
  "webpack-cli": "^5.0.1",
41
- "webpack-dev-server": "^4.11.1"
47
+ "webpack-dev-server": "^4.11.1",
48
+ "webpack-obfuscator": "^3.5.1"
42
49
  },
43
50
  "lint-staged": {
44
51
  "**/*.{js,jsx,ts,tsx}": [
package/types/common.d.ts CHANGED
@@ -6,6 +6,10 @@ export interface IInlineCheckoutBaseOptions {
6
6
  apiKey: string;
7
7
  returnUrl: string;
8
8
  callBack?: (response: any) => void;
9
+ signatures?:{
10
+ transaction?: string;
11
+ customer?: string;
12
+ }
9
13
  }
10
14
 
11
15
  export interface IConfigureCheckout extends Partial<IProcessPaymentRequest> {