@graphcommerce/magento-payment-paypal 10.0.0-canary.68 → 10.0.0-canary.72

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-paypal
2
2
 
3
+ ## 10.0.0-canary.72
4
+
5
+ ## 10.0.0-canary.71
6
+
7
+ ## 10.0.0-canary.70
8
+
9
+ ## 10.0.0-canary.69
10
+
3
11
  ## 10.0.0-canary.68
4
12
 
5
13
  ## 10.0.0-canary.67
@@ -48,8 +48,11 @@ export function PayPalPaymentHandler(props: PaymentHandlerProps) {
48
48
 
49
49
  try {
50
50
  assertOrderPlaced(result)
51
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
52
- onSuccess(result.data.placeOrder.order.order_number)
51
+ const orderNumber = result.data?.placeOrder?.order?.order_number
52
+ if (orderNumber) {
53
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
54
+ onSuccess(orderNumber)
55
+ }
53
56
  } catch (e) {
54
57
  await unlock({ token: null, PayerID: null })
55
58
  }
@@ -1,7 +1,7 @@
1
1
  import { useFormCompose } from '@graphcommerce/ecommerce-ui'
2
- import { ApolloError } from '@graphcommerce/graphql'
3
2
  import { useFormGqlMutationCart } from '@graphcommerce/magento-cart'
4
3
  import { type PaymentPlaceOrderProps } from '@graphcommerce/magento-cart-payment-method'
4
+ import { CombinedGraphQLErrors } from '@apollo/client/errors'
5
5
  import { useRouter } from 'next/router'
6
6
  import { usePayPalCartLock } from '../../hooks/usePayPalCartLock'
7
7
  import { PayPalPaymentPlaceOrderDocument } from './PayPalPaymentPlaceOrder.gql'
@@ -26,7 +26,7 @@ export function PayPalPaymentPlaceOrder(props: PaymentPlaceOrderProps) {
26
26
  if (!start) {
27
27
  const message =
28
28
  'Error while starting the PayPal payment, please try again with a different payment method'
29
- throw new ApolloError({ graphQLErrors: [{ message }] })
29
+ throw new CombinedGraphQLErrors({ errors: [{ message }] })
30
30
  }
31
31
 
32
32
  await lock({ token, method: code, PayerID: null })
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-payment-paypal",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "10.0.0-canary.68",
5
+ "version": "10.0.0-canary.72",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,16 +12,16 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^10.0.0-canary.68",
16
- "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.68",
17
- "@graphcommerce/graphql": "^10.0.0-canary.68",
18
- "@graphcommerce/image": "^10.0.0-canary.68",
19
- "@graphcommerce/magento-cart": "^10.0.0-canary.68",
20
- "@graphcommerce/magento-cart-payment-method": "^10.0.0-canary.68",
21
- "@graphcommerce/magento-store": "^10.0.0-canary.68",
22
- "@graphcommerce/next-ui": "^10.0.0-canary.68",
23
- "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.68",
24
- "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.68",
15
+ "@graphcommerce/ecommerce-ui": "^10.0.0-canary.72",
16
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.72",
17
+ "@graphcommerce/graphql": "^10.0.0-canary.72",
18
+ "@graphcommerce/image": "^10.0.0-canary.72",
19
+ "@graphcommerce/magento-cart": "^10.0.0-canary.72",
20
+ "@graphcommerce/magento-cart-payment-method": "^10.0.0-canary.72",
21
+ "@graphcommerce/magento-store": "^10.0.0-canary.72",
22
+ "@graphcommerce/next-ui": "^10.0.0-canary.72",
23
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.72",
24
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.72",
25
25
  "@lingui/core": "^5",
26
26
  "@lingui/macro": "^5",
27
27
  "@lingui/react": "^5",