@wearejh/m2-pwa-adyen 0.26.0 → 0.29.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 +30 -0
- package/lib/epics/onCancel.epic.ts +4 -26
- package/lib/epics/onError.epic.ts +6 -37
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.29.0](https://github.com/WeareJH/mage-mono/compare/v0.28.0...v0.29.0) (2024-08-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @wearejh/m2-pwa-adyen
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.28.0](https://github.com/WeareJH/mage-mono/compare/v0.25.0...v0.28.0) (2024-07-30)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* WOOD-2009 cancelled adyen orders ([#92](https://github.com/WeareJH/mage-mono/issues/92)) ([38c017e](https://github.com/WeareJH/mage-mono/commit/38c017e70c26adbb63616727d15594b5bf77e510))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [0.27.0](https://github.com/WeareJH/mage-mono/compare/v0.25.0...v0.27.0) (2024-07-30)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* WOOD-2009 cancelled adyen orders ([#92](https://github.com/WeareJH/mage-mono/issues/92)) ([38c017e](https://github.com/WeareJH/mage-mono/commit/38c017e70c26adbb63616727d15594b5bf77e510))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
# [0.26.0](https://github.com/WeareJH/mage-mono/compare/v0.25.0...v0.26.0) (2024-07-15)
|
|
7
37
|
|
|
8
38
|
**Note:** Version bump only for package @wearejh/m2-pwa-adyen
|
|
@@ -2,14 +2,12 @@ import { CheckoutMsg } from '@wearejh/m2-pwa-checkout';
|
|
|
2
2
|
import { State as CheckoutState } from '@wearejh/m2-pwa-checkout/lib/checkout.reducer';
|
|
3
3
|
import { scrollTop } from '@wearejh/m2-pwa-engine/lib/runtime/utils/scrollTop';
|
|
4
4
|
import { EpicDeps } from '@wearejh/m2-pwa-engine/lib/types';
|
|
5
|
-
import { extractErrorAndCode } from '@wearejh/swagger-rxjs/utils/ajax-helpers';
|
|
6
5
|
import { ofType } from 'redux-observable';
|
|
7
6
|
import { EMPTY, Observable, of } from 'rxjs';
|
|
8
|
-
import {
|
|
7
|
+
import { pluck, switchMap, withLatestFrom } from 'rxjs/operators';
|
|
9
8
|
|
|
10
|
-
import { Actions,
|
|
9
|
+
import { Actions, ActionTypes, TypeMap } from '../adyen.actions';
|
|
11
10
|
import { AppendState as AdyenStore } from '../adyen.types';
|
|
12
|
-
import { execute as cancelQuery } from '../rest/JhAdyenPaymentAdyenThreeDSAbortV1AbortPost';
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* This epic handles Adyen cancel events and communicates
|
|
@@ -18,7 +16,7 @@ import { execute as cancelQuery } from '../rest/JhAdyenPaymentAdyenThreeDSAbortV
|
|
|
18
16
|
* Within the Adyen module, you only need to dispatch
|
|
19
17
|
* the cancel action. This epic will handle the rest.
|
|
20
18
|
*/
|
|
21
|
-
export function onCancel(action$: Observable<any>, state$: Observable<any>,
|
|
19
|
+
export function onCancel(action$: Observable<any>, state$: Observable<any>, _deps: EpicDeps) {
|
|
22
20
|
/**
|
|
23
21
|
* Get the checkout order id from the store.
|
|
24
22
|
*/
|
|
@@ -43,27 +41,7 @@ export function onCancel(action$: Observable<any>, state$: Observable<any>, deps
|
|
|
43
41
|
return EMPTY;
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
orderId: Number(orderId),
|
|
49
|
-
},
|
|
50
|
-
deps,
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
return ajax$.pipe(
|
|
54
|
-
mergeMap(() => of(CheckoutMsg('Checkout.SetState', CheckoutState.Ready), scrollTop())),
|
|
55
|
-
|
|
56
|
-
catchError((errorResponse) => {
|
|
57
|
-
const { error } = extractErrorAndCode(errorResponse);
|
|
58
|
-
|
|
59
|
-
return of(
|
|
60
|
-
AdyenMessage(ActionTypes.Error, {
|
|
61
|
-
cancelPayment: false,
|
|
62
|
-
message: error,
|
|
63
|
-
}),
|
|
64
|
-
);
|
|
65
|
-
}),
|
|
66
|
-
);
|
|
44
|
+
return of(CheckoutMsg('Checkout.SetState', CheckoutState.Ready), scrollTop());
|
|
67
45
|
}),
|
|
68
46
|
);
|
|
69
47
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { CheckoutMsg } from '@wearejh/m2-pwa-checkout';
|
|
2
2
|
import { scrollTop } from '@wearejh/m2-pwa-engine/lib/runtime/utils/scrollTop';
|
|
3
3
|
import { EpicDeps } from '@wearejh/m2-pwa-engine/lib/types';
|
|
4
|
-
import { extractErrorAndCode } from '@wearejh/swagger-rxjs/utils/ajax-helpers';
|
|
5
4
|
import { ofType } from 'redux-observable';
|
|
6
|
-
import { EMPTY,
|
|
7
|
-
import {
|
|
8
|
-
import { CartMsg } from '@wearejh/m2-pwa-cart-gql';
|
|
5
|
+
import { EMPTY, Observable, of } from 'rxjs';
|
|
6
|
+
import { pluck, switchMap, withLatestFrom } from 'rxjs/operators';
|
|
9
7
|
|
|
10
8
|
import { Actions, ActionTypes, TypeMap } from '../adyen.actions';
|
|
11
9
|
import { AppendState as AdyenStore } from '../adyen.types';
|
|
12
|
-
import { execute as cancelQuery } from '../rest/JhAdyenPaymentAdyenThreeDSAbortV1AbortPost';
|
|
13
10
|
|
|
14
11
|
/**
|
|
15
12
|
* This epic handles Adyen error events, cancels the order,
|
|
@@ -18,7 +15,7 @@ import { execute as cancelQuery } from '../rest/JhAdyenPaymentAdyenThreeDSAbortV
|
|
|
18
15
|
* Within the Adyen module, you only need to dispatch
|
|
19
16
|
* the error action. This epic will handle the rest.
|
|
20
17
|
*/
|
|
21
|
-
export function onError(action$: Observable<any>, state$: Observable<any>,
|
|
18
|
+
export function onError(action$: Observable<any>, state$: Observable<any>, _deps: EpicDeps) {
|
|
22
19
|
/**
|
|
23
20
|
* Get the checkout order id from the store.
|
|
24
21
|
*/
|
|
@@ -40,9 +37,9 @@ export function onError(action$: Observable<any>, state$: Observable<any>, deps:
|
|
|
40
37
|
switchMap(
|
|
41
38
|
([
|
|
42
39
|
{
|
|
43
|
-
payload: {
|
|
40
|
+
payload: { message },
|
|
44
41
|
},
|
|
45
|
-
|
|
42
|
+
_orderId,
|
|
46
43
|
]) => {
|
|
47
44
|
let errorMessage = message;
|
|
48
45
|
|
|
@@ -54,35 +51,7 @@ export function onError(action$: Observable<any>, state$: Observable<any>, deps:
|
|
|
54
51
|
errorMessage = 'Can not set name for cross-domain window.';
|
|
55
52
|
}
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
if (!orderId) {
|
|
59
|
-
return of(CheckoutMsg('Checkout.PaymentSubmitError', 'Cannot find the order ID.'), scrollTop());
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const ajax$ = cancelQuery(
|
|
63
|
-
{
|
|
64
|
-
orderId: Number(orderId),
|
|
65
|
-
},
|
|
66
|
-
deps,
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
return ajax$.pipe(
|
|
70
|
-
mergeMap(() => {
|
|
71
|
-
return concat(
|
|
72
|
-
of(CheckoutMsg('Checkout.PaymentSubmitError', message)),
|
|
73
|
-
of(CartMsg('Cart.Refresh', { force: true }), scrollTop()),
|
|
74
|
-
);
|
|
75
|
-
}),
|
|
76
|
-
|
|
77
|
-
catchError((errorResponse) => {
|
|
78
|
-
const { error } = extractErrorAndCode(errorResponse);
|
|
79
|
-
|
|
80
|
-
return of(CheckoutMsg('Checkout.PaymentSubmitError', error), scrollTop());
|
|
81
|
-
}),
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return of(CheckoutMsg('Checkout.PaymentSubmitError', message), scrollTop());
|
|
54
|
+
return of(CheckoutMsg('Checkout.PaymentSubmitError', errorMessage), scrollTop());
|
|
86
55
|
},
|
|
87
56
|
),
|
|
88
57
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wearejh/m2-pwa-adyen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Shane Osbourne <shane.osbourne8@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@adyen/adyen-web": "5.59.0",
|
|
25
|
-
"@wearejh/m2-pwa-cart": "^0.
|
|
26
|
-
"@wearejh/m2-pwa-checkout": "^0.
|
|
27
|
-
"@wearejh/m2-pwa-engine": "^0.
|
|
28
|
-
"@wearejh/react-hooks": "^0.
|
|
29
|
-
"@wearejh/rx-form": "^0.
|
|
30
|
-
"@wearejh/swagger-rxjs": "^0.
|
|
25
|
+
"@wearejh/m2-pwa-cart": "^0.29.0",
|
|
26
|
+
"@wearejh/m2-pwa-checkout": "^0.29.0",
|
|
27
|
+
"@wearejh/m2-pwa-engine": "^0.29.0",
|
|
28
|
+
"@wearejh/react-hooks": "^0.29.0",
|
|
29
|
+
"@wearejh/rx-form": "^0.29.0",
|
|
30
|
+
"@wearejh/swagger-rxjs": "^0.29.0",
|
|
31
31
|
"load-js": "^3.0.3"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "23839acac7be06304d42b32c0ac41746843b56de"
|
|
34
34
|
}
|