@daffodil/payment 0.63.2 → 0.64.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/esm2020/driver/in-memory/backend/payment.service.mjs +3 -3
- package/esm2020/driver/in-memory/driver/payment-driver.module.mjs +6 -8
- package/esm2020/driver/in-memory/driver/payment.service.mjs +3 -3
- package/esm2020/driver/testing/drivers/payment-driver.module.mjs +5 -7
- package/esm2020/driver/testing/drivers/payment.service.mjs +3 -3
- package/esm2020/state/facades/payment/facade.mjs +4 -4
- package/esm2020/state/injection-tokens/processor-collection.token.mjs +1 -1
- package/esm2020/state/payment.module.mjs +5 -7
- package/esm2020/state/reducers/payment/reducer.mjs +2 -2
- package/esm2020/state/reducers/token/reducers.token.mjs +2 -2
- package/esm2020/state/selectors/payment.selector.mjs +1 -1
- package/esm2020/state/testing/mock-payment-facade.mjs +3 -3
- package/esm2020/state/testing/payment-testing.module.mjs +4 -4
- package/esm2020/testing/factories/kind.factory.mjs +5 -5
- package/esm2020/testing/factories/payment-request.factory.mjs +3 -3
- package/esm2020/testing/factories/payment-response.factory.mjs +3 -3
- package/esm2020/testing/testing.module.mjs +4 -4
- package/fesm2015/daffodil-payment-driver-in-memory.mjs +11 -13
- package/fesm2015/daffodil-payment-driver-in-memory.mjs.map +1 -1
- package/fesm2015/daffodil-payment-driver-testing.mjs +7 -9
- package/fesm2015/daffodil-payment-driver-testing.mjs.map +1 -1
- package/fesm2015/daffodil-payment-state-testing.mjs +7 -7
- package/fesm2015/daffodil-payment-state.mjs +7 -9
- package/fesm2015/daffodil-payment-state.mjs.map +1 -1
- package/fesm2015/daffodil-payment-testing.mjs +13 -13
- package/fesm2015/daffodil-payment-testing.mjs.map +1 -1
- package/fesm2020/daffodil-payment-driver-in-memory.mjs +11 -13
- package/fesm2020/daffodil-payment-driver-in-memory.mjs.map +1 -1
- package/fesm2020/daffodil-payment-driver-testing.mjs +7 -9
- package/fesm2020/daffodil-payment-driver-testing.mjs.map +1 -1
- package/fesm2020/daffodil-payment-state-testing.mjs +7 -7
- package/fesm2020/daffodil-payment-state.mjs +7 -9
- package/fesm2020/daffodil-payment-state.mjs.map +1 -1
- package/fesm2020/daffodil-payment-testing.mjs +13 -13
- package/fesm2020/daffodil-payment-testing.mjs.map +1 -1
- package/package.json +1 -1
- package/state/facades/payment/facade.d.ts +1 -1
- package/state/reducers/payment/reducer.d.ts +1 -1
- package/daffodil-payment.d.ts +0 -5
- package/driver/daffodil-payment-driver.d.ts +0 -5
- package/driver/in-memory/daffodil-payment-driver-in-memory.d.ts +0 -5
- package/driver/in-memory/package.json +0 -1
- package/driver/package.json +0 -1
- package/driver/testing/daffodil-payment-driver-testing.d.ts +0 -5
- package/driver/testing/package.json +0 -1
- package/state/daffodil-payment-state.d.ts +0 -5
- package/state/package.json +0 -1
- package/state/testing/daffodil-payment-state-testing.d.ts +0 -5
- package/state/testing/package.json +0 -1
- package/testing/daffodil-payment-testing.d.ts +0 -5
- package/testing/package.json +0 -1
|
@@ -159,9 +159,9 @@ class DaffPaymentPageFacade {
|
|
|
159
159
|
this.store.dispatch(action);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
/** @nocollapse */ DaffPaymentPageFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
163
|
-
/** @nocollapse */ DaffPaymentPageFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
164
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
162
|
+
/** @nocollapse */ DaffPaymentPageFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentPageFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
163
|
+
/** @nocollapse */ DaffPaymentPageFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentPageFacade, providedIn: 'root' });
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentPageFacade, decorators: [{
|
|
165
165
|
type: Injectable,
|
|
166
166
|
args: [{
|
|
167
167
|
providedIn: 'root',
|
|
@@ -217,12 +217,10 @@ const DAFF_PAYMENT_REDUCERS = new InjectionToken('DAFF_PAYMENT_REDUCERS', {
|
|
|
217
217
|
*/
|
|
218
218
|
class DaffPaymentStateModule {
|
|
219
219
|
}
|
|
220
|
-
/** @nocollapse */ DaffPaymentStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
221
|
-
/** @nocollapse */ DaffPaymentStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
222
|
-
/** @nocollapse */ DaffPaymentStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
223
|
-
|
|
224
|
-
]] });
|
|
225
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPaymentStateModule, decorators: [{
|
|
220
|
+
/** @nocollapse */ DaffPaymentStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
221
|
+
/** @nocollapse */ DaffPaymentStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, imports: [i1.StoreFeatureModule] });
|
|
222
|
+
/** @nocollapse */ DaffPaymentStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, imports: [StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS)] });
|
|
223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, decorators: [{
|
|
226
224
|
type: NgModule,
|
|
227
225
|
args: [{
|
|
228
226
|
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/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 DaffPaymentGenerateToken<T extends DaffPaymentRequest = DaffPaymentRequest> extends Action {\n readonly request: T;\n readonly address?: DaffPersonalAddress | DaffIdentifiable;\n}\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 {\n InjectionToken,\n Provider,\n} from '@angular/core';\nimport { ActionReducer } from '@ngrx/store';\n\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\n/**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffPaymentProvideExtraReducers}.\n */\nexport const DAFF_PAYMENT_EXTRA_REDUCERS = new InjectionToken<ActionReducer<DaffPaymentReducersState>[]>(\n 'DAFF_PAYMENT_EXTRA_REDUCERS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * ```ts\n * providers: [\n * ...daffPaymentProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffPaymentProvideExtraReducers(\n ...reducers: ActionReducer<DaffPaymentReducersState>[]\n): Provider[] {\n return reducers.map(reducer => ({\n provide: DAFF_PAYMENT_EXTRA_REDUCERS,\n useValue: reducer,\n multi: true,\n }));\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 {\n DaffPaymentGenerateToken,\n DaffPaymentActionTypes,\n DaffPaymentActions,\n DaffPaymentGenerateTokenFailure,\n} from '../../actions/payment.actions';\nimport { DaffPaymentStateReducerAdapter } from './adapter';\nimport { daffPaymentInitialState } from './initial-state';\nimport { DaffPaymentReducerState } from './interface';\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 { DaffPaymentStateRootSlice } from '../reducers/public_api';\nimport { getDaffPaymentReducersStateSelector } from './feature.selector';\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 { DaffPaymentStateRootSlice } from '../../reducers/public_api';\nimport { daffPaymentGetSelectors } from '../../selectors/public_api';\nimport { DaffPaymentPageFacadeInterface } from './interface';\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 {\n InjectionToken,\n ValueProvider,\n} from '@angular/core';\n\nimport { DaffPaymentAvailableProcessor } from '../models/public_api';\n\n/**\n * A multi-provider injection token for registering payment processors.\n */\nexport const DAFF_PAYMENT_AVAILABLE_PROCESSORS = new InjectionToken<DaffPaymentAvailableProcessor[]>(\n 'DAFF_PAYMENT_AVAILABLE_PROCESSORS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides a payment processor registration.\n *\n * See {@link DaffPaymentAvailableProcessor}.\n */\nexport const daffPaymentProvideAvailableProcessors = (...processors: DaffPaymentAvailableProcessor[]): ValueProvider[] =>\n processors.map(processor => ({\n provide: DAFF_PAYMENT_AVAILABLE_PROCESSORS,\n useValue: processor,\n multi: true,\n }));\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\n\nimport { daffArrayToDict } from '@daffodil/core';\n\nimport { DaffPaymentProcessorCollection } from '../models/public_api';\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from './available-processors.token';\n\n/**\n * An internal token to combine the available payment processors into a single collection.\n */\nexport const DAFF_PAYMENT_PROCESSOR_COLLECTION = new InjectionToken<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 {\n inject,\n InjectionToken,\n} from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { daffComposeReducers } from '@daffodil/core/state';\n// these unused imports are a workaround\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from '../../injection-tokens/public_api';\nimport { daffPaymentReducerFactory } from '../payment/reducer';\nimport { DaffPaymentReducersState } from '../reducers.interface';\nimport { DAFF_PAYMENT_EXTRA_REDUCERS } from './extra.token';\n\n/**\n * An internal token to hold the Daffodil payment reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\nexport const DAFF_PAYMENT_REDUCERS = new InjectionToken<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;AACS,IAAA,uBAGX;AAHD,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF,CAAA;AAChF,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF,CAAA;AAClF,CAAC,EAHW,s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AAC;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;;AC7BD;;AAEG;MAMU,sBAAsB,CAAA;;sIAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;uIAAtB,sBAAsB,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,CAAA;AAAtB,mBAAA,sBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,EAJxB,OAAA,EAAA,CAAA;AACP,YAAA,WAAW,CAAC,UAAU,CAAC,8BAA8B,EAAE,qBAAqB,CAAC;SAC9E,CAAA,EAAA,CAAA,CAAA;2FAEU,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;iBACF,CAAA;;;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/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 DaffPaymentGenerateToken<T extends DaffPaymentRequest = DaffPaymentRequest> extends Action {\n readonly request: T;\n readonly address?: DaffPersonalAddress | DaffIdentifiable;\n}\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 {\n InjectionToken,\n Provider,\n} from '@angular/core';\nimport { ActionReducer } from '@ngrx/store';\n\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\n/**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffPaymentProvideExtraReducers}.\n */\nexport const DAFF_PAYMENT_EXTRA_REDUCERS = new InjectionToken<ActionReducer<DaffPaymentReducersState>[]>(\n 'DAFF_PAYMENT_EXTRA_REDUCERS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * ```ts\n * providers: [\n * ...daffPaymentProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffPaymentProvideExtraReducers(\n ...reducers: ActionReducer<DaffPaymentReducersState>[]\n): Provider[] {\n return reducers.map(reducer => ({\n provide: DAFF_PAYMENT_EXTRA_REDUCERS,\n useValue: reducer,\n multi: true,\n }));\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 {\n InjectionToken,\n ValueProvider,\n} from '@angular/core';\n\nimport { DaffPaymentAvailableProcessor } from '../models/public_api';\n\n/**\n * A multi-provider injection token for registering payment processors.\n */\nexport const DAFF_PAYMENT_AVAILABLE_PROCESSORS = new InjectionToken<DaffPaymentAvailableProcessor[]>(\n 'DAFF_PAYMENT_AVAILABLE_PROCESSORS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides a payment processor registration.\n *\n * See {@link DaffPaymentAvailableProcessor}.\n */\nexport const daffPaymentProvideAvailableProcessors = (...processors: DaffPaymentAvailableProcessor[]): ValueProvider[] =>\n processors.map(processor => ({\n provide: DAFF_PAYMENT_AVAILABLE_PROCESSORS,\n useValue: processor,\n multi: true,\n }));\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\n\nimport { daffArrayToDict } from '@daffodil/core';\n\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from './available-processors.token';\nimport { DaffPaymentProcessorCollection } from '../models/public_api';\n\n/**\n * An internal token to combine the available payment processors into a single collection.\n */\nexport const DAFF_PAYMENT_PROCESSOR_COLLECTION = new InjectionToken<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 {\n inject,\n InjectionToken,\n} from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\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\n/**\n * An internal token to hold the Daffodil payment reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\nexport const DAFF_PAYMENT_REDUCERS = new InjectionToken<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;AACS,IAAA,uBAGX;AAHD,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF,CAAA;AAChF,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF,CAAA;AAClF,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,GAGjC,EAAA,CAAA,CAAA,CAAA;AAYD;;AAEG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,OAAU,EAAA;AAAV,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAG;AAFpB,QAAA,IAAA,CAAA,IAAI,GAAG,sBAAsB,CAAC,0BAA0B,CAAC;KAEjC;AAClC,CAAA;AAED;;AAEG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,OAAuB,EAAA;AAAvB,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAgB;AAFjC,QAAA,IAAA,CAAA,IAAI,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AAA,CAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,CAAA;uIAAtB,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;iBACF,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -21,9 +21,9 @@ class DaffPaymentResponseFactory extends DaffModelFactory {
|
|
|
21
21
|
super(MockPaymentResponse);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
/** @nocollapse */ DaffPaymentResponseFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
25
|
-
/** @nocollapse */ DaffPaymentResponseFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
24
|
+
/** @nocollapse */ DaffPaymentResponseFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentResponseFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
25
|
+
/** @nocollapse */ DaffPaymentResponseFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentResponseFactory, providedIn: 'root' });
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentResponseFactory, decorators: [{
|
|
27
27
|
type: Injectable,
|
|
28
28
|
args: [{
|
|
29
29
|
providedIn: 'root',
|
|
@@ -47,9 +47,9 @@ class DaffPaymentRequestFactory extends DaffModelFactory {
|
|
|
47
47
|
super(MockPaymentRequest);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
/** @nocollapse */ DaffPaymentRequestFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
51
|
-
/** @nocollapse */ DaffPaymentRequestFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
50
|
+
/** @nocollapse */ DaffPaymentRequestFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentRequestFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
51
|
+
/** @nocollapse */ DaffPaymentRequestFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentRequestFactory, providedIn: 'root' });
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentRequestFactory, decorators: [{
|
|
53
53
|
type: Injectable,
|
|
54
54
|
args: [{
|
|
55
55
|
providedIn: 'root',
|
|
@@ -103,9 +103,9 @@ class DaffPaymentResponseKindFactory extends DaffModelFactory {
|
|
|
103
103
|
return this._randomFactory.create(partial);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
/** @nocollapse */ DaffPaymentResponseKindFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
107
|
-
/** @nocollapse */ DaffPaymentResponseKindFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
106
|
+
/** @nocollapse */ DaffPaymentResponseKindFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentResponseKindFactory, deps: [{ token: DAFF_PAYMENT_RESPONSE_KIND_FACTORIES }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
107
|
+
/** @nocollapse */ DaffPaymentResponseKindFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentResponseKindFactory, providedIn: 'root' });
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentResponseKindFactory, decorators: [{
|
|
109
109
|
type: Injectable,
|
|
110
110
|
args: [{
|
|
111
111
|
providedIn: 'root',
|
|
@@ -122,16 +122,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
122
122
|
*/
|
|
123
123
|
class DaffPaymentTestingModule {
|
|
124
124
|
}
|
|
125
|
-
/** @nocollapse */ DaffPaymentTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
126
|
-
/** @nocollapse */ DaffPaymentTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
127
|
-
/** @nocollapse */ DaffPaymentTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
125
|
+
/** @nocollapse */ DaffPaymentTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
126
|
+
/** @nocollapse */ DaffPaymentTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingModule });
|
|
127
|
+
/** @nocollapse */ DaffPaymentTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingModule, providers: [
|
|
128
128
|
{
|
|
129
129
|
provide: DAFF_PAYMENT_RESPONSE_KIND_FACTORIES,
|
|
130
130
|
useExisting: DaffPaymentResponseFactory,
|
|
131
131
|
multi: true,
|
|
132
132
|
},
|
|
133
133
|
] });
|
|
134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingModule, decorators: [{
|
|
135
135
|
type: NgModule,
|
|
136
136
|
args: [{
|
|
137
137
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-payment-testing.mjs","sources":["../../../libs/payment/testing/src/factories/payment-response.factory.ts","../../../libs/payment/testing/src/factories/payment-request.factory.ts","../../../libs/payment/testing/src/injection-tokens/factories/kind.token.ts","../../../libs/payment/testing/src/factories/kind.factory.ts","../../../libs/payment/testing/src/testing.module.ts","../../../libs/payment/testing/src/daffodil-payment-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\n/**\n * Mock class for {@link DaffPaymentResponse}.\n */\nexport class MockPaymentResponse implements DaffPaymentResponse {\n method = faker.random.word();\n};\n\n/**\n * Model factory for {@link DaffPaymentResponse}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentResponseFactory extends DaffModelFactory<DaffPaymentResponse>{\n constructor() {\n super(MockPaymentResponse);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentRequest } from '@daffodil/payment';\n\n/**\n * Mock class for {@link DaffPaymentRequest}.\n */\nexport class MockPaymentRequest implements DaffPaymentRequest {\n kind = faker.random.word();\n};\n\n/**\n * Model factory for {@link DaffPaymentRequest}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentRequestFactory extends DaffModelFactory<DaffPaymentRequest>{\n constructor() {\n super(MockPaymentRequest);\n }\n}\n","import {\n inject,\n InjectionToken,\n Provider,\n Type,\n} from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DaffPaymentResponseFactory } from '../../factories/payment-response.factory';\n\n/**\n * A multi-provider injection token for providing extra payment result kind factories.\n * These factories correspond to different types of payment results that may be added by other packages.\n * This is useful for backend mocks (such as the testing driver) to generate an accurate representation\n * of the variety of results that an application can receive in production.\n */\nexport const DAFF_PAYMENT_RESPONSE_KIND_FACTORIES = new InjectionToken<DaffModelFactory<DaffPaymentResponse>[]>(\n 'DAFF_PAYMENT_RESPONSE_KIND_FACTORIES',\n { factory: () => [inject(DaffPaymentResponseFactory)], providedIn: 'root' },\n);\n\n/**\n * Provides extra payment result factory kinds.\n *\n * See {@link DAFF_PAYMENT_RESPONSE_KIND_FACTORIES}.\n *\n * ```ts\n * providers: [\n * ...daffProvidePaymentResponseKindFactories(\n * MyPaymentResponseFactory\n * )\n * ]\n * ```\n */\nexport function daffProvidePaymentResponseKindFactories<T extends DaffPaymentResponse = DaffPaymentResponse>(...factoryTypes: Type<DaffModelFactory<T>>[]): Provider[] {\n return factoryTypes.map(factoryType => ({\n provide: DAFF_PAYMENT_RESPONSE_KIND_FACTORIES,\n useExisting: factoryType,\n multi: true,\n }));\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\n\nimport { sample } from '@daffodil/core';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport {
|
|
1
|
+
{"version":3,"file":"daffodil-payment-testing.mjs","sources":["../../../libs/payment/testing/src/factories/payment-response.factory.ts","../../../libs/payment/testing/src/factories/payment-request.factory.ts","../../../libs/payment/testing/src/injection-tokens/factories/kind.token.ts","../../../libs/payment/testing/src/factories/kind.factory.ts","../../../libs/payment/testing/src/testing.module.ts","../../../libs/payment/testing/src/daffodil-payment-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\n/**\n * Mock class for {@link DaffPaymentResponse}.\n */\nexport class MockPaymentResponse implements DaffPaymentResponse {\n method = faker.random.word();\n};\n\n/**\n * Model factory for {@link DaffPaymentResponse}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentResponseFactory extends DaffModelFactory<DaffPaymentResponse>{\n constructor() {\n super(MockPaymentResponse);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentRequest } from '@daffodil/payment';\n\n/**\n * Mock class for {@link DaffPaymentRequest}.\n */\nexport class MockPaymentRequest implements DaffPaymentRequest {\n kind = faker.random.word();\n};\n\n/**\n * Model factory for {@link DaffPaymentRequest}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentRequestFactory extends DaffModelFactory<DaffPaymentRequest>{\n constructor() {\n super(MockPaymentRequest);\n }\n}\n","import {\n inject,\n InjectionToken,\n Provider,\n Type,\n} from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DaffPaymentResponseFactory } from '../../factories/payment-response.factory';\n\n/**\n * A multi-provider injection token for providing extra payment result kind factories.\n * These factories correspond to different types of payment results that may be added by other packages.\n * This is useful for backend mocks (such as the testing driver) to generate an accurate representation\n * of the variety of results that an application can receive in production.\n */\nexport const DAFF_PAYMENT_RESPONSE_KIND_FACTORIES = new InjectionToken<DaffModelFactory<DaffPaymentResponse>[]>(\n 'DAFF_PAYMENT_RESPONSE_KIND_FACTORIES',\n { factory: () => [inject(DaffPaymentResponseFactory)], providedIn: 'root' },\n);\n\n/**\n * Provides extra payment result factory kinds.\n *\n * See {@link DAFF_PAYMENT_RESPONSE_KIND_FACTORIES}.\n *\n * ```ts\n * providers: [\n * ...daffProvidePaymentResponseKindFactories(\n * MyPaymentResponseFactory\n * )\n * ]\n * ```\n */\nexport function daffProvidePaymentResponseKindFactories<T extends DaffPaymentResponse = DaffPaymentResponse>(...factoryTypes: Type<DaffModelFactory<T>>[]): Provider[] {\n return factoryTypes.map(factoryType => ({\n provide: DAFF_PAYMENT_RESPONSE_KIND_FACTORIES,\n useExisting: factoryType,\n multi: true,\n }));\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\n\nimport { sample } from '@daffodil/core';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { MockPaymentResponse } from './payment-response.factory';\nimport { DAFF_PAYMENT_RESPONSE_KIND_FACTORIES } from '../injection-tokens/factories/kind.token';\n\n/**\n * Factory for creating DaffPaymentResponses.\n * This will create a payment response of random kind.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentResponseKindFactory extends DaffModelFactory<DaffPaymentResponse> {\n constructor(\n @Inject(DAFF_PAYMENT_RESPONSE_KIND_FACTORIES) private kindFactories: DaffModelFactory<DaffPaymentResponse>[],\n ) {\n super(MockPaymentResponse);\n }\n\n private get _randomFactory(): DaffModelFactory<DaffPaymentResponse> {\n return sample(this.kindFactories);\n }\n\n /**\n * Creates a payment result of random kind.\n */\n create(partial = {}): DaffPaymentResponse {\n return this._randomFactory.create(partial);\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffPaymentResponseFactory } from './factories/public_api';\nimport { DAFF_PAYMENT_RESPONSE_KIND_FACTORIES } from './injection-tokens/public_api';\n\n/**\n * Provides the default payment result factory as a payment result type factory.\n */\n@NgModule({\n providers: [\n {\n provide: DAFF_PAYMENT_RESPONSE_KIND_FACTORIES,\n useExisting: DaffPaymentResponseFactory,\n multi: true,\n },\n ],\n})\nexport class DaffPaymentTestingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAMA;;AAEG;MACU,mBAAmB,CAAA;AAAhC,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAC9B;AAAA,CAAA;AAAA,CAAC;AAEF;;AAEG;AAIG,MAAO,0BAA2B,SAAQ,gBAAqC,CAAA;AACnF,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,mBAAmB,CAAC,CAAC;KAC5B;;0IAHU,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,mBAAA,0BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cAFzB,MAAM,EAAA,CAAA,CAAA;2FAEP,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAHtC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACZD;;AAEG;MACU,kBAAkB,CAAA;AAA/B,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAC5B;AAAA,CAAA;AAAA,CAAC;AAEF;;AAEG;AAIG,MAAO,yBAA0B,SAAQ,gBAAoC,CAAA;AACjF,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,kBAAkB,CAAC,CAAC;KAC3B;;yIAHU,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzB,mB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AA0B;AACvC,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA;iBACF,CAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -45,9 +45,9 @@ class DaffPaymentInMemoryBackendService {
|
|
|
45
45
|
}));
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
/** @nocollapse */ DaffPaymentInMemoryBackendService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
49
|
-
/** @nocollapse */ DaffPaymentInMemoryBackendService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
48
|
+
/** @nocollapse */ DaffPaymentInMemoryBackendService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentInMemoryBackendService, deps: [{ token: i1.DaffPaymentResponseKindFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
49
|
+
/** @nocollapse */ DaffPaymentInMemoryBackendService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentInMemoryBackendService, providedIn: 'root' });
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentInMemoryBackendService, decorators: [{
|
|
51
51
|
type: Injectable,
|
|
52
52
|
args: [{
|
|
53
53
|
providedIn: 'root',
|
|
@@ -71,9 +71,9 @@ class DaffPaymentInMemoryDriver {
|
|
|
71
71
|
return this.http.get(this.url);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
/** @nocollapse */ DaffPaymentInMemoryDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
75
|
-
/** @nocollapse */ DaffPaymentInMemoryDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
76
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
74
|
+
/** @nocollapse */ DaffPaymentInMemoryDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentInMemoryDriver, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
75
|
+
/** @nocollapse */ DaffPaymentInMemoryDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentInMemoryDriver, providedIn: 'root' });
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentInMemoryDriver, decorators: [{
|
|
77
77
|
type: Injectable,
|
|
78
78
|
args: [{
|
|
79
79
|
providedIn: 'root',
|
|
@@ -96,14 +96,12 @@ class DaffPaymentInMemoryDriverModule {
|
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
/** @nocollapse */ DaffPaymentInMemoryDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
100
|
-
/** @nocollapse */ DaffPaymentInMemoryDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
99
|
+
/** @nocollapse */ DaffPaymentInMemoryDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
100
|
+
/** @nocollapse */ DaffPaymentInMemoryDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentInMemoryDriverModule, imports: [CommonModule,
|
|
101
101
|
DaffPaymentTestingModule] });
|
|
102
|
-
/** @nocollapse */ DaffPaymentInMemoryDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
]] });
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPaymentInMemoryDriverModule, decorators: [{
|
|
102
|
+
/** @nocollapse */ DaffPaymentInMemoryDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentInMemoryDriverModule, imports: [CommonModule,
|
|
103
|
+
DaffPaymentTestingModule] });
|
|
104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentInMemoryDriverModule, decorators: [{
|
|
107
105
|
type: NgModule,
|
|
108
106
|
args: [{
|
|
109
107
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-payment-driver-in-memory.mjs","sources":["../../../libs/payment/driver/in-memory/src/backend/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment-driver.module.ts","../../../libs/payment/driver/in-memory/src/daffodil-payment-driver-in-memory.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n RequestInfo,\n} from 'angular-in-memory-web-api';\n\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\n/**\n * An in-memory service that delegates payment queries to child backends\n * via the {@link DAFF_PAYMENT_IN_MEMORY_BACKENDS}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryBackendService implements InMemoryDbService {\n constructor(\n private factory: DaffPaymentResponseKindFactory,\n ) {}\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * @docs-private\n */\n createDb(): any {\n return {};\n }\n\n /**\n * Generates a token from a processor backend.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: RequestInfo) {\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.OK,\n body: this.factory.create(),\n }));\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\n\n/**\n * The payment inmemory driver to mock the payment backend service.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryDriver implements DaffPaymentDriverInterface {\n /**\n * @docs-private\n */\n url = '/api/payment';\n\n constructor(\n private http: HttpClient,\n ) {}\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return this.http.get<DaffPaymentResponse>(this.url);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffPaymentDriver } from '@daffodil/payment/driver';\nimport { DaffPaymentTestingModule } from '@daffodil/payment/testing';\n\nimport { DaffPaymentInMemoryDriver } from './payment.service';\n\n/**\n * Provides the {@link DaffPaymentInMemoryDriver} as the {@link DaffPaymentDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffPaymentTestingModule,\n ],\n})\nexport class DaffPaymentInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentInMemoryDriverModule> {\n return {\n ngModule: DaffPaymentInMemoryDriverModule,\n providers: [\n {\n provide: DaffPaymentDriver,\n useExisting: DaffPaymentInMemoryDriver,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;AAWA;;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A,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,
|
|
1
|
+
{"version":3,"file":"daffodil-payment-driver-in-memory.mjs","sources":["../../../libs/payment/driver/in-memory/src/backend/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment-driver.module.ts","../../../libs/payment/driver/in-memory/src/daffodil-payment-driver-in-memory.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n RequestInfo,\n} from 'angular-in-memory-web-api';\n\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\n/**\n * An in-memory service that delegates payment queries to child backends\n * via the {@link DAFF_PAYMENT_IN_MEMORY_BACKENDS}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryBackendService implements InMemoryDbService {\n constructor(\n private factory: DaffPaymentResponseKindFactory,\n ) {}\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * @docs-private\n */\n createDb(): any {\n return {};\n }\n\n /**\n * Generates a token from a processor backend.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: RequestInfo) {\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.OK,\n body: this.factory.create(),\n }));\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\n\n/**\n * The payment inmemory driver to mock the payment backend service.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryDriver implements DaffPaymentDriverInterface {\n /**\n * @docs-private\n */\n url = '/api/payment';\n\n constructor(\n private http: HttpClient,\n ) {}\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return this.http.get<DaffPaymentResponse>(this.url);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffPaymentDriver } from '@daffodil/payment/driver';\nimport { DaffPaymentTestingModule } from '@daffodil/payment/testing';\n\nimport { DaffPaymentInMemoryDriver } from './payment.service';\n\n/**\n * Provides the {@link DaffPaymentInMemoryDriver} as the {@link DaffPaymentDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffPaymentTestingModule,\n ],\n})\nexport class DaffPaymentInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentInMemoryDriverModule> {\n return {\n ngModule: DaffPaymentInMemoryDriverModule,\n providers: [\n {\n provide: DaffPaymentDriver,\n useExisting: DaffPaymentInMemoryDriver,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;AAWA;;;AAGG;MAIU,iCAAiC,CAAA;AAC5C,IAAA,WAAA,CACU,OAAuC,EAAA;QAAvC,IAAO,CAAA,OAAA,GAAP,OAAO,CAAgC;KAC7C;AAEJ;;;;;;;AAOG;IACH,eAAe,CAAC,GAAW,EAAE,KAA2B,EAAA;AACtD,QAAA,OAAO,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;KACnC;AAED;;AAEG;IACH,QAAQ,GAAA;AACN,QAAA,OAAO,EAAE,CAAC;KACX;AAED;;;;;AAKG;AACH,IAAA,GAAG,CAAC,OAAoB,EAAA;QACtB,OAAO,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO;YAC1C,MAAM,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
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
/** @nocollapse */ DaffPaymentTestingDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
23
|
-
/** @nocollapse */ DaffPaymentTestingDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
22
|
+
/** @nocollapse */ DaffPaymentTestingDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingDriver, deps: [{ token: i1.DaffPaymentResponseKindFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
23
|
+
/** @nocollapse */ DaffPaymentTestingDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingDriver, providedIn: 'root' });
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingDriver, decorators: [{
|
|
25
25
|
type: Injectable,
|
|
26
26
|
args: [{
|
|
27
27
|
providedIn: 'root',
|
|
@@ -44,12 +44,10 @@ class DaffPaymentTestingDriverModule {
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
/** @nocollapse */ DaffPaymentTestingDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
48
|
-
/** @nocollapse */ DaffPaymentTestingDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
49
|
-
/** @nocollapse */ DaffPaymentTestingDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
50
|
-
|
|
51
|
-
]] });
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPaymentTestingDriverModule, decorators: [{
|
|
47
|
+
/** @nocollapse */ DaffPaymentTestingDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
48
|
+
/** @nocollapse */ DaffPaymentTestingDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingDriverModule, imports: [CommonModule] });
|
|
49
|
+
/** @nocollapse */ DaffPaymentTestingDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingDriverModule, imports: [CommonModule] });
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentTestingDriverModule, decorators: [{
|
|
53
51
|
type: NgModule,
|
|
54
52
|
args: [{
|
|
55
53
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-payment-driver-testing.mjs","sources":["../../../libs/payment/driver/testing/src/drivers/payment.service.ts","../../../libs/payment/driver/testing/src/drivers/payment-driver.module.ts","../../../libs/payment/driver/testing/src/daffodil-payment-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\n/**\n * A basic payment driver that creates mock payment results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentTestingDriver implements DaffPaymentDriverInterface {\n\n constructor(\n private paymentResponseFactory: DaffPaymentResponseKindFactory,\n ) {}\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return of(this.paymentResponseFactory.create());\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffPaymentDriver } from '@daffodil/payment/driver';\n\nimport { DaffPaymentTestingDriver } from './payment.service';\n\n/**\n * Provides the {@link DaffPaymentTestingDriver} as the {@link DaffPaymentDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffPaymentTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentTestingDriverModule> {\n return {\n ngModule: DaffPaymentTestingDriverModule,\n providers: [\n {\n provide: DaffPaymentDriver,\n useExisting: DaffPaymentTestingDriver,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAaA;;;;;AAKG;MAIU,wBAAwB,CAAA;AAEnC,IAAA,WAAA,CACU,sBAAsD,EAAA;QAAtD,IAAsB,CAAA,sBAAA,GAAtB,sBAAsB,CAAgC;KAC5D;AAEJ,IAAA,aAAa,CAAC,OAA2B,EAAA;QACvC,OAAO,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,EAAE,CAAC,CAAC;KACjD;;wIARU,wBAAwB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,mBAAA,wBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cAFvB,MAAM,EAAA,CAAA,CAAA;2FAEP,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAHpC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACXD;;AAEG;MAMU,8BAA8B,CAAA;AACzC,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,8BAA8B;AACxC,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,WAAW,EAAE,wBAAwB;AACtC,iBAAA;AACF,aAAA;SACF,CAAC;KACH;;8IAXU,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA9B,mBAAA,8BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAHvC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,mBAAA,8BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,
|
|
1
|
+
{"version":3,"file":"daffodil-payment-driver-testing.mjs","sources":["../../../libs/payment/driver/testing/src/drivers/payment.service.ts","../../../libs/payment/driver/testing/src/drivers/payment-driver.module.ts","../../../libs/payment/driver/testing/src/daffodil-payment-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\n/**\n * A basic payment driver that creates mock payment results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentTestingDriver implements DaffPaymentDriverInterface {\n\n constructor(\n private paymentResponseFactory: DaffPaymentResponseKindFactory,\n ) {}\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return of(this.paymentResponseFactory.create());\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffPaymentDriver } from '@daffodil/payment/driver';\n\nimport { DaffPaymentTestingDriver } from './payment.service';\n\n/**\n * Provides the {@link DaffPaymentTestingDriver} as the {@link DaffPaymentDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffPaymentTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentTestingDriverModule> {\n return {\n ngModule: DaffPaymentTestingDriverModule,\n providers: [\n {\n provide: DaffPaymentDriver,\n useExisting: DaffPaymentTestingDriver,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAaA;;;;;AAKG;MAIU,wBAAwB,CAAA;AAEnC,IAAA,WAAA,CACU,sBAAsD,EAAA;QAAtD,IAAsB,CAAA,sBAAA,GAAtB,sBAAsB,CAAgC;KAC5D;AAEJ,IAAA,aAAa,CAAC,OAA2B,EAAA;QACvC,OAAO,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,EAAE,CAAC,CAAC;KACjD;;wIARU,wBAAwB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,mBAAA,wBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cAFvB,MAAM,EAAA,CAAA,CAAA;2FAEP,wBAAwB,EAA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0.0", version: "
|
|
20
|
-
/** @nocollapse */ MockDaffPaymentPageFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
19
|
+
/** @nocollapse */ MockDaffPaymentPageFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MockDaffPaymentPageFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20
|
+
/** @nocollapse */ MockDaffPaymentPageFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MockDaffPaymentPageFacade, providedIn: 'root' });
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MockDaffPaymentPageFacade, decorators: [{
|
|
22
22
|
type: Injectable,
|
|
23
23
|
args: [{ providedIn: 'root' }]
|
|
24
24
|
}] });
|
|
@@ -28,12 +28,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
28
28
|
*/
|
|
29
29
|
class DaffPaymentStateTestingModule {
|
|
30
30
|
}
|
|
31
|
-
/** @nocollapse */ DaffPaymentStateTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
32
|
-
/** @nocollapse */ DaffPaymentStateTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
33
|
-
/** @nocollapse */ DaffPaymentStateTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
31
|
+
/** @nocollapse */ DaffPaymentStateTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
32
|
+
/** @nocollapse */ DaffPaymentStateTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateTestingModule });
|
|
33
|
+
/** @nocollapse */ DaffPaymentStateTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateTestingModule, providers: [
|
|
34
34
|
{ provide: DaffPaymentPageFacade, useExisting: MockDaffPaymentPageFacade },
|
|
35
35
|
] });
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateTestingModule, decorators: [{
|
|
37
37
|
type: NgModule,
|
|
38
38
|
args: [{
|
|
39
39
|
providers: [
|
|
@@ -170,9 +170,9 @@ class DaffPaymentPageFacade {
|
|
|
170
170
|
this.store.dispatch(action);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
/** @nocollapse */ DaffPaymentPageFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
174
|
-
/** @nocollapse */ DaffPaymentPageFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
173
|
+
/** @nocollapse */ DaffPaymentPageFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentPageFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
174
|
+
/** @nocollapse */ DaffPaymentPageFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentPageFacade, providedIn: 'root' });
|
|
175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentPageFacade, decorators: [{
|
|
176
176
|
type: Injectable,
|
|
177
177
|
args: [{
|
|
178
178
|
providedIn: 'root',
|
|
@@ -228,12 +228,10 @@ const DAFF_PAYMENT_REDUCERS = new InjectionToken('DAFF_PAYMENT_REDUCERS', {
|
|
|
228
228
|
*/
|
|
229
229
|
class DaffPaymentStateModule {
|
|
230
230
|
}
|
|
231
|
-
/** @nocollapse */ DaffPaymentStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
232
|
-
/** @nocollapse */ DaffPaymentStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
233
|
-
/** @nocollapse */ DaffPaymentStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
234
|
-
|
|
235
|
-
]] });
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPaymentStateModule, decorators: [{
|
|
231
|
+
/** @nocollapse */ DaffPaymentStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
232
|
+
/** @nocollapse */ DaffPaymentStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, imports: [i1.StoreFeatureModule] });
|
|
233
|
+
/** @nocollapse */ DaffPaymentStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, imports: [StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS)] });
|
|
234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, decorators: [{
|
|
237
235
|
type: NgModule,
|
|
238
236
|
args: [{
|
|
239
237
|
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/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 DaffPaymentGenerateToken<T extends DaffPaymentRequest = DaffPaymentRequest> extends Action {\n readonly request: T;\n readonly address?: DaffPersonalAddress | DaffIdentifiable;\n}\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 {\n InjectionToken,\n Provider,\n} from '@angular/core';\nimport { ActionReducer } from '@ngrx/store';\n\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\n/**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffPaymentProvideExtraReducers}.\n */\nexport const DAFF_PAYMENT_EXTRA_REDUCERS = new InjectionToken<ActionReducer<DaffPaymentReducersState>[]>(\n 'DAFF_PAYMENT_EXTRA_REDUCERS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * ```ts\n * providers: [\n * ...daffPaymentProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffPaymentProvideExtraReducers(\n ...reducers: ActionReducer<DaffPaymentReducersState>[]\n): Provider[] {\n return reducers.map(reducer => ({\n provide: DAFF_PAYMENT_EXTRA_REDUCERS,\n useValue: reducer,\n multi: true,\n }));\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 {\n DaffPaymentGenerateToken,\n DaffPaymentActionTypes,\n DaffPaymentActions,\n DaffPaymentGenerateTokenFailure,\n} from '../../actions/payment.actions';\nimport { DaffPaymentStateReducerAdapter } from './adapter';\nimport { daffPaymentInitialState } from './initial-state';\nimport { DaffPaymentReducerState } from './interface';\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 { DaffPaymentStateRootSlice } from '../reducers/public_api';\nimport { getDaffPaymentReducersStateSelector } from './feature.selector';\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 { DaffPaymentStateRootSlice } from '../../reducers/public_api';\nimport { daffPaymentGetSelectors } from '../../selectors/public_api';\nimport { DaffPaymentPageFacadeInterface } from './interface';\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 {\n InjectionToken,\n ValueProvider,\n} from '@angular/core';\n\nimport { DaffPaymentAvailableProcessor } from '../models/public_api';\n\n/**\n * A multi-provider injection token for registering payment processors.\n */\nexport const DAFF_PAYMENT_AVAILABLE_PROCESSORS = new InjectionToken<DaffPaymentAvailableProcessor[]>(\n 'DAFF_PAYMENT_AVAILABLE_PROCESSORS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides a payment processor registration.\n *\n * See {@link DaffPaymentAvailableProcessor}.\n */\nexport const daffPaymentProvideAvailableProcessors = (...processors: DaffPaymentAvailableProcessor[]): ValueProvider[] =>\n processors.map(processor => ({\n provide: DAFF_PAYMENT_AVAILABLE_PROCESSORS,\n useValue: processor,\n multi: true,\n }));\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\n\nimport { daffArrayToDict } from '@daffodil/core';\n\nimport { DaffPaymentProcessorCollection } from '../models/public_api';\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from './available-processors.token';\n\n/**\n * An internal token to combine the available payment processors into a single collection.\n */\nexport const DAFF_PAYMENT_PROCESSOR_COLLECTION = new InjectionToken<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 {\n inject,\n InjectionToken,\n} from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { daffComposeReducers } from '@daffodil/core/state';\n// these unused imports are a workaround\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from '../../injection-tokens/public_api';\nimport { daffPaymentReducerFactory } from '../payment/reducer';\nimport { DaffPaymentReducersState } from '../reducers.interface';\nimport { DAFF_PAYMENT_EXTRA_REDUCERS } from './extra.token';\n\n/**\n * An internal token to hold the Daffodil payment reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\nexport const DAFF_PAYMENT_REDUCERS = new InjectionToken<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,uBAGX;AAHD,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF,CAAA;AAChF,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF,CAAA;AAClF,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,GAGjC,EAAA,CAAA,CAAA,CAAA;AAYD;;AAEG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB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B,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;uIAAtB,sBAAsB,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,CAAA;AAAtB,mBAAA,sBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,EAJxB,OAAA,EAAA,CAAA;AACP,YAAA,WAAW,CAAC,UAAU,CAAC,8BAA8B,EAAE,qBAAqB,CAAC;AAC9E,SAAA,CAAA,EAAA,CAAA,CAAA;2FAEU,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,CAAA;;;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/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 DaffPaymentGenerateToken<T extends DaffPaymentRequest = DaffPaymentRequest> extends Action {\n readonly request: T;\n readonly address?: DaffPersonalAddress | DaffIdentifiable;\n}\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 {\n InjectionToken,\n Provider,\n} from '@angular/core';\nimport { ActionReducer } from '@ngrx/store';\n\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\n/**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffPaymentProvideExtraReducers}.\n */\nexport const DAFF_PAYMENT_EXTRA_REDUCERS = new InjectionToken<ActionReducer<DaffPaymentReducersState>[]>(\n 'DAFF_PAYMENT_EXTRA_REDUCERS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * ```ts\n * providers: [\n * ...daffPaymentProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffPaymentProvideExtraReducers(\n ...reducers: ActionReducer<DaffPaymentReducersState>[]\n): Provider[] {\n return reducers.map(reducer => ({\n provide: DAFF_PAYMENT_EXTRA_REDUCERS,\n useValue: reducer,\n multi: true,\n }));\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 {\n InjectionToken,\n ValueProvider,\n} from '@angular/core';\n\nimport { DaffPaymentAvailableProcessor } from '../models/public_api';\n\n/**\n * A multi-provider injection token for registering payment processors.\n */\nexport const DAFF_PAYMENT_AVAILABLE_PROCESSORS = new InjectionToken<DaffPaymentAvailableProcessor[]>(\n 'DAFF_PAYMENT_AVAILABLE_PROCESSORS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides a payment processor registration.\n *\n * See {@link DaffPaymentAvailableProcessor}.\n */\nexport const daffPaymentProvideAvailableProcessors = (...processors: DaffPaymentAvailableProcessor[]): ValueProvider[] =>\n processors.map(processor => ({\n provide: DAFF_PAYMENT_AVAILABLE_PROCESSORS,\n useValue: processor,\n multi: true,\n }));\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\n\nimport { daffArrayToDict } from '@daffodil/core';\n\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from './available-processors.token';\nimport { DaffPaymentProcessorCollection } from '../models/public_api';\n\n/**\n * An internal token to combine the available payment processors into a single collection.\n */\nexport const DAFF_PAYMENT_PROCESSOR_COLLECTION = new InjectionToken<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 {\n inject,\n InjectionToken,\n} from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\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\n/**\n * An internal token to hold the Daffodil payment reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\nexport const DAFF_PAYMENT_REDUCERS = new InjectionToken<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,uBAGX;AAHD,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF,CAAA;AAChF,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF,CAAA;AAClF,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,GAGjC,EAAA,CAAA,CAAA,CAAA;AAYD;;AAEG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,OAAU,EAAA;QAAV,IAAO,CAAA,OAAA,GAAP,OAAO,CAAG;AAFpB,QAAA,IAAA,CAAA,IAAI,GAAG,sBAAsB,CAAC,0BAA0B,CAAC;KAEjC;AAClC,CAAA;AAED;;AAEG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,OAAuB,EAAA;QAAvB,IAAO,CAAA,OAAA,GAAP,OAAO,CAAgB;AAFjC,QAAA,IAAA,CAAA,IAAI,GAAG,sBAAsB,CAAC,0BAA0B,CAAC;KAEpB;AAC/C;;AC5CD;;AAEG;AACI,MAAM,8BAA8B,GAAG;;ACK9C;;;;AAIG;MACU,2BAA2B,GAAG,IAAI,cAAc,CAC3D,6BAA6B,EAC7B;AACE,IAAA,OAAO,EAAE,MAAM,EAAE;AACjB,IAAA,UAAU,EAAE,KAAK;AAClB,CAAA,EACD;AAEF;;;;;;;;;;;AAWG;AACa,SAAA,+BAA+B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