@daffodil/payment 0.94.1 → 0.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/daffodil-payment-driver-in-memory.mjs +151 -118
- package/fesm2022/daffodil-payment-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-payment-driver-testing.mjs +93 -60
- package/fesm2022/daffodil-payment-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-payment-driver.mjs +12 -35
- package/fesm2022/daffodil-payment-driver.mjs.map +1 -1
- package/fesm2022/daffodil-payment-state-testing.mjs +85 -49
- package/fesm2022/daffodil-payment-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-payment-state.mjs +154 -238
- package/fesm2022/daffodil-payment-state.mjs.map +1 -1
- package/fesm2022/daffodil-payment-testing.mjs +178 -139
- package/fesm2022/daffodil-payment-testing.mjs.map +1 -1
- package/fesm2022/daffodil-payment.mjs +0 -4
- package/package.json +1 -1
- package/types/daffodil-payment-driver-in-memory.d.ts +54 -54
- package/types/daffodil-payment-driver-testing.d.ts +25 -23
- package/types/daffodil-payment-driver.d.ts +17 -25
- package/types/daffodil-payment-state-testing.d.ts +22 -19
- package/types/daffodil-payment-state.d.ts +114 -131
- package/types/daffodil-payment-testing.d.ts +37 -39
- package/types/daffodil-payment.d.ts +20 -23
- package/fesm2022/daffodil-payment.mjs.map +0 -1
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { ModuleWithProviders } from
|
|
3
|
-
import * as i1 from
|
|
4
|
-
import { Observable } from
|
|
5
|
-
import { DaffPaymentRequest, DaffPaymentResponse } from
|
|
6
|
-
import { DaffPaymentDriverInterface } from
|
|
7
|
-
import { DaffPaymentResponseKindFactory } from
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import { BehaviorSubject } from
|
|
3
|
-
import { DaffStateError } from
|
|
4
|
-
import { DaffPaymentPageFacadeInterface } from
|
|
5
|
-
import * as i0 from
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Provides the {@link MockDaffPaymentPageFacade} for {@link DaffPaymentPageFacade}.
|
|
31
|
+
*/
|
|
32
|
+
export declare const provideDaffPaymentStateTesting: () => EnvironmentProviders;
|
|
@@ -1,204 +1,187 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Action, ActionReducer, MemoizedSelector, Store } from
|
|
3
|
-
import { DaffIdentifiable } from
|
|
4
|
-
import { DaffStateError, DaffStoreFacade, daffTransformErrorToStateError } from
|
|
5
|
-
import { DaffPersonalAddress } from
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import { DaffPaymentDriverInterface } from
|
|
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
|
-
|
|
17
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
|
187
|
-
declare const
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
|
|
204
|
-
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import
|
|
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
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Provides the default payment result factory as a payment result type factory.
|
|
61
|
+
*/
|
|
62
|
+
export declare const provideDaffPaymentTesting: () => EnvironmentProviders;
|