@graphcommerce/magento-payment-adyen 9.0.0-canary.78 → 9.0.0-canary.80

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,5 +1,13 @@
1
1
  # @graphcommerce/magento-payment-adyen
2
2
 
3
+ ## 9.0.0-canary.80
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2341](https://github.com/graphcommerce-org/graphcommerce/pull/2341) [`86ecf9a`](https://github.com/graphcommerce-org/graphcommerce/commit/86ecf9a1bb4c48ceabd4944d81483bcd5b990350) - Payment method will now throw an error in onComplete to handle obscure errors ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
8
+
9
+ ## 9.0.0-canary.79
10
+
3
11
  ## 9.0.0-canary.78
4
12
 
5
13
  ## 9.0.0-canary.77
@@ -5,13 +5,14 @@ import {
5
5
  usePaymentMethodContext,
6
6
  } from '@graphcommerce/magento-cart-payment-method'
7
7
  import { FormRow } from '@graphcommerce/next-ui'
8
+ import { t } from '@lingui/macro'
8
9
  import { useRouter } from 'next/router'
9
10
  import { useAdyenCartLock } from '../../hooks/useAdyenCartLock'
10
11
  import { useAdyenPaymentMethod } from '../../hooks/useAdyenPaymentMethod'
11
12
  import {
13
+ AdyenPaymentOptionsAndPlaceOrderDocument,
12
14
  AdyenPaymentOptionsAndPlaceOrderMutation,
13
15
  AdyenPaymentOptionsAndPlaceOrderMutationVariables,
14
- AdyenPaymentOptionsAndPlaceOrderDocument,
15
16
  } from './AdyenPaymentOptionsAndPlaceOrder.gql'
16
17
 
17
18
  /** It sets the selected payment method on the cart. */
@@ -44,7 +45,13 @@ export function HppOptions(props: PaymentOptionsProps) {
44
45
  const merchantReference = result.data?.placeOrder?.order.order_number
45
46
  const action = result?.data?.placeOrder?.order.adyen_payment_status?.action
46
47
 
47
- if (result.errors || !merchantReference || !selectedMethod?.code || !action) return
48
+ if (result.errors) return
49
+
50
+ if (!merchantReference || !selectedMethod?.code || !action) {
51
+ throw Error(
52
+ t`An error occurred while processing your payment. Please contact the store owner`,
53
+ )
54
+ }
48
55
 
49
56
  const url = JSON.parse(action).url as string
50
57
  await lock({ method: selectedMethod.code, adyen: '1', merchantReference })
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.0-canary.78",
5
+ "version": "9.0.0-canary.80",
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.0-canary.78",
16
- "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.78",
17
- "@graphcommerce/graphql": "^9.0.0-canary.78",
18
- "@graphcommerce/graphql-mesh": "^9.0.0-canary.78",
19
- "@graphcommerce/image": "^9.0.0-canary.78",
20
- "@graphcommerce/magento-cart": "^9.0.0-canary.78",
21
- "@graphcommerce/magento-cart-payment-method": "^9.0.0-canary.78",
22
- "@graphcommerce/magento-product": "^9.0.0-canary.78",
23
- "@graphcommerce/magento-store": "^9.0.0-canary.78",
24
- "@graphcommerce/next-ui": "^9.0.0-canary.78",
25
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.78",
26
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.78",
15
+ "@graphcommerce/ecommerce-ui": "^9.0.0-canary.80",
16
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.80",
17
+ "@graphcommerce/graphql": "^9.0.0-canary.80",
18
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.80",
19
+ "@graphcommerce/image": "^9.0.0-canary.80",
20
+ "@graphcommerce/magento-cart": "^9.0.0-canary.80",
21
+ "@graphcommerce/magento-cart-payment-method": "^9.0.0-canary.80",
22
+ "@graphcommerce/magento-product": "^9.0.0-canary.80",
23
+ "@graphcommerce/magento-store": "^9.0.0-canary.80",
24
+ "@graphcommerce/next-ui": "^9.0.0-canary.80",
25
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.80",
26
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.80",
27
27
  "@lingui/core": "^4.2.1",
28
28
  "@lingui/macro": "^4.2.1",
29
29
  "@lingui/react": "^4.2.1",