@daffodil/payment 0.94.1 → 0.95.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/fesm2022/daffodil-payment-driver-in-memory.mjs +151 -118
- package/fesm2022/daffodil-payment-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-payment-driver-testing.mjs +93 -60
- package/fesm2022/daffodil-payment-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-payment-driver.mjs +12 -35
- package/fesm2022/daffodil-payment-driver.mjs.map +1 -1
- package/fesm2022/daffodil-payment-state-testing.mjs +85 -49
- package/fesm2022/daffodil-payment-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-payment-state.mjs +154 -238
- package/fesm2022/daffodil-payment-state.mjs.map +1 -1
- package/fesm2022/daffodil-payment-testing.mjs +178 -139
- package/fesm2022/daffodil-payment-testing.mjs.map +1 -1
- package/fesm2022/daffodil-payment.mjs +0 -4
- package/package.json +1 -1
- package/types/daffodil-payment-driver-in-memory.d.ts +54 -54
- package/types/daffodil-payment-driver-testing.d.ts +25 -23
- package/types/daffodil-payment-driver.d.ts +17 -25
- package/types/daffodil-payment-state-testing.d.ts +22 -19
- package/types/daffodil-payment-state.d.ts +114 -131
- package/types/daffodil-payment-testing.d.ts +37 -39
- package/types/daffodil-payment.d.ts +20 -23
- package/fesm2022/daffodil-payment.mjs.map +0 -1
|
@@ -1,50 +1,86 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Injectable, NgModule } from
|
|
3
|
-
import { BehaviorSubject } from
|
|
4
|
-
import { DaffPaymentPageFacade } from
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Injectable, NgModule, makeEnvironmentProviders } from "@angular/core";
|
|
3
|
+
import { BehaviorSubject } from "rxjs";
|
|
4
|
+
import { DaffPaymentPageFacade } from "@daffodil/payment/state";
|
|
5
|
+
var MockDaffPaymentPageFacade = class MockDaffPaymentPageFacade {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.loading$ = new BehaviorSubject(null);
|
|
8
|
+
this.errors$ = new BehaviorSubject([]);
|
|
9
|
+
}
|
|
10
|
+
dispatch(action) {}
|
|
11
|
+
static {
|
|
12
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
13
|
+
minVersion: "12.0.0",
|
|
14
|
+
version: "22.2.4",
|
|
15
|
+
ngImport: i0,
|
|
16
|
+
type: MockDaffPaymentPageFacade,
|
|
17
|
+
deps: [],
|
|
18
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
static {
|
|
22
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
23
|
+
minVersion: "12.0.0",
|
|
24
|
+
version: "22.2.4",
|
|
25
|
+
ngImport: i0,
|
|
26
|
+
type: MockDaffPaymentPageFacade,
|
|
27
|
+
providedIn: "root"
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
32
|
+
minVersion: "12.0.0",
|
|
33
|
+
version: "22.2.4",
|
|
34
|
+
ngImport: i0,
|
|
35
|
+
type: MockDaffPaymentPageFacade,
|
|
36
|
+
decorators: [{
|
|
37
|
+
type: Injectable,
|
|
38
|
+
args: [{ providedIn: "root" }]
|
|
39
|
+
}]
|
|
40
|
+
});
|
|
41
|
+
const provideDaffPaymentStateTesting = () => makeEnvironmentProviders([{
|
|
42
|
+
provide: DaffPaymentPageFacade,
|
|
43
|
+
useExisting: MockDaffPaymentPageFacade
|
|
44
|
+
}]);
|
|
45
|
+
var DaffPaymentStateTestingModule = class DaffPaymentStateTestingModule {
|
|
46
|
+
static {
|
|
47
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
48
|
+
minVersion: "12.0.0",
|
|
49
|
+
version: "22.2.4",
|
|
50
|
+
ngImport: i0,
|
|
51
|
+
type: DaffPaymentStateTestingModule,
|
|
52
|
+
deps: [],
|
|
53
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
static {
|
|
57
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
58
|
+
minVersion: "14.0.0",
|
|
59
|
+
version: "22.2.4",
|
|
60
|
+
ngImport: i0,
|
|
61
|
+
type: DaffPaymentStateTestingModule
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
static {
|
|
65
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
66
|
+
minVersion: "12.0.0",
|
|
67
|
+
version: "22.2.4",
|
|
68
|
+
ngImport: i0,
|
|
69
|
+
type: DaffPaymentStateTestingModule,
|
|
70
|
+
providers: [provideDaffPaymentStateTesting()]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
75
|
+
minVersion: "12.0.0",
|
|
76
|
+
version: "22.2.4",
|
|
77
|
+
ngImport: i0,
|
|
78
|
+
type: DaffPaymentStateTestingModule,
|
|
79
|
+
decorators: [{
|
|
80
|
+
type: NgModule,
|
|
81
|
+
args: [{ providers: [provideDaffPaymentStateTesting()] }]
|
|
82
|
+
}]
|
|
83
|
+
});
|
|
84
|
+
export { DaffPaymentStateTestingModule, MockDaffPaymentPageFacade, provideDaffPaymentStateTesting };
|
|
5
85
|
|
|
6
|
-
|
|
7
|
-
* Mocks out facade fields and methods for testing purposes.
|
|
8
|
-
*
|
|
9
|
-
* @inheritdoc
|
|
10
|
-
*/
|
|
11
|
-
class MockDaffPaymentPageFacade {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.loading$ = new BehaviorSubject(null);
|
|
14
|
-
this.errors$ = new BehaviorSubject([]);
|
|
15
|
-
}
|
|
16
|
-
dispatch(action) { }
|
|
17
|
-
;
|
|
18
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffPaymentPageFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
19
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffPaymentPageFacade, providedIn: 'root' }); }
|
|
20
|
-
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffPaymentPageFacade, decorators: [{
|
|
22
|
-
type: Injectable,
|
|
23
|
-
args: [{ providedIn: 'root' }]
|
|
24
|
-
}] });
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Provides the {@link MockDaffPaymentPageFacade} for {@link DaffPaymentPageFacade}.
|
|
28
|
-
*/
|
|
29
|
-
class DaffPaymentStateTestingModule {
|
|
30
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
31
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentStateTestingModule }); }
|
|
32
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentStateTestingModule, providers: [
|
|
33
|
-
{ provide: DaffPaymentPageFacade, useExisting: MockDaffPaymentPageFacade },
|
|
34
|
-
] }); }
|
|
35
|
-
}
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentStateTestingModule, decorators: [{
|
|
37
|
-
type: NgModule,
|
|
38
|
-
args: [{
|
|
39
|
-
providers: [
|
|
40
|
-
{ provide: DaffPaymentPageFacade, useExisting: MockDaffPaymentPageFacade },
|
|
41
|
-
],
|
|
42
|
-
}]
|
|
43
|
-
}] });
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Generated bundle index. Do not edit.
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
|
-
export { DaffPaymentStateTestingModule, MockDaffPaymentPageFacade };
|
|
50
|
-
//# sourceMappingURL=daffodil-payment-state-testing.mjs.map
|
|
86
|
+
//# sourceMappingURL=daffodil-payment-state-testing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-payment-state-testing.mjs","sources":["../../../libs/payment/state/testing/src/mock-payment-facade.ts","../../../libs/payment/state/testing/src/
|
|
1
|
+
{"version":3,"file":"daffodil-payment-state-testing.mjs","names":[],"sources":["../../../libs/payment/state/testing/src/mock-payment-facade.ts","../../../libs/payment/state/testing/src/provider.ts","../../../libs/payment/state/testing/src/payment-testing.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffPaymentPageFacadeInterface } from '@daffodil/payment/state';\n\n/**\n * Mocks out facade fields and methods for testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {\n loading$ = new BehaviorSubject<boolean>(null);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n\n dispatch(action: Action) {};\n}\n","import {\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport { DaffPaymentPageFacade } from '@daffodil/payment/state';\n\nimport { MockDaffPaymentPageFacade } from './mock-payment-facade';\n\n/**\n * Provides the {@link MockDaffPaymentPageFacade} for {@link DaffPaymentPageFacade}.\n */\nexport const provideDaffPaymentStateTesting = (): EnvironmentProviders => makeEnvironmentProviders([\n { provide: DaffPaymentPageFacade, useExisting: MockDaffPaymentPageFacade },\n]);\n","import { NgModule } from '@angular/core';\n\nimport { provideDaffPaymentStateTesting } from './provider';\n\n/**\n * Provides the {@link MockDaffPaymentPageFacade} for {@link DaffPaymentPageFacade}.\n *\n * @deprecated in favor of {@link provideDaffPaymentStateTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.\n */\n@NgModule({\n providers: [\n provideDaffPaymentStateTesting(),\n ],\n})\nexport class DaffPaymentStateTestingModule {}\n"],"mappings":";;;;AAaA,IAAa,4BAAb,MAAa,0BAAyB;CADtC,cAAA;EAEE,KAAA,WAAW,IAAI,gBAAyB,IAAI;EAC5C,KAAA,UAAU,IAAI,gBAAkC,CAAA,CAAE;CAGnD;CADC,SAAS,QAAc,CAAG;CAJf;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAyB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAzB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAyB,YADZ;EAAM,CAAA;CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAyB,YAAA,CAAA;EADrC,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE;;;ACAlC,MAAa,uCAA6D,yBAAyB,CACjG;CAAE,SAAS;CAAuB,aAAa;AAAyB,CACzE,CAAA;ACAD,IAAa,gCAAb,MAAa,8BAA6B;CAA7B;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA6B,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAA7B;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;EAA6B,CAAA;CAAA;CAA7B;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA6B,WAJ7B,CACT,+BAA8B,CAC/B;EAAA,CAAA;CAAA;;AAEU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA6B,YAAA,CAAA;EALzC,MAAA;EAAS,MAAA,CAAA,EACR,WAAW,CACT,+BAA8B,CAC/B,EACF,CAAA"}
|
|
@@ -1,250 +1,166 @@
|
|
|
1
|
-
import { createMultiInjectionToken, createSingleInjectionToken, daffArrayToDict } from
|
|
2
|
-
import * as i1 from
|
|
3
|
-
import {
|
|
4
|
-
import * as i0 from
|
|
5
|
-
import { Injectable, inject,
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The payment action types enum.
|
|
10
|
-
*/
|
|
1
|
+
import { createMultiInjectionToken, createSingleInjectionToken, daffArrayToDict } from "@daffodil/core";
|
|
2
|
+
import * as i1 from "@ngrx/store";
|
|
3
|
+
import { StoreModule, combineReducers, createFeatureSelector, createSelector, defaultMemoize, provideState, select } from "@ngrx/store";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { Injectable, NgModule, inject, makeEnvironmentProviders } from "@angular/core";
|
|
6
|
+
import { daffComposeReducers, daffTransformErrorToStateError } from "@daffodil/core/state";
|
|
11
7
|
var DaffPaymentActionTypes;
|
|
12
|
-
(function
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
(function(DaffPaymentActionTypes) {
|
|
9
|
+
DaffPaymentActionTypes["GenerateTokenSuccessAction"] = "[@daffodil/payment] Generate Token Success Action";
|
|
10
|
+
DaffPaymentActionTypes["GenerateTokenFailureAction"] = "[@daffodil/payment] Generate Token Failure Action";
|
|
15
11
|
})(DaffPaymentActionTypes || (DaffPaymentActionTypes = {}));
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* providers: [
|
|
53
|
-
* ...daffPaymentProvideExtraReducers(
|
|
54
|
-
* myReducer1,
|
|
55
|
-
* myReducer2
|
|
56
|
-
* )
|
|
57
|
-
* ]
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
provider: daffPaymentProvideExtraReducers, } = createMultiInjectionToken('DAFF_PAYMENT_EXTRA_REDUCERS', { providedIn: 'any' });
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Manages {@link DaffPaymentReducerState}.
|
|
64
|
-
*/
|
|
65
|
-
class DaffPaymentStateReducerAdapter {
|
|
66
|
-
/**
|
|
67
|
-
* Begins the payment operation flow.
|
|
68
|
-
* Sets loading to true.
|
|
69
|
-
*/
|
|
70
|
-
generateToken(state) {
|
|
71
|
-
return {
|
|
72
|
-
...state,
|
|
73
|
-
loading: true,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Sets loading to false and resets errors.
|
|
78
|
-
*/
|
|
79
|
-
tokenGenerated(state) {
|
|
80
|
-
return {
|
|
81
|
-
...state,
|
|
82
|
-
loading: false,
|
|
83
|
-
errors: [],
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Stores the from a failed payment.
|
|
88
|
-
* Also sets loading to false.
|
|
89
|
-
*/
|
|
90
|
-
storeError(errors, state) {
|
|
91
|
-
return {
|
|
92
|
-
...state,
|
|
93
|
-
errors,
|
|
94
|
-
loading: false,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* The initial state for the main payment state, see {@link DaffPaymentReducerState}.
|
|
101
|
-
*/
|
|
12
|
+
var DaffPaymentGenerateTokenSuccess = class {
|
|
13
|
+
constructor(payload) {
|
|
14
|
+
this.payload = payload;
|
|
15
|
+
this.type = DaffPaymentActionTypes.GenerateTokenSuccessAction;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var DaffPaymentGenerateTokenFailure = class {
|
|
19
|
+
constructor(payload) {
|
|
20
|
+
this.payload = payload;
|
|
21
|
+
this.type = DaffPaymentActionTypes.GenerateTokenFailureAction;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const DAFF_PAYMENT_STORE_FEATURE_KEY = "daffPayment";
|
|
25
|
+
const { token: DAFF_PAYMENT_EXTRA_REDUCERS, provider: daffPaymentProvideExtraReducers } = createMultiInjectionToken("DAFF_PAYMENT_EXTRA_REDUCERS", { providedIn: "any" });
|
|
26
|
+
var DaffPaymentStateReducerAdapter = class {
|
|
27
|
+
generateToken(state) {
|
|
28
|
+
return {
|
|
29
|
+
...state,
|
|
30
|
+
loading: true
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
tokenGenerated(state) {
|
|
34
|
+
return {
|
|
35
|
+
...state,
|
|
36
|
+
loading: false,
|
|
37
|
+
errors: []
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
storeError(errors, state) {
|
|
41
|
+
return {
|
|
42
|
+
...state,
|
|
43
|
+
errors,
|
|
44
|
+
loading: false
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
};
|
|
102
48
|
const daffPaymentInitialState = {
|
|
103
|
-
|
|
104
|
-
|
|
49
|
+
loading: false,
|
|
50
|
+
errors: []
|
|
105
51
|
};
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* The reducer for the payment page state, see {@link DaffPaymentReducerState}.
|
|
109
|
-
*/
|
|
110
52
|
const daffPaymentReducerFactory = (actions) => (state = daffPaymentInitialState, action) => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return adapter.storeError([action.payload], state);
|
|
119
|
-
default:
|
|
120
|
-
return state;
|
|
121
|
-
}
|
|
53
|
+
const adapter = new DaffPaymentStateReducerAdapter();
|
|
54
|
+
switch (true) {
|
|
55
|
+
case actions.includes(action.type): return adapter.generateToken(state);
|
|
56
|
+
case action.type === DaffPaymentActionTypes.GenerateTokenSuccessAction: return adapter.tokenGenerated(state);
|
|
57
|
+
case action.type === DaffPaymentActionTypes.GenerateTokenFailureAction: return adapter.storeError([action.payload], state);
|
|
58
|
+
default: return state;
|
|
59
|
+
}
|
|
122
60
|
};
|
|
123
|
-
|
|
124
|
-
const getDaffPaymentReducersStateSelector = defaultMemoize(() => ({
|
|
125
|
-
selectPaymentFeatureState: createFeatureSelector(DAFF_PAYMENT_STORE_FEATURE_KEY),
|
|
126
|
-
})).memoized;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Creates a group of selectors for {@link DaffPaymentReducerState} that use the passed state selector as the basis.
|
|
130
|
-
*/
|
|
61
|
+
const getDaffPaymentReducersStateSelector = defaultMemoize(() => ({ selectPaymentFeatureState: createFeatureSelector(DAFF_PAYMENT_STORE_FEATURE_KEY) })).memoized;
|
|
131
62
|
const daffPaymentCreateSelectors = () => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
selectPaymentErrors,
|
|
139
|
-
};
|
|
63
|
+
const { selectPaymentFeatureState } = getDaffPaymentReducersStateSelector();
|
|
64
|
+
const selectPaymentState = createSelector(selectPaymentFeatureState, (state) => state.payment);
|
|
65
|
+
return {
|
|
66
|
+
selectPaymentLoading: createSelector(selectPaymentState, (state) => state.loading),
|
|
67
|
+
selectPaymentErrors: createSelector(selectPaymentState, (state) => state.errors)
|
|
68
|
+
};
|
|
140
69
|
};
|
|
141
70
|
const daffPaymentGetSelectors = defaultMemoize(() => daffPaymentCreateSelectors()).memoized;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* An internal token to combine the available payment processors into a single collection.
|
|
184
|
-
*/
|
|
185
|
-
token: DAFF_PAYMENT_PROCESSOR_COLLECTION,
|
|
186
|
-
/**
|
|
187
|
-
* Provider function for {@link DAFF_PAYMENT_PROCESSOR_COLLECTION}.
|
|
188
|
-
*/
|
|
189
|
-
provider: provideDaffPaymentProcessorCollection, } = createSingleInjectionToken('DAFF_PAYMENT_PROCESSOR_COLLECTION', {
|
|
190
|
-
factory: () => {
|
|
191
|
-
const processors = inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS);
|
|
192
|
-
return daffArrayToDict(processors, ({ kind }) => kind);
|
|
193
|
-
},
|
|
71
|
+
var DaffPaymentPageFacade = class DaffPaymentPageFacade {
|
|
72
|
+
constructor(store) {
|
|
73
|
+
this.store = store;
|
|
74
|
+
const { selectPaymentLoading, selectPaymentErrors } = daffPaymentGetSelectors();
|
|
75
|
+
this.loading$ = this.store.pipe(select(selectPaymentLoading));
|
|
76
|
+
this.errors$ = this.store.pipe(select(selectPaymentErrors));
|
|
77
|
+
}
|
|
78
|
+
dispatch(action) {
|
|
79
|
+
this.store.dispatch(action);
|
|
80
|
+
}
|
|
81
|
+
static {
|
|
82
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
83
|
+
minVersion: "12.0.0",
|
|
84
|
+
version: "22.2.4",
|
|
85
|
+
ngImport: i0,
|
|
86
|
+
type: DaffPaymentPageFacade,
|
|
87
|
+
deps: [{ token: i1.Store }],
|
|
88
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
static {
|
|
92
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
93
|
+
minVersion: "12.0.0",
|
|
94
|
+
version: "22.2.4",
|
|
95
|
+
ngImport: i0,
|
|
96
|
+
type: DaffPaymentPageFacade,
|
|
97
|
+
providedIn: "root"
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
102
|
+
minVersion: "12.0.0",
|
|
103
|
+
version: "22.2.4",
|
|
104
|
+
ngImport: i0,
|
|
105
|
+
type: DaffPaymentPageFacade,
|
|
106
|
+
decorators: [{
|
|
107
|
+
type: Injectable,
|
|
108
|
+
args: [{ providedIn: "root" }]
|
|
109
|
+
}],
|
|
110
|
+
ctorParameters: () => [{ type: i1.Store }]
|
|
194
111
|
});
|
|
195
|
-
|
|
196
|
-
const {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
token:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
112
|
+
const { token: DAFF_PAYMENT_AVAILABLE_PROCESSORS, provider: daffPaymentProvideAvailableProcessors } = createMultiInjectionToken("DAFF_PAYMENT_AVAILABLE_PROCESSORS", { providedIn: "any" });
|
|
113
|
+
const { token: DAFF_PAYMENT_PROCESSOR_COLLECTION, provider: provideDaffPaymentProcessorCollection } = createSingleInjectionToken("DAFF_PAYMENT_PROCESSOR_COLLECTION", { factory: () => {
|
|
114
|
+
const processors = inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS);
|
|
115
|
+
return daffArrayToDict(processors, ({ kind }) => kind);
|
|
116
|
+
} });
|
|
117
|
+
const { token: DAFF_PAYMENT_ERROR_MATCHER, provider: provideDaffPaymentErrorMatcher } = createSingleInjectionToken("DAFF_PAYMENT_ERROR_MATCHER", { factory: () => daffTransformErrorToStateError });
|
|
118
|
+
const { token: DAFF_PAYMENT_REDUCERS, provider: provideDaffPaymentReducers, factoryProvider: provideDaffPaymentReducersFactory } = createSingleInjectionToken("DAFF_PAYMENT_REDUCERS");
|
|
119
|
+
var DaffPaymentStateModule = class DaffPaymentStateModule {
|
|
120
|
+
static {
|
|
121
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
122
|
+
minVersion: "12.0.0",
|
|
123
|
+
version: "22.2.4",
|
|
124
|
+
ngImport: i0,
|
|
125
|
+
type: DaffPaymentStateModule,
|
|
126
|
+
deps: [],
|
|
127
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
static {
|
|
131
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
132
|
+
minVersion: "14.0.0",
|
|
133
|
+
version: "22.2.4",
|
|
134
|
+
ngImport: i0,
|
|
135
|
+
type: DaffPaymentStateModule,
|
|
136
|
+
imports: [i1.StoreFeatureModule]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
static {
|
|
140
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
141
|
+
minVersion: "12.0.0",
|
|
142
|
+
version: "22.2.4",
|
|
143
|
+
ngImport: i0,
|
|
144
|
+
type: DaffPaymentStateModule,
|
|
145
|
+
providers: [provideDaffPaymentReducersFactory((() => daffComposeReducers([combineReducers({ payment: daffPaymentReducerFactory(inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS).map((({ action }) => action))) }), ...inject(DAFF_PAYMENT_EXTRA_REDUCERS)])))],
|
|
146
|
+
imports: [StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS)]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
151
|
+
minVersion: "12.0.0",
|
|
152
|
+
version: "22.2.4",
|
|
153
|
+
ngImport: i0,
|
|
154
|
+
type: DaffPaymentStateModule,
|
|
155
|
+
decorators: [{
|
|
156
|
+
type: NgModule,
|
|
157
|
+
args: [{
|
|
158
|
+
imports: [StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS)],
|
|
159
|
+
providers: [provideDaffPaymentReducersFactory((() => daffComposeReducers([combineReducers({ payment: daffPaymentReducerFactory(inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS).map((({ action }) => action))) }), ...inject(DAFF_PAYMENT_EXTRA_REDUCERS)])))]
|
|
160
|
+
}]
|
|
161
|
+
}]
|
|
226
162
|
});
|
|
163
|
+
const provideDaffPaymentState = () => makeEnvironmentProviders([provideState(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS), provideDaffPaymentReducersFactory(() => daffComposeReducers([combineReducers({ payment: daffPaymentReducerFactory(inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS).map(({ action }) => action)) }), ...inject(DAFF_PAYMENT_EXTRA_REDUCERS)]))]);
|
|
164
|
+
export { DAFF_PAYMENT_AVAILABLE_PROCESSORS, DAFF_PAYMENT_ERROR_MATCHER, DAFF_PAYMENT_EXTRA_REDUCERS, DAFF_PAYMENT_PROCESSOR_COLLECTION, DAFF_PAYMENT_STORE_FEATURE_KEY, DaffPaymentActionTypes, DaffPaymentGenerateTokenFailure, DaffPaymentGenerateTokenSuccess, DaffPaymentPageFacade, DaffPaymentStateModule, DaffPaymentStateReducerAdapter, daffPaymentGetSelectors, daffPaymentInitialState, daffPaymentProvideAvailableProcessors, daffPaymentProvideExtraReducers, daffPaymentReducerFactory, provideDaffPaymentErrorMatcher, provideDaffPaymentState };
|
|
227
165
|
|
|
228
|
-
|
|
229
|
-
* Creates the payment feature store.
|
|
230
|
-
*/
|
|
231
|
-
class DaffPaymentStateModule {
|
|
232
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
233
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentStateModule, imports: [i1.StoreFeatureModule] }); }
|
|
234
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentStateModule, imports: [StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS)] }); }
|
|
235
|
-
}
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentStateModule, decorators: [{
|
|
237
|
-
type: NgModule,
|
|
238
|
-
args: [{
|
|
239
|
-
imports: [
|
|
240
|
-
StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS),
|
|
241
|
-
],
|
|
242
|
-
}]
|
|
243
|
-
}] });
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Generated bundle index. Do not edit.
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
export { DAFF_PAYMENT_AVAILABLE_PROCESSORS, DAFF_PAYMENT_ERROR_MATCHER, DAFF_PAYMENT_EXTRA_REDUCERS, DAFF_PAYMENT_PROCESSOR_COLLECTION, DAFF_PAYMENT_STORE_FEATURE_KEY, DaffPaymentActionTypes, DaffPaymentGenerateTokenFailure, DaffPaymentGenerateTokenSuccess, DaffPaymentPageFacade, DaffPaymentStateModule, DaffPaymentStateReducerAdapter, daffPaymentGetSelectors, daffPaymentInitialState, daffPaymentProvideAvailableProcessors, daffPaymentProvideExtraReducers, daffPaymentReducerFactory, provideDaffPaymentErrorMatcher };
|
|
250
|
-
//# sourceMappingURL=daffodil-payment-state.mjs.map
|
|
166
|
+
//# sourceMappingURL=daffodil-payment-state.mjs.map
|