@akinon/next 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/hooks/use-payment-options.ts +10 -15
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import plugins from '
|
|
2
|
-
import
|
|
3
|
-
import { useAppSelector } from '
|
|
4
|
-
import { RootState } from '
|
|
1
|
+
import plugins from 'plugins';
|
|
2
|
+
import Settings from 'settings';
|
|
3
|
+
import { useAppSelector } from '../redux/hooks';
|
|
4
|
+
import { RootState } from 'redux/store';
|
|
5
5
|
|
|
6
6
|
export const usePaymentOptions = () => {
|
|
7
7
|
const { paymentOptions } = useAppSelector(
|
|
@@ -21,27 +21,22 @@ export const usePaymentOptions = () => {
|
|
|
21
21
|
|
|
22
22
|
const isInitialTypeIncluded = (type: string) => initialTypes.has(type);
|
|
23
23
|
|
|
24
|
-
const isPluginMapIncluded = (type: string) =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
};
|
|
24
|
+
const isPluginMapIncluded = (type: string) =>
|
|
25
|
+
paymentTypeToPluginMap[type]
|
|
26
|
+
? plugins.includes(paymentTypeToPluginMap[type])
|
|
27
|
+
: false;
|
|
31
28
|
|
|
32
29
|
const isExtraTypeIncluded = (type: string) => {
|
|
33
|
-
const extraPaymentTypes =
|
|
34
|
-
|
|
30
|
+
const extraPaymentTypes = Settings?.checkout?.extraPaymentTypes || [];
|
|
35
31
|
return (
|
|
36
32
|
extraPaymentTypes.includes(type) &&
|
|
37
33
|
!initialTypes.has(type) &&
|
|
38
|
-
!paymentTypeToPluginMap
|
|
34
|
+
!paymentTypeToPluginMap[type]
|
|
39
35
|
);
|
|
40
36
|
};
|
|
41
37
|
|
|
42
38
|
const filteredPaymentOptions = paymentOptions.filter((option) => {
|
|
43
39
|
const { payment_type } = option;
|
|
44
|
-
|
|
45
40
|
return (
|
|
46
41
|
isInitialTypeIncluded(payment_type) ||
|
|
47
42
|
isPluginMapIncluded(payment_type) ||
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/next",
|
|
3
3
|
"description": "Core package for Project Zero Next",
|
|
4
|
-
"version": "1.13.
|
|
4
|
+
"version": "1.13.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@typescript-eslint/eslint-plugin": "6.7.4",
|
|
27
27
|
"@typescript-eslint/parser": "6.7.4",
|
|
28
28
|
"eslint": "^8.14.0",
|
|
29
|
-
"@akinon/eslint-plugin-projectzero": "1.13.
|
|
29
|
+
"@akinon/eslint-plugin-projectzero": "1.13.1",
|
|
30
30
|
"eslint-config-prettier": "8.5.0"
|
|
31
31
|
}
|
|
32
32
|
}
|