@graphcommerce/mollie-magento-payment 8.1.0-canary.3 → 8.1.0-canary.5
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
CHANGED
|
@@ -1,8 +1,63 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 8.1.0-canary.
|
|
3
|
+
## 8.1.0-canary.5
|
|
4
4
|
|
|
5
|
-
## 8.
|
|
5
|
+
## 8.0.6-canary.4
|
|
6
|
+
|
|
7
|
+
## 8.0.6-canary.3
|
|
8
|
+
|
|
9
|
+
## 8.0.6-canary.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`530076e`](https://github.com/graphcommerce-org/graphcommerce/commit/530076e3664703cb8b577b7fcf1998a420819f60) - Moved all usages of useFormPersist to the <FormPersist/> component to prevent rerenders.
|
|
14
|
+
([@FrankHarland](https://github.com/FrankHarland))
|
|
15
|
+
|
|
16
|
+
## 8.0.6-canary.1
|
|
17
|
+
|
|
18
|
+
## 8.0.6-canary.0
|
|
19
|
+
|
|
20
|
+
## 8.0.5
|
|
21
|
+
|
|
22
|
+
## 8.0.5-canary.10
|
|
23
|
+
|
|
24
|
+
## 8.0.5-canary.9
|
|
25
|
+
|
|
26
|
+
## 8.0.5-canary.8
|
|
27
|
+
|
|
28
|
+
## 8.0.5-canary.7
|
|
29
|
+
|
|
30
|
+
## 8.0.5-canary.6
|
|
31
|
+
|
|
32
|
+
## 8.0.5-canary.5
|
|
33
|
+
|
|
34
|
+
## 8.0.5-canary.4
|
|
35
|
+
|
|
36
|
+
## 8.0.5-canary.3
|
|
37
|
+
|
|
38
|
+
## 8.0.5-canary.2
|
|
39
|
+
|
|
40
|
+
## 8.0.5-canary.1
|
|
41
|
+
|
|
42
|
+
## 8.0.5-canary.0
|
|
43
|
+
|
|
44
|
+
## 8.0.4
|
|
45
|
+
|
|
46
|
+
## 8.0.4-canary.1
|
|
47
|
+
|
|
48
|
+
## 8.0.4-canary.0
|
|
49
|
+
|
|
50
|
+
## 8.0.3
|
|
51
|
+
|
|
52
|
+
## 8.0.3-canary.6
|
|
53
|
+
|
|
54
|
+
## 8.0.3-canary.5
|
|
55
|
+
|
|
56
|
+
## 8.0.3-canary.4
|
|
57
|
+
|
|
58
|
+
## 8.0.3-canary.3
|
|
59
|
+
|
|
60
|
+
## 8.0.3-canary.2
|
|
6
61
|
|
|
7
62
|
## 8.0.3-canary.1
|
|
8
63
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SelectElement } from '@graphcommerce/ecommerce-ui'
|
|
2
2
|
import { useFormGqlMutationCart } from '@graphcommerce/magento-cart'
|
|
3
3
|
import { PaymentOptionsProps } from '@graphcommerce/magento-cart-payment-method'
|
|
4
|
-
import { FormRow,
|
|
5
|
-
import {
|
|
4
|
+
import { FormRow, filterNonNullableKeys } from '@graphcommerce/next-ui'
|
|
5
|
+
import { FormPersist, useFormCompose } from '@graphcommerce/react-hook-form'
|
|
6
6
|
import { SetMolliePaymentMethodIssuerOnCartDocument } from './SetMolliePaymentMethodIssuerOnCart.gql'
|
|
7
7
|
|
|
8
8
|
type MollieIssuerOptionsProps = PaymentOptionsProps & {
|
|
@@ -20,20 +20,19 @@ export function MollieIssuerOptions(props: MollieIssuerOptionsProps) {
|
|
|
20
20
|
|
|
21
21
|
const { handleSubmit, formState, required, control } = form
|
|
22
22
|
const submit = handleSubmit(() => {})
|
|
23
|
-
const valid = useFormValidFields(form, required)
|
|
24
23
|
|
|
25
|
-
// Since the issuer isn't retrievable from Magento we persist this value.
|
|
26
|
-
useFormPersist({
|
|
27
|
-
form,
|
|
28
|
-
name: `PaymentMethodOptions_${code}`,
|
|
29
|
-
persist: ['issuer'],
|
|
30
|
-
storage: 'localStorage',
|
|
31
|
-
})
|
|
32
24
|
useFormCompose({ form, step, submit, key: `PaymentMethodOptions_${code}` })
|
|
33
25
|
|
|
34
26
|
return (
|
|
35
27
|
<>
|
|
36
28
|
<form onSubmit={submit} noValidate>
|
|
29
|
+
<FormPersist
|
|
30
|
+
// Since the issuer isn't retrievable from Magento we persist this value.
|
|
31
|
+
form={form}
|
|
32
|
+
name={`PaymentMethodOptions_${code}`}
|
|
33
|
+
persist={['issuer']}
|
|
34
|
+
storage='localStorage'
|
|
35
|
+
/>
|
|
37
36
|
<FormRow>
|
|
38
37
|
<SelectElement
|
|
39
38
|
control={control}
|
|
@@ -43,9 +42,7 @@ export function MollieIssuerOptions(props: MollieIssuerOptionsProps) {
|
|
|
43
42
|
helperText={formState.isSubmitted && formState.errors.issuer?.message}
|
|
44
43
|
label={label}
|
|
45
44
|
required={required.issuer}
|
|
46
|
-
|
|
47
|
-
endAdornment: <InputCheckmark show={valid.issuer} select />,
|
|
48
|
-
}}
|
|
45
|
+
showValid
|
|
49
46
|
options={filterNonNullableKeys(mollie_available_issuers, ['code', 'name']).map(
|
|
50
47
|
(option) => ({
|
|
51
48
|
id: option.code,
|
|
@@ -12,6 +12,12 @@ import { MollieField } from './MollieField'
|
|
|
12
12
|
import { SetMolliePaymentMethodTokenOnCartDocument } from './SetMolliePaymentMethodTokenOnCart.gql'
|
|
13
13
|
import { mollieContext, MollieContext } from './mollieContext'
|
|
14
14
|
|
|
15
|
+
declare global {
|
|
16
|
+
interface Window {
|
|
17
|
+
Mollie?: Mollie
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
export function MollieCreditCardOptions(props: PaymentOptionsProps) {
|
|
16
22
|
const { code, step, Container } = props
|
|
17
23
|
const [loaded, setLoaded] = useState<boolean>(false)
|
|
@@ -38,11 +44,9 @@ export function MollieCreditCardOptions(props: PaymentOptionsProps) {
|
|
|
38
44
|
useFormCompose({ form, step, submit, key: `PaymentMethodOptions_${code}` })
|
|
39
45
|
|
|
40
46
|
useEffect(() => {
|
|
41
|
-
// @ts-expect-error window.Mollie is not defined in TS
|
|
42
47
|
if (!window.Mollie || mollie) return
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
const mollieInstance = (window.Mollie as Mollie)('pfl_Ah5xUV4c6z', {
|
|
49
|
+
const mollieInstance = window.Mollie('pfl_Ah5xUV4c6z', {
|
|
46
50
|
locale: conf.data?.storeConfig?.locale ?? 'en_US',
|
|
47
51
|
testmode: true,
|
|
48
52
|
})
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/mollie-magento-payment",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "8.1.0-canary.
|
|
5
|
+
"version": "8.1.0-canary.5",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/ecommerce-ui": "^8.1.0-canary.
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.
|
|
17
|
-
"@graphcommerce/graphql": "^8.1.0-canary.
|
|
18
|
-
"@graphcommerce/graphql-mesh": "^8.1.0-canary.
|
|
19
|
-
"@graphcommerce/image": "^8.1.0-canary.
|
|
20
|
-
"@graphcommerce/magento-cart": "^8.1.0-canary.
|
|
21
|
-
"@graphcommerce/magento-cart-payment-method": "^8.1.0-canary.
|
|
22
|
-
"@graphcommerce/magento-cart-shipping-address": "^8.1.0-canary.
|
|
23
|
-
"@graphcommerce/magento-product": "^8.1.0-canary.
|
|
24
|
-
"@graphcommerce/magento-product-configurable": "^8.1.0-canary.
|
|
25
|
-
"@graphcommerce/magento-store": "^8.1.0-canary.
|
|
26
|
-
"@graphcommerce/next-ui": "^8.1.0-canary.
|
|
27
|
-
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.
|
|
28
|
-
"@graphcommerce/react-hook-form": "^8.1.0-canary.
|
|
29
|
-
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.
|
|
15
|
+
"@graphcommerce/ecommerce-ui": "^8.1.0-canary.5",
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.5",
|
|
17
|
+
"@graphcommerce/graphql": "^8.1.0-canary.5",
|
|
18
|
+
"@graphcommerce/graphql-mesh": "^8.1.0-canary.5",
|
|
19
|
+
"@graphcommerce/image": "^8.1.0-canary.5",
|
|
20
|
+
"@graphcommerce/magento-cart": "^8.1.0-canary.5",
|
|
21
|
+
"@graphcommerce/magento-cart-payment-method": "^8.1.0-canary.5",
|
|
22
|
+
"@graphcommerce/magento-cart-shipping-address": "^8.1.0-canary.5",
|
|
23
|
+
"@graphcommerce/magento-product": "^8.1.0-canary.5",
|
|
24
|
+
"@graphcommerce/magento-product-configurable": "^8.1.0-canary.5",
|
|
25
|
+
"@graphcommerce/magento-store": "^8.1.0-canary.5",
|
|
26
|
+
"@graphcommerce/next-ui": "^8.1.0-canary.5",
|
|
27
|
+
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.5",
|
|
28
|
+
"@graphcommerce/react-hook-form": "^8.1.0-canary.5",
|
|
29
|
+
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.5",
|
|
30
30
|
"@lingui/core": "^4.2.1",
|
|
31
31
|
"@lingui/macro": "^4.2.1",
|
|
32
32
|
"@lingui/react": "^4.2.1",
|