@graphcommerce/magento-payment-adyen 9.0.1 → 9.0.2
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 +4 -0
- package/components/AdyenPaymentOptionsAndPlaceOrder/AdyenPaymentOptionsAndPlaceOrder.graphql +5 -0
- package/components/AdyenPaymentOptionsAndPlaceOrder/AdyenPaymentOptionsAndPlaceOrder.tsx +10 -3
- package/hooks/useAdyenHandlePaymentResponse.ts +1 -4
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { FormPersist, TextFieldElement, useFormCompose } from '@graphcommerce/ecommerce-ui'
|
|
2
2
|
import { useFormGqlMutationCart } from '@graphcommerce/magento-cart'
|
|
3
3
|
import type { PaymentOptionsProps } from '@graphcommerce/magento-cart-payment-method'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
assertOrderPlaced,
|
|
6
|
+
throwGenericPlaceOrderError,
|
|
7
|
+
usePaymentMethodContext,
|
|
8
|
+
} from '@graphcommerce/magento-cart-payment-method'
|
|
5
9
|
import { FormRow } from '@graphcommerce/next-ui'
|
|
6
10
|
import { t } from '@lingui/macro'
|
|
7
11
|
import { useRouter } from 'next/router'
|
|
@@ -40,15 +44,18 @@ export function HppOptions(props: PaymentOptionsProps) {
|
|
|
40
44
|
brandCode,
|
|
41
45
|
}),
|
|
42
46
|
onComplete: async (result) => {
|
|
47
|
+
assertOrderPlaced(result.data?.placeOrder)
|
|
43
48
|
const merchantReference = result.data?.placeOrder?.order.order_number
|
|
44
49
|
const action = result?.data?.placeOrder?.order.adyen_payment_status?.action
|
|
45
50
|
|
|
46
51
|
if (result.errors) return
|
|
47
52
|
|
|
48
53
|
if (!merchantReference || !selectedMethod?.code || !action) {
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
console.error(
|
|
55
|
+
'Adyen: Order was placed, but no merchant reference or action was returned, this is an issue on the Magento Adyen side.',
|
|
56
|
+
result,
|
|
51
57
|
)
|
|
58
|
+
throwGenericPlaceOrderError()
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
const url = JSON.parse(action).url as string
|
|
@@ -31,10 +31,7 @@ export type AdyenPaymentResponse = {
|
|
|
31
31
|
additionalData?: Types.checkout.PaymentResponse['additionalData']
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Will be removed
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
34
|
+
/** @public */
|
|
38
35
|
export function parsePaymentResponse(
|
|
39
36
|
status?: AdyenPaymentResponseFragment | null,
|
|
40
37
|
): AdyenPaymentResponse {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-payment-adyen",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "9.0.
|
|
5
|
+
"version": "9.0.2",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,18 +12,18 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/ecommerce-ui": "^9.0.
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.
|
|
17
|
-
"@graphcommerce/graphql": "^9.0.
|
|
18
|
-
"@graphcommerce/graphql-mesh": "^9.0.
|
|
19
|
-
"@graphcommerce/image": "^9.0.
|
|
20
|
-
"@graphcommerce/magento-cart": "^9.0.
|
|
21
|
-
"@graphcommerce/magento-cart-payment-method": "^9.0.
|
|
22
|
-
"@graphcommerce/magento-product": "^9.0.
|
|
23
|
-
"@graphcommerce/magento-store": "^9.0.
|
|
24
|
-
"@graphcommerce/next-ui": "^9.0.
|
|
25
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.
|
|
26
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.
|
|
15
|
+
"@graphcommerce/ecommerce-ui": "^9.0.2",
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.2",
|
|
17
|
+
"@graphcommerce/graphql": "^9.0.2",
|
|
18
|
+
"@graphcommerce/graphql-mesh": "^9.0.2",
|
|
19
|
+
"@graphcommerce/image": "^9.0.2",
|
|
20
|
+
"@graphcommerce/magento-cart": "^9.0.2",
|
|
21
|
+
"@graphcommerce/magento-cart-payment-method": "^9.0.2",
|
|
22
|
+
"@graphcommerce/magento-product": "^9.0.2",
|
|
23
|
+
"@graphcommerce/magento-store": "^9.0.2",
|
|
24
|
+
"@graphcommerce/next-ui": "^9.0.2",
|
|
25
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.2",
|
|
26
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.2",
|
|
27
27
|
"@lingui/core": "^4.2.1",
|
|
28
28
|
"@lingui/macro": "^4.2.1",
|
|
29
29
|
"@lingui/react": "^4.2.1",
|