@daffodil/authorizenet 0.66.1 → 0.67.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/driver/errors/error-codes.enum.d.ts +1 -1
- package/{esm2020 → esm2022}/driver/errors/error-codes.enum.mjs +2 -2
- package/{esm2020 → esm2022}/driver/in-memory/backend/authorize-net.service.mjs +4 -4
- package/{esm2020 → esm2022}/driver/in-memory/drivers/authorize-net-driver.module.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/authorize-net.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/authorize-net.module.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/authorize-net.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/payment.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/authorize-net-driver.module.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/authorize-net.service.mjs +4 -4
- package/{esm2020 → esm2022}/services/accept-js-loading.service.mjs +6 -6
- package/{esm2020 → esm2022}/state/authorize-net-state.module.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/authorize-net.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/facades/authorize-net.facade.mjs +5 -5
- package/esm2022/state/payment-state.module.mjs +40 -0
- package/{esm2020 → esm2022}/state/testing/authorize-net-testing.module.mjs +7 -7
- package/{esm2020 → esm2022}/state/testing/mock-authorize-net-facade.mjs +4 -4
- package/{fesm2015 → fesm2022}/daffodil-authorizenet-driver-in-memory.mjs +11 -11
- package/{fesm2015 → fesm2022}/daffodil-authorizenet-driver-in-memory.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-authorizenet-driver-magento.mjs +13 -13
- package/{fesm2020 → fesm2022}/daffodil-authorizenet-driver-magento.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-authorizenet-driver-testing.mjs +7 -7
- package/{fesm2020 → fesm2022}/daffodil-authorizenet-driver-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-authorizenet-driver.mjs +1 -1
- package/fesm2022/daffodil-authorizenet-driver.mjs.map +1 -0
- package/fesm2022/daffodil-authorizenet-state-testing.mjs +44 -0
- package/{fesm2020 → fesm2022}/daffodil-authorizenet-state-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-authorizenet-state.mjs +27 -27
- package/{fesm2020 → fesm2022}/daffodil-authorizenet-state.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-authorizenet.mjs +5 -5
- package/{fesm2020 → fesm2022}/daffodil-authorizenet.mjs.map +1 -1
- package/models/response.type.d.ts +1 -1
- package/package.json +1 -1
- package/state/actions/authorizenet.actions.d.ts +1 -1
- package/esm2020/state/payment-state.module.mjs +0 -40
- package/fesm2015/daffodil-authorizenet-driver-magento.mjs +0 -139
- package/fesm2015/daffodil-authorizenet-driver-magento.mjs.map +0 -1
- package/fesm2015/daffodil-authorizenet-driver-testing.mjs +0 -51
- package/fesm2015/daffodil-authorizenet-driver-testing.mjs.map +0 -1
- package/fesm2015/daffodil-authorizenet-driver.mjs +0 -251
- package/fesm2015/daffodil-authorizenet-driver.mjs.map +0 -1
- package/fesm2015/daffodil-authorizenet-state-testing.mjs +0 -44
- package/fesm2015/daffodil-authorizenet-state-testing.mjs.map +0 -1
- package/fesm2015/daffodil-authorizenet-state.mjs +0 -352
- package/fesm2015/daffodil-authorizenet-state.mjs.map +0 -1
- package/fesm2015/daffodil-authorizenet.mjs +0 -61
- package/fesm2015/daffodil-authorizenet.mjs.map +0 -1
- package/fesm2020/daffodil-authorizenet-driver-in-memory.mjs +0 -84
- package/fesm2020/daffodil-authorizenet-driver-in-memory.mjs.map +0 -1
- package/fesm2020/daffodil-authorizenet-driver.mjs.map +0 -1
- package/fesm2020/daffodil-authorizenet-state-testing.mjs +0 -44
- /package/{esm2020 → esm2022}/constants/kind.mjs +0 -0
- /package/{esm2020 → esm2022}/constants/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/daffodil-authorizenet.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/daffodil-authorizenet-driver.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/acceptjs_invalid.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/acceptjs_missing.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/auth-failed.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/error-code-map.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/input-missing.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/insecure-connection.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-api-response.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-cc-cvv.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-cc-exp-month.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-cc-exp-year.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-cc-name.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-cc-number.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-client-key.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-login-id.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-postal-code.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/past-cc-expiration.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/unconfigured.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/backend/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/daffodil-authorizenet-driver-in-memory.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/drivers/authorize-net-payment-id.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/drivers/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/authorize-net-config.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/authorize-net-payment-id.token.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/authorize-net-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/payment-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/authorize-net-payment-id.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/daffodil-authorizenet-driver-magento.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/authorize-net-payment.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transformers/authorize-net-transformer.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/daffodil-authorizenet-driver-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/drivers/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/models/acceptJs/accept.mjs +0 -0
- /package/{esm2020 → esm2022}/models/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/models/request/authorize-net-request.mjs +0 -0
- /package/{esm2020 → esm2022}/models/request/authorize-net-token-request.mjs +0 -0
- /package/{esm2020 → esm2022}/models/request/credit-card.mjs +0 -0
- /package/{esm2020 → esm2022}/models/request.type.mjs +0 -0
- /package/{esm2020 → esm2022}/models/response/authorize-net-response.mjs +0 -0
- /package/{esm2020 → esm2022}/models/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/services/accept-js-production.token.mjs +0 -0
- /package/{esm2020 → esm2022}/services/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/authorizenet.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/config/default.mjs +0 -0
- /package/{esm2020 → esm2022}/state/config/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/config/token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/config/type.mjs +0 -0
- /package/{esm2020 → esm2022}/state/daffodil-authorizenet-state.mjs +0 -0
- /package/{esm2020 → esm2022}/state/facades/authorize-net-facade.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/state/index.mjs +0 -0
- /package/{esm2020 → esm2022}/state/injection-tokens/error-matcher.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/injection-tokens/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/authorize-net/authorize-net-reducer.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/authorize-net/authorize-net.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/authorize-net/initial-state.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/authorize-net/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/authorize-net-reducers.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/authorize-net.reducers.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/authorizenet-store-feature-key.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/token/extra.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/token/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/token/reducers.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/selectors/authorize-net.selector.mjs +0 -0
- /package/{esm2020 → esm2022}/state/testing/daffodil-authorizenet-state-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/state/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/state/testing/public_api.mjs +0 -0
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import * as i1 from '@ngrx/store';
|
|
2
|
-
import { createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
|
|
3
|
-
import { DaffPaymentActionTypes, DaffPaymentStateModule, daffPaymentProvideAvailableProcessors, daffPaymentProvideExtraReducers, daffPaymentReducerFactory } from '@daffodil/payment/state';
|
|
4
|
-
import * as i0 from '@angular/core';
|
|
5
|
-
import { InjectionToken, Injectable, Inject, inject, NgModule } from '@angular/core';
|
|
6
|
-
import { daffTransformErrorToStateError, substream, daffComposeReducers } from '@daffodil/core/state';
|
|
7
|
-
import * as i1$1 from '@ngrx/effects';
|
|
8
|
-
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
9
|
-
import { of, defer } from 'rxjs';
|
|
10
|
-
import { switchMap, map, catchError, tap } from 'rxjs/operators';
|
|
11
|
-
import { DaffAuthorizeNetAcceptjsMissingError, DaffAuthorizeNetDriver, DaffAuthorizeNetPaymentId, DaffAuthorizeNetPaymentDriver } from '@daffodil/authorizenet/driver';
|
|
12
|
-
import { DaffCartPaymentUpdateWithBilling, DaffCartPaymentActionTypes } from '@daffodil/cart/state';
|
|
13
|
-
import { backoff } from '@daffodil/core';
|
|
14
|
-
import * as i2 from '@daffodil/authorizenet';
|
|
15
|
-
import { DAFF_AUTHORIZENET_PAYMENT_KIND } from '@daffodil/authorizenet';
|
|
16
|
-
|
|
17
|
-
var DaffAuthorizeNetActionTypes;
|
|
18
|
-
(function (DaffAuthorizeNetActionTypes) {
|
|
19
|
-
DaffAuthorizeNetActionTypes["UpdatePaymentAction"] = "[Daff-Authorize-Net] Update Payment";
|
|
20
|
-
DaffAuthorizeNetActionTypes["UpdatePaymentSuccessAction"] = "[Daff-Authorize-Net] Update Payment Success";
|
|
21
|
-
DaffAuthorizeNetActionTypes["UpdatePaymentFailureAction"] = "[Daff-Authorize-Net] Update Payment Failure";
|
|
22
|
-
DaffAuthorizeNetActionTypes["ApplyPaymentAction"] = "[@daffodil/authorizenet] Apply Payment";
|
|
23
|
-
DaffAuthorizeNetActionTypes["LoadAcceptJsAction"] = "[Daff-Authorize-Net] Load Accept Js";
|
|
24
|
-
DaffAuthorizeNetActionTypes["LoadAcceptJsSuccessAction"] = "[Daff-Authorize-Net] Load Accept Js Success";
|
|
25
|
-
DaffAuthorizeNetActionTypes["LoadAcceptJsFailureAction"] = "[Daff-Authorize-Net] Load Accept Js Failure";
|
|
26
|
-
})(DaffAuthorizeNetActionTypes || (DaffAuthorizeNetActionTypes = {}));
|
|
27
|
-
/**
|
|
28
|
-
* An action triggered to initialize a generate token request.
|
|
29
|
-
*
|
|
30
|
-
* @param payload - An DaffAuthorizeNetRequestData object.
|
|
31
|
-
*/
|
|
32
|
-
class DaffAuthorizeNetUpdatePayment {
|
|
33
|
-
constructor(tokenRequest, address) {
|
|
34
|
-
this.tokenRequest = tokenRequest;
|
|
35
|
-
this.address = address;
|
|
36
|
-
this.type = DaffAuthorizeNetActionTypes.UpdatePaymentAction;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* An action triggered upon successfully updating the payment method.
|
|
41
|
-
*
|
|
42
|
-
* @param payload - A string that is the payment nonce for a credit card.
|
|
43
|
-
*/
|
|
44
|
-
class DaffAuthorizeNetUpdatePaymentSuccess {
|
|
45
|
-
constructor() {
|
|
46
|
-
this.type = DaffAuthorizeNetActionTypes.UpdatePaymentSuccessAction;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* An action triggered upon failing to update the payment method.
|
|
51
|
-
*
|
|
52
|
-
* @param payload - A string that is an error message.
|
|
53
|
-
*/
|
|
54
|
-
class DaffAuthorizeNetUpdatePaymentFailure {
|
|
55
|
-
constructor(payload) {
|
|
56
|
-
this.payload = payload;
|
|
57
|
-
this.type = DaffAuthorizeNetActionTypes.UpdatePaymentFailureAction;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
class DaffLoadAcceptJs {
|
|
61
|
-
constructor() {
|
|
62
|
-
this.type = DaffAuthorizeNetActionTypes.LoadAcceptJsAction;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Indicates that the AcceptJs library has loaded successfully.
|
|
67
|
-
*/
|
|
68
|
-
class DaffLoadAcceptJsSuccess {
|
|
69
|
-
constructor() {
|
|
70
|
-
this.type = DaffAuthorizeNetActionTypes.LoadAcceptJsSuccessAction;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Indicates that the AcceptJs library has failed to load
|
|
75
|
-
*/
|
|
76
|
-
class DaffLoadAcceptJsFailure {
|
|
77
|
-
constructor(payload) {
|
|
78
|
-
this.payload = payload;
|
|
79
|
-
this.type = DaffAuthorizeNetActionTypes.LoadAcceptJsFailureAction;
|
|
80
|
-
}
|
|
81
|
-
;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Triggers the application of an authorize.net payment.
|
|
85
|
-
*/
|
|
86
|
-
class DaffAuthorizenetApplyPayment {
|
|
87
|
-
constructor(request, address) {
|
|
88
|
-
this.request = request;
|
|
89
|
-
this.address = address;
|
|
90
|
-
this.type = DaffAuthorizeNetActionTypes.ApplyPaymentAction;
|
|
91
|
-
}
|
|
92
|
-
;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const daffAuthorizeNetReducerInitialState = {
|
|
96
|
-
isAcceptLoaded: false,
|
|
97
|
-
paymentError: null,
|
|
98
|
-
acceptJsLoadError: null,
|
|
99
|
-
loading: false,
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
function daffAuthorizeNetReducer(state = daffAuthorizeNetReducerInitialState, action) {
|
|
103
|
-
switch (action.type) {
|
|
104
|
-
case DaffAuthorizeNetActionTypes.UpdatePaymentAction:
|
|
105
|
-
case DaffAuthorizeNetActionTypes.ApplyPaymentAction:
|
|
106
|
-
return Object.assign(Object.assign({}, state), { loading: true });
|
|
107
|
-
case DaffAuthorizeNetActionTypes.UpdatePaymentSuccessAction:
|
|
108
|
-
case DaffPaymentActionTypes.GenerateTokenSuccessAction:
|
|
109
|
-
return Object.assign(Object.assign({}, state), { loading: false, paymentError: null });
|
|
110
|
-
case DaffAuthorizeNetActionTypes.UpdatePaymentFailureAction:
|
|
111
|
-
case DaffPaymentActionTypes.GenerateTokenFailureAction:
|
|
112
|
-
return Object.assign(Object.assign({}, state), { loading: false, paymentError: action.payload });
|
|
113
|
-
case DaffAuthorizeNetActionTypes.LoadAcceptJsSuccessAction:
|
|
114
|
-
return Object.assign(Object.assign({}, state), { isAcceptLoaded: true, acceptJsLoadError: null });
|
|
115
|
-
case DaffAuthorizeNetActionTypes.LoadAcceptJsFailureAction:
|
|
116
|
-
return Object.assign(Object.assign({}, state), { loading: false, acceptJsLoadError: action.payload });
|
|
117
|
-
default:
|
|
118
|
-
return state;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const daffAuthorizeNetReducers = {
|
|
123
|
-
authorizeNet: daffAuthorizeNetReducer,
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const DAFF_AUTHORIZENET_STORE_FEATURE_KEY = 'daffAuthorizenet';
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* A token to hold the injectable extra reducers.
|
|
130
|
-
*
|
|
131
|
-
* Prefer using {@link daffAuthorizeNetProvideExtraReducers}.
|
|
132
|
-
*/
|
|
133
|
-
const DAFF_AUTHORIZE_NET_EXTRA_REDUCERS = new InjectionToken('DAFF_AUTHORIZE_NET_EXTRA_REDUCERS', {
|
|
134
|
-
factory: () => [],
|
|
135
|
-
providedIn: 'any',
|
|
136
|
-
});
|
|
137
|
-
/**
|
|
138
|
-
* Provides additional reducers that run after the standard Daffodil authorizenet reducers.
|
|
139
|
-
*
|
|
140
|
-
* ```ts
|
|
141
|
-
* providers: [
|
|
142
|
-
* ...daffAuthorizeNetProvideExtraReducers(
|
|
143
|
-
* myReducer1,
|
|
144
|
-
* myReducer2
|
|
145
|
-
* )
|
|
146
|
-
* ]
|
|
147
|
-
* ```
|
|
148
|
-
*/
|
|
149
|
-
function daffAuthorizeNetProvideExtraReducers(...reducers) {
|
|
150
|
-
return reducers.map(reducer => ({
|
|
151
|
-
provide: DAFF_AUTHORIZE_NET_EXTRA_REDUCERS,
|
|
152
|
-
useValue: reducer,
|
|
153
|
-
multi: true,
|
|
154
|
-
}));
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const createAuthorizeNetSelectors = () => {
|
|
158
|
-
/**
|
|
159
|
-
* AuthorizeNet Feature State
|
|
160
|
-
*/
|
|
161
|
-
const selectAuthorizeNetFeatureState = createFeatureSelector(DAFF_AUTHORIZENET_STORE_FEATURE_KEY);
|
|
162
|
-
/**
|
|
163
|
-
* AuthorizeNet State
|
|
164
|
-
*/
|
|
165
|
-
const selectAuthorizeNetState = createSelector(selectAuthorizeNetFeatureState, (state) => state.authorizeNet);
|
|
166
|
-
/**
|
|
167
|
-
* AuthorizeNet loading state
|
|
168
|
-
*/
|
|
169
|
-
const selectLoading = createSelector(selectAuthorizeNetState, (state) => state.loading);
|
|
170
|
-
/**
|
|
171
|
-
* AuthorizeNet payment error
|
|
172
|
-
*/
|
|
173
|
-
const selectPaymentError = createSelector(selectAuthorizeNetState, (state) => state.paymentError);
|
|
174
|
-
/**
|
|
175
|
-
* AcceptJs load error
|
|
176
|
-
*/
|
|
177
|
-
const selectAcceptJsLoadError = createSelector(selectAuthorizeNetState, (state) => state.acceptJsLoadError);
|
|
178
|
-
/**
|
|
179
|
-
* AcceptJs is loaded
|
|
180
|
-
*/
|
|
181
|
-
const selectIsAcceptJsLoaded = createSelector(selectAuthorizeNetState, (state) => state.isAcceptLoaded);
|
|
182
|
-
return {
|
|
183
|
-
selectAuthorizeNetFeatureState,
|
|
184
|
-
selectAuthorizeNetState,
|
|
185
|
-
selectLoading,
|
|
186
|
-
selectPaymentError,
|
|
187
|
-
selectAcceptJsLoadError,
|
|
188
|
-
selectIsAcceptJsLoaded,
|
|
189
|
-
};
|
|
190
|
-
};
|
|
191
|
-
const daffAuthorizeNetSelectors = (() => {
|
|
192
|
-
let cache;
|
|
193
|
-
return () => cache = cache
|
|
194
|
-
? cache
|
|
195
|
-
: createAuthorizeNetSelectors();
|
|
196
|
-
})();
|
|
197
|
-
|
|
198
|
-
const daffAuthorizeNetStateDefaultConfig = {
|
|
199
|
-
acceptMaxRetries: 5,
|
|
200
|
-
acceptBackoffTiming: 30,
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
const DAFF_AUTHORIZE_NET_STATE_CONFIG = new InjectionToken('DAFF_AUTHORIZE_NET_STATE_CONFIG', { factory: () => daffAuthorizeNetStateDefaultConfig });
|
|
204
|
-
const provideDaffAuthorizeNetStateConfig = (config) => ({
|
|
205
|
-
provide: DAFF_AUTHORIZE_NET_STATE_CONFIG,
|
|
206
|
-
useValue: config,
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
211
|
-
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
212
|
-
*/
|
|
213
|
-
const DAFF_AUTHORIZENET_ERROR_MATCHER = new InjectionToken('DAFF_AUTHORIZENET_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
214
|
-
|
|
215
|
-
class DaffAuthorizeNetFacade {
|
|
216
|
-
constructor(store) {
|
|
217
|
-
this.store = store;
|
|
218
|
-
const { selectIsAcceptJsLoaded, selectLoading, selectPaymentError, selectAcceptJsLoadError, } = daffAuthorizeNetSelectors();
|
|
219
|
-
this.isAcceptJsLoaded$ = this.store.pipe(select(selectIsAcceptJsLoaded));
|
|
220
|
-
this.loading$ = this.store.pipe(select(selectLoading));
|
|
221
|
-
this.paymentError$ = this.store.pipe(select(selectPaymentError));
|
|
222
|
-
this.acceptJsLoadError$ = this.store.pipe(select(selectAcceptJsLoadError));
|
|
223
|
-
}
|
|
224
|
-
dispatch(action) {
|
|
225
|
-
this.store.dispatch(action);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
/** @nocollapse */ DaffAuthorizeNetFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
229
|
-
/** @nocollapse */ DaffAuthorizeNetFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetFacade, providedIn: 'root' });
|
|
230
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetFacade, decorators: [{
|
|
231
|
-
type: Injectable,
|
|
232
|
-
args: [{
|
|
233
|
-
providedIn: 'root',
|
|
234
|
-
}]
|
|
235
|
-
}], ctorParameters: function () { return [{ type: i1.Store }]; } });
|
|
236
|
-
|
|
237
|
-
class DaffAuthorizeNetEffects {
|
|
238
|
-
constructor(actions$, driver, authorizeNetPaymentId, errorMatcher, config, acceptJsLoadingService) {
|
|
239
|
-
this.actions$ = actions$;
|
|
240
|
-
this.driver = driver;
|
|
241
|
-
this.authorizeNetPaymentId = authorizeNetPaymentId;
|
|
242
|
-
this.errorMatcher = errorMatcher;
|
|
243
|
-
this.config = config;
|
|
244
|
-
this.acceptJsLoadingService = acceptJsLoadingService;
|
|
245
|
-
this.updatePayment$ = createEffect(() => this.actions$.pipe(ofType(DaffAuthorizeNetActionTypes.UpdatePaymentAction), switchMap((action) => this.driver.generateToken(action.tokenRequest).pipe(map(resp => new DaffCartPaymentUpdateWithBilling({
|
|
246
|
-
method: this.authorizeNetPaymentId,
|
|
247
|
-
payment_info: resp,
|
|
248
|
-
}, action.address)), catchError((error) => of(new DaffAuthorizeNetUpdatePaymentFailure(this.errorMatcher(error))))))));
|
|
249
|
-
this.updatePaymentSuccessSubstream$ = createEffect(() => this.actions$.pipe(substream([DaffAuthorizeNetActionTypes.UpdatePaymentAction, DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction], DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction), map(() => new DaffAuthorizeNetUpdatePaymentSuccess())));
|
|
250
|
-
this.updatePaymentFailureSubstream$ = createEffect(() => this.actions$.pipe(substream([DaffAuthorizeNetActionTypes.UpdatePaymentAction, DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction], DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction), map(([updatePaymentAction, updatePaymentFailureAction]) => new DaffAuthorizeNetUpdatePaymentFailure(this.errorMatcher(updatePaymentFailureAction.payload[0])))));
|
|
251
|
-
this.loadAcceptJs$ = createEffect(() => (maxTries = this.config.acceptMaxRetries, ms = this.config.acceptBackoffTiming) => this.actions$.pipe(ofType(DaffAuthorizeNetActionTypes.LoadAcceptJsAction), tap((action) => this.acceptJsLoadingService.load()), switchMap(() => defer(() => of(this.acceptJsLoadingService.getAccept())).pipe(backoff(maxTries, ms), map((Accept) => Accept ? new DaffLoadAcceptJsSuccess() : new DaffLoadAcceptJsFailure(new DaffAuthorizeNetAcceptjsMissingError('Accept.js failed to load.'))), catchError((error) => of(new DaffLoadAcceptJsFailure(this.errorMatcher(error))))))));
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
/** @nocollapse */ DaffAuthorizeNetEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetEffects, deps: [{ token: i1$1.Actions }, { token: DaffAuthorizeNetDriver }, { token: DaffAuthorizeNetPaymentId }, { token: DAFF_AUTHORIZENET_ERROR_MATCHER }, { token: DAFF_AUTHORIZE_NET_STATE_CONFIG }, { token: i2.DaffAcceptJsLoadingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
255
|
-
/** @nocollapse */ DaffAuthorizeNetEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetEffects });
|
|
256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetEffects, decorators: [{
|
|
257
|
-
type: Injectable
|
|
258
|
-
}], ctorParameters: function () {
|
|
259
|
-
return [{ type: i1$1.Actions }, { type: undefined, decorators: [{
|
|
260
|
-
type: Inject,
|
|
261
|
-
args: [DaffAuthorizeNetDriver]
|
|
262
|
-
}] }, { type: undefined, decorators: [{
|
|
263
|
-
type: Inject,
|
|
264
|
-
args: [DaffAuthorizeNetPaymentId]
|
|
265
|
-
}] }, { type: undefined, decorators: [{
|
|
266
|
-
type: Inject,
|
|
267
|
-
args: [DAFF_AUTHORIZENET_ERROR_MATCHER]
|
|
268
|
-
}] }, { type: undefined, decorators: [{
|
|
269
|
-
type: Inject,
|
|
270
|
-
args: [DAFF_AUTHORIZE_NET_STATE_CONFIG]
|
|
271
|
-
}] }, { type: i2.DaffAcceptJsLoadingService }];
|
|
272
|
-
} });
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* An internal token to hold the Daffodil authorizenet reducers.
|
|
276
|
-
* Includes the extra and standard reducers.
|
|
277
|
-
*
|
|
278
|
-
* @docs-private
|
|
279
|
-
*/
|
|
280
|
-
const DAFF_AUTHORIZE_NET_REDUCERS = new InjectionToken('DAFF_AUTHORIZE_NET_REDUCERS', {
|
|
281
|
-
providedIn: 'any',
|
|
282
|
-
factory: () => daffComposeReducers([
|
|
283
|
-
combineReducers({
|
|
284
|
-
authorizeNet: daffAuthorizeNetReducer,
|
|
285
|
-
}),
|
|
286
|
-
...inject(DAFF_AUTHORIZE_NET_EXTRA_REDUCERS),
|
|
287
|
-
]),
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
class DaffAuthorizeNetStateModule {
|
|
291
|
-
static withConfig(config = {}) {
|
|
292
|
-
return {
|
|
293
|
-
ngModule: DaffAuthorizeNetStateModule,
|
|
294
|
-
providers: [
|
|
295
|
-
provideDaffAuthorizeNetStateConfig(Object.assign(Object.assign({}, daffAuthorizeNetStateDefaultConfig), config)),
|
|
296
|
-
],
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
/** @nocollapse */ DaffAuthorizeNetStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
301
|
-
/** @nocollapse */ DaffAuthorizeNetStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetStateModule, imports: [i1.StoreFeatureModule, i1$1.EffectsFeatureModule] });
|
|
302
|
-
/** @nocollapse */ DaffAuthorizeNetStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetStateModule, imports: [StoreModule.forFeature(DAFF_AUTHORIZENET_STORE_FEATURE_KEY, DAFF_AUTHORIZE_NET_REDUCERS),
|
|
303
|
-
EffectsModule.forFeature([DaffAuthorizeNetEffects])] });
|
|
304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetStateModule, decorators: [{
|
|
305
|
-
type: NgModule,
|
|
306
|
-
args: [{
|
|
307
|
-
imports: [
|
|
308
|
-
StoreModule.forFeature(DAFF_AUTHORIZENET_STORE_FEATURE_KEY, DAFF_AUTHORIZE_NET_REDUCERS),
|
|
309
|
-
EffectsModule.forFeature([DaffAuthorizeNetEffects]),
|
|
310
|
-
],
|
|
311
|
-
}]
|
|
312
|
-
}] });
|
|
313
|
-
|
|
314
|
-
class DaffAuthorizeNetPaymentStateModule {
|
|
315
|
-
}
|
|
316
|
-
/** @nocollapse */ DaffAuthorizeNetPaymentStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetPaymentStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
317
|
-
/** @nocollapse */ DaffAuthorizeNetPaymentStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetPaymentStateModule, imports: [DaffPaymentStateModule] });
|
|
318
|
-
/** @nocollapse */ DaffAuthorizeNetPaymentStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetPaymentStateModule, providers: [
|
|
319
|
-
daffPaymentProvideAvailableProcessors({
|
|
320
|
-
kind: DAFF_AUTHORIZENET_PAYMENT_KIND,
|
|
321
|
-
action: DaffAuthorizeNetActionTypes.ApplyPaymentAction,
|
|
322
|
-
driver: DaffAuthorizeNetPaymentDriver,
|
|
323
|
-
}),
|
|
324
|
-
...daffPaymentProvideExtraReducers(combineReducers({
|
|
325
|
-
payment: daffPaymentReducerFactory([DaffAuthorizeNetActionTypes.ApplyPaymentAction]),
|
|
326
|
-
})),
|
|
327
|
-
], imports: [DaffPaymentStateModule] });
|
|
328
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetPaymentStateModule, decorators: [{
|
|
329
|
-
type: NgModule,
|
|
330
|
-
args: [{
|
|
331
|
-
imports: [
|
|
332
|
-
DaffPaymentStateModule,
|
|
333
|
-
],
|
|
334
|
-
providers: [
|
|
335
|
-
daffPaymentProvideAvailableProcessors({
|
|
336
|
-
kind: DAFF_AUTHORIZENET_PAYMENT_KIND,
|
|
337
|
-
action: DaffAuthorizeNetActionTypes.ApplyPaymentAction,
|
|
338
|
-
driver: DaffAuthorizeNetPaymentDriver,
|
|
339
|
-
}),
|
|
340
|
-
...daffPaymentProvideExtraReducers(combineReducers({
|
|
341
|
-
payment: daffPaymentReducerFactory([DaffAuthorizeNetActionTypes.ApplyPaymentAction]),
|
|
342
|
-
})),
|
|
343
|
-
],
|
|
344
|
-
}]
|
|
345
|
-
}] });
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Generated bundle index. Do not edit.
|
|
349
|
-
*/
|
|
350
|
-
|
|
351
|
-
export { DAFF_AUTHORIZENET_ERROR_MATCHER, DAFF_AUTHORIZENET_STORE_FEATURE_KEY, DAFF_AUTHORIZE_NET_EXTRA_REDUCERS, DAFF_AUTHORIZE_NET_STATE_CONFIG, DaffAuthorizeNetActionTypes, DaffAuthorizeNetFacade, DaffAuthorizeNetPaymentStateModule, DaffAuthorizeNetStateModule, DaffAuthorizeNetUpdatePayment, DaffAuthorizeNetUpdatePaymentFailure, DaffAuthorizeNetUpdatePaymentSuccess, DaffAuthorizenetApplyPayment, DaffLoadAcceptJs, DaffLoadAcceptJsFailure, DaffLoadAcceptJsSuccess, daffAuthorizeNetProvideExtraReducers, daffAuthorizeNetReducer, daffAuthorizeNetReducerInitialState, daffAuthorizeNetReducers, daffAuthorizeNetSelectors, daffAuthorizeNetStateDefaultConfig, provideDaffAuthorizeNetStateConfig };
|
|
352
|
-
//# sourceMappingURL=daffodil-authorizenet-state.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-authorizenet-state.mjs","sources":["../../../libs/authorizenet/state/src/actions/authorizenet.actions.ts","../../../libs/authorizenet/state/src/reducers/authorize-net/initial-state.ts","../../../libs/authorizenet/state/src/reducers/authorize-net/authorize-net.reducer.ts","../../../libs/authorizenet/state/src/reducers/authorize-net.reducers.ts","../../../libs/authorizenet/state/src/reducers/authorizenet-store-feature-key.ts","../../../libs/authorizenet/state/src/reducers/token/extra.token.ts","../../../libs/authorizenet/state/src/selectors/authorize-net.selector.ts","../../../libs/authorizenet/state/src/config/default.ts","../../../libs/authorizenet/state/src/config/token.ts","../../../libs/authorizenet/state/src/injection-tokens/error-matcher.token.ts","../../../libs/authorizenet/state/src/facades/authorize-net.facade.ts","../../../libs/authorizenet/state/src/effects/authorize-net.effects.ts","../../../libs/authorizenet/state/src/reducers/token/reducers.token.ts","../../../libs/authorizenet/state/src/authorize-net-state.module.ts","../../../libs/authorizenet/state/src/payment-state.module.ts","../../../libs/authorizenet/state/src/daffodil-authorizenet-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport {\n DaffAuthorizenetPaymentRequest,\n DaffAuthorizeNetTokenRequest,\n} from '@daffodil/authorizenet';\nimport { DaffCartAddress } from '@daffodil/cart';\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffPersonalAddress } from '@daffodil/geography';\nimport { DaffPaymentGenerateToken } from '@daffodil/payment/state';\n\nexport enum DaffAuthorizeNetActionTypes {\n UpdatePaymentAction = '[Daff-Authorize-Net] Update Payment',\n UpdatePaymentSuccessAction = '[Daff-Authorize-Net] Update Payment Success',\n UpdatePaymentFailureAction = '[Daff-Authorize-Net] Update Payment Failure',\n ApplyPaymentAction = '[@daffodil/authorizenet] Apply Payment',\n LoadAcceptJsAction = '[Daff-Authorize-Net] Load Accept Js',\n LoadAcceptJsSuccessAction = '[Daff-Authorize-Net] Load Accept Js Success',\n LoadAcceptJsFailureAction = '[Daff-Authorize-Net] Load Accept Js Failure'\n}\n\n/**\n * An action triggered to initialize a generate token request.\n *\n * @param payload - An DaffAuthorizeNetRequestData object.\n */\nexport class DaffAuthorizeNetUpdatePayment<\n T extends DaffAuthorizeNetTokenRequest = DaffAuthorizeNetTokenRequest,\n V extends DaffCartAddress = DaffCartAddress\n> implements Action {\n readonly type = DaffAuthorizeNetActionTypes.UpdatePaymentAction;\n\n constructor(public tokenRequest: T, public address: Partial<V>) { }\n}\n\n/**\n * An action triggered upon successfully updating the payment method.\n *\n * @param payload - A string that is the payment nonce for a credit card.\n */\nexport class DaffAuthorizeNetUpdatePaymentSuccess implements Action {\n readonly type = DaffAuthorizeNetActionTypes.UpdatePaymentSuccessAction;\n}\n\n/**\n * An action triggered upon failing to update the payment method.\n *\n * @param payload - A string that is an error message.\n */\nexport class DaffAuthorizeNetUpdatePaymentFailure implements Action {\n readonly type = DaffAuthorizeNetActionTypes.UpdatePaymentFailureAction;\n\n constructor(public payload: DaffStateError) { }\n}\n\nexport class DaffLoadAcceptJs implements Action {\n readonly type = DaffAuthorizeNetActionTypes.LoadAcceptJsAction;\n}\n\n/**\n * Indicates that the AcceptJs library has loaded successfully.\n */\nexport class DaffLoadAcceptJsSuccess implements Action {\n readonly type = DaffAuthorizeNetActionTypes.LoadAcceptJsSuccessAction;\n}\n\n/**\n * Indicates that the AcceptJs library has failed to load\n */\nexport class DaffLoadAcceptJsFailure implements Action {\n readonly type = DaffAuthorizeNetActionTypes.LoadAcceptJsFailureAction;\n\n constructor(public payload: DaffStateError) {};\n}\n\n/**\n * Triggers the application of an authorize.net payment.\n */\nexport class DaffAuthorizenetApplyPayment implements DaffPaymentGenerateToken<DaffAuthorizenetPaymentRequest> {\n readonly type = DaffAuthorizeNetActionTypes.ApplyPaymentAction;\n\n constructor(\n public request: DaffAuthorizenetPaymentRequest,\n public address?: DaffPersonalAddress | DaffIdentifiable,\n ) {};\n}\n\nexport type DaffAuthorizeNetActions<\n T extends DaffAuthorizeNetTokenRequest = DaffAuthorizeNetTokenRequest\n> =\n\t| DaffAuthorizeNetUpdatePayment<T>\n\t| DaffAuthorizeNetUpdatePaymentSuccess\n\t| DaffAuthorizeNetUpdatePaymentFailure\n\t| DaffAuthorizenetApplyPayment\n\t| DaffLoadAcceptJsSuccess\n\t| DaffLoadAcceptJsFailure\n\t| DaffLoadAcceptJs;\n","import { DaffAuthorizeNetReducerState } from './authorize-net-reducer.interface';\n\nexport const daffAuthorizeNetReducerInitialState: DaffAuthorizeNetReducerState = {\n isAcceptLoaded: false,\n paymentError: null,\n acceptJsLoadError: null,\n loading: false,\n};\n","import { DaffAuthorizeNetTokenRequest } from '@daffodil/authorizenet';\nimport {\n DaffPaymentActions,\n DaffPaymentActionTypes,\n} from '@daffodil/payment/state';\n\nimport { DaffAuthorizeNetReducerState } from './authorize-net-reducer.interface';\nimport { daffAuthorizeNetReducerInitialState } from './initial-state';\nimport {\n DaffAuthorizeNetActions,\n DaffAuthorizeNetActionTypes,\n} from '../../actions/authorizenet.actions';\n\nexport function daffAuthorizeNetReducer <T extends DaffAuthorizeNetTokenRequest>(\n state: DaffAuthorizeNetReducerState = daffAuthorizeNetReducerInitialState,\n action: DaffAuthorizeNetActions<T> | DaffPaymentActions,\n): DaffAuthorizeNetReducerState {\n switch (action.type) {\n case DaffAuthorizeNetActionTypes.UpdatePaymentAction:\n case DaffAuthorizeNetActionTypes.ApplyPaymentAction:\n return {\n ...state,\n loading: true,\n };\n case DaffAuthorizeNetActionTypes.UpdatePaymentSuccessAction:\n case DaffPaymentActionTypes.GenerateTokenSuccessAction:\n return {\n ...state,\n loading: false,\n paymentError: null,\n };\n case DaffAuthorizeNetActionTypes.UpdatePaymentFailureAction:\n case DaffPaymentActionTypes.GenerateTokenFailureAction:\n return {\n ...state,\n loading: false,\n paymentError: action.payload,\n };\n\n case DaffAuthorizeNetActionTypes.LoadAcceptJsSuccessAction:\n return {\n ...state,\n isAcceptLoaded: true,\n acceptJsLoadError: null,\n };\n case DaffAuthorizeNetActionTypes.LoadAcceptJsFailureAction:\n return {\n ...state,\n loading: false,\n acceptJsLoadError: action.payload,\n };\n default:\n return state;\n }\n}\n","import { daffAuthorizeNetReducer } from './authorize-net/authorize-net.reducer';\n\nexport const daffAuthorizeNetReducers = {\n authorizeNet: daffAuthorizeNetReducer,\n};\n","export const DAFF_AUTHORIZENET_STORE_FEATURE_KEY = 'daffAuthorizenet';\n","import {\n InjectionToken,\n Provider,\n} from '@angular/core';\nimport { ActionReducer } from '@ngrx/store';\n\nimport { DaffAuthorizeNetReducersState } from '../authorize-net-reducers.interface';\n\n/**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffAuthorizeNetProvideExtraReducers}.\n */\nexport const DAFF_AUTHORIZE_NET_EXTRA_REDUCERS = new InjectionToken<ActionReducer<DaffAuthorizeNetReducersState>[]>(\n 'DAFF_AUTHORIZE_NET_EXTRA_REDUCERS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides additional reducers that run after the standard Daffodil authorizenet reducers.\n *\n * ```ts\n * providers: [\n * ...daffAuthorizeNetProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffAuthorizeNetProvideExtraReducers(\n ...reducers: ActionReducer<DaffAuthorizeNetReducersState>[]\n): Provider[] {\n return reducers.map(reducer => ({\n provide: DAFF_AUTHORIZE_NET_EXTRA_REDUCERS,\n useValue: reducer,\n multi: true,\n }));\n}\n","import {\n createSelector,\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\n\nimport {\n DaffAuthorizeNetReducersState,\n DaffAuthorizeNetReducerState,\n DaffAuthorizeNetStateRootSlice,\n DAFF_AUTHORIZENET_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\n\nexport interface DaffAuthorizeNetMemoizedSelectors {\n selectAuthorizeNetFeatureState: MemoizedSelector<DaffAuthorizeNetStateRootSlice, DaffAuthorizeNetReducersState>;\n selectAuthorizeNetState: MemoizedSelector<DaffAuthorizeNetStateRootSlice, DaffAuthorizeNetReducerState> ;\n selectLoading: MemoizedSelector<DaffAuthorizeNetStateRootSlice, boolean>;\n selectPaymentError: MemoizedSelector<DaffAuthorizeNetStateRootSlice, DaffStateError>;\n selectAcceptJsLoadError: MemoizedSelector<DaffAuthorizeNetStateRootSlice, DaffStateError>;\n selectIsAcceptJsLoaded: MemoizedSelector<DaffAuthorizeNetStateRootSlice, boolean>;\n}\n\nconst createAuthorizeNetSelectors = (): DaffAuthorizeNetMemoizedSelectors => {\n\n /**\n * AuthorizeNet Feature State\n */\n const selectAuthorizeNetFeatureState = createFeatureSelector<DaffAuthorizeNetStateRootSlice, DaffAuthorizeNetReducersState>(DAFF_AUTHORIZENET_STORE_FEATURE_KEY);\n\n /**\n * AuthorizeNet State\n */\n const selectAuthorizeNetState = createSelector(\n selectAuthorizeNetFeatureState,\n (state: DaffAuthorizeNetReducersState) => state.authorizeNet,\n );\n\n /**\n * AuthorizeNet loading state\n */\n const selectLoading = createSelector(\n selectAuthorizeNetState,\n (state: DaffAuthorizeNetReducerState) => state.loading,\n );\n\n /**\n * AuthorizeNet payment error\n */\n const selectPaymentError = createSelector(\n selectAuthorizeNetState,\n (state: DaffAuthorizeNetReducerState) => state.paymentError,\n );\n\n /**\n * AcceptJs load error\n */\n const selectAcceptJsLoadError = createSelector(\n selectAuthorizeNetState,\n (state: DaffAuthorizeNetReducerState) => state.acceptJsLoadError,\n );\n\n /**\n * AcceptJs is loaded\n */\n const selectIsAcceptJsLoaded = createSelector(\n selectAuthorizeNetState,\n (state: DaffAuthorizeNetReducerState) => state.isAcceptLoaded,\n );\n\n return {\n selectAuthorizeNetFeatureState,\n selectAuthorizeNetState,\n selectLoading,\n selectPaymentError,\n selectAcceptJsLoadError,\n selectIsAcceptJsLoaded,\n };\n};\n\nexport const daffAuthorizeNetSelectors = (() => {\n let cache;\n return (): DaffAuthorizeNetMemoizedSelectors => cache = cache\n ? cache\n : createAuthorizeNetSelectors();\n})();\n","import { DaffAuthorizeNetStateConfig } from './type';\n\nexport const daffAuthorizeNetStateDefaultConfig: DaffAuthorizeNetStateConfig = {\n acceptMaxRetries: 5,\n acceptBackoffTiming: 30,\n};\n","import {\n InjectionToken,\n ValueProvider,\n} from '@angular/core';\n\nimport { daffAuthorizeNetStateDefaultConfig } from './default';\nimport { DaffAuthorizeNetStateConfig } from './type';\n\nexport const DAFF_AUTHORIZE_NET_STATE_CONFIG = new InjectionToken('DAFF_AUTHORIZE_NET_STATE_CONFIG', { factory: () => daffAuthorizeNetStateDefaultConfig });\n\nexport const provideDaffAuthorizeNetStateConfig = (config: DaffAuthorizeNetStateConfig): ValueProvider => ({\n provide: DAFF_AUTHORIZE_NET_STATE_CONFIG,\n useValue: config,\n});\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_AUTHORIZENET_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_AUTHORIZENET_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\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 { DaffAuthorizeNetFacadeInterface } from './authorize-net-facade.interface';\nimport { DaffAuthorizeNetStateRootSlice } from '../reducers/authorize-net-reducers.interface';\nimport { daffAuthorizeNetSelectors } from '../selectors/authorize-net.selector';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthorizeNetFacade implements DaffAuthorizeNetFacadeInterface {\n\n isAcceptJsLoaded$: Observable<boolean>;\n loading$: Observable<boolean>;\n paymentError$: Observable<DaffStateError>;\n acceptJsLoadError$: Observable<DaffStateError>;\n\n constructor(private store: Store<DaffAuthorizeNetStateRootSlice>) {\n const {\n selectIsAcceptJsLoaded,\n selectLoading,\n selectPaymentError,\n selectAcceptJsLoadError,\n } = daffAuthorizeNetSelectors();\n\n this.isAcceptJsLoaded$ = this.store.pipe(select(selectIsAcceptJsLoaded));\n this.loading$ = this.store.pipe(select(selectLoading));\n this.paymentError$ = this.store.pipe(select(selectPaymentError));\n this.acceptJsLoadError$ = this.store.pipe(select(selectAcceptJsLoadError));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport {\n defer,\n Observable,\n of,\n} from 'rxjs';\nimport {\n switchMap,\n catchError,\n map,\n tap,\n} from 'rxjs/operators';\n\nimport {\n DaffAcceptJsLoadingService,\n DaffAuthorizeNetTokenRequest,\n} from '@daffodil/authorizenet';\nimport {\n DaffAuthorizeNetDriver,\n DaffAuthorizeNetService,\n DaffAuthorizeNetPaymentId,\n DaffAuthorizeNetAcceptjsMissingError,\n} from '@daffodil/authorizenet/driver';\nimport {\n DaffCartPaymentActionTypes,\n DaffCartPaymentUpdateWithBilling,\n DaffCartPaymentUpdateWithBillingFailure,\n} from '@daffodil/cart/state';\nimport {\n backoff,\n DaffError,\n} from '@daffodil/core';\nimport {\n substream,\n ErrorTransformer,\n} from '@daffodil/core/state';\n\nimport {\n DaffAuthorizeNetActionTypes,\n DaffAuthorizeNetUpdatePayment,\n DaffAuthorizeNetUpdatePaymentFailure,\n DaffLoadAcceptJs,\n DaffAuthorizeNetUpdatePaymentSuccess,\n DaffLoadAcceptJsFailure,\n DaffLoadAcceptJsSuccess,\n} from '../actions/authorizenet.actions';\nimport {\n DAFF_AUTHORIZE_NET_STATE_CONFIG,\n DaffAuthorizeNetStateConfig,\n} from '../config/public_api';\nimport { DAFF_AUTHORIZENET_ERROR_MATCHER } from '../injection-tokens/public_api';\n\n@Injectable()\nexport class DaffAuthorizeNetEffects<T extends DaffAuthorizeNetTokenRequest = DaffAuthorizeNetTokenRequest> {\n\n constructor(\n private actions$: Actions,\n @Inject(DaffAuthorizeNetDriver) private driver: DaffAuthorizeNetService<T>,\n @Inject(DaffAuthorizeNetPaymentId) private authorizeNetPaymentId: string,\n @Inject(DAFF_AUTHORIZENET_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n @Inject(DAFF_AUTHORIZE_NET_STATE_CONFIG) private config: DaffAuthorizeNetStateConfig,\n private acceptJsLoadingService: DaffAcceptJsLoadingService,\n ) {}\n\n\n updatePayment$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(DaffAuthorizeNetActionTypes.UpdatePaymentAction),\n switchMap((action: DaffAuthorizeNetUpdatePayment<T>) =>\n this.driver.generateToken(action.tokenRequest).pipe(\n map(resp => new DaffCartPaymentUpdateWithBilling(\n {\n method: this.authorizeNetPaymentId,\n payment_info: resp,\n },\n action.address,\n )),\n catchError((error: DaffError) =>\n of(new DaffAuthorizeNetUpdatePaymentFailure(this.errorMatcher(error))),\n ),\n ),\n ),\n ));\n\n\n updatePaymentSuccessSubstream$: Observable<any> = createEffect(() => this.actions$.pipe(\n\t substream(\n\t [DaffAuthorizeNetActionTypes.UpdatePaymentAction, DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction],\n\t DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction,\n\t ),\n\t map(() => new DaffAuthorizeNetUpdatePaymentSuccess()),\n ));\n\n\n updatePaymentFailureSubstream$: Observable<any> = createEffect(() => this.actions$.pipe(\n\t substream(\n\t [DaffAuthorizeNetActionTypes.UpdatePaymentAction, DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction],\n\t DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction,\n\t ),\n\t map(([updatePaymentAction, updatePaymentFailureAction]: [DaffAuthorizeNetUpdatePayment, DaffCartPaymentUpdateWithBillingFailure]) =>\n\t new DaffAuthorizeNetUpdatePaymentFailure(this.errorMatcher(updatePaymentFailureAction.payload[0])),\n\t ),\n ));\n\n\n loadAcceptJs$ = createEffect(() => (maxTries = this.config.acceptMaxRetries, ms = this.config.acceptBackoffTiming): Observable<any> => this.actions$.pipe(\n ofType(DaffAuthorizeNetActionTypes.LoadAcceptJsAction),\n tap((action: DaffLoadAcceptJs) => this.acceptJsLoadingService.load()),\n switchMap(() => defer(() => of(this.acceptJsLoadingService.getAccept())).pipe(\n backoff(maxTries, ms),\n map((Accept) => Accept ? new DaffLoadAcceptJsSuccess() : new DaffLoadAcceptJsFailure(new DaffAuthorizeNetAcceptjsMissingError('Accept.js failed to load.'))),\n catchError((error: DaffError) => of(new DaffLoadAcceptJsFailure(this.errorMatcher(error)))),\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\n\nimport { DAFF_AUTHORIZE_NET_EXTRA_REDUCERS } from './extra.token';\nimport { daffAuthorizeNetReducer } from '../authorize-net/authorize-net.reducer';\nimport { DaffAuthorizeNetReducersState } from '../authorize-net-reducers.interface';\n\n/**\n * An internal token to hold the Daffodil authorizenet reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\nexport const DAFF_AUTHORIZE_NET_REDUCERS = new InjectionToken<ActionReducer<DaffAuthorizeNetReducersState>>(\n 'DAFF_AUTHORIZE_NET_REDUCERS',\n {\n providedIn: 'any',\n factory: () => daffComposeReducers([\n combineReducers({\n authorizeNet: daffAuthorizeNetReducer,\n }),\n ...inject(DAFF_AUTHORIZE_NET_EXTRA_REDUCERS),\n ]),\n },\n);\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport {\n DaffAuthorizeNetStateConfig,\n daffAuthorizeNetStateDefaultConfig,\n provideDaffAuthorizeNetStateConfig,\n} from './config/public_api';\nimport { DaffAuthorizeNetEffects } from './effects/authorize-net.effects';\nimport { DAFF_AUTHORIZENET_STORE_FEATURE_KEY } from './reducers/authorizenet-store-feature-key';\nimport { DAFF_AUTHORIZE_NET_REDUCERS } from './reducers/token/reducers.token';\n\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_AUTHORIZENET_STORE_FEATURE_KEY, DAFF_AUTHORIZE_NET_REDUCERS),\n EffectsModule.forFeature([DaffAuthorizeNetEffects]),\n ],\n})\nexport class DaffAuthorizeNetStateModule {\n static withConfig(config: Partial<DaffAuthorizeNetStateConfig> = {}): ModuleWithProviders<DaffAuthorizeNetStateModule> {\n return {\n ngModule: DaffAuthorizeNetStateModule,\n providers: [\n provideDaffAuthorizeNetStateConfig({\n ...daffAuthorizeNetStateDefaultConfig,\n ...config,\n }),\n ],\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { combineReducers } from '@ngrx/store';\n\nimport { DAFF_AUTHORIZENET_PAYMENT_KIND } from '@daffodil/authorizenet';\nimport { DaffAuthorizeNetPaymentDriver } from '@daffodil/authorizenet/driver';\nimport {\n daffPaymentProvideAvailableProcessors,\n daffPaymentProvideExtraReducers,\n daffPaymentReducerFactory,\n DaffPaymentStateModule,\n} from '@daffodil/payment/state';\n\nimport { DaffAuthorizeNetActionTypes } from './actions/authorizenet.actions';\n\n@NgModule({\n imports: [\n DaffPaymentStateModule,\n ],\n providers: [\n daffPaymentProvideAvailableProcessors({\n kind: DAFF_AUTHORIZENET_PAYMENT_KIND,\n action: DaffAuthorizeNetActionTypes.ApplyPaymentAction,\n driver: DaffAuthorizeNetPaymentDriver,\n }),\n ...daffPaymentProvideExtraReducers(combineReducers({\n payment: daffPaymentReducerFactory([DaffAuthorizeNetActionTypes.ApplyPaymentAction]),\n })),\n ],\n})\nexport class DaffAuthorizeNetPaymentStateModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2"],"mappings":";;;;;;;;;;;;;;;;AAYY,IAAA,4BAQX;AARD,CAAA,UAAY,2BAA2B,EAAA;AACrC,IAAA,2BAAA,CAAA,qBAAA,CAAA,GAAA,qCAA2D,CAAA;AAC3D,IAAA,2BAAA,CAAA,4BAAA,CAAA,GAAA,6CAA0E,CAAA;AAC1E,IAAA,2BAAA,CAAA,4BAAA,CAAA,GAAA,6CAA0E,CAAA;AAC1E,IAAA,2BAAA,CAAA,oBAAA,CAAA,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M,EAAE,2BAA2B,CAAC,kBAAkB;AACtD,YAAA,MAAM,EAAE,6BAA6B;SACtC,CAAC;QACF,GAAG,+BAA+B,CAAC,eAAe,CAAC;YACjD,OAAO,EAAE,yBAAyB,CAAC,CAAC,2BAA2B,CAAC,kBAAkB,CAAC,CAAC;AACrF,SAAA,CAAC,CAAC;AACJ,KAAA,EAAA,OAAA,EAAA,CAXC,sBAAsB,CAAA,EAAA,CAAA,CAAA;2FAab,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAf9C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,sBAAsB;AACvB,qBAAA;AACD,oBAAA,SAAS,EAAE;AACT,wBAAA,qCAAqC,CAAC;AACpC,4BAAA,IAAI,EAAE,8BAA8B;4BACpC,MAAM,EAAE,2BAA2B,CAAC,kBAAkB;AACtD,4BAAA,MAAM,EAAE,6BAA6B;yBACtC,CAAC;wBACF,GAAG,+BAA+B,CAAC,eAAe,CAAC;4BACjD,OAAO,EAAE,yBAAyB,CAAC,CAAC,2BAA2B,CAAC,kBAAkB,CAAC,CAAC;AACrF,yBAAA,CAAC,CAAC;AACJ,qBAAA;iBACF,CAAA;;;AC5BD;;AAEG;;;;"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { DOCUMENT } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, Injectable, Inject } from '@angular/core';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A token that represents the version to use for Accept.JS calls.
|
|
7
|
-
* A "true" value configures the package to use the production AcceptJs endpoint,
|
|
8
|
-
* and a "false" value configures it to use the Sandbox AcceptJs endpoint.
|
|
9
|
-
* By default, we assume you're using the sandbox (false).
|
|
10
|
-
*/
|
|
11
|
-
const DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION = new InjectionToken('DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION', {
|
|
12
|
-
providedIn: 'root',
|
|
13
|
-
factory: () => false,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const ACCEPT_JS_SANDBOX_URL = 'https://jstest.authorize.net/v1/Accept.js';
|
|
17
|
-
const ACCEPT_JS_PRODUCTION_URL = 'https://js.authorize.net/v1/Accept.js';
|
|
18
|
-
class DaffAcceptJsLoadingService {
|
|
19
|
-
constructor(production, doc) {
|
|
20
|
-
this.production = production;
|
|
21
|
-
this.doc = doc;
|
|
22
|
-
}
|
|
23
|
-
load() {
|
|
24
|
-
if (typeof Accept === 'undefined') {
|
|
25
|
-
const acceptJsScript = this.doc.createElement('script');
|
|
26
|
-
acceptJsScript.async = true;
|
|
27
|
-
acceptJsScript.setAttribute('type', 'text/javascript');
|
|
28
|
-
acceptJsScript.setAttribute('src', this.production ? ACCEPT_JS_PRODUCTION_URL : ACCEPT_JS_SANDBOX_URL);
|
|
29
|
-
acceptJsScript.setAttribute('charset', 'utf-8');
|
|
30
|
-
this.doc.body.appendChild(acceptJsScript);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
getAccept() {
|
|
34
|
-
return Accept;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/** @nocollapse */ DaffAcceptJsLoadingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAcceptJsLoadingService, deps: [{ token: DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
38
|
-
/** @nocollapse */ DaffAcceptJsLoadingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAcceptJsLoadingService, providedIn: 'root' });
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAcceptJsLoadingService, decorators: [{
|
|
40
|
-
type: Injectable,
|
|
41
|
-
args: [{
|
|
42
|
-
providedIn: 'root',
|
|
43
|
-
}]
|
|
44
|
-
}], ctorParameters: function () {
|
|
45
|
-
return [{ type: undefined, decorators: [{
|
|
46
|
-
type: Inject,
|
|
47
|
-
args: [DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION]
|
|
48
|
-
}] }, { type: undefined, decorators: [{
|
|
49
|
-
type: Inject,
|
|
50
|
-
args: [DOCUMENT]
|
|
51
|
-
}] }];
|
|
52
|
-
} });
|
|
53
|
-
|
|
54
|
-
const DAFF_AUTHORIZENET_PAYMENT_KIND = 'daffAuthorizenet';
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Generated bundle index. Do not edit.
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
export { DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION, DAFF_AUTHORIZENET_PAYMENT_KIND, DaffAcceptJsLoadingService };
|
|
61
|
-
//# sourceMappingURL=daffodil-authorizenet.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-authorizenet.mjs","sources":["../../../libs/authorizenet/src/services/accept-js-production.token.ts","../../../libs/authorizenet/src/services/accept-js-loading.service.ts","../../../libs/authorizenet/src/constants/kind.ts","../../../libs/authorizenet/src/daffodil-authorizenet.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/**\n * A token that represents the version to use for Accept.JS calls.\n * A \"true\" value configures the package to use the production AcceptJs endpoint,\n * and a \"false\" value configures it to use the Sandbox AcceptJs endpoint.\n * By default, we assume you're using the sandbox (false).\n */\nexport const DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION = new InjectionToken<\nboolean\n>('DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION', {\n providedIn: 'root',\n factory: () => false,\n});\n","import { DOCUMENT } from '@angular/common';\nimport {\n Inject,\n Injectable,\n} from '@angular/core';\n\nimport { DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION } from './accept-js-production.token';\nimport { AcceptType } from '../models/acceptJs/accept';\n\nconst ACCEPT_JS_SANDBOX_URL = 'https://jstest.authorize.net/v1/Accept.js';\nconst ACCEPT_JS_PRODUCTION_URL = 'https://js.authorize.net/v1/Accept.js';\n\nexport declare let Accept: AcceptType;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAcceptJsLoadingService {\n constructor(\n @Inject(DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION) private production: boolean,\n @Inject(DOCUMENT) private doc,\n ) {}\n\n load(): void {\n if (typeof Accept === 'undefined') {\n const acceptJsScript = this.doc.createElement('script');\n acceptJsScript.async = true;\n acceptJsScript.setAttribute('type', 'text/javascript');\n acceptJsScript.setAttribute(\n 'src',\n this.production ? ACCEPT_JS_PRODUCTION_URL : ACCEPT_JS_SANDBOX_URL,\n );\n acceptJsScript.setAttribute('charset', 'utf-8');\n this.doc.body.appendChild(acceptJsScript);\n }\n }\n\n getAccept(): AcceptType {\n return Accept;\n }\n}\n","export const DAFF_AUTHORIZENET_PAYMENT_KIND = 'daffAuthorizenet';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAEA;;;;;AAKG;MACU,sCAAsC,GAAG,IAAI,cAAc,CAEtE,wCAAwC,EAAE;AAC1C,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,KAAK;AACrB,CAAA;;ACJD,MAAM,qBAAqB,GAAG,2CAA2C,CAAC;AAC1E,MAAM,wBAAwB,GAAG,uCAAuC,CAAC;MAO5D,0BAA0B,CAAA;IACrC,WAC0D,CAAA,UAAmB,EACjD,GAAG,EAAA;AAD2B,QAAA,IAAU,CAAA,UAAA,GAAV,UAAU,CAAS;AACjD,QAAA,IAAG,CAAA,GAAA,GAAH,GAAG,CAAA;KAC3B;IAEJ,IAAI,GAAA;AACF,QAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG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
4
|
-
import { DaffAuthorizeNetDriver, DaffAuthorizeNetPaymentId } from '@daffodil/authorizenet/driver';
|
|
5
|
-
import * as i1 from '@angular/common/http';
|
|
6
|
-
import { STATUS } from 'angular-in-memory-web-api';
|
|
7
|
-
|
|
8
|
-
const DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID = 'daff_inmemory';
|
|
9
|
-
|
|
10
|
-
class DaffInMemoryAuthorizeNetService {
|
|
11
|
-
constructor(http) {
|
|
12
|
-
this.http = http;
|
|
13
|
-
this.url = '/api/authorizenet';
|
|
14
|
-
}
|
|
15
|
-
generateToken(paymentTokenRequest) {
|
|
16
|
-
return this.http.post(this.url + '/generateToken', paymentTokenRequest);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
/** @nocollapse */ DaffInMemoryAuthorizeNetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryAuthorizeNetService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20
|
-
/** @nocollapse */ DaffInMemoryAuthorizeNetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryAuthorizeNetService, providedIn: 'root' });
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryAuthorizeNetService, decorators: [{
|
|
22
|
-
type: Injectable,
|
|
23
|
-
args: [{
|
|
24
|
-
providedIn: 'root',
|
|
25
|
-
}]
|
|
26
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
27
|
-
|
|
28
|
-
class DaffAuthorizeNetInMemoryDriverModule {
|
|
29
|
-
static forRoot() {
|
|
30
|
-
return {
|
|
31
|
-
ngModule: DaffAuthorizeNetInMemoryDriverModule,
|
|
32
|
-
providers: [
|
|
33
|
-
{
|
|
34
|
-
provide: DaffAuthorizeNetDriver,
|
|
35
|
-
useExisting: DaffInMemoryAuthorizeNetService,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
provide: DaffAuthorizeNetPaymentId,
|
|
39
|
-
useValue: DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID,
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/** @nocollapse */ DaffAuthorizeNetInMemoryDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
46
|
-
/** @nocollapse */ DaffAuthorizeNetInMemoryDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetInMemoryDriverModule, imports: [CommonModule] });
|
|
47
|
-
/** @nocollapse */ DaffAuthorizeNetInMemoryDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetInMemoryDriverModule, imports: [CommonModule] });
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffAuthorizeNetInMemoryDriverModule, decorators: [{
|
|
49
|
-
type: NgModule,
|
|
50
|
-
args: [{
|
|
51
|
-
imports: [
|
|
52
|
-
CommonModule,
|
|
53
|
-
],
|
|
54
|
-
}]
|
|
55
|
-
}] });
|
|
56
|
-
|
|
57
|
-
class DaffInMemoryBackendAuthorizenetService {
|
|
58
|
-
createDb() {
|
|
59
|
-
return {};
|
|
60
|
-
}
|
|
61
|
-
get(reqInfo) {
|
|
62
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
63
|
-
body: {
|
|
64
|
-
code: DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID,
|
|
65
|
-
},
|
|
66
|
-
status: STATUS.OK,
|
|
67
|
-
}));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/** @nocollapse */ DaffInMemoryBackendAuthorizenetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendAuthorizenetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
71
|
-
/** @nocollapse */ DaffInMemoryBackendAuthorizenetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendAuthorizenetService, providedIn: 'root' });
|
|
72
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendAuthorizenetService, decorators: [{
|
|
73
|
-
type: Injectable,
|
|
74
|
-
args: [{
|
|
75
|
-
providedIn: 'root',
|
|
76
|
-
}]
|
|
77
|
-
}] });
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Generated bundle index. Do not edit.
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
export { DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID, DaffAuthorizeNetInMemoryDriverModule, DaffInMemoryAuthorizeNetService, DaffInMemoryBackendAuthorizenetService };
|
|
84
|
-
//# sourceMappingURL=daffodil-authorizenet-driver-in-memory.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-authorizenet-driver-in-memory.mjs","sources":["../../../libs/authorizenet/driver/in-memory/src/drivers/authorize-net-payment-id.ts","../../../libs/authorizenet/driver/in-memory/src/drivers/authorize-net.service.ts","../../../libs/authorizenet/driver/in-memory/src/drivers/authorize-net-driver.module.ts","../../../libs/authorizenet/driver/in-memory/src/backend/authorize-net.service.ts","../../../libs/authorizenet/driver/in-memory/src/daffodil-authorizenet-driver-in-memory.ts"],"sourcesContent":["export const DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID = 'daff_inmemory';\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffAuthorizeNetTokenRequest } from '@daffodil/authorizenet';\nimport { DaffAuthorizeNetService } from '@daffodil/authorizenet/driver';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryAuthorizeNetService implements DaffAuthorizeNetService<DaffAuthorizeNetTokenRequest> {\n url = '/api/authorizenet';\n\n constructor(private http: HttpClient) {}\n\n generateToken(paymentTokenRequest: DaffAuthorizeNetTokenRequest): Observable<any> {\n return this.http.post<DaffAuthorizeNetTokenRequest>(this.url + '/generateToken', paymentTokenRequest);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n DaffAuthorizeNetDriver,\n DaffAuthorizeNetPaymentId,\n} from '@daffodil/authorizenet/driver';\n\nimport { DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID } from './authorize-net-payment-id';\nimport { DaffInMemoryAuthorizeNetService } from './authorize-net.service';\n\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffAuthorizeNetInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffAuthorizeNetInMemoryDriverModule> {\n return {\n ngModule: DaffAuthorizeNetInMemoryDriverModule,\n providers: [\n {\n provide: DaffAuthorizeNetDriver,\n useExisting: DaffInMemoryAuthorizeNetService,\n },\n {\n provide: DaffAuthorizeNetPaymentId,\n useValue: DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID,\n },\n ],\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID } from '../drivers/authorize-net-payment-id';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendAuthorizenetService implements InMemoryDbService {\n createDb(): any {\n return {};\n }\n\n get(reqInfo: any) {\n return reqInfo.utils.createResponse$(() => ({\n body: {\n code: DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID,\n },\n status: STATUS.OK,\n }));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAO,MAAM,uCAAuC,GAAG;;MCU1C,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAoB,IAAgB,EAAA;QAAhB,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;QAFpC,IAAG,CAAA,GAAA,GAAG,mBAAmB,CAAC;KAEc;AAExC,IAAA,aAAa,CAAC,mBAAiD,EAAA;AAC7D,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAA+B,IAAI,CAAC,GAAG,GAAG,gBAAgB,EAAE,mBAAmB,CAAC,CAAC;KACvG;;+IAPU,+BAA+B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA/B,mBAAA,+BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,cAF9B,MAAM,EAAA,CAAA,CAAA;2FAEP,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAH3C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;MCWY,oCAAoC,CAAA;AAC/C,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,oCAAoC;AAC9C,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,sBAAsB;AAC/B,oBAAA,WAAW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