@graphcommerce/mollie-magento-payment 8.1.0-canary.3 → 8.1.0-canary.30
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,113 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 8.1.0-canary.
|
|
3
|
+
## 8.1.0-canary.30
|
|
4
4
|
|
|
5
|
-
## 8.1.0-canary.
|
|
5
|
+
## 8.1.0-canary.29
|
|
6
|
+
|
|
7
|
+
## 8.1.0-canary.28
|
|
8
|
+
|
|
9
|
+
## 8.1.0-canary.27
|
|
10
|
+
|
|
11
|
+
## 8.1.0-canary.26
|
|
12
|
+
|
|
13
|
+
## 8.1.0-canary.25
|
|
14
|
+
|
|
15
|
+
## 8.1.0-canary.24
|
|
16
|
+
|
|
17
|
+
## 8.1.0-canary.23
|
|
18
|
+
|
|
19
|
+
## 8.1.0-canary.22
|
|
20
|
+
|
|
21
|
+
## 8.1.0-canary.21
|
|
22
|
+
|
|
23
|
+
## 8.1.0-canary.20
|
|
24
|
+
|
|
25
|
+
## 8.1.0-canary.19
|
|
26
|
+
|
|
27
|
+
## 8.1.0-canary.18
|
|
28
|
+
|
|
29
|
+
## 8.1.0-canary.17
|
|
30
|
+
|
|
31
|
+
## 8.1.0-canary.16
|
|
32
|
+
|
|
33
|
+
## 8.1.0-canary.15
|
|
34
|
+
|
|
35
|
+
## 8.1.0-canary.14
|
|
36
|
+
|
|
37
|
+
## 8.1.0-canary.13
|
|
38
|
+
|
|
39
|
+
## 8.1.0-canary.12
|
|
40
|
+
|
|
41
|
+
## 8.1.0-canary.11
|
|
42
|
+
|
|
43
|
+
## 8.1.0-canary.10
|
|
44
|
+
|
|
45
|
+
## 8.1.0-canary.9
|
|
46
|
+
|
|
47
|
+
## 8.1.0-canary.8
|
|
48
|
+
|
|
49
|
+
## 8.1.0-canary.7
|
|
50
|
+
|
|
51
|
+
## 8.1.0-canary.6
|
|
52
|
+
|
|
53
|
+
## 8.1.0-canary.5
|
|
54
|
+
|
|
55
|
+
## 8.0.6-canary.4
|
|
56
|
+
|
|
57
|
+
## 8.0.6-canary.3
|
|
58
|
+
|
|
59
|
+
## 8.0.6-canary.2
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- [#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.
|
|
64
|
+
([@FrankHarland](https://github.com/FrankHarland))
|
|
65
|
+
|
|
66
|
+
## 8.0.6-canary.1
|
|
67
|
+
|
|
68
|
+
## 8.0.6-canary.0
|
|
69
|
+
|
|
70
|
+
## 8.0.5
|
|
71
|
+
|
|
72
|
+
## 8.0.5-canary.10
|
|
73
|
+
|
|
74
|
+
## 8.0.5-canary.9
|
|
75
|
+
|
|
76
|
+
## 8.0.5-canary.8
|
|
77
|
+
|
|
78
|
+
## 8.0.5-canary.7
|
|
79
|
+
|
|
80
|
+
## 8.0.5-canary.6
|
|
81
|
+
|
|
82
|
+
## 8.0.5-canary.5
|
|
83
|
+
|
|
84
|
+
## 8.0.5-canary.4
|
|
85
|
+
|
|
86
|
+
## 8.0.5-canary.3
|
|
87
|
+
|
|
88
|
+
## 8.0.5-canary.2
|
|
89
|
+
|
|
90
|
+
## 8.0.5-canary.1
|
|
91
|
+
|
|
92
|
+
## 8.0.5-canary.0
|
|
93
|
+
|
|
94
|
+
## 8.0.4
|
|
95
|
+
|
|
96
|
+
## 8.0.4-canary.1
|
|
97
|
+
|
|
98
|
+
## 8.0.4-canary.0
|
|
99
|
+
|
|
100
|
+
## 8.0.3
|
|
101
|
+
|
|
102
|
+
## 8.0.3-canary.6
|
|
103
|
+
|
|
104
|
+
## 8.0.3-canary.5
|
|
105
|
+
|
|
106
|
+
## 8.0.3-canary.4
|
|
107
|
+
|
|
108
|
+
## 8.0.3-canary.3
|
|
109
|
+
|
|
110
|
+
## 8.0.3-canary.2
|
|
6
111
|
|
|
7
112
|
## 8.0.3-canary.1
|
|
8
113
|
|
|
@@ -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
|
})
|
|
@@ -34,12 +34,15 @@ export function MolliePlaceOrder(props: PaymentPlaceOrderProps) {
|
|
|
34
34
|
// When redirecting to the payment gateway
|
|
35
35
|
if (mollie_redirect_url && mollie_payment_token) {
|
|
36
36
|
await lock({ mollie_payment_token, method: code, order_number })
|
|
37
|
-
|
|
38
|
-
setTimeout(resolve, 1000)
|
|
39
|
-
})
|
|
37
|
+
|
|
40
38
|
await push(mollie_redirect_url)
|
|
41
39
|
} else {
|
|
42
|
-
|
|
40
|
+
console.error(`incomplete mollie response, cannot redirect`, data.placeOrder)
|
|
41
|
+
|
|
42
|
+
form.setError('root', {
|
|
43
|
+
message:
|
|
44
|
+
'An error occurred while processing your payment. Please contact the store owner',
|
|
45
|
+
})
|
|
43
46
|
}
|
|
44
47
|
},
|
|
45
48
|
})
|
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.30",
|
|
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.30",
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.30",
|
|
17
|
+
"@graphcommerce/graphql": "^8.1.0-canary.30",
|
|
18
|
+
"@graphcommerce/graphql-mesh": "^8.1.0-canary.30",
|
|
19
|
+
"@graphcommerce/image": "^8.1.0-canary.30",
|
|
20
|
+
"@graphcommerce/magento-cart": "^8.1.0-canary.30",
|
|
21
|
+
"@graphcommerce/magento-cart-payment-method": "^8.1.0-canary.30",
|
|
22
|
+
"@graphcommerce/magento-cart-shipping-address": "^8.1.0-canary.30",
|
|
23
|
+
"@graphcommerce/magento-product": "^8.1.0-canary.30",
|
|
24
|
+
"@graphcommerce/magento-product-configurable": "^8.1.0-canary.30",
|
|
25
|
+
"@graphcommerce/magento-store": "^8.1.0-canary.30",
|
|
26
|
+
"@graphcommerce/next-ui": "^8.1.0-canary.30",
|
|
27
|
+
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.30",
|
|
28
|
+
"@graphcommerce/react-hook-form": "^8.1.0-canary.30",
|
|
29
|
+
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.30",
|
|
30
30
|
"@lingui/core": "^4.2.1",
|
|
31
31
|
"@lingui/macro": "^4.2.1",
|
|
32
32
|
"@lingui/react": "^4.2.1",
|