@daffodil/payment 0.94.1-rc.0 → 0.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +1,35 @@
1
- import * as i0 from '@angular/core';
2
- import { ModuleWithProviders } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { Observable } from 'rxjs';
5
- import { DaffPaymentRequest, DaffPaymentResponse } from '@daffodil/payment';
6
- import { DaffPaymentDriverInterface } from '@daffodil/payment/driver';
7
- import { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';
8
-
1
+ import * as i0 from "@angular/core";
2
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ import { Observable } from "rxjs";
5
+ import { DaffPaymentRequest, DaffPaymentResponse } from "@daffodil/payment";
6
+ import { DaffPaymentDriverInterface } from "@daffodil/payment/driver";
7
+ import { DaffPaymentResponseKindFactory } from "@daffodil/payment/testing";
9
8
  /**
10
9
  * Provides the {@link DaffPaymentTestingDriver} as the {@link DaffPaymentDriver}.
10
+ *
11
+ * @deprecated in favor of {@link provideDaffPaymentTestingDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
11
12
  */
12
- declare class DaffPaymentTestingDriverModule {
13
- static forRoot(): ModuleWithProviders<DaffPaymentTestingDriverModule>;
14
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentTestingDriverModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffPaymentTestingDriverModule, never, [typeof i1.CommonModule], never>;
16
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffPaymentTestingDriverModule>;
13
+ export declare class DaffPaymentTestingDriverModule {
14
+ static forRoot(): ModuleWithProviders<DaffPaymentTestingDriverModule>;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentTestingDriverModule, never>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffPaymentTestingDriverModule, never, [typeof i1.CommonModule], never>;
17
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffPaymentTestingDriverModule>;
17
18
  }
18
-
19
+ /**
20
+ * Provides the {@link DaffPaymentTestingDriver} as the {@link DaffPaymentDriver}.
21
+ */
22
+ export declare const provideDaffPaymentTestingDriver: () => EnvironmentProviders;
19
23
  /**
20
24
  * A basic payment driver that creates mock payment results of different kinds.
21
25
  * For testing purposes.
22
26
  *
23
27
  * @inheritdoc
24
28
  */
25
- declare class DaffPaymentTestingDriver implements DaffPaymentDriverInterface {
26
- private paymentResponseFactory;
27
- constructor(paymentResponseFactory: DaffPaymentResponseKindFactory);
28
- generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse>;
29
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentTestingDriver, never>;
30
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffPaymentTestingDriver>;
31
- }
32
-
33
- export { DaffPaymentTestingDriver, DaffPaymentTestingDriverModule };
29
+ export declare class DaffPaymentTestingDriver implements DaffPaymentDriverInterface {
30
+ private paymentResponseFactory;
31
+ constructor(paymentResponseFactory: DaffPaymentResponseKindFactory);
32
+ generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse>;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentTestingDriver, never>;
34
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
35
+ }
@@ -1,36 +1,28 @@
1
- import * as _angular_core from '@angular/core';
2
- import { Observable } from 'rxjs';
3
- import { DaffPaymentResponse, DaffPaymentRequest } from '@daffodil/payment';
4
- import { DaffInheritableError, DaffError } from '@daffodil/core';
5
-
6
- declare const DaffPaymentDriver: _angular_core.InjectionToken<DaffPaymentDriverInterface<DaffPaymentResponse<unknown>>>;
7
- declare const provideDaffPaymentDriver: <R extends DaffPaymentDriverInterface<DaffPaymentResponse<unknown>> = DaffPaymentDriverInterface<DaffPaymentResponse<unknown>>>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
1
+ import { Observable } from "rxjs";
2
+ import { DaffPaymentRequest, DaffPaymentResponse } from "@daffodil/payment";
3
+ import { DaffError, DaffInheritableError } from "@daffodil/core";
4
+ export declare const DaffPaymentDriver: import("@angular/core").InjectionToken<DaffPaymentDriverInterface<DaffPaymentResponse<unknown>>>, provideDaffPaymentDriver: <R extends DaffPaymentDriverInterface<DaffPaymentResponse<unknown>> = DaffPaymentDriverInterface<DaffPaymentResponse<unknown>>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
8
5
  /**
9
6
  * The payment driver is responsible for taking user payment input and generating a token for use with the platform.
10
7
  */
11
- interface DaffPaymentDriverInterface<T extends DaffPaymentResponse = DaffPaymentResponse> {
12
- /**
13
- * Generate a payment token.
14
- */
15
- generateToken(request: DaffPaymentRequest): Observable<T>;
8
+ export interface DaffPaymentDriverInterface<T extends DaffPaymentResponse = DaffPaymentResponse> {
9
+ /**
10
+ * Generate a payment token.
11
+ */
12
+ generateToken(request: DaffPaymentRequest): Observable<T>;
16
13
  }
17
-
18
- declare const DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE = "DAFF_PAYMENT_INVALID_API_RESPONSE";
14
+ export declare const DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE = "DAFF_PAYMENT_INVALID_API_RESPONSE";
19
15
  /**
20
16
  * A general error indicating that the platform returned a response which cannot be processed.
21
17
  */
22
- declare class DaffPaymentInvalidAPIResponseError extends DaffInheritableError implements DaffError {
23
- message: string;
24
- readonly code: string;
25
- constructor(message: string);
18
+ export declare class DaffPaymentInvalidAPIResponseError extends DaffInheritableError implements DaffError {
19
+ message: string;
20
+ readonly code: string;
21
+ constructor(message: string);
26
22
  }
27
-
28
23
  /**
29
24
  * A mapping from error codes to error class constructors.
30
25
  */
31
- declare const DaffPaymentDriverErrorMap: {
32
- DAFF_PAYMENT_INVALID_API_RESPONSE: typeof DaffPaymentInvalidAPIResponseError;
33
- };
34
-
35
- export { DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE, DaffPaymentDriver, DaffPaymentDriverErrorMap, DaffPaymentInvalidAPIResponseError, provideDaffPaymentDriver };
36
- export type { DaffPaymentDriverInterface };
26
+ export declare const DaffPaymentDriverErrorMap: {
27
+ DAFF_PAYMENT_INVALID_API_RESPONSE: typeof DaffPaymentInvalidAPIResponseError;
28
+ };
@@ -1,29 +1,32 @@
1
- import { Action } from '@ngrx/store';
2
- import { BehaviorSubject } from 'rxjs';
3
- import { DaffStateError } from '@daffodil/core/state';
4
- import { DaffPaymentPageFacadeInterface } from '@daffodil/payment/state';
5
- import * as i0 from '@angular/core';
6
-
1
+ import { Action } from "@ngrx/store";
2
+ import { BehaviorSubject } from "rxjs";
3
+ import { DaffStateError } from "@daffodil/core/state";
4
+ import { DaffPaymentPageFacadeInterface } from "@daffodil/payment/state";
5
+ import * as i0 from "@angular/core";
6
+ import { EnvironmentProviders } from "@angular/core";
7
7
  /**
8
8
  * Mocks out facade fields and methods for testing purposes.
9
9
  *
10
10
  * @inheritdoc
11
11
  */
12
- declare class MockDaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {
13
- loading$: BehaviorSubject<boolean>;
14
- errors$: BehaviorSubject<DaffStateError[]>;
15
- dispatch(action: Action): void;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffPaymentPageFacade, never>;
17
- static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffPaymentPageFacade>;
12
+ export declare class MockDaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {
13
+ loading$: BehaviorSubject<boolean>;
14
+ errors$: BehaviorSubject<DaffStateError[]>;
15
+ dispatch(action: Action): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffPaymentPageFacade, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
18
18
  }
19
-
20
19
  /**
21
20
  * Provides the {@link MockDaffPaymentPageFacade} for {@link DaffPaymentPageFacade}.
21
+ *
22
+ * @deprecated in favor of {@link provideDaffPaymentStateTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
22
23
  */
23
- declare class DaffPaymentStateTestingModule {
24
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentStateTestingModule, never>;
25
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffPaymentStateTestingModule, never, never, never>;
26
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffPaymentStateTestingModule>;
24
+ export declare class DaffPaymentStateTestingModule {
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentStateTestingModule, never>;
26
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffPaymentStateTestingModule, never, never, never>;
27
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffPaymentStateTestingModule>;
27
28
  }
28
-
29
- export { DaffPaymentStateTestingModule, MockDaffPaymentPageFacade };
29
+ /**
30
+ * Provides the {@link MockDaffPaymentPageFacade} for {@link DaffPaymentPageFacade}.
31
+ */
32
+ export declare const provideDaffPaymentStateTesting: () => EnvironmentProviders;
@@ -1,204 +1,187 @@
1
- import * as _ngrx_store from '@ngrx/store';
2
- import { Action, ActionReducer, MemoizedSelector, Store } from '@ngrx/store';
3
- import { DaffIdentifiable } from '@daffodil/core';
4
- import { DaffStateError, DaffStoreFacade, daffTransformErrorToStateError } from '@daffodil/core/state';
5
- import { DaffPersonalAddress } from '@daffodil/geography';
6
- import { DaffPaymentResponse, DaffPaymentRequest } from '@daffodil/payment';
7
- import * as _angular_core from '@angular/core';
8
- import { InjectionToken } from '@angular/core';
9
- import { Observable } from 'rxjs';
10
- import { DaffPaymentDriverInterface } from '@daffodil/payment/driver';
11
-
1
+ import * as i1 from "@ngrx/store";
2
+ import { Action, ActionReducer, MemoizedSelector, Store } from "@ngrx/store";
3
+ import { DaffIdentifiable } from "@daffodil/core";
4
+ import { DaffStateError, DaffStoreFacade, daffTransformErrorToStateError } from "@daffodil/core/state";
5
+ import { DaffPersonalAddress } from "@daffodil/geography";
6
+ import { DaffPaymentRequest, DaffPaymentResponse } from "@daffodil/payment";
7
+ import { Observable } from "rxjs";
8
+ import * as i0 from "@angular/core";
9
+ import { EnvironmentProviders, InjectionToken } from "@angular/core";
10
+ import { DaffPaymentDriverInterface } from "@daffodil/payment/driver";
12
11
  /**
13
12
  * The payment action types enum.
14
13
  */
15
- declare enum DaffPaymentActionTypes {
16
- GenerateTokenSuccessAction = "[@daffodil/payment] Generate Token Success Action",
17
- GenerateTokenFailureAction = "[@daffodil/payment] Generate Token Failure Action"
14
+ export declare enum DaffPaymentActionTypes {
15
+ GenerateTokenSuccessAction = "[@daffodil/payment] Generate Token Success Action",
16
+ GenerateTokenFailureAction = "[@daffodil/payment] Generate Token Failure Action"
18
17
  }
19
18
  /**
20
19
  * Generates a payment token.
21
20
  *
22
21
  * @param query The payment query.
23
22
  */
24
- interface DaffPaymentGenerateTokenPayload<T extends DaffPaymentRequest = DaffPaymentRequest> {
25
- readonly request: T;
26
- readonly address?: DaffPersonalAddress | DaffIdentifiable;
27
- }
28
- interface DaffPaymentGenerateToken<T extends DaffPaymentRequest = DaffPaymentRequest> extends DaffPaymentGenerateTokenPayload<T>, Action {
23
+ export interface DaffPaymentGenerateTokenPayload<T extends DaffPaymentRequest = DaffPaymentRequest> {
24
+ readonly request: T;
25
+ readonly address?: DaffPersonalAddress | DaffIdentifiable;
29
26
  }
27
+ export interface DaffPaymentGenerateToken<T extends DaffPaymentRequest = DaffPaymentRequest> extends DaffPaymentGenerateTokenPayload<T>, Action {}
30
28
  /**
31
29
  * Indicates a successful generation of a payment token.
32
30
  */
33
- declare class DaffPaymentGenerateTokenSuccess<T extends DaffPaymentResponse = DaffPaymentResponse> implements Action {
34
- payload: T;
35
- readonly type = DaffPaymentActionTypes.GenerateTokenSuccessAction;
36
- constructor(payload: T);
31
+ export declare class DaffPaymentGenerateTokenSuccess<T extends DaffPaymentResponse = DaffPaymentResponse> implements Action {
32
+ payload: T;
33
+ readonly type = DaffPaymentActionTypes.GenerateTokenSuccessAction;
34
+ constructor(payload: T);
37
35
  }
38
36
  /**
39
37
  * A failed payment with the error message.
40
38
  */
41
- declare class DaffPaymentGenerateTokenFailure implements Action {
42
- payload: DaffStateError;
43
- readonly type = DaffPaymentActionTypes.GenerateTokenFailureAction;
44
- constructor(payload: DaffStateError);
39
+ export declare class DaffPaymentGenerateTokenFailure implements Action {
40
+ payload: DaffStateError;
41
+ readonly type = DaffPaymentActionTypes.GenerateTokenFailureAction;
42
+ constructor(payload: DaffStateError);
45
43
  }
46
44
  /**
47
45
  * A union of the payment action types.
48
46
  */
49
- type DaffPaymentActions<T extends DaffPaymentResponse = DaffPaymentResponse> = DaffPaymentGenerateTokenSuccess<T> | DaffPaymentGenerateTokenFailure;
50
-
47
+ export type DaffPaymentActions<T extends DaffPaymentResponse = DaffPaymentResponse> = DaffPaymentGenerateTokenSuccess<T> | DaffPaymentGenerateTokenFailure;
51
48
  /**
52
49
  * The main payment state.
53
50
  * Contains info about the current or most recent payment operation.
54
51
  */
55
- interface DaffPaymentReducerState {
56
- /**
57
- * Whether there is a pending payment operation.
58
- */
59
- loading: boolean;
60
- /**
61
- * A list of payment errors, if any.
62
- */
63
- errors: DaffStateError[];
52
+ export interface DaffPaymentReducerState {
53
+ /**
54
+ * Whether there is a pending payment operation.
55
+ */
56
+ loading: boolean;
57
+ /**
58
+ * A list of payment errors, if any.
59
+ */
60
+ errors: DaffStateError[];
64
61
  }
65
-
66
62
  /**
67
63
  * Manages {@link DaffPaymentReducerState}.
68
64
  */
69
- declare class DaffPaymentStateReducerAdapter {
70
- /**
71
- * Begins the payment operation flow.
72
- * Sets loading to true.
73
- */
74
- generateToken(state: DaffPaymentReducerState): DaffPaymentReducerState;
75
- /**
76
- * Sets loading to false and resets errors.
77
- */
78
- tokenGenerated(state: DaffPaymentReducerState): DaffPaymentReducerState;
79
- /**
80
- * Stores the from a failed payment.
81
- * Also sets loading to false.
82
- */
83
- storeError(errors: DaffStateError[], state: DaffPaymentReducerState): DaffPaymentReducerState;
65
+ export declare class DaffPaymentStateReducerAdapter {
66
+ /**
67
+ * Begins the payment operation flow.
68
+ * Sets loading to true.
69
+ */
70
+ generateToken(state: DaffPaymentReducerState): DaffPaymentReducerState;
71
+ /**
72
+ * Sets loading to false and resets errors.
73
+ */
74
+ tokenGenerated(state: DaffPaymentReducerState): DaffPaymentReducerState;
75
+ /**
76
+ * Stores the from a failed payment.
77
+ * Also sets loading to false.
78
+ */
79
+ storeError(errors: DaffStateError[], state: DaffPaymentReducerState): DaffPaymentReducerState;
84
80
  }
85
-
86
81
  /**
87
82
  * The initial state for the main payment state, see {@link DaffPaymentReducerState}.
88
83
  */
89
- declare const daffPaymentInitialState: DaffPaymentReducerState;
90
-
84
+ export declare const daffPaymentInitialState: DaffPaymentReducerState;
91
85
  /**
92
86
  * The reducer for the payment page state, see {@link DaffPaymentReducerState}.
93
87
  */
94
- declare const daffPaymentReducerFactory: <T extends DaffPaymentResponse = DaffPaymentResponse>(actions: DaffPaymentGenerateToken["type"][]) => (state: DaffPaymentReducerState, action: DaffPaymentActions<T>) => DaffPaymentReducerState;
95
-
88
+ export declare const daffPaymentReducerFactory: <T extends DaffPaymentResponse = DaffPaymentResponse>(actions: DaffPaymentGenerateToken["type"][]) => (state: DaffPaymentReducerState, action: DaffPaymentActions<T>) => DaffPaymentReducerState;
96
89
  /**
97
90
  * The key under which the payment feature state will be stored.
98
91
  */
99
- declare const DAFF_PAYMENT_STORE_FEATURE_KEY = "daffPayment";
100
-
92
+ export declare const DAFF_PAYMENT_STORE_FEATURE_KEY = "daffPayment";
101
93
  /**
102
94
  * The feature state for payment.
103
95
  */
104
- interface DaffPaymentReducersState {
105
- payment: DaffPaymentReducerState;
96
+ export interface DaffPaymentReducersState {
97
+ payment: DaffPaymentReducerState;
106
98
  }
107
99
  /**
108
100
  * The footprint of payment feature state in the root application state.
109
101
  */
110
- interface DaffPaymentStateRootSlice {
111
- [DAFF_PAYMENT_STORE_FEATURE_KEY]: DaffPaymentReducersState;
102
+ export interface DaffPaymentStateRootSlice {
103
+ [DAFF_PAYMENT_STORE_FEATURE_KEY]: DaffPaymentReducersState;
112
104
  }
113
-
114
- declare const DAFF_PAYMENT_EXTRA_REDUCERS: _angular_core.InjectionToken<ActionReducer<DaffPaymentReducersState, _ngrx_store.Action<string>>[]>;
115
- declare const daffPaymentProvideExtraReducers: <R extends ActionReducer<DaffPaymentReducersState, _ngrx_store.Action<string>> = ActionReducer<DaffPaymentReducersState, _ngrx_store.Action<string>>>(...values: R[]) => Array<_angular_core.ValueProvider>;
116
-
105
+ export declare const DAFF_PAYMENT_EXTRA_REDUCERS: import("@angular/core").InjectionToken<ActionReducer<DaffPaymentReducersState, import("@ngrx/store").Action<string>>[]>, daffPaymentProvideExtraReducers: <R extends ActionReducer<DaffPaymentReducersState, import("@ngrx/store").Action<string>> = ActionReducer<DaffPaymentReducersState, import("@ngrx/store").Action<string>>>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
117
106
  /**
118
107
  * Selectors for the main part of payment state.
119
108
  */
120
- interface DaffPaymentSelectors {
121
- /**
122
- * Selects whether there is a pending payment operation.
123
- */
124
- selectPaymentLoading: MemoizedSelector<DaffPaymentStateRootSlice, boolean>;
125
- /**
126
- * Selects the list of payment errors, if any.
127
- */
128
- selectPaymentErrors: MemoizedSelector<DaffPaymentStateRootSlice, DaffStateError[]>;
109
+ export interface DaffPaymentSelectors {
110
+ /**
111
+ * Selects whether there is a pending payment operation.
112
+ */
113
+ selectPaymentLoading: MemoizedSelector<DaffPaymentStateRootSlice, boolean>;
114
+ /**
115
+ * Selects the list of payment errors, if any.
116
+ */
117
+ selectPaymentErrors: MemoizedSelector<DaffPaymentStateRootSlice, DaffStateError[]>;
129
118
  }
130
- declare const daffPaymentGetSelectors: () => DaffPaymentSelectors;
131
-
119
+ export declare const daffPaymentGetSelectors: () => DaffPaymentSelectors;
132
120
  /**
133
121
  * Exposes the payment state selectors.
134
122
  */
135
- interface DaffPaymentPageFacadeInterface extends DaffStoreFacade<Action> {
136
- /**
137
- * Whether there is a pending payment operation.
138
- */
139
- loading$: Observable<boolean>;
140
- /**
141
- * A list of payment errors, if any.
142
- */
143
- errors$: Observable<DaffStateError[]>;
123
+ export interface DaffPaymentPageFacadeInterface extends DaffStoreFacade<Action> {
124
+ /**
125
+ * Whether there is a pending payment operation.
126
+ */
127
+ loading$: Observable<boolean>;
128
+ /**
129
+ * A list of payment errors, if any.
130
+ */
131
+ errors$: Observable<DaffStateError[]>;
144
132
  }
145
-
146
133
  /**
147
134
  * @inheritdoc
148
135
  *
149
136
  * Serves as the base for a payment facade.
150
137
  * Extend this class and pass in the selectors for the specific state you wish to target.
151
138
  */
152
- declare class DaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {
153
- private store;
154
- loading$: Observable<boolean>;
155
- errors$: Observable<DaffStateError[]>;
156
- constructor(store: Store<DaffPaymentStateRootSlice>);
157
- dispatch(action: Action): void;
158
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffPaymentPageFacade, never>;
159
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<DaffPaymentPageFacade>;
139
+ export declare class DaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {
140
+ private store;
141
+ loading$: Observable<boolean>;
142
+ errors$: Observable<DaffStateError[]>;
143
+ constructor(store: Store<DaffPaymentStateRootSlice>);
144
+ dispatch(action: Action): void;
145
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentPageFacade, never>;
146
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
160
147
  }
161
-
162
148
  /**
163
149
  * A representation of an available payment processor.
164
150
  */
165
- interface DaffPaymentAvailableProcessor {
166
- /**
167
- * The processor kind.
168
- */
169
- kind: DaffPaymentRequest['kind'];
170
- /**
171
- * The action type string that triggers token generation.
172
- */
173
- action: string;
174
- /**
175
- * An injection token of the driver that can perform token generation
176
- * for this specific payment processor.
177
- */
178
- driver: InjectionToken<DaffPaymentDriverInterface>;
151
+ export interface DaffPaymentAvailableProcessor {
152
+ /**
153
+ * The processor kind.
154
+ */
155
+ kind: DaffPaymentRequest['kind'];
156
+ /**
157
+ * The action type string that triggers token generation.
158
+ */
159
+ action: string;
160
+ /**
161
+ * An injection token of the driver that can perform token generation
162
+ * for this specific payment processor.
163
+ */
164
+ driver: InjectionToken<DaffPaymentDriverInterface>;
179
165
  }
180
-
181
166
  /**
182
167
  * A collection of {@link DaffPaymentAvailableProcessor}s.
183
168
  */
184
- type DaffPaymentProcessorCollection = Record<DaffPaymentAvailableProcessor['kind'], DaffPaymentAvailableProcessor>;
185
-
186
- declare const DAFF_PAYMENT_AVAILABLE_PROCESSORS: _angular_core.InjectionToken<DaffPaymentAvailableProcessor[]>;
187
- declare const daffPaymentProvideAvailableProcessors: <R extends DaffPaymentAvailableProcessor = DaffPaymentAvailableProcessor>(...values: R[]) => Array<_angular_core.ValueProvider>;
188
-
189
- declare const DAFF_PAYMENT_PROCESSOR_COLLECTION: _angular_core.InjectionToken<DaffPaymentProcessorCollection>;
190
-
191
- declare const DAFF_PAYMENT_ERROR_MATCHER: _angular_core.InjectionToken<typeof daffTransformErrorToStateError>;
192
- declare const provideDaffPaymentErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => _angular_core.ValueProvider;
193
-
169
+ export type DaffPaymentProcessorCollection = Record<DaffPaymentAvailableProcessor['kind'], DaffPaymentAvailableProcessor>;
170
+ export declare const DAFF_PAYMENT_AVAILABLE_PROCESSORS: import("@angular/core").InjectionToken<DaffPaymentAvailableProcessor[]>, daffPaymentProvideAvailableProcessors: <R extends DaffPaymentAvailableProcessor = DaffPaymentAvailableProcessor>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
171
+ declare const DAFF_PAYMENT_PROCESSOR_COLLECTION: import("@angular/core").InjectionToken<DaffPaymentProcessorCollection>, provideDaffPaymentProcessorCollection: <R extends DaffPaymentProcessorCollection = DaffPaymentProcessorCollection>(value: R) => import("@angular/core").ValueProvider;
172
+ export declare const DAFF_PAYMENT_ERROR_MATCHER: import("@angular/core").InjectionToken<typeof daffTransformErrorToStateError>, provideDaffPaymentErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => import("@angular/core").ValueProvider;
194
173
  /**
195
174
  * Creates the payment feature store.
175
+ *
176
+ * @deprecated in favor of {@link provideDaffPaymentState} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
196
177
  */
197
- declare class DaffPaymentStateModule {
198
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffPaymentStateModule, never>;
199
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<DaffPaymentStateModule, never, [typeof _ngrx_store.StoreFeatureModule], never>;
200
- static ɵinj: _angular_core.ɵɵInjectorDeclaration<DaffPaymentStateModule>;
178
+ export declare class DaffPaymentStateModule {
179
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentStateModule, never>;
180
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffPaymentStateModule, never, [typeof i1.StoreFeatureModule], never>;
181
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffPaymentStateModule>;
201
182
  }
202
-
203
- export { DAFF_PAYMENT_AVAILABLE_PROCESSORS, DAFF_PAYMENT_ERROR_MATCHER, DAFF_PAYMENT_EXTRA_REDUCERS, DAFF_PAYMENT_PROCESSOR_COLLECTION, DAFF_PAYMENT_STORE_FEATURE_KEY, DaffPaymentActionTypes, DaffPaymentGenerateTokenFailure, DaffPaymentGenerateTokenSuccess, DaffPaymentPageFacade, DaffPaymentStateModule, DaffPaymentStateReducerAdapter, daffPaymentGetSelectors, daffPaymentInitialState, daffPaymentProvideAvailableProcessors, daffPaymentProvideExtraReducers, daffPaymentReducerFactory, provideDaffPaymentErrorMatcher };
204
- export type { DaffPaymentActions, DaffPaymentAvailableProcessor, DaffPaymentGenerateToken, DaffPaymentGenerateTokenPayload, DaffPaymentPageFacadeInterface, DaffPaymentProcessorCollection, DaffPaymentReducerState, DaffPaymentReducersState, DaffPaymentSelectors, DaffPaymentStateRootSlice };
183
+ /**
184
+ * Provides the `@daffodil/payment/state` feature state.
185
+ */
186
+ export declare const provideDaffPaymentState: () => EnvironmentProviders;
187
+ export { DAFF_PAYMENT_PROCESSOR_COLLECTION };
@@ -1,64 +1,62 @@
1
- import { DaffModelFactory } from '@daffodil/core/testing';
2
- import { DaffPaymentResponse, DaffPaymentRequest } from '@daffodil/payment';
3
- import * as i0 from '@angular/core';
4
- import * as _daffodil_core from '@daffodil/core';
5
-
1
+ import { DaffModelFactory } from "@daffodil/core/testing";
2
+ import { DaffPaymentRequest, DaffPaymentResponse } from "@daffodil/payment";
3
+ import * as i0 from "@angular/core";
4
+ import { EnvironmentProviders } from "@angular/core";
6
5
  /**
7
6
  * Mock class for {@link DaffPaymentResponse}.
8
7
  */
9
- declare class MockPaymentResponse implements DaffPaymentResponse {
10
- method: string;
8
+ export declare class MockPaymentResponse implements DaffPaymentResponse {
9
+ method: string;
11
10
  }
12
11
  /**
13
12
  * Model factory for {@link DaffPaymentResponse}.
14
13
  */
15
- declare class DaffPaymentResponseFactory extends DaffModelFactory<DaffPaymentResponse, typeof MockPaymentResponse> {
16
- constructor();
17
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentResponseFactory, never>;
18
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffPaymentResponseFactory>;
14
+ export declare class DaffPaymentResponseFactory extends DaffModelFactory<DaffPaymentResponse, typeof MockPaymentResponse> {
15
+ constructor();
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentResponseFactory, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
19
18
  }
20
-
21
19
  /**
22
20
  * Mock class for {@link DaffPaymentRequest}.
23
21
  */
24
- declare class MockPaymentRequest implements DaffPaymentRequest {
25
- kind: string;
22
+ export declare class MockPaymentRequest implements DaffPaymentRequest {
23
+ kind: string;
26
24
  }
27
25
  /**
28
26
  * Model factory for {@link DaffPaymentRequest}.
29
27
  */
30
- declare class DaffPaymentRequestFactory extends DaffModelFactory<DaffPaymentRequest> {
31
- constructor();
32
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentRequestFactory, never>;
33
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffPaymentRequestFactory>;
28
+ export declare class DaffPaymentRequestFactory extends DaffModelFactory<DaffPaymentRequest> {
29
+ constructor();
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentRequestFactory, never>;
31
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
34
32
  }
35
-
36
33
  /**
37
34
  * Factory for creating DaffPaymentResponses.
38
35
  * This will create a payment response of random kind.
39
36
  */
40
- declare class DaffPaymentResponseKindFactory extends DaffModelFactory<DaffPaymentResponse> {
41
- private kindFactories;
42
- constructor(kindFactories: DaffModelFactory<DaffPaymentResponse>[]);
43
- private get _randomFactory();
44
- /**
45
- * Creates a payment result of random kind.
46
- */
47
- create(partial?: {}): DaffPaymentResponse;
48
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentResponseKindFactory, never>;
49
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffPaymentResponseKindFactory>;
37
+ export declare class DaffPaymentResponseKindFactory extends DaffModelFactory<DaffPaymentResponse> {
38
+ private kindFactories;
39
+ constructor(kindFactories: DaffModelFactory<DaffPaymentResponse>[]);
40
+ private get _randomFactory();
41
+ /**
42
+ * Creates a payment result of random kind.
43
+ */
44
+ create(partial?: {}): DaffPaymentResponse;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentResponseKindFactory, never>;
46
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
50
47
  }
51
-
52
- declare const DAFF_PAYMENT_RESPONSE_KIND_FACTORIES: i0.InjectionToken<DaffModelFactory<DaffPaymentResponse<unknown>, _daffodil_core.Constructable<DaffPaymentResponse<unknown>>>[]>;
53
- declare const provideDaffPaymentResponseKindFactories: <R extends DaffModelFactory<DaffPaymentResponse<unknown>, _daffodil_core.Constructable<DaffPaymentResponse<unknown>>> = DaffModelFactory<DaffPaymentResponse<unknown>, _daffodil_core.Constructable<DaffPaymentResponse<unknown>>>>(...classes: i0.Type<R>[]) => Array<i0.ExistingProvider>;
54
-
48
+ export declare const DAFF_PAYMENT_RESPONSE_KIND_FACTORIES: import("@angular/core").InjectionToken<DaffModelFactory<DaffPaymentResponse<unknown>, import("@daffodil/core").Constructable<DaffPaymentResponse<unknown>>>[]>, provideDaffPaymentResponseKindFactories: <R extends DaffModelFactory<DaffPaymentResponse<unknown>, import("@daffodil/core").Constructable<DaffPaymentResponse<unknown>>> = DaffModelFactory<DaffPaymentResponse<unknown>, import("@daffodil/core").Constructable<DaffPaymentResponse<unknown>>>>(...classes: import("@angular/core").Type<R>[]) => Array<import("@angular/core").ExistingProvider>;
55
49
  /**
56
50
  * Provides the default payment result factory as a payment result type factory.
51
+ *
52
+ * @deprecated in favor of {@link provideDaffPaymentTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
57
53
  */
58
- declare class DaffPaymentTestingModule {
59
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentTestingModule, never>;
60
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffPaymentTestingModule, never, never, never>;
61
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffPaymentTestingModule>;
54
+ export declare class DaffPaymentTestingModule {
55
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentTestingModule, never>;
56
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffPaymentTestingModule, never, never, never>;
57
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffPaymentTestingModule>;
62
58
  }
63
-
64
- export { DAFF_PAYMENT_RESPONSE_KIND_FACTORIES, DaffPaymentRequestFactory, DaffPaymentResponseFactory, DaffPaymentResponseKindFactory, DaffPaymentTestingModule, MockPaymentRequest, MockPaymentResponse, provideDaffPaymentResponseKindFactories };
59
+ /**
60
+ * Provides the default payment result factory as a payment result type factory.
61
+ */
62
+ export declare const provideDaffPaymentTesting: () => EnvironmentProviders;