diff --git a/.eslintrc.js b/.eslintrc.js index 0061af819..ec597a8df 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,7 +22,9 @@ module.exports = { plugins: ['react'], rules: { 'prettier/prettier': ['error', { singleQuote: true, endOfLine: 'auto' }], - 'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }] + 'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }], + 'import/no-cycle': 'off', // TODO: remove after clean localstorage + 'react/forbid-prop-types': 'off' // TODO: remove after moving to redux }, settings: { 'import/resolver': { diff --git a/README.md b/README.md index 23fe962ef..686f7f478 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ To find out more about MediaStore SDK, see: - node v14.15.0 - react v16.14.0 + ## Installation @@ -67,6 +68,8 @@ Setting the environment is required for all components. The environment is one o - `sandbox` (default) - `production` +**Each component needs to be wrapper into Provider, as in the example below.** + ##### Other Config methods ```javascript @@ -102,7 +105,8 @@ Auth.logout(clb); // removes all Cleeng data from local storage and redux. clb - ```javascript import { useEffect } from 'react'; -import { Config, Purchase, Auth } from '@cleeng/mediastore-sdk'; +import { Config, Purchase, Auth, store } from '@cleeng/mediastore-sdk'; +import { Provider } from "react-redux"; export default function Home() { Config.setEnvironment("sandbox"); @@ -117,7 +121,9 @@ export default function Home() { return ( <> {Auth.isLogged() ? ( - + + + ) : ( )} @@ -180,32 +186,21 @@ Config.setCheckoutPayPalUrls({ - `offerId` \* - ID of Cleeng offer, for which Checkout component should be opened. Accepts `offerId` with or without the country suffix, eg. `S531234647_PL`, `S531234647`. - `onSuccess` - function called after a successful checkout process. -- `availablePaymentMethods` - array of the available payment methods. If provided, call for payment-methods will be skipped. Every payment method object should have `id`, `methodName` and `paymentGateway`. Payment method can be selected as a default by adding default property. - `resetPasswordCallback` - function called after a successful reset password request, when user clicks 'Go back to the login page' **Usage** ```javascript -const availablePaymentMethods = [ - { - id: 142029029, - methodName: "card", - paymentGateway: "adyen", - default: true - }, - { - id: 153379135, - methodName: "paypal", - paymentGateway: "paypal" - } -]; +import { Checkout, store } from "@cleeng/mediastore-sdk"; +import { Provider } from "react-redux"; - console.log("success")} - offerId={"S531234647_PL"} - availablePaymentMethods={availablePaymentMethods} - resetPasswordCallback={() => console.log("redirect user to the login page")} -/>; + + console.log("success")} + offerId={"S531234647_PL"} + resetPasswordCallback={() => console.log("redirect user to the login page")} + /> +; ``` ####

MyAccount

@@ -234,7 +229,6 @@ Config.setMyAccountPayPalUrls({ **Props** - `customCancellationReasons` - array of the custom cancellation reasons. List of that reasons will be displayed on unsubscribe popup. The provided cancellation reasons will replace our default ones. Every cancellation reason should have key and value. -- `availablePaymentMethodIds` - object of the available payment methods IDs. If provided, call for payment-methods will be skipped (used in 'Edit payment method' section). Object properties should have a payment gateway name as a key, and a paymentMethodId as a value. - `skipAvailableDowngradesStep` - an optional parameter that can be used to skip available downgrades step in the unsubscribe process. **Usage sample** @@ -248,22 +242,14 @@ const customCancellationReasons = [ { value: "Switch to a different service", key: "service" } ]; -const availablePaymentMethodIds = { - adyen: 142029029, - paypal: 153379135 -}; - ; ``` -**All MyAccount components (PlanDetails, PaymentInfo, UpdateProfile, and all inside) require to be wrapped by the store.** - **Server-side rendering** This component should be rendered in the browser. Sample of usage with **NextJS** @@ -381,10 +367,7 @@ Config.setPublisher("111111111"); // required **Props** - `offerId` \* - ID of Cleeng offer, for which Purchase component should be opened. If not provided, it will use the item from local storage with name 'CLEENG_OFFER_ID' -- `onSuccess` - function called after a successful payment process -- `availablePaymentMethods` - array of the available payment methods. If provided, call for payment-methods will be skipped. Every payment method object should have `id`, `methodName` and `paymentGateway`. Payment method can be selected as a default by adding default property. - -\* - required +- `onSuccess` - function called after a successful payment process \* - required **Config methods** @@ -403,27 +386,12 @@ Config.setCheckoutPayPalUrls({ **Usage sample** ```javascript -import { Config, Purchase } from "@cleeng/mediastore-sdk"; - -const availablePaymentMethods = [ - { - id: 142029029, - methodName: "card", - paymentGateway: "adyen", - default: true - }, - { - id: 153379135, - methodName: "paypal", - paymentGateway: "paypal" - } -]; +import { Purchase, Config, store } from "@cleeng/mediastore-sdk"; +import { Provider } from "react-redux"; - console.log("success")} - availablePaymentMethods={availablePaymentMethods} -/>; + + console.log("success")} /> +; ``` ####

Subscriptions

@@ -530,7 +498,7 @@ const customCancellationReasons = [ ; ``` -**All MyAccount components (PlanDetails, PaymentInfo, UpdateProfile, and all inside) require to be wrapped by the store.** +**All components require to be wrapped by the store.** ####

PaymentInfo

@@ -552,28 +520,17 @@ Config.setMyAccountPayPalUrls({ }); ``` -**Props** - -- `availablePaymentMethodIds` - object of the available payment methods IDs. If provided, call for payment-methods will be skipped (used in 'Edit payment method' section). Object properties should have a payment gateway name as a key, and a paymentMethodId as a value. - **Usage sample** ```javascript import { PaymentInfo, store } from "@cleeng/mediastore-sdk"; import { Provider } from "react-redux"; -const availablePaymentMethodIds = { - adyen: 142029029, - paypal: 153379135 -}; - - + ; ``` -**All MyAccount components (PlanDetails, PaymentInfo, UpdateProfile, and all inside) require to be wrapped by the store.** - ####

TransactionList

`TransactionList` is a part of the `PaymentInfo` component and contains only information about all transactions that took place in the past. @@ -596,7 +553,7 @@ import { Provider } from "react-redux"; ; ``` -**All MyAccount components (PlanDetails, PaymentInfo, UpdateProfile, and all inside) require to be wrapped by the store.** +**All components require to be wrapped by the store.** ####

UpdateProfile

@@ -622,7 +579,7 @@ import { Provider } from "react-redux"; ; ``` -**All MyAccount components (PlanDetails, PaymentInfo, UpdateProfile, and all inside) require to be wrapped by the store.** +**All components require to be wrapped by the store.** ####

CheckoutConsents

diff --git a/package-lock.json b/package-lock.json index e0c55fdef..0edd33866 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,8 +6,9 @@ "packages": { "": { "name": "@cleeng/mediastore-sdk", - "version": "2.1.0", + "version": "2.2.0", "dependencies": { + "@adyen/adyen-web": "5.29.0", "@reduxjs/toolkit": "^1.7.2", "camelcase": "^5.3.1", "dotenv": "6.2.0", @@ -77,6 +78,20 @@ "integrity": "sha512-+u76oB43nOHrF4DDWRLWDCtci7f3QJoEBigemIdIeTi1ODqjx6Tad9NCVnPRwewWlKkVab5PlK8DCtPTyX7S8g==", "dev": true }, + "node_modules/@adyen/adyen-web": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@adyen/adyen-web/-/adyen-web-5.29.0.tgz", + "integrity": "sha512-zoflOQ/uxbSlW+wZqX2N+8AwAj3Y6pCPsOw1gWVC0f9AaITjwE4peNxkYtmJKwpkM+3Eaq3I13iramsn15u3nw==", + "dependencies": { + "@babel/runtime": "^7.15.4", + "@babel/runtime-corejs3": "^7.19.1", + "@types/applepayjs": "^3.0.4", + "@types/googlepay": "^0.6.2", + "classnames": "^2.3.1", + "core-js-pure": "^3.25.3", + "preact": "10.11.2" + } + }, "node_modules/@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", @@ -130,28 +145,28 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.1.tgz", - "integrity": "sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.5.tgz", + "integrity": "sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.2.tgz", - "integrity": "sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.5.tgz", + "integrity": "sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ==", "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.2", + "@babel/generator": "^7.20.5", "@babel/helper-compilation-targets": "^7.20.0", "@babel/helper-module-transforms": "^7.20.2", - "@babel/helpers": "^7.20.1", - "@babel/parser": "^7.20.2", + "@babel/helpers": "^7.20.5", + "@babel/parser": "^7.20.5", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2", + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -167,11 +182,11 @@ } }, "node_modules/@babel/generator": { - "version": "7.20.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.4.tgz", - "integrity": "sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.5.tgz", + "integrity": "sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==", "dependencies": { - "@babel/types": "^7.20.2", + "@babel/types": "^7.20.5", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -235,9 +250,9 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.2.tgz", - "integrity": "sha512-k22GoYRAHPYr9I+Gvy2ZQlAe5mGy8BqWst2wRt8cwIufWTxrsVshhIBvYNqC80N0GSFWTsqRVexOtfzlgOEDvA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.5.tgz", + "integrity": "sha512-3RCdA/EmEaikrhayahwToF0fpweU/8o2p8vhc1c/1kftHOdTKuC65kik/TLc+qfbS8JKw4qqJbne4ovICDhmww==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", @@ -256,13 +271,13 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz", - "integrity": "sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz", + "integrity": "sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", - "regexpu-core": "^5.1.0" + "regexpu-core": "^5.2.1" }, "engines": { "node": ">=6.9.0" @@ -485,28 +500,28 @@ } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.19.0.tgz", - "integrity": "sha512-txX8aN8CZyYGTwcLhlk87KRqncAzhh5TpQamZUa0/u3an36NtDpUP6bQgBCBcLeBs09R/OwQu3OjK0k/HwfNDg==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz", + "integrity": "sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==", "dev": true, "dependencies": { "@babel/helper-function-name": "^7.19.0", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.1.tgz", - "integrity": "sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg==", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.6.tgz", + "integrity": "sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w==", "dependencies": { "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.0" + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" }, "engines": { "node": ">=6.9.0" @@ -526,9 +541,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.3.tgz", - "integrity": "sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz", + "integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==", "bin": { "parser": "bin/babel-parser.js" }, @@ -784,14 +799,14 @@ } }, "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.18.6.tgz", - "integrity": "sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz", + "integrity": "sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2", "@babel/plugin-syntax-private-property-in-object": "^7.14.5" }, "engines": { @@ -1110,9 +1125,9 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.2.tgz", - "integrity": "sha512-y5V15+04ry69OV2wULmwhEA6jwSWXO1TwAtIwiPXcvHcoOQUqpyMVd2bDsQJMW8AurjulIyUV8kDqtjSwHy1uQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.5.tgz", + "integrity": "sha512-WvpEIW9Cbj9ApF3yJCjIEEf1EiNJLtXagOrL5LNWEZOo3jv8pmPoYTSNJQvqej8OavVlgOoOPw6/htGZro6IkA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.20.2" @@ -1354,13 +1369,13 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.19.1.tgz", - "integrity": "sha512-oWk9l9WItWBQYS4FgXD4Uyy5kq898lvkXpXQxoJEY1RnvPk4R/Dvu2ebXU9q8lP+rlMwUQTFf2Ok6d78ODa0kw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz", + "integrity": "sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-create-regexp-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2" }, "engines": { "node": ">=6.9.0" @@ -1401,9 +1416,9 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.3.tgz", - "integrity": "sha512-oZg/Fpx0YDrj13KsLyO8I/CX3Zdw7z0O9qOd95SqcoIzuqy/WTGWvePeHAnZCN54SfdyjHcb1S30gc8zlzlHcA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.5.tgz", + "integrity": "sha512-h7plkOmcndIUWXZFLgpbrh2+fXAi47zcUX7IrOQuZdLD0I0KvjJ6cvo3BEcAOsDOcZhVKGJqv07mkSqK0y2isQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.20.2" @@ -1496,13 +1511,13 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.6.tgz", - "integrity": "sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz", + "integrity": "sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "regenerator-transform": "^0.15.0" + "@babel/helper-plugin-utils": "^7.20.2", + "regenerator-transform": "^0.15.1" }, "engines": { "node": ">=6.9.0" @@ -1779,24 +1794,23 @@ } }, "node_modules/@babel/runtime": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.1.tgz", - "integrity": "sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.6.tgz", + "integrity": "sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA==", "dependencies": { - "regenerator-runtime": "^0.13.10" + "regenerator-runtime": "^0.13.11" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/runtime-corejs3": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.20.1.tgz", - "integrity": "sha512-CGulbEDcg/ND1Im7fUNRZdGXmX2MTWVVZacQi/6DiKE5HNwZ3aVTm5PV4lO8HHz0B2h8WQyvKKjbX5XgTtydsg==", - "dev": true, + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.20.6.tgz", + "integrity": "sha512-tqeujPiuEfcH067mx+7otTQWROVMKHXEaOQcAeNV5dDdbPWvPcFA8/W9LXw2NfjNmOetqLl03dfnG2WALPlsRQ==", "dependencies": { "core-js-pure": "^3.25.1", - "regenerator-runtime": "^0.13.10" + "regenerator-runtime": "^0.13.11" }, "engines": { "node": ">=6.9.0" @@ -1816,18 +1830,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.1.tgz", - "integrity": "sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.5.tgz", + "integrity": "sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ==", "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.1", + "@babel/generator": "^7.20.5", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.1", - "@babel/types": "^7.20.0", + "@babel/parser": "^7.20.5", + "@babel/types": "^7.20.5", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1836,9 +1850,9 @@ } }, "node_modules/@babel/types": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.2.tgz", - "integrity": "sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", + "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", "dependencies": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", @@ -2017,16 +2031,16 @@ "integrity": "sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==" }, "node_modules/@floating-ui/core": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.0.1.tgz", - "integrity": "sha512-bO37brCPfteXQfFY0DyNDGB3+IMe4j150KFQcgJ5aBP295p9nBGeHEs/p0czrRbtlHq4Px/yoPXO/+dOCcF4uA==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.0.4.tgz", + "integrity": "sha512-FPFLbg2b06MIw1dqk2SOEMAMX3xlrreGjcui5OTxfBDtaKTmh0kioOVjT8gcfl58juawL/yF+S+gnq8aUYQx/Q==" }, "node_modules/@floating-ui/dom": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.0.4.tgz", - "integrity": "sha512-maYJRv+sAXTy4K9mzdv0JPyNW5YPVHrqtY90tEdI6XNpuLOP26Ci2pfwPsKBA/Wh4Z3FX5sUrtUFTdMYj9v+ug==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.0.9.tgz", + "integrity": "sha512-nF9P6/BoARdt+h+CdUW3td4EUVngeDONCGuzRgnZveRZiJETx63cxhinE0JaPPC2tbcdTY9IGZocS5/7ag3xRg==", "dependencies": { - "@floating-ui/core": "^1.0.1" + "@floating-ui/core": "^1.0.4" } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -2238,9 +2252,9 @@ } }, "node_modules/@jest/core/node_modules/ci-info": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz", - "integrity": "sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.0.tgz", + "integrity": "sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==", "dev": true, "engines": { "node": ">=8" @@ -2892,9 +2906,9 @@ } }, "node_modules/@reduxjs/toolkit": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.0.tgz", - "integrity": "sha512-ak11IrjYcUXRqlhNPwnz6AcvA2ynJTu8PzDbbqQw4a3xR4KZtgiqbNblQD+10CRbfK4+5C79SOyxnT9dhBqFnA==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.1.tgz", + "integrity": "sha512-HikrdY+IDgRfRYlCTGUQaiCxxDDgM1mQrRbZ6S1HFZX5ZYuJ4o8EstNmhTwHdPl2rTmLxzwSu0b3AyeyTlR+RA==", "dependencies": { "immer": "^9.0.16", "redux": "^4.2.0", @@ -2941,9 +2955,9 @@ "dev": true }, "node_modules/@sinonjs/commons": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.5.tgz", - "integrity": "sha512-rTpCA0wG1wUxglBSFdMMY0oTrKYvgf4fNgv/sXbfCVAdf+FnPBdKJR/7XbpTCwbCrvCbdPYnlWaUUYz4V2fPDA==", + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", + "integrity": "sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==", "dev": true, "dependencies": { "type-detect": "4.0.8" @@ -3184,6 +3198,11 @@ "node": ">=10.13.0" } }, + "node_modules/@types/applepayjs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/applepayjs/-/applepayjs-3.0.4.tgz", + "integrity": "sha512-RqaVZWy1Kj4e1PoUoOI8uA+4UuuLpicQFxfU9Y/xWJFZFT6mFB4PiiY911iDxFk7pdvaj5HKH7VsWRisRca1Rg==" + }, "node_modules/@types/aria-query": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.2.tgz", @@ -3223,9 +3242,9 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.2.tgz", - "integrity": "sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg==", + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.3.tgz", + "integrity": "sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==", "dev": true, "dependencies": { "@babel/types": "^7.3.0" @@ -3241,6 +3260,11 @@ "@types/node": "*" } }, + "node_modules/@types/googlepay": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/@types/googlepay/-/googlepay-0.6.4.tgz", + "integrity": "sha512-PTt/UCllzl8z5HmhymPpSj6uENZvVKZvCBYdDVmbBVJnLStitxtWrterAOQZkKGlqVdzxNXYeif5hOAMNMS5mw==" + }, "node_modules/@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -3284,9 +3308,9 @@ } }, "node_modules/@types/jest": { - "version": "29.2.3", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.2.3.tgz", - "integrity": "sha512-6XwoEbmatfyoCjWRX7z0fKMmgYKe9+/HrviJ5k0X/tjJWHGAezZOfYaxqQKuzG/TvQyr+ktjm4jgbk0s4/oF2w==", + "version": "29.2.4", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.2.4.tgz", + "integrity": "sha512-PipFB04k2qTRPePduVLTRiPzQfvMeLwUN3Z21hsAKaB/W9IIzgB2pizCL466ftJlcyZqnHoC9ZHpxLGl3fS86A==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -3355,9 +3379,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", + "version": "18.11.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.11.tgz", + "integrity": "sha512-KJ021B1nlQUBLopzZmPBVuGU9un7WJd/W4ya7Ih02B4Uwky5Nja0yGYav2EfYIk0RR2Q9oVhf60S2XR1BCWJ2g==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -3383,9 +3407,9 @@ "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" }, "node_modules/@types/react": { - "version": "18.0.25", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.25.tgz", - "integrity": "sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==", + "version": "18.0.26", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.26.tgz", + "integrity": "sha512-hCR3PJQsAIXyxhTNSiDFY//LhnMZWpNNr5etoCqx/iUfGc5gXWtQR2Phl908jVR6uPXacojQWTg4qRpkxTuGug==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -3447,9 +3471,9 @@ "dev": true }, "node_modules/@types/yargs": { - "version": "17.0.13", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.13.tgz", - "integrity": "sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==", + "version": "17.0.17", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.17.tgz", + "integrity": "sha512-72bWxFKTK6uwWJAVT+3rF6Jo6RTojiJ27FQo8Rf60AL+VZbzoVPnMFhKsUnbjR8A3BTCYQ7Mv3hnl8T0A+CX9g==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -3619,9 +3643,9 @@ } }, "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", @@ -3713,6 +3737,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.1.tgz", + "integrity": "sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.1.3" + } + }, "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -4280,9 +4317,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001431", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz", - "integrity": "sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==", + "version": "1.0.30001436", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001436.tgz", + "integrity": "sha512-ZmWkKsnC2ifEPoWUvSAIGyOYwT+keAaaWPHiQ9DfMqS1t6tfuyFYoWR78TeZtznkEQ64+vGXH9cZrElwR2Mrxg==", "funding": [ { "type": "opencollective", @@ -4362,6 +4399,11 @@ "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", "dev": true }, + "node_modules/classnames": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -4636,7 +4678,6 @@ "version": "3.26.1", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.26.1.tgz", "integrity": "sha512-VVXcDpp/xJ21KdULRq/lXdLzQAtX7+37LzpyfFM973il0tWSsDEoyzG38G14AjTpK9VTfiNM9jnFauq/CpaWGQ==", - "dev": true, "hasInstallScript": true, "funding": { "type": "opencollective", @@ -4914,9 +4955,9 @@ } }, "node_modules/decimal.js": { - "version": "10.4.2", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.2.tgz", - "integrity": "sha512-ic1yEvwT6GuvaYwBLLY6/aFFgjZdySKTE8en/fkU3QICTmRtgtSlFn0u0BXN06InZwtfCelR7j8LRiDI/02iGA==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", "dev": true }, "node_modules/dedent": { @@ -5247,9 +5288,9 @@ } }, "node_modules/es-abstract": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.4.tgz", - "integrity": "sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==", + "version": "1.20.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.5.tgz", + "integrity": "sha512-7h8MM2EQhsCA7pU/Nv78qOXFpD8Rhqd12gYiSJVkrH9+e8VuA8JlPJK/hQjjlLv6pJvx/z1iRFKzYb0XT/RuAQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", @@ -5258,6 +5299,7 @@ "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.3", "get-symbol-description": "^1.0.0", + "gopd": "^1.0.1", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", "has-symbols": "^1.0.3", @@ -5273,8 +5315,8 @@ "object.assign": "^4.1.4", "regexp.prototype.flags": "^1.4.3", "safe-regex-test": "^1.0.0", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", "unbox-primitive": "^1.0.2" }, "engines": { @@ -5651,25 +5693,26 @@ } }, "node_modules/eslint-plugin-react": { - "version": "7.31.10", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.10.tgz", - "integrity": "sha512-e4N/nc6AAlg4UKW/mXeYWd3R++qUano5/o+t+wnWxIf+bLsOaH3a4q74kX3nDjYym3VBN4HyO9nEn1GcAqgQOA==", + "version": "7.31.11", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.11.tgz", + "integrity": "sha512-TTvq5JsT5v56wPa9OYHzsrOlHzKZKjV+aLgS+55NJP/cuzdiQPC7PfYoUjMoxlffKtvijpk7vA/jmuqRb9nohw==", "dev": true, "dependencies": { - "array-includes": "^3.1.5", - "array.prototype.flatmap": "^1.3.0", + "array-includes": "^3.1.6", + "array.prototype.flatmap": "^1.3.1", + "array.prototype.tosorted": "^1.1.1", "doctrine": "^2.1.0", "estraverse": "^5.3.0", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.1.2", - "object.entries": "^1.1.5", - "object.fromentries": "^2.0.5", - "object.hasown": "^1.1.1", - "object.values": "^1.1.5", + "object.entries": "^1.1.6", + "object.fromentries": "^2.0.6", + "object.hasown": "^1.1.2", + "object.values": "^1.1.6", "prop-types": "^15.8.1", "resolve": "^2.0.0-next.3", "semver": "^6.3.0", - "string.prototype.matchall": "^4.0.7" + "string.prototype.matchall": "^4.0.8" }, "engines": { "node": ">=4" @@ -6105,9 +6148,9 @@ } }, "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", + "integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -6496,9 +6539,9 @@ } }, "node_modules/globby/node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz", + "integrity": "sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==", "dev": true, "engines": { "node": ">= 4" @@ -7979,9 +8022,9 @@ } }, "node_modules/jest-config/node_modules/ci-info": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz", - "integrity": "sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.0.tgz", + "integrity": "sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==", "dev": true, "engines": { "node": ">=8" @@ -9270,9 +9313,9 @@ } }, "node_modules/jest-util/node_modules/ci-info": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz", - "integrity": "sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.0.tgz", + "integrity": "sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==", "dev": true, "engines": { "node": ">=8" @@ -9595,18 +9638,18 @@ } }, "node_modules/jsdom": { - "version": "20.0.2", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.2.tgz", - "integrity": "sha512-AHWa+QO/cgRg4N+DsmHg1Y7xnz+8KU3EflM0LVDTdmrYOc1WWTSkOjtpUveQH+1Bqd5rtcVnb/DuxV/UjDO4rA==", + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", "dev": true, "dependencies": { "abab": "^2.0.6", - "acorn": "^8.8.0", + "acorn": "^8.8.1", "acorn-globals": "^7.0.0", "cssom": "^0.5.0", "cssstyle": "^2.3.0", "data-urls": "^3.0.2", - "decimal.js": "^10.4.1", + "decimal.js": "^10.4.2", "domexception": "^4.0.0", "escodegen": "^2.0.0", "form-data": "^4.0.0", @@ -9619,12 +9662,12 @@ "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^3.0.0", + "w3c-xmlserializer": "^4.0.0", "webidl-conversions": "^7.0.0", "whatwg-encoding": "^2.0.0", "whatwg-mimetype": "^3.0.0", "whatwg-url": "^11.0.0", - "ws": "^8.9.0", + "ws": "^8.11.0", "xml-name-validator": "^4.0.0" }, "engines": { @@ -9745,12 +9788,12 @@ "dev": true }, "node_modules/language-tags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz", - "integrity": "sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.6.tgz", + "integrity": "sha512-HNkaCgM8wZgE/BZACeotAAgpL9FUjEnhgF0FVQMIgH//zqTPreLYMb3rWYkYAqPoF75Jwuycp1da7uz66cfFQg==", "dev": true, "dependencies": { - "language-subtag-registry": "~0.3.2" + "language-subtag-registry": "^0.3.20" } }, "node_modules/leven": { @@ -10910,9 +10953,9 @@ } }, "node_modules/parse5": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.1.tgz", - "integrity": "sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dev": true, "dependencies": { "entities": "^4.4.0" @@ -11138,9 +11181,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", - "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "version": "6.0.11", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz", + "integrity": "sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==", "dev": true, "dependencies": { "cssesc": "^3.0.0", @@ -11156,6 +11199,15 @@ "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", "dev": true }, + "node_modules/preact": { + "version": "10.11.2", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.11.2.tgz", + "integrity": "sha512-skAwGDFmgxhq1DCBHke/9e12ewkhc7WYwjuhHB8HHS8zkdtITXLRmUMTeol2ldxvLwYtwbFeifZ9uDDWuyL4Iw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, "node_modules/prefix-style": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/prefix-style/-/prefix-style-2.0.1.tgz", @@ -11438,9 +11490,9 @@ } }, "node_modules/react-select": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.6.1.tgz", - "integrity": "sha512-dYNRswtxUHW+F1Sc0HnxO5ryecPIAsG0+Cwyq5EIXZJBxCxUG2hFfQz41tc++30/2ISuuPglDikc4hEb4NsiuA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.0.tgz", + "integrity": "sha512-lJGiMxCa3cqnUr2Jjtg9YHsaytiZqeNOKeibv6WF5zbK/fPegZ1hg3y/9P1RZVLhqBTs0PfqQLKuAACednYGhQ==", "dependencies": { "@babel/runtime": "^7.12.0", "@emotion/cache": "^11.4.0", @@ -11610,14 +11662,14 @@ } }, "node_modules/regenerator-runtime": { - "version": "0.13.10", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz", - "integrity": "sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw==" + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" }, "node_modules/regenerator-transform": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.0.tgz", - "integrity": "sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg==", + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz", + "integrity": "sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==", "dev": true, "dependencies": { "@babel/runtime": "^7.8.4" @@ -12344,9 +12396,9 @@ } }, "node_modules/stylelint": { - "version": "14.15.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.15.0.tgz", - "integrity": "sha512-JOgDAo5QRsqiOZPZO+B9rKJvBm64S0xasbuRPAbPs6/vQDgDCnZLIiw6XcAS6GQKk9k1sBWR6rmH3Mfj8OknKg==", + "version": "14.16.0", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.16.0.tgz", + "integrity": "sha512-X6uTi9DcxjzLV8ZUAjit1vsRtSwcls0nl07c9rqOPzvpA8IvTX/xWEkBRowS0ffevRrqkHa/ThDEu86u73FQDg==", "dev": true, "dependencies": { "@csstools/selector-specificity": "^2.0.2", @@ -12362,7 +12414,7 @@ "globby": "^11.1.0", "globjoin": "^0.1.4", "html-tags": "^3.2.0", - "ignore": "^5.2.0", + "ignore": "^5.2.1", "import-lazy": "^4.0.0", "imurmurhash": "^0.1.4", "is-plain-object": "^5.0.0", @@ -12376,7 +12428,7 @@ "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", - "postcss-selector-parser": "^6.0.10", + "postcss-selector-parser": "^6.0.11", "postcss-value-parser": "^4.2.0", "resolve-from": "^5.0.0", "string-width": "^4.2.3", @@ -12584,9 +12636,9 @@ } }, "node_modules/stylelint/node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz", + "integrity": "sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==", "dev": true, "engines": { "node": ">= 4" @@ -13236,15 +13288,15 @@ } }, "node_modules/w3c-xmlserializer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz", - "integrity": "sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", "dev": true, "dependencies": { "xml-name-validator": "^4.0.0" }, "engines": { - "node": ">=12" + "node": ">=14" } }, "node_modules/walker": { @@ -13592,6 +13644,20 @@ "integrity": "sha512-+u76oB43nOHrF4DDWRLWDCtci7f3QJoEBigemIdIeTi1ODqjx6Tad9NCVnPRwewWlKkVab5PlK8DCtPTyX7S8g==", "dev": true }, + "@adyen/adyen-web": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@adyen/adyen-web/-/adyen-web-5.29.0.tgz", + "integrity": "sha512-zoflOQ/uxbSlW+wZqX2N+8AwAj3Y6pCPsOw1gWVC0f9AaITjwE4peNxkYtmJKwpkM+3Eaq3I13iramsn15u3nw==", + "requires": { + "@babel/runtime": "^7.15.4", + "@babel/runtime-corejs3": "^7.19.1", + "@types/applepayjs": "^3.0.4", + "@types/googlepay": "^0.6.2", + "classnames": "^2.3.1", + "core-js-pure": "^3.25.3", + "preact": "10.11.2" + } + }, "@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", @@ -13627,25 +13693,25 @@ } }, "@babel/compat-data": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.1.tgz", - "integrity": "sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ==" + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.5.tgz", + "integrity": "sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g==" }, "@babel/core": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.2.tgz", - "integrity": "sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.5.tgz", + "integrity": "sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ==", "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.2", + "@babel/generator": "^7.20.5", "@babel/helper-compilation-targets": "^7.20.0", "@babel/helper-module-transforms": "^7.20.2", - "@babel/helpers": "^7.20.1", - "@babel/parser": "^7.20.2", + "@babel/helpers": "^7.20.5", + "@babel/parser": "^7.20.5", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2", + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -13654,11 +13720,11 @@ } }, "@babel/generator": { - "version": "7.20.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.4.tgz", - "integrity": "sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.5.tgz", + "integrity": "sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==", "requires": { - "@babel/types": "^7.20.2", + "@babel/types": "^7.20.5", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -13706,9 +13772,9 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.2.tgz", - "integrity": "sha512-k22GoYRAHPYr9I+Gvy2ZQlAe5mGy8BqWst2wRt8cwIufWTxrsVshhIBvYNqC80N0GSFWTsqRVexOtfzlgOEDvA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.5.tgz", + "integrity": "sha512-3RCdA/EmEaikrhayahwToF0fpweU/8o2p8vhc1c/1kftHOdTKuC65kik/TLc+qfbS8JKw4qqJbne4ovICDhmww==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", @@ -13721,13 +13787,13 @@ } }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz", - "integrity": "sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz", + "integrity": "sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", - "regexpu-core": "^5.1.0" + "regexpu-core": "^5.2.1" } }, "@babel/helper-define-polyfill-provider": { @@ -13887,25 +13953,25 @@ "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==" }, "@babel/helper-wrap-function": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.19.0.tgz", - "integrity": "sha512-txX8aN8CZyYGTwcLhlk87KRqncAzhh5TpQamZUa0/u3an36NtDpUP6bQgBCBcLeBs09R/OwQu3OjK0k/HwfNDg==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz", + "integrity": "sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==", "dev": true, "requires": { "@babel/helper-function-name": "^7.19.0", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" } }, "@babel/helpers": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.1.tgz", - "integrity": "sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg==", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.6.tgz", + "integrity": "sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w==", "requires": { "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.0" + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" } }, "@babel/highlight": { @@ -13919,9 +13985,9 @@ } }, "@babel/parser": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.3.tgz", - "integrity": "sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==" + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz", + "integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==" }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { "version": "7.18.6", @@ -14081,14 +14147,14 @@ } }, "@babel/plugin-proposal-private-property-in-object": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.18.6.tgz", - "integrity": "sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz", + "integrity": "sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2", "@babel/plugin-syntax-private-property-in-object": "^7.14.5" } }, @@ -14302,9 +14368,9 @@ } }, "@babel/plugin-transform-block-scoping": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.2.tgz", - "integrity": "sha512-y5V15+04ry69OV2wULmwhEA6jwSWXO1TwAtIwiPXcvHcoOQUqpyMVd2bDsQJMW8AurjulIyUV8kDqtjSwHy1uQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.5.tgz", + "integrity": "sha512-WvpEIW9Cbj9ApF3yJCjIEEf1EiNJLtXagOrL5LNWEZOo3jv8pmPoYTSNJQvqej8OavVlgOoOPw6/htGZro6IkA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.20.2" @@ -14456,13 +14522,13 @@ } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.19.1.tgz", - "integrity": "sha512-oWk9l9WItWBQYS4FgXD4Uyy5kq898lvkXpXQxoJEY1RnvPk4R/Dvu2ebXU9q8lP+rlMwUQTFf2Ok6d78ODa0kw==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz", + "integrity": "sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-create-regexp-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2" } }, "@babel/plugin-transform-new-target": { @@ -14485,9 +14551,9 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.3.tgz", - "integrity": "sha512-oZg/Fpx0YDrj13KsLyO8I/CX3Zdw7z0O9qOd95SqcoIzuqy/WTGWvePeHAnZCN54SfdyjHcb1S30gc8zlzlHcA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.5.tgz", + "integrity": "sha512-h7plkOmcndIUWXZFLgpbrh2+fXAi47zcUX7IrOQuZdLD0I0KvjJ6cvo3BEcAOsDOcZhVKGJqv07mkSqK0y2isQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.20.2" @@ -14544,13 +14610,13 @@ } }, "@babel/plugin-transform-regenerator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.6.tgz", - "integrity": "sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz", + "integrity": "sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.18.6", - "regenerator-transform": "^0.15.0" + "@babel/helper-plugin-utils": "^7.20.2", + "regenerator-transform": "^0.15.1" } }, "@babel/plugin-transform-reserved-words": { @@ -14752,21 +14818,20 @@ } }, "@babel/runtime": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.1.tgz", - "integrity": "sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.6.tgz", + "integrity": "sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA==", "requires": { - "regenerator-runtime": "^0.13.10" + "regenerator-runtime": "^0.13.11" } }, "@babel/runtime-corejs3": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.20.1.tgz", - "integrity": "sha512-CGulbEDcg/ND1Im7fUNRZdGXmX2MTWVVZacQi/6DiKE5HNwZ3aVTm5PV4lO8HHz0B2h8WQyvKKjbX5XgTtydsg==", - "dev": true, + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.20.6.tgz", + "integrity": "sha512-tqeujPiuEfcH067mx+7otTQWROVMKHXEaOQcAeNV5dDdbPWvPcFA8/W9LXw2NfjNmOetqLl03dfnG2WALPlsRQ==", "requires": { "core-js-pure": "^3.25.1", - "regenerator-runtime": "^0.13.10" + "regenerator-runtime": "^0.13.11" } }, "@babel/template": { @@ -14780,26 +14845,26 @@ } }, "@babel/traverse": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.1.tgz", - "integrity": "sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.5.tgz", + "integrity": "sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ==", "requires": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.1", + "@babel/generator": "^7.20.5", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.1", - "@babel/types": "^7.20.0", + "@babel/parser": "^7.20.5", + "@babel/types": "^7.20.5", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.2.tgz", - "integrity": "sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", + "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", "requires": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", @@ -14943,16 +15008,16 @@ "integrity": "sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==" }, "@floating-ui/core": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.0.1.tgz", - "integrity": "sha512-bO37brCPfteXQfFY0DyNDGB3+IMe4j150KFQcgJ5aBP295p9nBGeHEs/p0czrRbtlHq4Px/yoPXO/+dOCcF4uA==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.0.4.tgz", + "integrity": "sha512-FPFLbg2b06MIw1dqk2SOEMAMX3xlrreGjcui5OTxfBDtaKTmh0kioOVjT8gcfl58juawL/yF+S+gnq8aUYQx/Q==" }, "@floating-ui/dom": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.0.4.tgz", - "integrity": "sha512-maYJRv+sAXTy4K9mzdv0JPyNW5YPVHrqtY90tEdI6XNpuLOP26Ci2pfwPsKBA/Wh4Z3FX5sUrtUFTdMYj9v+ug==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.0.9.tgz", + "integrity": "sha512-nF9P6/BoARdt+h+CdUW3td4EUVngeDONCGuzRgnZveRZiJETx63cxhinE0JaPPC2tbcdTY9IGZocS5/7ag3xRg==", "requires": { - "@floating-ui/core": "^1.0.1" + "@floating-ui/core": "^1.0.4" } }, "@istanbuljs/load-nyc-config": { @@ -15109,9 +15174,9 @@ } }, "ci-info": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz", - "integrity": "sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.0.tgz", + "integrity": "sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==", "dev": true }, "color-convert": { @@ -15611,9 +15676,9 @@ } }, "@reduxjs/toolkit": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.0.tgz", - "integrity": "sha512-ak11IrjYcUXRqlhNPwnz6AcvA2ynJTu8PzDbbqQw4a3xR4KZtgiqbNblQD+10CRbfK4+5C79SOyxnT9dhBqFnA==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.1.tgz", + "integrity": "sha512-HikrdY+IDgRfRYlCTGUQaiCxxDDgM1mQrRbZ6S1HFZX5ZYuJ4o8EstNmhTwHdPl2rTmLxzwSu0b3AyeyTlR+RA==", "requires": { "immer": "^9.0.16", "redux": "^4.2.0", @@ -15637,9 +15702,9 @@ "dev": true }, "@sinonjs/commons": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.5.tgz", - "integrity": "sha512-rTpCA0wG1wUxglBSFdMMY0oTrKYvgf4fNgv/sXbfCVAdf+FnPBdKJR/7XbpTCwbCrvCbdPYnlWaUUYz4V2fPDA==", + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", + "integrity": "sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==", "dev": true, "requires": { "type-detect": "4.0.8" @@ -15818,6 +15883,11 @@ "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==" }, + "@types/applepayjs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/applepayjs/-/applepayjs-3.0.4.tgz", + "integrity": "sha512-RqaVZWy1Kj4e1PoUoOI8uA+4UuuLpicQFxfU9Y/xWJFZFT6mFB4PiiY911iDxFk7pdvaj5HKH7VsWRisRca1Rg==" + }, "@types/aria-query": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.2.tgz", @@ -15857,9 +15927,9 @@ } }, "@types/babel__traverse": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.2.tgz", - "integrity": "sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg==", + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.3.tgz", + "integrity": "sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==", "dev": true, "requires": { "@babel/types": "^7.3.0" @@ -15875,6 +15945,11 @@ "@types/node": "*" } }, + "@types/googlepay": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/@types/googlepay/-/googlepay-0.6.4.tgz", + "integrity": "sha512-PTt/UCllzl8z5HmhymPpSj6uENZvVKZvCBYdDVmbBVJnLStitxtWrterAOQZkKGlqVdzxNXYeif5hOAMNMS5mw==" + }, "@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -15918,9 +15993,9 @@ } }, "@types/jest": { - "version": "29.2.3", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.2.3.tgz", - "integrity": "sha512-6XwoEbmatfyoCjWRX7z0fKMmgYKe9+/HrviJ5k0X/tjJWHGAezZOfYaxqQKuzG/TvQyr+ktjm4jgbk0s4/oF2w==", + "version": "29.2.4", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.2.4.tgz", + "integrity": "sha512-PipFB04k2qTRPePduVLTRiPzQfvMeLwUN3Z21hsAKaB/W9IIzgB2pizCL466ftJlcyZqnHoC9ZHpxLGl3fS86A==", "dev": true, "requires": { "expect": "^29.0.0", @@ -15982,9 +16057,9 @@ "dev": true }, "@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", + "version": "18.11.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.11.tgz", + "integrity": "sha512-KJ021B1nlQUBLopzZmPBVuGU9un7WJd/W4ya7Ih02B4Uwky5Nja0yGYav2EfYIk0RR2Q9oVhf60S2XR1BCWJ2g==", "dev": true }, "@types/normalize-package-data": { @@ -16010,9 +16085,9 @@ "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" }, "@types/react": { - "version": "18.0.25", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.25.tgz", - "integrity": "sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==", + "version": "18.0.26", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.26.tgz", + "integrity": "sha512-hCR3PJQsAIXyxhTNSiDFY//LhnMZWpNNr5etoCqx/iUfGc5gXWtQR2Phl908jVR6uPXacojQWTg4qRpkxTuGug==", "requires": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -16074,9 +16149,9 @@ "dev": true }, "@types/yargs": { - "version": "17.0.13", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.13.tgz", - "integrity": "sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==", + "version": "17.0.17", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.17.tgz", + "integrity": "sha512-72bWxFKTK6uwWJAVT+3rF6Jo6RTojiJ27FQo8Rf60AL+VZbzoVPnMFhKsUnbjR8A3BTCYQ7Mv3hnl8T0A+CX9g==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -16205,9 +16280,9 @@ "dev": true }, "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "requires": { "normalize-path": "^3.0.0", @@ -16275,6 +16350,19 @@ "es-shim-unscopables": "^1.0.0" } }, + "array.prototype.tosorted": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.1.tgz", + "integrity": "sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.1.3" + } + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -16698,9 +16786,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001431", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz", - "integrity": "sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==" + "version": "1.0.30001436", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001436.tgz", + "integrity": "sha512-ZmWkKsnC2ifEPoWUvSAIGyOYwT+keAaaWPHiQ9DfMqS1t6tfuyFYoWR78TeZtznkEQ64+vGXH9cZrElwR2Mrxg==" }, "chalk": { "version": "2.4.2", @@ -16753,6 +16841,11 @@ "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", "dev": true }, + "classnames": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -16963,8 +17056,7 @@ "core-js-pure": { "version": "3.26.1", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.26.1.tgz", - "integrity": "sha512-VVXcDpp/xJ21KdULRq/lXdLzQAtX7+37LzpyfFM973il0tWSsDEoyzG38G14AjTpK9VTfiNM9jnFauq/CpaWGQ==", - "dev": true + "integrity": "sha512-VVXcDpp/xJ21KdULRq/lXdLzQAtX7+37LzpyfFM973il0tWSsDEoyzG38G14AjTpK9VTfiNM9jnFauq/CpaWGQ==" }, "cosmiconfig": { "version": "5.2.1", @@ -17169,9 +17261,9 @@ } }, "decimal.js": { - "version": "10.4.2", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.2.tgz", - "integrity": "sha512-ic1yEvwT6GuvaYwBLLY6/aFFgjZdySKTE8en/fkU3QICTmRtgtSlFn0u0BXN06InZwtfCelR7j8LRiDI/02iGA==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", "dev": true }, "dedent": { @@ -17425,9 +17517,9 @@ } }, "es-abstract": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.4.tgz", - "integrity": "sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==", + "version": "1.20.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.5.tgz", + "integrity": "sha512-7h8MM2EQhsCA7pU/Nv78qOXFpD8Rhqd12gYiSJVkrH9+e8VuA8JlPJK/hQjjlLv6pJvx/z1iRFKzYb0XT/RuAQ==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -17436,6 +17528,7 @@ "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.3", "get-symbol-description": "^1.0.0", + "gopd": "^1.0.1", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", "has-symbols": "^1.0.3", @@ -17451,8 +17544,8 @@ "object.assign": "^4.1.4", "regexp.prototype.flags": "^1.4.3", "safe-regex-test": "^1.0.0", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", "unbox-primitive": "^1.0.2" } }, @@ -17799,25 +17892,26 @@ } }, "eslint-plugin-react": { - "version": "7.31.10", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.10.tgz", - "integrity": "sha512-e4N/nc6AAlg4UKW/mXeYWd3R++qUano5/o+t+wnWxIf+bLsOaH3a4q74kX3nDjYym3VBN4HyO9nEn1GcAqgQOA==", + "version": "7.31.11", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.11.tgz", + "integrity": "sha512-TTvq5JsT5v56wPa9OYHzsrOlHzKZKjV+aLgS+55NJP/cuzdiQPC7PfYoUjMoxlffKtvijpk7vA/jmuqRb9nohw==", "dev": true, "requires": { - "array-includes": "^3.1.5", - "array.prototype.flatmap": "^1.3.0", + "array-includes": "^3.1.6", + "array.prototype.flatmap": "^1.3.1", + "array.prototype.tosorted": "^1.1.1", "doctrine": "^2.1.0", "estraverse": "^5.3.0", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.1.2", - "object.entries": "^1.1.5", - "object.fromentries": "^2.0.5", - "object.hasown": "^1.1.1", - "object.values": "^1.1.5", + "object.entries": "^1.1.6", + "object.fromentries": "^2.0.6", + "object.hasown": "^1.1.2", + "object.values": "^1.1.6", "prop-types": "^15.8.1", "resolve": "^2.0.0-next.3", "semver": "^6.3.0", - "string.prototype.matchall": "^4.0.7" + "string.prototype.matchall": "^4.0.8" }, "dependencies": { "doctrine": { @@ -18075,9 +18169,9 @@ "dev": true }, "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", + "integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -18378,9 +18472,9 @@ }, "dependencies": { "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz", + "integrity": "sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==", "dev": true }, "slash": { @@ -19444,9 +19538,9 @@ } }, "ci-info": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz", - "integrity": "sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.0.tgz", + "integrity": "sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==", "dev": true }, "color-convert": { @@ -20414,9 +20508,9 @@ } }, "ci-info": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz", - "integrity": "sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.0.tgz", + "integrity": "sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==", "dev": true }, "color-convert": { @@ -20659,18 +20753,18 @@ } }, "jsdom": { - "version": "20.0.2", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.2.tgz", - "integrity": "sha512-AHWa+QO/cgRg4N+DsmHg1Y7xnz+8KU3EflM0LVDTdmrYOc1WWTSkOjtpUveQH+1Bqd5rtcVnb/DuxV/UjDO4rA==", + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", "dev": true, "requires": { "abab": "^2.0.6", - "acorn": "^8.8.0", + "acorn": "^8.8.1", "acorn-globals": "^7.0.0", "cssom": "^0.5.0", "cssstyle": "^2.3.0", "data-urls": "^3.0.2", - "decimal.js": "^10.4.1", + "decimal.js": "^10.4.2", "domexception": "^4.0.0", "escodegen": "^2.0.0", "form-data": "^4.0.0", @@ -20683,12 +20777,12 @@ "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^3.0.0", + "w3c-xmlserializer": "^4.0.0", "webidl-conversions": "^7.0.0", "whatwg-encoding": "^2.0.0", "whatwg-mimetype": "^3.0.0", "whatwg-url": "^11.0.0", - "ws": "^8.9.0", + "ws": "^8.11.0", "xml-name-validator": "^4.0.0" }, "dependencies": { @@ -20773,12 +20867,12 @@ "dev": true }, "language-tags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz", - "integrity": "sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.6.tgz", + "integrity": "sha512-HNkaCgM8wZgE/BZACeotAAgpL9FUjEnhgF0FVQMIgH//zqTPreLYMb3rWYkYAqPoF75Jwuycp1da7uz66cfFQg==", "dev": true, "requires": { - "language-subtag-registry": "~0.3.2" + "language-subtag-registry": "^0.3.20" } }, "leven": { @@ -21663,9 +21757,9 @@ } }, "parse5": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.1.tgz", - "integrity": "sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dev": true, "requires": { "entities": "^4.4.0" @@ -21823,9 +21917,9 @@ "requires": {} }, "postcss-selector-parser": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", - "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "version": "6.0.11", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz", + "integrity": "sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==", "dev": true, "requires": { "cssesc": "^3.0.0", @@ -21838,6 +21932,11 @@ "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", "dev": true }, + "preact": { + "version": "10.11.2", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.11.2.tgz", + "integrity": "sha512-skAwGDFmgxhq1DCBHke/9e12ewkhc7WYwjuhHB8HHS8zkdtITXLRmUMTeol2ldxvLwYtwbFeifZ9uDDWuyL4Iw==" + }, "prefix-style": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/prefix-style/-/prefix-style-2.0.1.tgz", @@ -22047,9 +22146,9 @@ } }, "react-select": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.6.1.tgz", - "integrity": "sha512-dYNRswtxUHW+F1Sc0HnxO5ryecPIAsG0+Cwyq5EIXZJBxCxUG2hFfQz41tc++30/2ISuuPglDikc4hEb4NsiuA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.0.tgz", + "integrity": "sha512-lJGiMxCa3cqnUr2Jjtg9YHsaytiZqeNOKeibv6WF5zbK/fPegZ1hg3y/9P1RZVLhqBTs0PfqQLKuAACednYGhQ==", "requires": { "@babel/runtime": "^7.12.0", "@emotion/cache": "^11.4.0", @@ -22182,14 +22281,14 @@ } }, "regenerator-runtime": { - "version": "0.13.10", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz", - "integrity": "sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw==" + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" }, "regenerator-transform": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.0.tgz", - "integrity": "sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg==", + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz", + "integrity": "sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==", "dev": true, "requires": { "@babel/runtime": "^7.8.4" @@ -22757,9 +22856,9 @@ } }, "stylelint": { - "version": "14.15.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.15.0.tgz", - "integrity": "sha512-JOgDAo5QRsqiOZPZO+B9rKJvBm64S0xasbuRPAbPs6/vQDgDCnZLIiw6XcAS6GQKk9k1sBWR6rmH3Mfj8OknKg==", + "version": "14.16.0", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.16.0.tgz", + "integrity": "sha512-X6uTi9DcxjzLV8ZUAjit1vsRtSwcls0nl07c9rqOPzvpA8IvTX/xWEkBRowS0ffevRrqkHa/ThDEu86u73FQDg==", "dev": true, "requires": { "@csstools/selector-specificity": "^2.0.2", @@ -22775,7 +22874,7 @@ "globby": "^11.1.0", "globjoin": "^0.1.4", "html-tags": "^3.2.0", - "ignore": "^5.2.0", + "ignore": "^5.2.1", "import-lazy": "^4.0.0", "imurmurhash": "^0.1.4", "is-plain-object": "^5.0.0", @@ -22789,7 +22888,7 @@ "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", - "postcss-selector-parser": "^6.0.10", + "postcss-selector-parser": "^6.0.11", "postcss-value-parser": "^4.2.0", "resolve-from": "^5.0.0", "string-width": "^4.2.3", @@ -22897,9 +22996,9 @@ } }, "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz", + "integrity": "sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==", "dev": true }, "json-schema-traverse": { @@ -23447,9 +23546,9 @@ "integrity": "sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==" }, "w3c-xmlserializer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz", - "integrity": "sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", "dev": true, "requires": { "xml-name-validator": "^4.0.0" diff --git a/package.json b/package.json index 237bbc266..60f277f6c 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "styled-components": ">= 4" }, "dependencies": { + "@adyen/adyen-web": "5.29.0", "@reduxjs/toolkit": "^1.7.2", "camelcase": "^5.3.1", "dotenv": "6.2.0", diff --git a/src/api/Auth/loginCustomer.js b/src/api/Auth/loginCustomer.js index c47d46ddb..9b0f9a8ae 100644 --- a/src/api/Auth/loginCustomer.js +++ b/src/api/Auth/loginCustomer.js @@ -1,5 +1,4 @@ import { fetchWithHeaders } from 'util/fetchHelper'; -import { sendMessage } from 'util/appConfigHelper'; import getApiURL from 'util/environmentHelper'; const loginCustomer = async (email, password, loginBy) => { @@ -16,9 +15,6 @@ const loginCustomer = async (email, password, loginBy) => { }) }); const json = await resp.json(); - sendMessage({ - ...json.responseData - }); return { status: resp.status, ...json diff --git a/src/api/Auth/registerCustomer.js b/src/api/Auth/registerCustomer.js index 84cb31089..dbc18145a 100644 --- a/src/api/Auth/registerCustomer.js +++ b/src/api/Auth/registerCustomer.js @@ -1,4 +1,3 @@ -import { sendMessage } from 'util/appConfigHelper'; import { fetchWithHeaders } from 'util/fetchHelper'; import getApiURL from 'util/environmentHelper'; @@ -25,9 +24,6 @@ const registerCustomer = async ( }) }); const json = await resp.json(); - sendMessage({ - ...json.responseData - }); return { status: resp.status, ...json diff --git a/src/api/Customer/getOfferDetails.js b/src/api/Customer/getOfferDetails.js index 6a5270834..7f0ddf088 100644 --- a/src/api/Customer/getOfferDetails.js +++ b/src/api/Customer/getOfferDetails.js @@ -15,7 +15,17 @@ const getOfferDetails = async offerId => { } const url = `${API_URL}/offers/${offerId}/customers/${customerEmail}`; - return fetchWithHeaders(url, {}).then(res => res.json()); + return fetchWithHeaders(url, {}) + .then(async res => { + const { responseData, errors } = await res.json(); + if (!res.ok) { + throw new Error(errors[0]); + } + return responseData; + }) + .catch(err => { + throw new Error(err); + }); }; export default getOfferDetails; diff --git a/src/api/Order/createOrder.js b/src/api/Order/createOrder.js index 75c6192e5..b7e3354d0 100644 --- a/src/api/Order/createOrder.js +++ b/src/api/Order/createOrder.js @@ -16,7 +16,17 @@ const createOrder = (offerId, paymentMethodId = 0) => { customerId, paymentMethodId }) - }).then(res => res.json()); + }) + .then(async res => { + const { responseData, errors } = await res.json(); + if (!res.ok) { + throw new Error(errors[0]); + } + return responseData; + }) + .catch(err => { + throw new Error(err); + }); }; export default createOrder; diff --git a/src/api/Order/getOrder.js b/src/api/Order/getOrder.js index 8403a7674..3cffc8110 100644 --- a/src/api/Order/getOrder.js +++ b/src/api/Order/getOrder.js @@ -7,7 +7,17 @@ const getOrder = orderId => { return fetchWithJWT(url, { method: 'GET' - }).then(res => res.json()); + }) + .then(async res => { + const { responseData, errors } = await res.json(); + if (!res.ok) { + throw new Error(errors[0]); + } + return responseData; + }) + .catch(err => { + throw new Error(err); + }); }; export default getOrder; diff --git a/src/api/Order/updateOrder.js b/src/api/Order/updateOrder.js index e2da00291..6a1c4f0ab 100644 --- a/src/api/Order/updateOrder.js +++ b/src/api/Order/updateOrder.js @@ -8,7 +8,17 @@ const updateOrder = (orderId, params) => { return fetchWithJWT(url, { method: 'PATCH', body: JSON.stringify({ ...params }) - }).then(res => res.json()); + }) + .then(async res => { + const { responseData, errors } = await res.json(); + if (!res.ok) { + throw new Error(errors[0]); + } + return responseData; + }) + .catch(err => { + throw new Error(err); + }); }; export default updateOrder; diff --git a/src/api/Payment/createPaymentSession.js b/src/api/Payment/createPaymentSession.js new file mode 100644 index 000000000..fa228a9e6 --- /dev/null +++ b/src/api/Payment/createPaymentSession.js @@ -0,0 +1,25 @@ +import { getData } from 'util/appConfigHelper'; +import fetchWithJWT from 'util/fetchHelper'; +import getApiURL from 'util/environmentHelper'; + +const createPaymentSession = async isMyAccount => { + const API_URL = getApiURL(); + + const orderId = parseInt(getData('CLEENG_ORDER_ID') || '0', 10); + + const url = `${API_URL}/connectors/adyen/sessions`; + + try { + const res = await fetchWithJWT(url, { + method: 'POST', + body: isMyAccount + ? JSON.stringify({ returnUrl: 'https://cleeng.com' }) + : JSON.stringify({ orderId, returnUrl: 'https://cleeng.com' }) + }); + return res.json(); + } catch (e) { + return e; + } +}; + +export default createPaymentSession; diff --git a/src/api/Payment/submitPayment.js b/src/api/Payment/submitPayment.js index 21770e87f..ed0fabb24 100644 --- a/src/api/Payment/submitPayment.js +++ b/src/api/Payment/submitPayment.js @@ -2,16 +2,23 @@ import { getData } from 'util/appConfigHelper'; import fetchWithJWT from 'util/fetchHelper'; import getApiURL from 'util/environmentHelper'; -const submitPayment = async card => { +const submitPayment = async (paymentMethod, browserInfo, billingAddress) => { const API_URL = getApiURL(); const orderId = parseInt(getData('CLEENG_ORDER_ID') || '0', 10); - const url = `${API_URL}/connectors/adyen/payments`; + const url = `${API_URL}/connectors/adyen/initial-payment`; try { const res = await fetchWithJWT(url, { method: 'POST', - body: JSON.stringify({ orderId, card }) + body: JSON.stringify({ + orderId, + paymentMethod, + browserInfo, + billingAddress, + origin: window.location.origin, + returnUrl: 'https://cleeng.com' + }) }); return res.json(); } catch (e) { diff --git a/src/api/Payment/submitPaymentWithoutDetails.js b/src/api/Payment/submitPaymentWithoutDetails.js index 52f760f51..17698400a 100644 --- a/src/api/Payment/submitPaymentWithoutDetails.js +++ b/src/api/Payment/submitPaymentWithoutDetails.js @@ -7,15 +7,20 @@ const submitPaymentWithoutDetails = async () => { const orderId = parseInt(getData('CLEENG_ORDER_ID') || '0', 10); const url = `${API_URL}/payments`; - try { - const res = await fetchWithJWT(url, { - method: 'POST', - body: JSON.stringify({ orderId }) + return fetchWithJWT(url, { + method: 'POST', + body: JSON.stringify({ orderId }) + }) + .then(async res => { + const { responseData, errors } = await res.json(); + if (!res.ok) { + throw new Error(errors[0]); + } + return responseData; + }) + .catch(err => { + throw new Error(err); }); - return res.json(); - } catch (e) { - return e; - } }; export default submitPaymentWithoutDetails; diff --git a/src/api/PaymentDetails/updateAdyenPaymentDetails.js b/src/api/PaymentDetails/updateAdyenPaymentDetails.js index d8170fd64..1ad60c068 100644 --- a/src/api/PaymentDetails/updateAdyenPaymentDetails.js +++ b/src/api/PaymentDetails/updateAdyenPaymentDetails.js @@ -1,14 +1,25 @@ import fetchWithJWT from 'util/fetchHelper'; import getApiURL from 'util/environmentHelper'; -const updateAdyenPaymentDetails = async (paymentMethodId, card) => { +const updateAdyenPaymentDetails = async ( + paymentMethodId, + paymentMethod, + browserInfo, + billingAddress +) => { const API_URL = getApiURL(); - const url = `${API_URL}/connectors/adyen/payment_details`; + const url = `${API_URL}/connectors/adyen/payment-details`; try { const res = await fetchWithJWT(url, { method: 'POST', - body: JSON.stringify({ card, paymentMethodId }) + body: JSON.stringify({ + paymentMethod, + paymentMethodId, + browserInfo, + billingAddress, + returnUrl: 'https://cleeng.com' + }) }); return res.json(); } catch (e) { diff --git a/src/api/index.js b/src/api/index.js index b8328f68b..5f4d5b6d7 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -23,6 +23,7 @@ import getPaymentMethods from './Publisher/getPaymentMethods'; import getConsents from './Publisher/getConsents'; import getOrder from './Order/getOrder'; import updateSwitch from './Customer/updateSwitch'; +import updatePayPalPaymentDetails from './PaymentDetails/updatePayPalPaymentDetails'; export { getPaymentDetails, @@ -49,5 +50,6 @@ export { getPaymentMethods, getConsents, getOrder, - updateSwitch + updateSwitch, + updatePayPalPaymentDetails }; diff --git a/src/assets/images/chevron.svg b/src/assets/images/chevron.svg new file mode 100644 index 000000000..b4ee96d5d --- /dev/null +++ b/src/assets/images/chevron.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/images/paymentMethods/PPicon.svg b/src/assets/images/paymentMethods/PPicon.svg new file mode 100644 index 000000000..5e8ab4588 --- /dev/null +++ b/src/assets/images/paymentMethods/PPicon.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/src/assets/images/paymentMethods/PayPalColor.svg b/src/assets/images/paymentMethods/PayPalColor.svg new file mode 100644 index 000000000..b8d910827 --- /dev/null +++ b/src/assets/images/paymentMethods/PayPalColor.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/assets/images/paymentMethods/googlepay.svg b/src/assets/images/paymentMethods/googlepay.svg new file mode 100644 index 000000000..db0e9a912 --- /dev/null +++ b/src/assets/images/paymentMethods/googlepay.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/src/assets/images/paymentMethods/payment-paypal.svg b/src/assets/images/paymentMethods/payment-paypal.svg new file mode 100644 index 000000000..1ea6f6953 --- /dev/null +++ b/src/assets/images/paymentMethods/payment-paypal.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Adyen/Adyen.js b/src/components/Adyen/Adyen.js index c65cb8005..7d30458ec 100644 --- a/src/components/Adyen/Adyen.js +++ b/src/components/Adyen/Adyen.js @@ -1,159 +1,194 @@ /* eslint-disable react/jsx-props-no-spreading */ -import React, { Component } from 'react'; +import React, { useState, useEffect, useRef } from 'react'; import PropTypes from 'prop-types'; -import Button from 'components/Button'; -import Loader from 'components/Loader'; import { withTranslation } from 'react-i18next'; import labeling from 'containers/labeling'; -import { FontColor } from 'styles/variables'; -import { getData } from 'util/appConfigHelper'; -import { AdyenStyled, ConfirmButtonStyled } from './AdyenStyled'; - -const COMPONENT_CONTAINER_ID = 'component-container'; -const PAYMENT_METHOD_CARD = 'card'; - -class Adyen extends Component { - constructor(props) { - super(props); - this.state = { - isLoaded: false - }; - } - - componentDidMount() { - if (window.AdyenCheckout === undefined) { - this.loadAdyenStylesheet() - .then(this.loadAdyenScript) - .then(this.renderCheckout) - .then(() => { - this.setState({ - isLoaded: true - }); - }); - } else { - this.renderCheckout(); - this.setState({ - isLoaded: true - }); - } - } +import AdyenCheckout from '@adyen/adyen-web'; +import createPaymentSession from 'api/Payment/createPaymentSession'; +import usePrevious from 'util/usePreviousHook'; +import useScript from 'util/useScriptHook'; +import { useSelector } from 'react-redux'; +import { AdyenStyled } from './AdyenStyled'; +import '@adyen/adyen-web/dist/adyen.css'; +import eventDispatcher, { MSSDK_ADYEN_ERROR } from '../../util/eventDispatcher'; +import Loader from '../Loader'; +import { + getAdyenEnv, + getAdyenClientKey, + getGooglePayEnv +} from './util/getAdyenConfig'; +import adyenTranslations from './util/AdyenTranslations'; - onError = e => { - const { error, fieldType } = e; - window.dispatchEvent( - new CustomEvent('MSSDK:Adyen-error', { - detail: { - error, - fieldType - } - }) - ); - }; +const Adyen = ({ + onSubmit, + isMyAccount, + selectPaymentMethod, + isPayPalAvailable, + selectedPaymentMethod, + getDropIn, + onAdditionalDetails +}) => { + const { totalPrice, discount } = useSelector(state => state.order.order); + const [isLoading, setIsLoading] = useState(true); + const containerRef = useRef(null); + const [dropInInstance, setDropInInstance] = useState(null); + const prevTotalPrice = usePrevious(totalPrice); + useScript('https://pay.google.com/gp/p/js/pay.js'); - getAdyenEnv = () => - getData('CLEENG_ENVIRONMENT') === 'production' ? 'live' : 'test'; - - loadAdyenStylesheet = () => { - const ADYEN_STYLESHEET_HREF = `https://checkoutshopper-${this.getAdyenEnv()}.adyen.com/checkoutshopper/sdk/3.11.4/adyen.css`; - return new Promise((resolve, reject) => { - const linkEl = document.createElement('link'); - linkEl.onload = resolve; - linkEl.onerror = reject; - linkEl.rel = 'stylesheet'; - linkEl.href = ADYEN_STYLESHEET_HREF; - document.body.append(linkEl); + const onError = e => { + const { error, fieldType } = e; + eventDispatcher(MSSDK_ADYEN_ERROR, { + error, + fieldType }); }; - // we won't test chain loading resources from Adyen - /* istanbul ignore next */ - loadAdyenScript = () => { - const ADYEN_SCRIPT_HREF = `https://checkoutshopper-${this.getAdyenEnv()}.adyen.com/checkoutshopper/sdk/3.10.1/adyen.js`; - return new Promise((resolve, reject) => { - const scriptEl = document.createElement('script'); - scriptEl.onload = resolve; - scriptEl.onerror = reject; - scriptEl.src = ADYEN_SCRIPT_HREF; - document.body.append(scriptEl); - }); + const onSelect = ({ + data: { + paymentMethod: { type } + } + }) => { + if (type === 'scheme') { + selectPaymentMethod('card'); + return; + } + selectPaymentMethod(type); }; - renderCheckout = () => { - const { onSubmit, onChange } = this.props; - const configuration = { - showPayButton: false, - hasHolderName: true, - holderNameRequired: true, - environment: this.getAdyenEnv(), - clientKey: - this.getAdyenEnv() === 'live' - ? 'live_BQDOFBYTGZB3XKF62GBYSLPUJ4YW2TPL' - : 'test_I4OFGUUCEVB5TI222AS3N2Y2LY6PJM3K', - onSubmit, - onChange, - onError: this.onError + const createDropInInstance = async ({ + id, + sessionData, + shopperStatement: merchantName, + amount, + countryCode, + paymentMethods + }) => { + const amountObj = { + amount, + countryCode }; + const applePayConfigurationObj = + paymentMethods && + paymentMethods.find(item => item.type === 'applepay')?.configuration; + const googlePayConfigurationObj = + paymentMethods && + paymentMethods.find(item => item.type === 'googlepay')?.configuration; - const cardConfiguration = { - styles: { - base: { - color: FontColor + const configuration = { + locale: 'en-US', + translations: adyenTranslations, + environment: getAdyenEnv(), + analytics: { + enabled: true // analytics data for Adyen + }, + session: { + id, + sessionData + }, + clientKey: getAdyenClientKey(), + onSubmit, + // onPaymentCompleted, TODO: most likely not needed, will be reviewed with redirect flow https://docs.adyen.com/online-payments/web-drop-in#handle-redirect-result + onAdditionalDetails, + onError, + paymentMethodsConfiguration: { + card: { + hasHolderName: true, + holderNameRequired: true, + billingAddressRequired: true // required for 3DS + }, + applepay: { + ...amountObj, + ...(applePayConfigurationObj && { + configuration: { + merchantName, + merchantId: applePayConfigurationObj.merchantId + } + }) + }, + googlepay: { + environment: getGooglePayEnv(), + ...(googlePayConfigurationObj && { + configuration: { + merchantName, + gatewayMerchantId: googlePayConfigurationObj.gatewayMerchantId, + merchantId: googlePayConfigurationObj.merchantId + } + }), + ...amountObj } } }; - this.checkout = new window.AdyenCheckout(configuration) - .create(PAYMENT_METHOD_CARD, cardConfiguration) - .mount(`#${COMPONENT_CONTAINER_ID}`); + const checkout = await AdyenCheckout(configuration); + if (containerRef.current) { + const dropin = checkout.create('dropin', { + onSelect, + openFirstPaymentMethod: !window.matchMedia('(max-width:991px)').matches + }); + dropin.mount(containerRef.current); + setDropInInstance(dropin); + getDropIn(dropin); + } + setIsLoading(false); }; - render() { - const { isLoaded } = this.state; - const { t, isPaymentProcessing, isCheckout } = this.props; - const myAccountProps = { - size: 'normal', - width: '60%', - margin: 'auto' - }; - const confirmButtonText = isCheckout ? t('Complete purchase') : t('Update'); - - return ( - -
- {isLoaded && ( - - - - )} - - ); - } -} + const createSession = async () => { + const { responseData } = await createPaymentSession(isMyAccount); + if (responseData?.id) { + createDropInInstance(responseData); + } + }; + + useEffect(() => { + createSession(); + }, []); + + useEffect(() => { + if ( + !isMyAccount && + dropInInstance && + prevTotalPrice !== totalPrice && + discount.applied + ) { + // recreate dropin when coupon was applied + dropInInstance.unmount(); + getDropIn(null); + setIsLoading(true); + createSession(); // recreate Adyen Instance if price was changed + } + }, [totalPrice]); + + useEffect(() => { + if (!selectedPaymentMethod || !dropInInstance) { + return; + } + + if (selectedPaymentMethod === 'paypal') { + dropInInstance.closeActivePaymentMethod(); + } + }, [selectedPaymentMethod]); + + return ( + + {isLoading && } +
+ + ); +}; + Adyen.propTypes = { - t: PropTypes.func, onSubmit: PropTypes.func.isRequired, - onChange: PropTypes.func, - isPaymentProcessing: PropTypes.bool, - isCheckout: PropTypes.bool + isMyAccount: PropTypes.bool, + selectPaymentMethod: PropTypes.func.isRequired, + isPayPalAvailable: PropTypes.bool.isRequired, + selectedPaymentMethod: PropTypes.string, + getDropIn: PropTypes.func.isRequired, + onAdditionalDetails: PropTypes.func.isRequired }; Adyen.defaultProps = { - t: k => k, - onChange: () => {}, - isPaymentProcessing: false, - isCheckout: true + selectedPaymentMethod: '', + isMyAccount: false }; export { Adyen as PureAdyen }; diff --git a/src/components/Adyen/AdyenStyled.js b/src/components/Adyen/AdyenStyled.js index 8887ff36b..bf06cf9b4 100644 --- a/src/components/Adyen/AdyenStyled.js +++ b/src/components/Adyen/AdyenStyled.js @@ -3,14 +3,16 @@ import { FontColor, ConfirmColor, ErrorColor, - BackgroundColor + LineColor, + White } from 'styles/variables'; export const AdyenStyled = styled.div.attrs(() => ({ className: 'msd__payment__adyen' }))` - max-width: 320px; + max-width: 375px; margin: 12px auto 0 auto; + ${props => props.isMyAccount && css` @@ -20,9 +22,15 @@ export const AdyenStyled = styled.div.attrs(() => ({ opacity: 0.8; } `} + .adyen-checkout__button.adyen-checkout__button--pay { + background: ${ConfirmColor}; + border-radius: 30px; + } + .adyen-checkout__payment-method__details__content { + margin: 2px 0 20px; + } - .adyen-checkout__label--focused - .adyen-checkout__label__text { + .adyen-checkout__label--focused .adyen-checkout__label__text { color: ${FontColor}; opacity: 1; } @@ -44,23 +52,84 @@ export const AdyenStyled = styled.div.attrs(() => ({ .adyen-checkout__input:active:hover, .adyen-checkout__input:focus, .adyen-checkout__input:focus:hover { - border: 1px solid rgb(81 83 100 / 80%); + border: 1px solid ${ConfirmColor}; box-shadow: 0 0 5px 2px #f3f3f3; } + .adyen-checkout__spinner { border: 3px solid ${FontColor}; border-top-color: transparent; } + .adyen-checkout__input--valid { border-bottom-color: ${ConfirmColor}; } - .adyen-checkout__input { - background-color: ${BackgroundColor}; + + .adyen-checkout__input, + .adyen-checkout__dropdown__button { color: ${FontColor} !important; + border-color: #d8ddea; + box-shadow: none; + } + .adyen-checkout__dropdown__button--active { + border: 1px solid ${ConfirmColor}; + box-shadow: 0 0 5px 2px #f3f3f3; } - .input-field { + + .input-field, + .adyen-checkout__dropdown__list { color: ${FontColor} !important; } + + .adyen-checkout__payment-method { + border: 1px solid ${LineColor}; + margin: 0; + } + + .adyen-checkout__payment-method:not(:first-child) { + border-radius: 0; + } + + .adyen-checkout__payment-method:first-child { + border-radius: 12px 12px 0 0; + } + + .adyen-checkout__payment-method:last-child { + border-radius: ${({ isAdditionalPayment }) => + isAdditionalPayment ? 'none' : '12px'}; + } + + .adyen-checkout__payment-method__radio { + display: none; + } + + .adyen-checkout__payment-method__header { + padding: 12px 16px 12px 12px; + position: relative; + } + + .adyen-checkout__payment-method--selected { + border-color: ${ConfirmColor}; + background-color: ${White}; + } + + .adyen-checkout__payment-method__brands { + padding-right: 35px; + } + + .adyen-checkout__payment-method--selected + .adyen-checkout__payment-method__header:before { + rotate: 180deg; + } + + .adyen-checkout__payment-method__header:before { + content: url("data:image/svg+xml;charset=UTF-8,%3csvg id='Component_60_1' data-name='Component 60 – 1' xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3e%3cg id='Group_3522' data-name='Group 3522' transform='translate(-1246 -422)'%3e%3cg id='Group_3513' data-name='Group 3513' transform='translate(1246 422)'%3e%3cg id='Group_3515' data-name='Group 3515'%3e%3cpath id='Path_2546' data-name='Path 2546' d='M7316.21-6266.358l4.922,4.921,4.921-4.921' transform='translate(-7311.131 6274.746)' fill='none' stroke='%23a5a5a5' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.2'/%3e%3cg id='Ellipse_461' data-name='Ellipse 461' transform='translate(0)' fill='none' stroke='%23a5a5a5' stroke-width='1.2'%3e%3ccircle cx='10' cy='10' r='10' stroke='none'/%3e%3ccircle cx='10' cy='10' r='9.4' fill='none'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e "); + display: block; + width: 20px; + height: 20px; + position: absolute; + right: 16px; + } `; export const ConfirmButtonStyled = styled.div` diff --git a/src/components/Adyen/util/AdyenTranslations.js b/src/components/Adyen/util/AdyenTranslations.js new file mode 100644 index 000000000..905413b4c --- /dev/null +++ b/src/components/Adyen/util/AdyenTranslations.js @@ -0,0 +1,8 @@ +const adyenTranslations = { + 'en-US': { + 'creditCard.holderName.invalid': 'Cardholder name is not valid', + 'error.va.sf-cc-dat.01': 'Expiry date is in the past' + } +}; + +export default adyenTranslations; diff --git a/src/components/Adyen/util/getAdyenConfig.js b/src/components/Adyen/util/getAdyenConfig.js new file mode 100644 index 000000000..5b78fe1fe --- /dev/null +++ b/src/components/Adyen/util/getAdyenConfig.js @@ -0,0 +1,13 @@ +import { getData } from 'util/appConfigHelper'; + +const CLIENT_KEY_LIVE = 'live_BQDOFBYTGZB3XKF62GBYSLPUJ4YW2TPL'; +const CLIENT_KEY_TEST = 'test_I4OFGUUCEVB5TI222AS3N2Y2LY6PJM3K'; + +export const getAdyenEnv = () => + getData('CLEENG_ENVIRONMENT') !== 'production' ? 'test' : 'live'; + +export const getAdyenClientKey = () => + getAdyenEnv() === 'test' ? CLIENT_KEY_TEST : CLIENT_KEY_LIVE; + +export const getGooglePayEnv = () => + getAdyenEnv() === 'test' ? 'TEST' : 'PRODUCTION'; diff --git a/src/components/Button/ButtonStyled.js b/src/components/Button/ButtonStyled.js index d5742a5a3..0d2081c90 100644 --- a/src/components/Button/ButtonStyled.js +++ b/src/components/Button/ButtonStyled.js @@ -53,7 +53,7 @@ const ButtonStyled = styled.button.attrs(props => ({ font-size: 13px; font-weight: 600; `} - + ${props => (props.theme === 'confirm' && css` diff --git a/src/components/Checkout/Checkout.js b/src/components/Checkout/Checkout.js index 56ca21c12..ee3d84065 100644 --- a/src/components/Checkout/Checkout.js +++ b/src/components/Checkout/Checkout.js @@ -11,6 +11,8 @@ import ThankYouPage from 'components/ThankYouPage'; import Auth from 'services/auth'; import PasswordResetSuccess from 'components/PasswordResetSuccess'; import { getData } from 'util/appConfigHelper'; +import { connect } from 'react-redux'; +import { init } from 'redux/publisherConfigSlice'; const CheckoutSteps = { LOGIN: { @@ -48,6 +50,10 @@ class Checkout extends Component { } componentDidMount() { + const { initValues, offerId } = this.props; + initValues({ + offerId + }); if (Auth.isLogged()) { this.setState({ currentStep: 3 @@ -63,12 +69,7 @@ class Checkout extends Component { render() { const { currentStep } = this.state; - const { - onSuccess, - offerId, - availablePaymentMethods, - resetPasswordCallback - } = this.props; + const { onSuccess, offerId, resetPasswordCallback } = this.props; switch (currentStep) { case 0: @@ -102,7 +103,6 @@ class Checkout extends Component { return ( this.goToStep(CheckoutSteps.PURCHASE.nextStep)} /> ); @@ -131,22 +131,21 @@ class Checkout extends Component { Checkout.propTypes = { offerId: PropTypes.string, - availablePaymentMethods: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.number, - methodName: PropTypes.string, - default: PropTypes.bool - }) - ), onSuccess: PropTypes.func, - resetPasswordCallback: PropTypes.func + resetPasswordCallback: PropTypes.func, + initValues: PropTypes.func.isRequired }; Checkout.defaultProps = { offerId: null, - availablePaymentMethods: null, onSuccess: () => {}, resetPasswordCallback: () => {} }; -export default Checkout; +export const mapDispatchToProps = dispatch => ({ + initValues: values => { + dispatch(init(values)); + } +}); + +export default connect(null, mapDispatchToProps)(Checkout); diff --git a/src/components/CheckoutPriceBox/CheckoutPriceBox.js b/src/components/CheckoutPriceBox/CheckoutPriceBox.js index 2ec24a62e..ffc39a7cc 100644 --- a/src/components/CheckoutPriceBox/CheckoutPriceBox.js +++ b/src/components/CheckoutPriceBox/CheckoutPriceBox.js @@ -3,7 +3,9 @@ import PropTypes from 'prop-types'; import formatNumber from 'util/formatNumber'; import { withTranslation } from 'react-i18next'; import labeling from 'containers/labeling'; +import { currencyFormat } from 'util/planHelper'; +import { useSelector } from 'react-redux'; import { StyledTotalLabel, StyledOfferPrice, @@ -14,111 +16,97 @@ import { StyledPriceWrapper } from './CheckoutPriceBoxStyled'; -const CheckoutPriceBox = ({ - isCouponApplied, - finalPrice, - discountAmount, - taxValue, - customerServiceFee, - paymentMethodFee, - customerCurrencySymbol, - offerPrice, - taxRate, - country, - t -}) => ( - - - - {t('Price')} - - {`${customerCurrencySymbol}${formatNumber(offerPrice)} `} - {country === 'US' ? t('excl. Tax') : t('excl. VAT')} - - +const CheckoutPriceBox = ({ t }) => { + const { + priceBreakdown: { + offerPrice, + discountAmount, + taxValue, + customerServiceFee, + paymentMethodFee + }, + discount: { applied: isCouponApplied }, + taxRate, + country, + totalPrice: finalPrice, + currency + } = useSelector(state => state.order.order); - {isCouponApplied && ( + return ( + + - {t('Coupon Discount')} + {t('Price')} - - {customerCurrencySymbol} - {formatNumber(discountAmount)} + {`${currencyFormat[currency]}${formatNumber(offerPrice)} `} + {country === 'US' ? t('excl. Tax') : t('excl. VAT')} - )} - {(taxValue !== 0 || taxRate !== 0) && ( - - - {country === 'US' ? t('Applicable Tax') : t('Applicable VAT')} - - - {taxValue ? ( - `${customerCurrencySymbol}${formatNumber(taxValue)}` - ) : ( - <> - )} - {!taxValue && taxRate && isCouponApplied && ( -

- {customerCurrencySymbol} {formatNumber(taxRate * offerPrice)} -

- )} -
-
- )} - {customerServiceFee !== 0 && ( - - {t('Service Fee')} - - {`${customerCurrencySymbol}${formatNumber(customerServiceFee)}`} - - - )} + {isCouponApplied && ( + + {t('Coupon Discount')} + + - {currencyFormat[currency]} + {formatNumber(discountAmount)} + + + )} + {(taxValue !== 0 || taxRate !== 0) && ( + + + {country === 'US' ? t('Applicable Tax') : t('Applicable VAT')} + + + {taxValue ? ( + `${currencyFormat[currency]}${formatNumber(taxValue)}` + ) : ( + <> + )} + {!taxValue && taxRate && isCouponApplied && ( +

+ {currencyFormat[currency]}{' '} + {formatNumber(taxRate * offerPrice)} +

+ )} +
+
+ )} + + {customerServiceFee !== 0 && ( + + {t('Service Fee')} + + {`${currencyFormat[currency]}${formatNumber(customerServiceFee)}`} + + + )} + + {paymentMethodFee !== 0 && ( + + {t('Payment Method Fee')} + + {`${currencyFormat[currency]}${formatNumber(paymentMethodFee)}`} + + + )} - {paymentMethodFee !== 0 && ( - {t('Payment Method Fee')} - - {`${customerCurrencySymbol}${formatNumber(paymentMethodFee)}`} - + {t('Total')} + + {`${currencyFormat[currency]}${formatNumber(finalPrice)}`} + - )} - - - {t('Total')} - - {`${customerCurrencySymbol}${formatNumber(finalPrice)}`} - - -
-
-); +
+
+ ); +}; CheckoutPriceBox.propTypes = { - customerCurrencySymbol: PropTypes.string, - offerPrice: PropTypes.number, - discountAmount: PropTypes.number, - taxValue: PropTypes.number, - taxRate: PropTypes.number, - customerServiceFee: PropTypes.number, - paymentMethodFee: PropTypes.number, - isCouponApplied: PropTypes.bool, - finalPrice: PropTypes.number, - country: PropTypes.string, t: PropTypes.func }; CheckoutPriceBox.defaultProps = { - customerCurrencySymbol: '', - offerPrice: 0, - discountAmount: 0, - taxRate: 0, - taxValue: 0, - customerServiceFee: 0, - paymentMethodFee: 0, - isCouponApplied: false, - finalPrice: 0, - country: '', t: k => k }; diff --git a/src/components/CouponInput/CouponInput.js b/src/components/CouponInput/CouponInput.js index b63ce2bdc..fbb447881 100644 --- a/src/components/CouponInput/CouponInput.js +++ b/src/components/CouponInput/CouponInput.js @@ -28,11 +28,13 @@ class CouponInput extends Component { } componentDidUpdate(prevProps) { - const { showMessage, message, messageType } = this.props; + const { + couponDetails: { showMessage, message, messageType } + } = this.props; if ( - showMessage !== prevProps.showMessage || - message !== prevProps.message || - messageType !== prevProps.messageType + showMessage !== prevProps.couponDetails.showMessage || + message !== prevProps.couponDetails.message || + messageType !== prevProps.couponDetails.messageType ) { this.disableSuppressMessage(); this.clearFadeOutTimeout(); @@ -118,10 +120,8 @@ class CouponInput extends Component { render() { const { - showMessage, + couponDetails: { message, messageType, showMessage }, fullWidth, - message, - messageType, value, onChange, couponLoading, @@ -188,33 +188,35 @@ class CouponInput extends Component { CouponInput.propTypes = { value: PropTypes.string, - showMessage: PropTypes.bool, fullWidth: PropTypes.bool, - message: PropTypes.node, - messageType: PropTypes.oneOf([MESSAGE_TYPE_FAIL, MESSAGE_TYPE_SUCCESS]), + couponDetails: PropTypes.shape({ + showMessage: PropTypes.bool, + message: PropTypes.node, + messageType: PropTypes.oneOf([MESSAGE_TYPE_FAIL, MESSAGE_TYPE_SUCCESS]) + }), onSubmit: PropTypes.func.isRequired, onChange: PropTypes.func, onClose: PropTypes.func, onInputToggle: PropTypes.func, t: PropTypes.func, - couponLoading: PropTypes.bool, + couponLoading: PropTypes.bool.isRequired, source: PropTypes.oneOf(['myaccount', 'checkout', '']) }; CouponInput.defaultProps = { value: '', - showMessage: false, + couponDetails: { + showMessage: false, + message: '', + messageType: MESSAGE_TYPE_SUCCESS + }, fullWidth: false, - message: null, - messageType: MESSAGE_TYPE_FAIL, onChange: () => {}, onClose: () => {}, onInputToggle: () => {}, t: k => k, - couponLoading: false, source: '' }; export { CouponInput as PureCouponInput }; - export default withTranslation()(labeling()(CouponInput)); diff --git a/src/components/FreeOffer/FreeOffer.js b/src/components/FreeOffer/FreeOffer.js index cd7147163..826aae93a 100644 --- a/src/components/FreeOffer/FreeOffer.js +++ b/src/components/FreeOffer/FreeOffer.js @@ -1,12 +1,12 @@ -import React, { Component } from 'react'; +import React, { useCallback } from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; -import submitPaymentWithoutDetails from 'api/Payment/submitPaymentWithoutDetails'; -import { getData } from 'util/appConfigHelper'; import { periodMapper, dateFormat } from 'util/planHelper'; import labeling from 'containers/labeling'; import Button from 'components/Button'; import Loader from 'components/Loader'; +import { useDispatch, useSelector } from 'react-redux'; +import { submitPaymentWithoutDetails } from 'redux/paymentSlice'; import { WrapStyled, TitleStyled, @@ -18,17 +18,16 @@ import { ErrorMessageStyled } from './FreeOfferStyled'; -class FreeOffer extends Component { - constructor(props) { - super(props); - this.state = { - isLoading: false, - error: '' - }; - } +const FreeOffer = ({ onPaymentComplete, t }) => { + const { loading: isLoading, error } = useSelector(state => state.payment); + const { period, expiresAt, startTime, offerTitle, offerId } = useSelector( + state => state.offer.offer + ); + const dispatch = useDispatch(); - generateDescriptionForFreeOffer = (period, expiresAt, startTime) => { - const offerType = getData('CLEENG_OFFER_ID').charAt(0); + const offerType = offerId?.charAt(0); + const icon = period || offerType; + const generateDescriptionForFreeOffer = () => { switch (offerType) { case 'S': { return `Free subscription`; @@ -52,98 +51,47 @@ class FreeOffer extends Component { } }; - getAccessToFreeOffer = () => { - const { onPaymentComplete, t } = this.props; - this.setState({ - isLoading: true, - error: '' - }); - submitPaymentWithoutDetails().then(paymentReponse => { - if (paymentReponse.errors.length) { - if ( - paymentReponse.errors[0].includes( - "Order doesn't have paymentMethodId" - ) - ) { - this.setState({ - isLoading: false, - error: t( - 'Unable to proceed, because of wrong offer settings. Please, contact the owner of the offer' - ) - }); - } else { - this.setState({ - isLoading: false, - error: t( - 'Oops, something went wrong! Please, reload the page and try again' - ) - }); - } - } else { - onPaymentComplete(); - } - }); - }; + const getAccessToFreeOffer = useCallback(() => { + dispatch(submitPaymentWithoutDetails()) + .unwrap() + .then(onPaymentComplete); + }, []); - render() { - const { - icon, - period, - expiresAt, - startTime, - title, - offerId, - t - } = this.props; - const { isLoading, error } = this.state; - return ( - - - - {t(`offer-title-${offerId}`, title)} - - {this.generateDescriptionForFreeOffer(period, expiresAt, startTime)} - - - - {error && {error}} - - {t('Free, no additional cost')} - - - ); - } -} + return ( + + + + {t(`offer-title-${offerId}`, offerTitle)} + + {generateDescriptionForFreeOffer()} + + + + {error && {t(error)}} + + {t('Free, no additional cost')} + + + ); +}; FreeOffer.propTypes = { - icon: PropTypes.string, - title: PropTypes.string, - period: PropTypes.string, - expiresAt: PropTypes.string, - startTime: PropTypes.number, onPaymentComplete: PropTypes.func.isRequired, - offerId: PropTypes.string, t: PropTypes.func }; FreeOffer.defaultProps = { - icon: '', - title: '', - period: '', - expiresAt: null, - startTime: null, - offerId: '', t: k => k }; diff --git a/src/components/Input/InputStyled.js b/src/components/Input/InputStyled.js index 60abef615..327523037 100644 --- a/src/components/Input/InputStyled.js +++ b/src/components/Input/InputStyled.js @@ -1,6 +1,13 @@ import styled, { css } from 'styled-components'; -import * as Colors from '../../styles/variables'; -import { media } from '../../styles/BreakPoints'; +import { + FontColor, + BackgroundColor, + ConfirmColor, + ErrorColor, + TextFieldBorderFilter, + PasswordStrengthColors +} from 'styles/variables'; +import { media } from 'styles/BreakPoints'; export const InputComponentStyled = styled.div` display: flex; @@ -21,7 +28,7 @@ export const LabelStyled = styled.label.attrs(() => ({ margin: 0; padding: 0 3px; - color: ${Colors.FontColor}; + color: ${FontColor}; transition: 200ms cubic-bezier(0, 0, 0.2, 1) 0ms; ${props => @@ -39,7 +46,7 @@ export const LabelStyled = styled.label.attrs(() => ({ width: 100%; height: 15px; - background: ${Colors.BackgroundColor}; + background: ${BackgroundColor}; z-index: -1; opacity: 0; @@ -73,13 +80,13 @@ export const InputElementWrapperStyled = styled.div.attrs(() => ({ padding: 13px 0 14px; background: transparent; - border: 1px solid ${Colors.MediumGrey}; + border: 1px solid #b7bfca; transition: 0.2s ease-in-out; &:focus-within { - border-color: ${Colors.ConfirmColor}; + border-color: ${ConfirmColor}; ${LabelStyled} { - color: ${Colors.ConfirmColor}; + color: ${ConfirmColor}; transform: translate(0, -25px) scaleY(0.9); &::after { opacity: 1; @@ -105,7 +112,7 @@ export const InputElementStyled = styled.input.attrs(() => ({ margin: 0 15px; - color: ${Colors.FontColor}; + color: ${FontColor}; background: transparent; border: none; outline: none; @@ -115,7 +122,7 @@ export const InputElementStyled = styled.input.attrs(() => ({ &:focus + label { transform: translate(0, -25px) scaleY(0.9); - color: ${Colors.ConfirmColor}; + color: ${ConfirmColor}; ${props => props.withIcon && css` @@ -167,13 +174,13 @@ export const ErrorWrapper = styled.div.attrs(() => ({ margin-top: 8px; content: ''; - color: ${Colors.ErrorColor}; + color: ${ErrorColor}; transition: 0.2s ease-in-out; ${props => props.passwordStrength && css` - color: ${Colors[props.passwordStrength]}; + color: ${PasswordStrengthColors[props.passwordStrength]}; `} font-size: 13px; @@ -193,7 +200,7 @@ export const StyledPasswordVisibility = styled.img.attrs(() => ({ }))` height: 20px; width: 20px; - filter: ${Colors.TextFieldBorderFilter}; + filter: ${TextFieldBorderFilter}; `; export const StyledButton = styled.button` @@ -234,7 +241,7 @@ export const InputRequiredStyled = styled.span.attrs(() => ({ font-size: 12px; line-height: 12px; top: 50%; - color: ${Colors.ErrorColor}; + color: ${ErrorColor}; transform: translate(0, -50%); z-index: 1; `; diff --git a/src/components/Offer/Offer.js b/src/components/Offer/Offer.js index d62ce916b..c87ce987c 100644 --- a/src/components/Offer/Offer.js +++ b/src/components/Offer/Offer.js @@ -1,19 +1,16 @@ import React, { Component } from 'react'; +import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import labeling from 'containers/labeling'; -import CouponInput from 'components/CouponInput/CouponInput'; +import CouponInput from 'containers/CouponInput/CouponInput.container'; import { MESSAGE_TYPE_FAIL, MESSAGE_TYPE_SUCCESS } from 'components/Input'; import Payment from 'components/Payment'; import Header from 'components/Header'; import SectionHeader from 'components/SectionHeader'; import Footer from 'components/Footer'; -import OfferCard from 'components/OfferCard'; import CheckoutPriceBox from 'components/CheckoutPriceBox'; import FreeOffer from 'components/FreeOffer'; -import { getData } from 'util/appConfigHelper'; -import { periodMapper, dateFormat } from 'util/planHelper'; -import formatNumber from 'util/formatNumber'; import { StyledOfferBody, StyledOfferWrapper, @@ -21,6 +18,7 @@ import { StyledOfferCouponWrapper, OfferCardWrapperStyled } from './OfferStyled'; +import OfferCheckoutCard from '../OfferCheckoutCard'; class Offer extends Component { constructor(props) { @@ -30,260 +28,57 @@ class Offer extends Component { }; } - getReadablePeriod = period => { - switch (period) { - case 'week': - return 'week.'; - case 'month': - return 'month.'; - case '3months': - return '3 months.'; - case '6months': - return '6 months.'; - case 'year': - return 'year.'; - default: - return ''; - } - }; - - generateDescription = offerType => { - const { t } = this.props; - switch (offerType) { - case 'S': { - const { - offerDetails: { - freePeriods, - freeDays, - trialAvailable, - period, - customerCurrencySymbol - }, - orderDetails: { - priceBreakdown: { offerPrice }, - taxRate, - country - } - } = this.props; - const grossPrice = formatNumber(offerPrice + taxRate * offerPrice); - let taxCopy = 'VAT'; - if (country === 'US') taxCopy = 'Tax'; - if (trialAvailable) { - if (freeDays) { - const description = `You will be charged {{customerCurrencySymbol}}{{grossPrice}} (incl. {{taxCopy}}) after {{freeDays}} days.
Next payments will occur every ${this.getReadablePeriod( - period - )}`; - return t( - `subscription-desc.trial-days.period-${period}`, - description, - { - customerCurrencySymbol, - grossPrice, - taxCopy, - freeDays - } - ); - } - if (freePeriods) { - let description = - 'You will be charged {{customerCurrencySymbol}}{{grossPrice}} (incl. {{taxCopy}}) '; - switch (period) { - case 'month': - if (freePeriods === 1) { - description += - 'after month.
Next payments will occur every month.'; - } else { - description += - 'after {{freePeriods}} months.
Next payments will occur every month.'; - } - break; - case 'week': - if (freePeriods === 1) { - description += - 'after week.
Next payments will occur every week.'; - } else { - description += - 'after {{freePeriods}} weeks.
Next payments will occur every week.'; - } - break; - default: - description = ''; - } - return t( - `subscription-desc.trial-period${ - freePeriods === 1 ? '' : 's' - }.period-${period}`, - description, - { - customerCurrencySymbol, - grossPrice, - taxCopy, - freePeriods - } - ); - } - } - const description = `You will be charged {{customerCurrencySymbol}}{{grossPrice}} (incl. {{taxCopy}}) every ${this.getReadablePeriod( - period - )}`; - return t(`subscription-desc.period-${period}`, description, { - customerCurrencySymbol, - grossPrice, - taxCopy - }); - } - case 'P': { - const { - offerDetails: { period, expiresAt } - } = this.props; - if (!period) { - const date = dateFormat(expiresAt, true); - return t('pass-desc.date', `Access until {{date}}`, { date }); - } - return periodMapper[period] - ? `${periodMapper[period].accessText} season pass` - : ''; - } - case 'E': { - const { - offerDetails: { startTime } - } = this.props; - return `Pay-per-view event ${ - startTime ? dateFormat(startTime, true) : '' - }`; - } - case 'R': { - const { - offerDetails: { period } - } = this.props; - return periodMapper[period] - ? `${periodMapper[period].accessText} access` - : ''; - } - case 'A': - return t('Unlimited access'); - default: - return ''; - } - }; - render() { const { - offerDetails: { - offerTitle, - customerCurrencySymbol, - trialAvailable, - period, - expiresAt, - startTime, - offerId - }, - orderDetails, - orderDetails: { - priceBreakdown: { - offerPrice, - discountAmount, - taxValue, - customerServiceFee, - paymentMethodFee - }, - discount: { applied }, - totalPrice, - requiredPaymentDetails, - taxRate, - country - }, - couponProps: { - showMessage, - message, - messageType, - onSubmit, - couponLoading - }, + trialAvailable, + discountApplied, + totalPrice, + couponProps: { onSubmit }, onPaymentComplete, - updatePriceBreakdown, - availablePaymentMethods, t } = this.props; - const isCouponApplied = applied; const { coupon } = this.state; - const finalPrice = totalPrice; - const offerType = getData('CLEENG_OFFER_ID').charAt(0); - const isFree = totalPrice === 0 && !trialAvailable && !isCouponApplied; + const isFree = totalPrice === 0 && !trialAvailable && !discountApplied; + + if (isFree) { + return ( + +
+
+ +
+ + ); + } + return (
- {isFree ? ( - - ) : ( - <> - - - {t('Complete your purchase')} - - <> - - - - - - this.setState({ coupon: e })} - couponLoading={couponLoading} - source="checkout" - /> - - - - - - - - )} + <> + + + {t('Complete your purchase')} + + <> + + + + + + this.setState({ coupon: e })} + source="checkout" + /> + + + + + + +