@graphcommerce/magento-cart-payment-method 7.0.0-canary.21 → 7.0.0
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 +177 -1
- package/PaymentMethodActionCardList/PaymentMethodActionCardListForm.tsx +0 -1
- package/PaymentMethodContext/PaymentMethodContext.tsx +1 -1
- package/PaymentMethodOptionsNoop/PaymentMethodOptionsNoop.tsx +8 -1
- package/package.json +15 -14
- package/test/goToPayment.ts +2 -1
- package/test/selectPaymentMethod.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,182 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 7.0.0
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2031](https://github.com/graphcommerce-org/graphcommerce/pull/2031) [`4d8fc9e99`](https://github.com/graphcommerce-org/graphcommerce/commit/4d8fc9e998fc9361282833316ec9564da0644ed6) - Eslint fixes and suppress accepted warnings ([@paales](https://github.com/paales))
|
|
8
|
+
|
|
9
|
+
- [#1943](https://github.com/graphcommerce-org/graphcommerce/pull/1943) [`138215b45`](https://github.com/graphcommerce-org/graphcommerce/commit/138215b453703f44243c85b3bfab58814d86131c) - When a PayPal buyer would return to the website it would sometimes clear the buyers token ([@paales](https://github.com/paales))
|
|
10
|
+
|
|
11
|
+
- [#2027](https://github.com/graphcommerce-org/graphcommerce/pull/2027) [`e384fe2e4`](https://github.com/graphcommerce-org/graphcommerce/commit/e384fe2e47d849fe6f7bfa7c6dd48b9b6b5b1bd1) - Solved an issue where the empty cart would be shown between the payment and success page. ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
|
12
|
+
|
|
13
|
+
## 6.2.0-canary.98
|
|
14
|
+
|
|
15
|
+
## 6.2.0-canary.97
|
|
16
|
+
|
|
17
|
+
## 6.2.0-canary.96
|
|
18
|
+
|
|
19
|
+
## 6.2.0-canary.95
|
|
20
|
+
|
|
21
|
+
## 6.2.0-canary.94
|
|
22
|
+
|
|
23
|
+
## 6.2.0-canary.93
|
|
24
|
+
|
|
25
|
+
## 6.2.0-canary.92
|
|
26
|
+
|
|
27
|
+
## 6.2.0-canary.91
|
|
28
|
+
|
|
29
|
+
## 6.2.0-canary.90
|
|
30
|
+
|
|
31
|
+
## 6.2.0-canary.89
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- [#2031](https://github.com/graphcommerce-org/graphcommerce/pull/2031) [`4d8fc9e99`](https://github.com/graphcommerce-org/graphcommerce/commit/4d8fc9e998fc9361282833316ec9564da0644ed6) - Eslint fixes and suppress accepted warnings ([@paales](https://github.com/paales))
|
|
36
|
+
|
|
37
|
+
## 6.2.0-canary.88
|
|
38
|
+
|
|
39
|
+
## 6.2.0-canary.87
|
|
40
|
+
|
|
41
|
+
## 6.2.0-canary.86
|
|
42
|
+
|
|
43
|
+
## 6.2.0-canary.85
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- [#2027](https://github.com/graphcommerce-org/graphcommerce/pull/2027) [`e384fe2e4`](https://github.com/graphcommerce-org/graphcommerce/commit/e384fe2e47d849fe6f7bfa7c6dd48b9b6b5b1bd1) - Solved an issue where the empty cart would be shown between the payment and success page. ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
|
48
|
+
|
|
49
|
+
## 6.2.0-canary.84
|
|
50
|
+
|
|
51
|
+
## 6.2.0-canary.83
|
|
52
|
+
|
|
53
|
+
## 6.2.0-canary.82
|
|
54
|
+
|
|
55
|
+
## 6.2.0-canary.81
|
|
56
|
+
|
|
57
|
+
## 6.2.0-canary.80
|
|
58
|
+
|
|
59
|
+
## 6.2.0-canary.79
|
|
60
|
+
|
|
61
|
+
## 6.2.0-canary.78
|
|
62
|
+
|
|
63
|
+
## 6.2.0-canary.77
|
|
64
|
+
|
|
65
|
+
## 6.2.0-canary.76
|
|
66
|
+
|
|
67
|
+
## 6.2.0-canary.75
|
|
68
|
+
|
|
69
|
+
## 6.2.0-canary.74
|
|
70
|
+
|
|
71
|
+
## 6.2.0-canary.73
|
|
72
|
+
|
|
73
|
+
## 6.2.0-canary.72
|
|
74
|
+
|
|
75
|
+
## 6.2.0-canary.71
|
|
76
|
+
|
|
77
|
+
## 6.2.0-canary.70
|
|
78
|
+
|
|
79
|
+
## 6.2.0-canary.69
|
|
80
|
+
|
|
81
|
+
## 6.2.0-canary.68
|
|
82
|
+
|
|
83
|
+
## 6.2.0-canary.67
|
|
84
|
+
|
|
85
|
+
## 6.2.0-canary.66
|
|
86
|
+
|
|
87
|
+
## 6.2.0-canary.65
|
|
88
|
+
|
|
89
|
+
## 6.2.0-canary.64
|
|
90
|
+
|
|
91
|
+
## 6.2.0-canary.63
|
|
92
|
+
|
|
93
|
+
## 6.2.0-canary.62
|
|
94
|
+
|
|
95
|
+
## 6.2.0-canary.61
|
|
96
|
+
|
|
97
|
+
## 6.2.0-canary.60
|
|
98
|
+
|
|
99
|
+
## 6.2.0-canary.59
|
|
100
|
+
|
|
101
|
+
## 6.2.0-canary.58
|
|
102
|
+
|
|
103
|
+
## 6.2.0-canary.57
|
|
104
|
+
|
|
105
|
+
## 6.2.0-canary.56
|
|
106
|
+
|
|
107
|
+
## 6.2.0-canary.55
|
|
108
|
+
|
|
109
|
+
## 6.2.0-canary.54
|
|
110
|
+
|
|
111
|
+
## 6.2.0-canary.53
|
|
112
|
+
|
|
113
|
+
## 6.2.0-canary.52
|
|
114
|
+
|
|
115
|
+
## 6.2.0-canary.51
|
|
116
|
+
|
|
117
|
+
## 6.2.0-canary.50
|
|
118
|
+
|
|
119
|
+
## 6.2.0-canary.49
|
|
120
|
+
|
|
121
|
+
## 6.2.0-canary.48
|
|
122
|
+
|
|
123
|
+
## 6.2.0-canary.47
|
|
124
|
+
|
|
125
|
+
## 6.2.0-canary.46
|
|
126
|
+
|
|
127
|
+
## 6.2.0-canary.45
|
|
128
|
+
|
|
129
|
+
## 6.2.0-canary.44
|
|
130
|
+
|
|
131
|
+
## 6.2.0-canary.43
|
|
132
|
+
|
|
133
|
+
## 6.2.0-canary.42
|
|
134
|
+
|
|
135
|
+
## 6.2.0-canary.41
|
|
136
|
+
|
|
137
|
+
## 6.2.0-canary.40
|
|
138
|
+
|
|
139
|
+
## 6.2.0-canary.39
|
|
140
|
+
|
|
141
|
+
## 6.2.0-canary.38
|
|
142
|
+
|
|
143
|
+
## 6.2.0-canary.37
|
|
144
|
+
|
|
145
|
+
## 6.2.0-canary.36
|
|
146
|
+
|
|
147
|
+
## 6.2.0-canary.35
|
|
148
|
+
|
|
149
|
+
## 6.2.0-canary.34
|
|
150
|
+
|
|
151
|
+
## 6.2.0-canary.33
|
|
152
|
+
|
|
153
|
+
## 6.2.0-canary.32
|
|
154
|
+
|
|
155
|
+
## 6.2.0-canary.31
|
|
156
|
+
|
|
157
|
+
## 6.2.0-canary.30
|
|
158
|
+
|
|
159
|
+
## 6.2.0-canary.29
|
|
160
|
+
|
|
161
|
+
## 6.2.0-canary.28
|
|
162
|
+
|
|
163
|
+
## 6.2.0-canary.27
|
|
164
|
+
|
|
165
|
+
## 6.2.0-canary.26
|
|
166
|
+
|
|
167
|
+
## 6.2.0-canary.25
|
|
168
|
+
|
|
169
|
+
## 6.2.0-canary.24
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- [#1943](https://github.com/graphcommerce-org/graphcommerce/pull/1943) [`138215b45`](https://github.com/graphcommerce-org/graphcommerce/commit/138215b453703f44243c85b3bfab58814d86131c) - When a PayPal buyer would return to the website it would sometimes clear the buyers token ([@paales](https://github.com/paales))
|
|
174
|
+
|
|
175
|
+
## 6.2.0-canary.23
|
|
176
|
+
|
|
177
|
+
## 6.2.0-canary.22
|
|
178
|
+
|
|
179
|
+
## 6.2.0-canary.21
|
|
4
180
|
|
|
5
181
|
## 6.2.0-canary.20
|
|
6
182
|
|
|
@@ -57,11 +57,11 @@ export function PaymentMethodContextProvider(props: PaymentMethodContextProvider
|
|
|
57
57
|
const onSuccessCb: NonNullable<PaymentMethodContextProps['onSuccess']> = useEventCallback(
|
|
58
58
|
async (orderNumber) => {
|
|
59
59
|
await onSuccess?.(orderNumber, context.data?.cart)
|
|
60
|
-
clearCurrentCartId()
|
|
61
60
|
await push({
|
|
62
61
|
pathname: successUrl,
|
|
63
62
|
query: { order_number: orderNumber, cart_id: context.data?.cart?.id },
|
|
64
63
|
})
|
|
64
|
+
clearCurrentCartId()
|
|
65
65
|
},
|
|
66
66
|
)
|
|
67
67
|
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import { useFormGqlMutationCart } from '@graphcommerce/magento-cart'
|
|
1
|
+
import { useCartQuery, useFormGqlMutationCart } from '@graphcommerce/magento-cart'
|
|
2
2
|
import { useFormAutoSubmit, useFormCompose } from '@graphcommerce/react-hook-form'
|
|
3
3
|
import { PaymentOptionsProps } from '../Api/PaymentMethod'
|
|
4
|
+
import { GetPaymentMethodContextDocument } from '../PaymentMethodContext/GetPaymentMethodContext.gql'
|
|
4
5
|
import { PaymentMethodOptionsNoopDocument } from './PaymentMethodOptionsNoop.gql'
|
|
5
6
|
|
|
6
7
|
/** It sets the selected payment method on the cart. */
|
|
7
8
|
export function PaymentMethodOptionsNoop(props: PaymentOptionsProps) {
|
|
8
9
|
const { code, step } = props
|
|
9
10
|
|
|
11
|
+
const context = useCartQuery(GetPaymentMethodContextDocument)
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
14
|
* In the this folder you'll also find a PaymentMethodOptionsNoop.graphql document that is
|
|
12
15
|
* imported here and used as the basis for the form below.
|
|
13
16
|
*/
|
|
14
17
|
const form = useFormGqlMutationCart(PaymentMethodOptionsNoopDocument, {
|
|
18
|
+
onBeforeSubmit(variables) {
|
|
19
|
+
if (variables.code === context.data?.cart?.selected_payment_method?.code) return false
|
|
20
|
+
return variables
|
|
21
|
+
},
|
|
15
22
|
mode: 'onChange',
|
|
16
23
|
defaultValues: { code },
|
|
17
24
|
})
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-cart-payment-method",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "7.0.0
|
|
5
|
+
"version": "7.0.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,23 +12,24 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "7.0.0
|
|
16
|
-
"@graphcommerce/prettier-config-pwa": "7.0.0
|
|
17
|
-
"@graphcommerce/typescript-config-pwa": "7.0.0
|
|
18
|
-
"@graphcommerce/magento-cart-shipping-address": "7.0.0
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "7.0.0",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "7.0.0",
|
|
17
|
+
"@graphcommerce/typescript-config-pwa": "7.0.0",
|
|
18
|
+
"@graphcommerce/magento-cart-shipping-address": "7.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@graphcommerce/framer-scroller": "7.0.0
|
|
22
|
-
"@graphcommerce/graphql": "7.0.0
|
|
23
|
-
"@graphcommerce/image": "7.0.0
|
|
24
|
-
"@graphcommerce/magento-cart": "7.0.0
|
|
25
|
-
"@graphcommerce/magento-store": "7.0.0
|
|
26
|
-
"@graphcommerce/next-ui": "7.0.0
|
|
27
|
-
"@graphcommerce/react-hook-form": "7.0.0
|
|
21
|
+
"@graphcommerce/framer-scroller": "7.0.0",
|
|
22
|
+
"@graphcommerce/graphql": "7.0.0",
|
|
23
|
+
"@graphcommerce/image": "7.0.0",
|
|
24
|
+
"@graphcommerce/magento-cart": "7.0.0",
|
|
25
|
+
"@graphcommerce/magento-store": "7.0.0",
|
|
26
|
+
"@graphcommerce/next-ui": "7.0.0",
|
|
27
|
+
"@graphcommerce/react-hook-form": "7.0.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@lingui/react": "^
|
|
31
|
-
"@lingui/core": "^
|
|
30
|
+
"@lingui/react": "^4.2.1",
|
|
31
|
+
"@lingui/core": "^4.2.1",
|
|
32
|
+
"@lingui/macro": "^4.2.1",
|
|
32
33
|
"@mui/material": "^5.10.16",
|
|
33
34
|
"framer-motion": "^10.0.0",
|
|
34
35
|
"next": "^13.2.0",
|
package/test/goToPayment.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
1
2
|
import { ApolloClient, NormalizedCacheObject } from '@graphcommerce/graphql'
|
|
2
|
-
import { fillShippingAddressForm } from '@graphcommerce/magento-cart-shipping-address/test/fillShippingAddressForm'
|
|
3
3
|
import { fillCartAgreementsForm } from '@graphcommerce/magento-cart/test/fillCartAgreementsForm'
|
|
4
|
+
import { fillShippingAddressForm } from '@graphcommerce/magento-cart-shipping-address/test/fillShippingAddressForm'
|
|
4
5
|
import { Page } from '@playwright/test'
|
|
5
6
|
|
|
6
7
|
export const goToPayment = async (
|