@graphcommerce/mollie-magento-payment 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
|
@@ -52,7 +52,7 @@ export function MolliePaymentHandler({ code }: PaymentHandlerProps) {
|
|
|
52
52
|
returnedCartId = res.data?.mollieRestoreCart?.cart.id
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
if (result.
|
|
55
|
+
if (result.error || !paymentStatus) return
|
|
56
56
|
|
|
57
57
|
if (successStatusses.includes(paymentStatus)) {
|
|
58
58
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
@@ -30,12 +30,12 @@ export function MolliePlaceOrder(props: PaymentPlaceOrderProps) {
|
|
|
30
30
|
onComplete: async (result) => {
|
|
31
31
|
assertMollieOrderPlaced(result)
|
|
32
32
|
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const order = result.data?.placeOrder?.order
|
|
34
|
+
const { mollie_payment_token, order_number, mollie_redirect_url } = order
|
|
35
35
|
|
|
36
36
|
// Redirect to the payment gateway
|
|
37
|
-
await lock({ mollie_payment_token, method: code, order_number })
|
|
38
|
-
await push(mollie_redirect_url)
|
|
37
|
+
await lock({ mollie_payment_token: mollie_payment_token ?? null, method: code, order_number })
|
|
38
|
+
if (mollie_redirect_url) await push(mollie_redirect_url)
|
|
39
39
|
},
|
|
40
40
|
})
|
|
41
41
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { AssertedOrderPlaced, PlacedOrder } from '@graphcommerce/magento-cart-payment-method'
|
|
1
|
+
import type { ApolloLink } from '@graphcommerce/graphql'
|
|
3
2
|
import {
|
|
4
3
|
assertOrderPlaced,
|
|
5
4
|
throwGenericPlaceOrderError,
|
|
@@ -7,18 +6,20 @@ import {
|
|
|
7
6
|
import type { MolliePlaceOrderMutation } from './MolliePlaceOrder.gql'
|
|
8
7
|
|
|
9
8
|
/** Assert that the order was place successfully. */
|
|
10
|
-
export function assertMollieOrderPlaced<T extends
|
|
9
|
+
export function assertMollieOrderPlaced<T extends ApolloLink.Result<MolliePlaceOrderMutation>>(
|
|
11
10
|
result: T,
|
|
12
|
-
): asserts result is
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
): asserts result is T &
|
|
12
|
+
ApolloLink.Result<MolliePlaceOrderMutation> & {
|
|
13
|
+
data: {
|
|
14
|
+
placeOrder: {
|
|
15
|
+
order: {
|
|
16
|
+
order_number: string
|
|
17
|
+
mollie_redirect_url: string
|
|
18
|
+
mollie_payment_token: string
|
|
19
|
+
}
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
|
-
}
|
|
21
|
-
} {
|
|
22
|
+
} {
|
|
22
23
|
assertOrderPlaced(result)
|
|
23
24
|
|
|
24
25
|
const { mollie_redirect_url, mollie_payment_token } = result.data.placeOrder.order
|
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": "10.0.0-canary.
|
|
5
|
+
"version": "10.0.0-canary.72",
|
|
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": "^10.0.0-canary.
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.
|
|
17
|
-
"@graphcommerce/graphql": "^10.0.0-canary.
|
|
18
|
-
"@graphcommerce/graphql-mesh": "^10.0.0-canary.
|
|
19
|
-
"@graphcommerce/image": "^10.0.0-canary.
|
|
20
|
-
"@graphcommerce/magento-cart": "^10.0.0-canary.
|
|
21
|
-
"@graphcommerce/magento-cart-payment-method": "^10.0.0-canary.
|
|
22
|
-
"@graphcommerce/magento-cart-shipping-address": "^10.0.0-canary.
|
|
23
|
-
"@graphcommerce/magento-product": "^10.0.0-canary.
|
|
24
|
-
"@graphcommerce/magento-product-configurable": "^10.0.0-canary.
|
|
25
|
-
"@graphcommerce/magento-store": "^10.0.0-canary.
|
|
26
|
-
"@graphcommerce/next-ui": "^10.0.0-canary.
|
|
27
|
-
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.
|
|
28
|
-
"@graphcommerce/react-hook-form": "^10.0.0-canary.
|
|
29
|
-
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.
|
|
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/graphql-mesh": "^10.0.0-canary.72",
|
|
19
|
+
"@graphcommerce/image": "^10.0.0-canary.72",
|
|
20
|
+
"@graphcommerce/magento-cart": "^10.0.0-canary.72",
|
|
21
|
+
"@graphcommerce/magento-cart-payment-method": "^10.0.0-canary.72",
|
|
22
|
+
"@graphcommerce/magento-cart-shipping-address": "^10.0.0-canary.72",
|
|
23
|
+
"@graphcommerce/magento-product": "^10.0.0-canary.72",
|
|
24
|
+
"@graphcommerce/magento-product-configurable": "^10.0.0-canary.72",
|
|
25
|
+
"@graphcommerce/magento-store": "^10.0.0-canary.72",
|
|
26
|
+
"@graphcommerce/next-ui": "^10.0.0-canary.72",
|
|
27
|
+
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.72",
|
|
28
|
+
"@graphcommerce/react-hook-form": "^10.0.0-canary.72",
|
|
29
|
+
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.72",
|
|
30
30
|
"@lingui/core": "^5",
|
|
31
31
|
"@lingui/macro": "^5",
|
|
32
32
|
"@lingui/react": "^5",
|