@daffodil/payment 0.81.1 → 0.82.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/README.md +1 -1
- package/fesm2022/daffodil-payment-driver-in-memory.mjs +10 -10
- package/fesm2022/daffodil-payment-driver-testing.mjs +7 -7
- package/fesm2022/daffodil-payment-state-testing.mjs +7 -7
- package/fesm2022/daffodil-payment-state.mjs +7 -7
- package/fesm2022/daffodil-payment-state.mjs.map +1 -1
- package/fesm2022/daffodil-payment-testing.mjs +13 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
## Overview
|
|
5
5
|
`@daffodil/payment` doesn't inherently support any particular payment methods but instead provide base models and extension points that are utilized by other libraries.
|
|
6
6
|
|
|
7
|
-
See [@daffodil/authorizenet](
|
|
7
|
+
See [@daffodil/authorizenet](/libs/authorizenet/README.md) for an example of such a library.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
To install `@daffodil/payment`, use the following commands in your terminal.
|
|
@@ -49,10 +49,10 @@ class DaffPaymentInMemoryBackendService {
|
|
|
49
49
|
body: this.factory.create(),
|
|
50
50
|
}));
|
|
51
51
|
}
|
|
52
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
53
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
52
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentInMemoryBackendService, deps: [{ token: i1.DaffPaymentResponseKindFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
53
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentInMemoryBackendService, providedIn: 'root' }); }
|
|
54
54
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentInMemoryBackendService, decorators: [{
|
|
56
56
|
type: Injectable,
|
|
57
57
|
args: [{
|
|
58
58
|
providedIn: 'root',
|
|
@@ -72,10 +72,10 @@ class DaffPaymentInMemoryDriver extends DaffInMemoryDriverBase {
|
|
|
72
72
|
generateToken(request) {
|
|
73
73
|
return this.http.get(this.url);
|
|
74
74
|
}
|
|
75
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
76
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
75
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentInMemoryDriver, deps: [{ token: i1$1.HttpClient }, { token: i2.InMemoryBackendConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
76
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentInMemoryDriver, providedIn: 'root' }); }
|
|
77
77
|
}
|
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentInMemoryDriver, decorators: [{
|
|
79
79
|
type: Injectable,
|
|
80
80
|
args: [{
|
|
81
81
|
providedIn: 'root',
|
|
@@ -95,13 +95,13 @@ class DaffPaymentInMemoryDriverModule {
|
|
|
95
95
|
],
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
99
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
98
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
99
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentInMemoryDriverModule, imports: [CommonModule,
|
|
100
100
|
DaffPaymentTestingModule] }); }
|
|
101
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
101
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentInMemoryDriverModule, imports: [CommonModule,
|
|
102
102
|
DaffPaymentTestingModule] }); }
|
|
103
103
|
}
|
|
104
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentInMemoryDriverModule, decorators: [{
|
|
105
105
|
type: NgModule,
|
|
106
106
|
args: [{
|
|
107
107
|
imports: [
|
|
@@ -18,10 +18,10 @@ class DaffPaymentTestingDriver {
|
|
|
18
18
|
generateToken(request) {
|
|
19
19
|
return of(this.paymentResponseFactory.create());
|
|
20
20
|
}
|
|
21
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
22
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
21
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingDriver, deps: [{ token: i1.DaffPaymentResponseKindFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
22
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingDriver, providedIn: 'root' }); }
|
|
23
23
|
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingDriver, decorators: [{
|
|
25
25
|
type: Injectable,
|
|
26
26
|
args: [{
|
|
27
27
|
providedIn: 'root',
|
|
@@ -40,11 +40,11 @@ class DaffPaymentTestingDriverModule {
|
|
|
40
40
|
],
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
44
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
45
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
43
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
44
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingDriverModule, imports: [CommonModule] }); }
|
|
45
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingDriverModule, imports: [CommonModule] }); }
|
|
46
46
|
}
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingDriverModule, decorators: [{
|
|
48
48
|
type: NgModule,
|
|
49
49
|
args: [{
|
|
50
50
|
imports: [
|
|
@@ -15,10 +15,10 @@ class MockDaffPaymentPageFacade {
|
|
|
15
15
|
}
|
|
16
16
|
dispatch(action) { }
|
|
17
17
|
;
|
|
18
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
19
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
18
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffPaymentPageFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
19
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffPaymentPageFacade, providedIn: 'root' }); }
|
|
20
20
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffPaymentPageFacade, decorators: [{
|
|
22
22
|
type: Injectable,
|
|
23
23
|
args: [{ providedIn: 'root' }]
|
|
24
24
|
}] });
|
|
@@ -27,13 +27,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
|
|
|
27
27
|
* Provides the {@link MockDaffPaymentPageFacade} for {@link DaffPaymentPageFacade}.
|
|
28
28
|
*/
|
|
29
29
|
class DaffPaymentStateTestingModule {
|
|
30
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
31
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
32
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
30
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
31
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentStateTestingModule }); }
|
|
32
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentStateTestingModule, providers: [
|
|
33
33
|
{ provide: DaffPaymentPageFacade, useExisting: MockDaffPaymentPageFacade },
|
|
34
34
|
] }); }
|
|
35
35
|
}
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentStateTestingModule, decorators: [{
|
|
37
37
|
type: NgModule,
|
|
38
38
|
args: [{
|
|
39
39
|
providers: [
|
|
@@ -162,10 +162,10 @@ class DaffPaymentPageFacade {
|
|
|
162
162
|
dispatch(action) {
|
|
163
163
|
this.store.dispatch(action);
|
|
164
164
|
}
|
|
165
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
166
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
165
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentPageFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
166
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentPageFacade, providedIn: 'root' }); }
|
|
167
167
|
}
|
|
168
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentPageFacade, decorators: [{
|
|
169
169
|
type: Injectable,
|
|
170
170
|
args: [{
|
|
171
171
|
providedIn: 'root',
|
|
@@ -235,11 +235,11 @@ provider: provideDaffPaymentReducers, } = createSingleInjectionToken('DAFF_PAYME
|
|
|
235
235
|
* Creates the payment feature store.
|
|
236
236
|
*/
|
|
237
237
|
class DaffPaymentStateModule {
|
|
238
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
239
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
240
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
238
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
239
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentStateModule, imports: [i1.StoreFeatureModule] }); }
|
|
240
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentStateModule, imports: [StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS)] }); }
|
|
241
241
|
}
|
|
242
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentStateModule, decorators: [{
|
|
243
243
|
type: NgModule,
|
|
244
244
|
args: [{
|
|
245
245
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-payment-state.mjs","sources":["../../../libs/payment/state/src/actions/payment.actions.ts","../../../libs/payment/state/src/reducers/store-feature-key.ts","../../../libs/payment/state/src/reducers/token/extra.token.ts","../../../libs/payment/state/src/reducers/payment/adapter.ts","../../../libs/payment/state/src/reducers/payment/initial-state.ts","../../../libs/payment/state/src/reducers/payment/reducer.ts","../../../libs/payment/state/src/selectors/feature.selector.ts","../../../libs/payment/state/src/selectors/payment.selector.ts","../../../libs/payment/state/src/facades/payment/facade.ts","../../../libs/payment/state/src/injection-tokens/available-processors.token.ts","../../../libs/payment/state/src/injection-tokens/processor-collection.token.ts","../../../libs/payment/state/src/injection-tokens/error-matcher.token.ts","../../../libs/payment/state/src/reducers/token/reducers.token.ts","../../../libs/payment/state/src/payment.module.ts","../../../libs/payment/state/src/daffodil-payment-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffPersonalAddress } from '@daffodil/geography';\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\n\n/**\n * The payment action types enum.\n */\nexport enum DaffPaymentActionTypes {\n GenerateTokenSuccessAction = '[@daffodil/payment] Generate Token Success Action',\n GenerateTokenFailureAction = '[@daffodil/payment] Generate Token Failure Action',\n}\n\n/**\n * Generates a payment token.\n *\n * @param query The payment query.\n */\nexport interface DaffPaymentGenerateTokenPayload<T extends DaffPaymentRequest = DaffPaymentRequest> {\n readonly request: T;\n readonly address?: DaffPersonalAddress | DaffIdentifiable;\n}\nexport interface DaffPaymentGenerateToken<T extends DaffPaymentRequest = DaffPaymentRequest> extends DaffPaymentGenerateTokenPayload<T>, Action {}\n\n/**\n * Indicates a successful generation of a payment token.\n */\nexport class DaffPaymentGenerateTokenSuccess<T extends DaffPaymentResponse = DaffPaymentResponse> implements Action {\n readonly type = DaffPaymentActionTypes.GenerateTokenSuccessAction;\n\n constructor(public payload: T) {}\n}\n\n/**\n * A failed payment with the error message.\n */\nexport class DaffPaymentGenerateTokenFailure implements Action {\n readonly type = DaffPaymentActionTypes.GenerateTokenFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\n/**\n * A union of the payment action types.\n */\nexport type DaffPaymentActions<\n T extends DaffPaymentResponse = DaffPaymentResponse,\n> =\n | DaffPaymentGenerateTokenSuccess<T>\n | DaffPaymentGenerateTokenFailure;\n","/**\n * The key under which the payment feature state will be stored.\n */\nexport const DAFF_PAYMENT_STORE_FEATURE_KEY = 'daffPayment';\n","import { ActionReducer } from '@ngrx/store';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\nexport const {\n /**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffPaymentProvideExtraReducers}.\n */\n token: DAFF_PAYMENT_EXTRA_REDUCERS,\n\n /**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * @example\n * ```ts\n * providers: [\n * ...daffPaymentProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\n provider: daffPaymentProvideExtraReducers,\n} = createMultiInjectionToken<ActionReducer<DaffPaymentReducersState>>(\n 'DAFF_PAYMENT_EXTRA_REDUCERS',\n { providedIn: 'any' },\n);\n","import { DaffStateError } from '@daffodil/core/state';\n\nimport { DaffPaymentReducerState } from './interface';\n\n/**\n * Manages {@link DaffPaymentReducerState}.\n */\nexport class DaffPaymentStateReducerAdapter {\n\n /**\n * Begins the payment operation flow.\n * Sets loading to true.\n */\n generateToken(state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n loading: true,\n };\n }\n\n /**\n * Sets loading to false and resets errors.\n */\n tokenGenerated(state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n loading: false,\n errors: [],\n };\n }\n\n /**\n * Stores the from a failed payment.\n * Also sets loading to false.\n */\n storeError(errors: DaffStateError[], state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n errors,\n loading: false,\n };\n }\n}\n","import { DaffPaymentReducerState } from './interface';\n\n/**\n * The initial state for the main payment state, see {@link DaffPaymentReducerState}.\n */\nexport const daffPaymentInitialState: DaffPaymentReducerState = {\n loading: false,\n errors: [],\n};\n","import { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DaffPaymentStateReducerAdapter } from './adapter';\nimport { daffPaymentInitialState } from './initial-state';\nimport { DaffPaymentReducerState } from './interface';\nimport {\n DaffPaymentGenerateToken,\n DaffPaymentActionTypes,\n DaffPaymentActions,\n DaffPaymentGenerateTokenFailure,\n} from '../../actions/payment.actions';\n\n/**\n * The reducer for the payment page state, see {@link DaffPaymentReducerState}.\n */\nexport const daffPaymentReducerFactory = <T extends DaffPaymentResponse = DaffPaymentResponse>(actions: DaffPaymentGenerateToken['type'][]) =>\n (\n state = daffPaymentInitialState,\n action: DaffPaymentActions<T>,\n ): DaffPaymentReducerState => {\n const adapter = new DaffPaymentStateReducerAdapter();\n switch (true) {\n case actions.includes(action.type):\n return adapter.generateToken(state);\n\n case action.type === DaffPaymentActionTypes.GenerateTokenSuccessAction:\n return adapter.tokenGenerated(state);\n\n case action.type === DaffPaymentActionTypes.GenerateTokenFailureAction:\n return adapter.storeError([(<DaffPaymentGenerateTokenFailure>action).payload], state);\n\n default:\n return state;\n }\n };\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n DaffPaymentStateRootSlice,\n DaffPaymentReducersState,\n DAFF_PAYMENT_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\n/**\n * Selector for the payment feature state.\n */\nexport interface DaffPaymentFeatureSelector {\n selectPaymentFeatureState: MemoizedSelector<DaffPaymentStateRootSlice, DaffPaymentReducersState>;\n}\n\nexport const getDaffPaymentReducersStateSelector = (() => {\n let cache;\n return (): DaffPaymentFeatureSelector =>\n cache = cache || {\n selectPaymentFeatureState: createFeatureSelector<DaffPaymentReducersState>(DAFF_PAYMENT_STORE_FEATURE_KEY),\n };\n})();\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\n\nimport { getDaffPaymentReducersStateSelector } from './feature.selector';\nimport { DaffPaymentStateRootSlice } from '../reducers/public_api';\n\n/**\n * Selectors for the main part of payment state.\n */\nexport interface DaffPaymentSelectors {\n /**\n * Selects whether there is a pending payment operation.\n */\n selectPaymentLoading: MemoizedSelector<DaffPaymentStateRootSlice, boolean>;\n /**\n * Selects the list of payment errors, if any.\n */\n selectPaymentErrors: MemoizedSelector<DaffPaymentStateRootSlice, DaffStateError[]>;\n}\n\n/**\n * Creates a group of selectors for {@link DaffPaymentReducerState} that use the passed state selector as the basis.\n */\nconst daffPaymentCreateSelectors = () => {\n const { selectPaymentFeatureState } = getDaffPaymentReducersStateSelector();\n const selectPaymentState = createSelector(\n selectPaymentFeatureState,\n state => state.payment,\n );\n\n const selectPaymentLoading = createSelector(\n selectPaymentState,\n state => state.loading,\n );\n\n const selectPaymentErrors = createSelector(\n selectPaymentState,\n state => state.errors,\n );\n\n return {\n selectPaymentLoading,\n selectPaymentErrors,\n };\n};\n\n\nexport const daffPaymentGetSelectors = (() => {\n let cache;\n return (): DaffPaymentSelectors =>\n cache = cache || daffPaymentCreateSelectors();\n})();\n\n","import { Injectable } from '@angular/core';\nimport {\n Action,\n Store,\n select,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\n\nimport { DaffPaymentPageFacadeInterface } from './interface';\nimport { DaffPaymentStateRootSlice } from '../../reducers/public_api';\nimport { daffPaymentGetSelectors } from '../../selectors/public_api';\n\n/**\n * @inheritdoc\n *\n * Serves as the base for a payment facade.\n * Extend this class and pass in the selectors for the specific state you wish to target.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {\n loading$: Observable<boolean>;\n errors$: Observable<DaffStateError[]>;\n\n constructor(\n private store: Store<DaffPaymentStateRootSlice>,\n ) {\n const {\n selectPaymentLoading,\n selectPaymentErrors,\n } = daffPaymentGetSelectors();\n\n this.loading$ = this.store.pipe(select(selectPaymentLoading));\n this.errors$ = this.store.pipe(select(selectPaymentErrors));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffPaymentAvailableProcessor } from '../models/public_api';\n\nexport const {\n /**\n * A multi-provider injection token for registering payment processors.\n */\n token: DAFF_PAYMENT_AVAILABLE_PROCESSORS,\n\n /**\n * Provides a payment processor registration.\n *\n * See {@link DaffPaymentAvailableProcessor}.\n */\n provider: daffPaymentProvideAvailableProcessors,\n} = createMultiInjectionToken<DaffPaymentAvailableProcessor>(\n 'DAFF_PAYMENT_AVAILABLE_PROCESSORS',\n { providedIn: 'any' },\n);\n","import { inject } from '@angular/core';\n\nimport {\n createSingleInjectionToken,\n daffArrayToDict,\n} from '@daffodil/core';\n\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from './available-processors.token';\nimport { DaffPaymentProcessorCollection } from '../models/public_api';\n\nexport const {\n /**\n * An internal token to combine the available payment processors into a single collection.\n */\n token: DAFF_PAYMENT_PROCESSOR_COLLECTION,\n /**\n * Provider function for {@link DAFF_PAYMENT_PROCESSOR_COLLECTION}.\n */\n provider: provideDaffPaymentProcessorCollection,\n} = createSingleInjectionToken<DaffPaymentProcessorCollection>(\n 'DAFF_PAYMENT_PROCESSOR_COLLECTION',\n {\n factory: () => {\n const processors = inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS);\n return daffArrayToDict(processors, ({ kind }) => kind);\n },\n },\n);\n","import { createSingleInjectionToken } from '@daffodil/core';\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\nexport const {\n /**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\n token: DAFF_PAYMENT_ERROR_MATCHER,\n /**\n * Provider function for {@link DAFF_PAYMENT_ERROR_MATCHER}.\n */\n provider: provideDaffPaymentErrorMatcher,\n} = createSingleInjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_PAYMENT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import { inject } from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\nimport { daffComposeReducers } from '@daffodil/core/state';\n// these unused imports are a workaround\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DAFF_PAYMENT_EXTRA_REDUCERS } from './extra.token';\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from '../../injection-tokens/public_api';\nimport { daffPaymentReducerFactory } from '../payment/reducer';\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\nexport const {\n /**\n * An internal token to hold the Daffodil payment reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\n token: DAFF_PAYMENT_REDUCERS,\n /**\n * Provider function for {@link DAFF_PAYMENT_REDUCERS}.\n */\n provider: provideDaffPaymentReducers,\n} = createSingleInjectionToken<ActionReducer<DaffPaymentReducersState>>(\n 'DAFF_PAYMENT_REDUCERS',\n {\n providedIn: 'any',\n factory: () => daffComposeReducers([\n combineReducers({\n payment: daffPaymentReducerFactory(inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS).map(({ action }) => action)),\n }),\n ...inject(DAFF_PAYMENT_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DAFF_PAYMENT_STORE_FEATURE_KEY } from './reducers/public_api';\nimport { DAFF_PAYMENT_REDUCERS } from './reducers/token/reducers.token';\n\n/**\n * Creates the payment feature store.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS),\n ],\n})\nexport class DaffPaymentStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUA;;AAEG;IACS;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF;AAChF,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF;AAClF,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,GAGjC,EAAA,CAAA,CAAA;AAaD;;AAEG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,OAAU,EAAA;QAAV,IAAO,CAAA,OAAA,GAAP,OAAO;AAFjB,QAAA,IAAA,CAAA,IAAI,GAAG,sBAAsB,CAAC,0BAA0B;;AAGlE;AAED;;AAEG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,OAAuB,EAAA;QAAvB,IAAO,CAAA,OAAA,GAAP,OAAO;AAFjB,QAAA,IAAA,CAAA,IAAI,GAAG,sBAAsB,CAAC,0BAA0B;;AAGlE;;AC7CD;;AAEG;AACI,MAAM,8BAA8B,GAAG;;ACGjC,MAAA;AACX;;;;AAIG;AACH,KAAK,EAAE,2BAA2B;AAElC;;;;;;;;;;;;AAYG;AACH,QAAQ,EAAE,+BAA+B,GAC1C,GAAG,yBAAyB,CAC3B,6BAA6B,EAC7B,EAAE,UAAU,EAAE,KAAK,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CAC5B,uBAAuB,EACvB;AACE,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjC,QAAA,eAAe,CAAC;AACd,YAAA,OAAO,EAAE,yBAAyB,CAAC,MAAM,CAAC,iCAAiC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,CAAC;SAC1G,CAAC;QACF,GAAG,MAAM,CAAC,2BAA2B,CAAC;KACvC,CAAC;AACH,CAAA,CACF;;ACjCD;;AAEG;MAMU,sBAAsB,CAAA;iIAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;kIAAtB,sBAAsB,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,CAAA;kIAAtB,sBAAsB,EAAA,OAAA,EAAA,CAH/B,WAAW,CAAC,UAAU,CAAC,8BAA8B,EAAE,qBAAqB,CAAC,CAAA,EAAA,CAAA,CAAA;;2FAGpE,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBALlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,8BAA8B,EAAE,qBAAqB,CAAC;AAC9E,qBAAA;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-payment-state.mjs","sources":["../../../libs/payment/state/src/actions/payment.actions.ts","../../../libs/payment/state/src/reducers/store-feature-key.ts","../../../libs/payment/state/src/reducers/token/extra.token.ts","../../../libs/payment/state/src/reducers/payment/adapter.ts","../../../libs/payment/state/src/reducers/payment/initial-state.ts","../../../libs/payment/state/src/reducers/payment/reducer.ts","../../../libs/payment/state/src/selectors/feature.selector.ts","../../../libs/payment/state/src/selectors/payment.selector.ts","../../../libs/payment/state/src/facades/payment/facade.ts","../../../libs/payment/state/src/injection-tokens/available-processors.token.ts","../../../libs/payment/state/src/injection-tokens/processor-collection.token.ts","../../../libs/payment/state/src/injection-tokens/error-matcher.token.ts","../../../libs/payment/state/src/reducers/token/reducers.token.ts","../../../libs/payment/state/src/payment.module.ts","../../../libs/payment/state/src/daffodil-payment-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffPersonalAddress } from '@daffodil/geography';\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\n\n/**\n * The payment action types enum.\n */\nexport enum DaffPaymentActionTypes {\n GenerateTokenSuccessAction = '[@daffodil/payment] Generate Token Success Action',\n GenerateTokenFailureAction = '[@daffodil/payment] Generate Token Failure Action',\n}\n\n/**\n * Generates a payment token.\n *\n * @param query The payment query.\n */\nexport interface DaffPaymentGenerateTokenPayload<T extends DaffPaymentRequest = DaffPaymentRequest> {\n readonly request: T;\n readonly address?: DaffPersonalAddress | DaffIdentifiable;\n}\nexport interface DaffPaymentGenerateToken<T extends DaffPaymentRequest = DaffPaymentRequest> extends DaffPaymentGenerateTokenPayload<T>, Action {}\n\n/**\n * Indicates a successful generation of a payment token.\n */\nexport class DaffPaymentGenerateTokenSuccess<T extends DaffPaymentResponse = DaffPaymentResponse> implements Action {\n readonly type = DaffPaymentActionTypes.GenerateTokenSuccessAction;\n\n constructor(public payload: T) {}\n}\n\n/**\n * A failed payment with the error message.\n */\nexport class DaffPaymentGenerateTokenFailure implements Action {\n readonly type = DaffPaymentActionTypes.GenerateTokenFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\n/**\n * A union of the payment action types.\n */\nexport type DaffPaymentActions<\n T extends DaffPaymentResponse = DaffPaymentResponse,\n> =\n | DaffPaymentGenerateTokenSuccess<T>\n | DaffPaymentGenerateTokenFailure;\n","/**\n * The key under which the payment feature state will be stored.\n */\nexport const DAFF_PAYMENT_STORE_FEATURE_KEY = 'daffPayment';\n","import { ActionReducer } from '@ngrx/store';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\nexport const {\n /**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffPaymentProvideExtraReducers}.\n */\n token: DAFF_PAYMENT_EXTRA_REDUCERS,\n\n /**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * @example\n * ```ts\n * providers: [\n * ...daffPaymentProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\n provider: daffPaymentProvideExtraReducers,\n} = createMultiInjectionToken<ActionReducer<DaffPaymentReducersState>>(\n 'DAFF_PAYMENT_EXTRA_REDUCERS',\n { providedIn: 'any' },\n);\n","import { DaffStateError } from '@daffodil/core/state';\n\nimport { DaffPaymentReducerState } from './interface';\n\n/**\n * Manages {@link DaffPaymentReducerState}.\n */\nexport class DaffPaymentStateReducerAdapter {\n\n /**\n * Begins the payment operation flow.\n * Sets loading to true.\n */\n generateToken(state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n loading: true,\n };\n }\n\n /**\n * Sets loading to false and resets errors.\n */\n tokenGenerated(state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n loading: false,\n errors: [],\n };\n }\n\n /**\n * Stores the from a failed payment.\n * Also sets loading to false.\n */\n storeError(errors: DaffStateError[], state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n errors,\n loading: false,\n };\n }\n}\n","import { DaffPaymentReducerState } from './interface';\n\n/**\n * The initial state for the main payment state, see {@link DaffPaymentReducerState}.\n */\nexport const daffPaymentInitialState: DaffPaymentReducerState = {\n loading: false,\n errors: [],\n};\n","import { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DaffPaymentStateReducerAdapter } from './adapter';\nimport { daffPaymentInitialState } from './initial-state';\nimport { DaffPaymentReducerState } from './interface';\nimport {\n DaffPaymentGenerateToken,\n DaffPaymentActionTypes,\n DaffPaymentActions,\n DaffPaymentGenerateTokenFailure,\n} from '../../actions/payment.actions';\n\n/**\n * The reducer for the payment page state, see {@link DaffPaymentReducerState}.\n */\nexport const daffPaymentReducerFactory = <T extends DaffPaymentResponse = DaffPaymentResponse>(actions: DaffPaymentGenerateToken['type'][]) =>\n (\n state = daffPaymentInitialState,\n action: DaffPaymentActions<T>,\n ): DaffPaymentReducerState => {\n const adapter = new DaffPaymentStateReducerAdapter();\n switch (true) {\n case actions.includes(action.type):\n return adapter.generateToken(state);\n\n case action.type === DaffPaymentActionTypes.GenerateTokenSuccessAction:\n return adapter.tokenGenerated(state);\n\n case action.type === DaffPaymentActionTypes.GenerateTokenFailureAction:\n return adapter.storeError([(<DaffPaymentGenerateTokenFailure>action).payload], state);\n\n default:\n return state;\n }\n };\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n DaffPaymentStateRootSlice,\n DaffPaymentReducersState,\n DAFF_PAYMENT_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\n/**\n * Selector for the payment feature state.\n */\nexport interface DaffPaymentFeatureSelector {\n selectPaymentFeatureState: MemoizedSelector<DaffPaymentStateRootSlice, DaffPaymentReducersState>;\n}\n\nexport const getDaffPaymentReducersStateSelector = (() => {\n let cache;\n return (): DaffPaymentFeatureSelector =>\n cache = cache || {\n selectPaymentFeatureState: createFeatureSelector<DaffPaymentReducersState>(DAFF_PAYMENT_STORE_FEATURE_KEY),\n };\n})();\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\n\nimport { getDaffPaymentReducersStateSelector } from './feature.selector';\nimport { DaffPaymentStateRootSlice } from '../reducers/public_api';\n\n/**\n * Selectors for the main part of payment state.\n */\nexport interface DaffPaymentSelectors {\n /**\n * Selects whether there is a pending payment operation.\n */\n selectPaymentLoading: MemoizedSelector<DaffPaymentStateRootSlice, boolean>;\n /**\n * Selects the list of payment errors, if any.\n */\n selectPaymentErrors: MemoizedSelector<DaffPaymentStateRootSlice, DaffStateError[]>;\n}\n\n/**\n * Creates a group of selectors for {@link DaffPaymentReducerState} that use the passed state selector as the basis.\n */\nconst daffPaymentCreateSelectors = () => {\n const { selectPaymentFeatureState } = getDaffPaymentReducersStateSelector();\n const selectPaymentState = createSelector(\n selectPaymentFeatureState,\n state => state.payment,\n );\n\n const selectPaymentLoading = createSelector(\n selectPaymentState,\n state => state.loading,\n );\n\n const selectPaymentErrors = createSelector(\n selectPaymentState,\n state => state.errors,\n );\n\n return {\n selectPaymentLoading,\n selectPaymentErrors,\n };\n};\n\n\nexport const daffPaymentGetSelectors = (() => {\n let cache;\n return (): DaffPaymentSelectors =>\n cache = cache || daffPaymentCreateSelectors();\n})();\n\n","import { Injectable } from '@angular/core';\nimport {\n Action,\n Store,\n select,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\n\nimport { DaffPaymentPageFacadeInterface } from './interface';\nimport { DaffPaymentStateRootSlice } from '../../reducers/public_api';\nimport { daffPaymentGetSelectors } from '../../selectors/public_api';\n\n/**\n * @inheritdoc\n *\n * Serves as the base for a payment facade.\n * Extend this class and pass in the selectors for the specific state you wish to target.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {\n loading$: Observable<boolean>;\n errors$: Observable<DaffStateError[]>;\n\n constructor(\n private store: Store<DaffPaymentStateRootSlice>,\n ) {\n const {\n selectPaymentLoading,\n selectPaymentErrors,\n } = daffPaymentGetSelectors();\n\n this.loading$ = this.store.pipe(select(selectPaymentLoading));\n this.errors$ = this.store.pipe(select(selectPaymentErrors));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffPaymentAvailableProcessor } from '../models/public_api';\n\nexport const {\n /**\n * A multi-provider injection token for registering payment processors.\n */\n token: DAFF_PAYMENT_AVAILABLE_PROCESSORS,\n\n /**\n * Provides a payment processor registration.\n *\n * See {@link DaffPaymentAvailableProcessor}.\n */\n provider: daffPaymentProvideAvailableProcessors,\n} = createMultiInjectionToken<DaffPaymentAvailableProcessor>(\n 'DAFF_PAYMENT_AVAILABLE_PROCESSORS',\n { providedIn: 'any' },\n);\n","import { inject } from '@angular/core';\n\nimport {\n createSingleInjectionToken,\n daffArrayToDict,\n} from '@daffodil/core';\n\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from './available-processors.token';\nimport { DaffPaymentProcessorCollection } from '../models/public_api';\n\nexport const {\n /**\n * An internal token to combine the available payment processors into a single collection.\n */\n token: DAFF_PAYMENT_PROCESSOR_COLLECTION,\n /**\n * Provider function for {@link DAFF_PAYMENT_PROCESSOR_COLLECTION}.\n */\n provider: provideDaffPaymentProcessorCollection,\n} = createSingleInjectionToken<DaffPaymentProcessorCollection>(\n 'DAFF_PAYMENT_PROCESSOR_COLLECTION',\n {\n factory: () => {\n const processors = inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS);\n return daffArrayToDict(processors, ({ kind }) => kind);\n },\n },\n);\n","import { createSingleInjectionToken } from '@daffodil/core';\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\nexport const {\n /**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\n token: DAFF_PAYMENT_ERROR_MATCHER,\n /**\n * Provider function for {@link DAFF_PAYMENT_ERROR_MATCHER}.\n */\n provider: provideDaffPaymentErrorMatcher,\n} = createSingleInjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_PAYMENT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import { inject } from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\nimport { daffComposeReducers } from '@daffodil/core/state';\n\nimport { DAFF_PAYMENT_EXTRA_REDUCERS } from './extra.token';\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from '../../injection-tokens/public_api';\nimport { daffPaymentReducerFactory } from '../payment/reducer';\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\nexport const {\n /**\n * An internal token to hold the Daffodil payment reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\n token: DAFF_PAYMENT_REDUCERS,\n /**\n * Provider function for {@link DAFF_PAYMENT_REDUCERS}.\n */\n provider: provideDaffPaymentReducers,\n} = createSingleInjectionToken<ActionReducer<DaffPaymentReducersState>>(\n 'DAFF_PAYMENT_REDUCERS',\n {\n providedIn: 'any',\n factory: () => daffComposeReducers([\n combineReducers({\n payment: daffPaymentReducerFactory(inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS).map(({ action }) => action)),\n }),\n ...inject(DAFF_PAYMENT_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DAFF_PAYMENT_STORE_FEATURE_KEY } from './reducers/public_api';\nimport { DAFF_PAYMENT_REDUCERS } from './reducers/token/reducers.token';\n\n/**\n * Creates the payment feature store.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS),\n ],\n})\nexport class DaffPaymentStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUA;;AAEG;IACS;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF;AAChF,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF;AAClF,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,GAGjC,EAAA,CAAA,CAAA;AAaD;;AAEG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,OAAU,EAAA;QAAV,IAAO,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,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,8BAA8B,EAAE,qBAAqB,CAAC;AAC9E,qBAAA;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -20,10 +20,10 @@ class DaffPaymentResponseFactory extends DaffModelFactory {
|
|
|
20
20
|
constructor() {
|
|
21
21
|
super(MockPaymentResponse);
|
|
22
22
|
}
|
|
23
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
24
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
23
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentResponseFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
24
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentResponseFactory, providedIn: 'root' }); }
|
|
25
25
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentResponseFactory, decorators: [{
|
|
27
27
|
type: Injectable,
|
|
28
28
|
args: [{
|
|
29
29
|
providedIn: 'root',
|
|
@@ -46,10 +46,10 @@ class DaffPaymentRequestFactory extends DaffModelFactory {
|
|
|
46
46
|
constructor() {
|
|
47
47
|
super(MockPaymentRequest);
|
|
48
48
|
}
|
|
49
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
50
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
49
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentRequestFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
50
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentRequestFactory, providedIn: 'root' }); }
|
|
51
51
|
}
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentRequestFactory, decorators: [{
|
|
53
53
|
type: Injectable,
|
|
54
54
|
args: [{
|
|
55
55
|
providedIn: 'root',
|
|
@@ -101,10 +101,10 @@ class DaffPaymentResponseKindFactory extends DaffModelFactory {
|
|
|
101
101
|
create(partial = {}) {
|
|
102
102
|
return this._randomFactory.create(partial);
|
|
103
103
|
}
|
|
104
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
105
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
104
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentResponseKindFactory, deps: [{ token: DAFF_PAYMENT_RESPONSE_KIND_FACTORIES }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
105
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentResponseKindFactory, providedIn: 'root' }); }
|
|
106
106
|
}
|
|
107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentResponseKindFactory, decorators: [{
|
|
108
108
|
type: Injectable,
|
|
109
109
|
args: [{
|
|
110
110
|
providedIn: 'root',
|
|
@@ -118,13 +118,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
|
|
|
118
118
|
* Provides the default payment result factory as a payment result type factory.
|
|
119
119
|
*/
|
|
120
120
|
class DaffPaymentTestingModule {
|
|
121
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
122
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
123
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
121
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
122
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingModule }); }
|
|
123
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingModule, providers: [
|
|
124
124
|
provideDaffPaymentResponseKindFactories(DaffPaymentResponseFactory),
|
|
125
125
|
] }); }
|
|
126
126
|
}
|
|
127
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffPaymentTestingModule, decorators: [{
|
|
128
128
|
type: NgModule,
|
|
129
129
|
args: [{
|
|
130
130
|
providers: [
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@daffodil/payment","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/payment"]}}},"version":"0.
|
|
1
|
+
{"name":"@daffodil/payment","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/payment"]}}},"version":"0.82.0","description":"A client-side Angular package for managing ecommerce payments agnostic to the ecommerce platform.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^19.0.0","@angular/core":"^19.0.0","@daffodil/core":"0.82.0","@ngrx/effects":"^19.0.0","@ngrx/store":"^19.0.0","rxjs":"7.8.1"},"optionalDependencies":{"@apollo/client":"^3.12.6","@daffodil/driver":"0.82.0","apollo-angular":"^8.0.0","@faker-js/faker":"^7.6.0"},"module":"fesm2022/daffodil-payment.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-payment.mjs"},"./driver":{"types":"./driver/index.d.ts","default":"./fesm2022/daffodil-payment-driver.mjs"},"./state":{"types":"./state/index.d.ts","default":"./fesm2022/daffodil-payment-state.mjs"},"./testing":{"types":"./testing/index.d.ts","default":"./fesm2022/daffodil-payment-testing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","default":"./fesm2022/daffodil-payment-driver-in-memory.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","default":"./fesm2022/daffodil-payment-driver-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","default":"./fesm2022/daffodil-payment-state-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
|