@daffodil/authorizenet 0.39.11 → 0.40.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/daffodil-authorizenet.d.ts +1 -0
- package/driver/daffodil-authorizenet-driver.d.ts +1 -0
- package/driver/in-memory/backend/authorize-net.service.d.ts +3 -0
- package/driver/in-memory/daffodil-authorizenet-driver-in-memory.d.ts +1 -0
- package/driver/in-memory/drivers/authorize-net-driver.module.d.ts +5 -0
- package/driver/in-memory/drivers/authorize-net.service.d.ts +3 -0
- package/driver/in-memory/package.json +5 -6
- package/driver/magento/authorize-net.module.d.ts +5 -0
- package/driver/magento/authorize-net.service.d.ts +3 -0
- package/driver/magento/daffodil-authorizenet-driver-magento.d.ts +1 -0
- package/driver/magento/package.json +5 -6
- package/driver/package.json +5 -6
- package/driver/testing/daffodil-authorizenet-driver-testing.d.ts +1 -0
- package/driver/testing/drivers/authorize-net-driver.module.d.ts +5 -0
- package/driver/testing/drivers/authorize-net.service.d.ts +3 -0
- package/driver/testing/package.json +5 -6
- package/{esm2015/daffodil-authorizenet.js → esm2020/daffodil-authorizenet.mjs} +0 -0
- package/{esm2015/driver/daffodil-authorizenet-driver.js → esm2020/driver/daffodil-authorizenet-driver.mjs} +0 -0
- package/{esm2015/driver/errors/acceptjs_invalid.js → esm2020/driver/errors/acceptjs_invalid.mjs} +0 -0
- package/{esm2015/driver/errors/acceptjs_missing.js → esm2020/driver/errors/acceptjs_missing.mjs} +0 -0
- package/{esm2015/driver/errors/auth-failed.js → esm2020/driver/errors/auth-failed.mjs} +0 -0
- package/{esm2015/driver/errors/error-code-map.js → esm2020/driver/errors/error-code-map.mjs} +0 -0
- package/{esm2015/driver/errors/error-codes.enum.js → esm2020/driver/errors/error-codes.enum.mjs} +0 -0
- package/{esm2015/driver/errors/input-missing.js → esm2020/driver/errors/input-missing.mjs} +0 -0
- package/{esm2015/driver/errors/insecure-connection.js → esm2020/driver/errors/insecure-connection.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-api-response.js → esm2020/driver/errors/invalid-api-response.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-cc-cvv.js → esm2020/driver/errors/invalid-cc-cvv.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-cc-exp-month.js → esm2020/driver/errors/invalid-cc-exp-month.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-cc-exp-year.js → esm2020/driver/errors/invalid-cc-exp-year.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-cc-name.js → esm2020/driver/errors/invalid-cc-name.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-cc-number.js → esm2020/driver/errors/invalid-cc-number.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-client-key.js → esm2020/driver/errors/invalid-client-key.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-login-id.js → esm2020/driver/errors/invalid-login-id.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-postal-code.js → esm2020/driver/errors/invalid-postal-code.mjs} +0 -0
- package/{esm2015/driver/errors/past-cc-expiration.js → esm2020/driver/errors/past-cc-expiration.mjs} +0 -0
- package/{esm2015/driver/errors/public_api.js → esm2020/driver/errors/public_api.mjs} +0 -0
- package/esm2020/driver/in-memory/backend/authorize-net.service.mjs +26 -0
- package/{esm2015/driver/in-memory/backend/public_api.js → esm2020/driver/in-memory/backend/public_api.mjs} +0 -0
- package/{esm2015/driver/in-memory/daffodil-authorizenet-driver-in-memory.js → esm2020/driver/in-memory/daffodil-authorizenet-driver-in-memory.mjs} +0 -0
- package/esm2020/driver/in-memory/drivers/authorize-net-driver.module.mjs +37 -0
- package/{esm2015/driver/in-memory/drivers/authorize-net-payment-id.js → esm2020/driver/in-memory/drivers/authorize-net-payment-id.mjs} +0 -0
- package/esm2020/driver/in-memory/drivers/authorize-net.service.mjs +22 -0
- package/{esm2015/driver/in-memory/drivers/public_api.js → esm2020/driver/in-memory/drivers/public_api.mjs} +0 -0
- package/{esm2015/driver/in-memory/index.js → esm2020/driver/in-memory/index.mjs} +0 -0
- package/{esm2015/driver/in-memory/public_api.js → esm2020/driver/in-memory/public_api.mjs} +0 -0
- package/{esm2015/driver/index.js → esm2020/driver/index.mjs} +0 -0
- package/{esm2015/driver/interfaces/authorize-net-config.interface.js → esm2020/driver/interfaces/authorize-net-config.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/authorize-net-payment-id.token.js → esm2020/driver/interfaces/authorize-net-payment-id.token.mjs} +0 -0
- package/{esm2015/driver/interfaces/authorize-net-service.interface.js → esm2020/driver/interfaces/authorize-net-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/public_api.js → esm2020/driver/interfaces/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/authorize-net-payment-id.js → esm2020/driver/magento/authorize-net-payment-id.mjs} +0 -0
- package/esm2020/driver/magento/authorize-net.module.mjs +44 -0
- package/esm2020/driver/magento/authorize-net.service.mjs +37 -0
- package/{esm2015/driver/magento/daffodil-authorizenet-driver-magento.js → esm2020/driver/magento/daffodil-authorizenet-driver-magento.mjs} +0 -0
- package/{esm2015/driver/magento/index.js → esm2020/driver/magento/index.mjs} +0 -0
- package/{esm2015/driver/magento/models/authorize-net-payment.js → esm2020/driver/magento/models/authorize-net-payment.mjs} +0 -0
- package/{esm2015/driver/magento/public_api.js → esm2020/driver/magento/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/transformers/authorize-net-transformer.js → esm2020/driver/magento/transformers/authorize-net-transformer.mjs} +0 -0
- package/{esm2015/driver/public_api.js → esm2020/driver/public_api.mjs} +0 -0
- package/{esm2015/driver/testing/daffodil-authorizenet-driver-testing.js → esm2020/driver/testing/daffodil-authorizenet-driver-testing.mjs} +0 -0
- package/esm2020/driver/testing/drivers/authorize-net-driver.module.mjs +32 -0
- package/esm2020/driver/testing/drivers/authorize-net.service.mjs +17 -0
- package/{esm2015/driver/testing/drivers/public_api.js → esm2020/driver/testing/drivers/public_api.mjs} +0 -0
- package/{esm2015/driver/testing/index.js → esm2020/driver/testing/index.mjs} +0 -0
- package/{esm2015/driver/testing/public_api.js → esm2020/driver/testing/public_api.mjs} +0 -0
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/{esm2015/injection-tokens/error-matcher.token.js → esm2020/injection-tokens/error-matcher.token.mjs} +0 -0
- package/{esm2015/injection-tokens/public_api.js → esm2020/injection-tokens/public_api.mjs} +0 -0
- package/{esm2015/models/acceptJs/accept.js → esm2020/models/acceptJs/accept.mjs} +0 -0
- package/{esm2015/models/public_api.js → esm2020/models/public_api.mjs} +0 -0
- package/{esm2015/models/request/authorize-net-request.js → esm2020/models/request/authorize-net-request.mjs} +0 -0
- package/{esm2015/models/request/authorize-net-token-request.js → esm2020/models/request/authorize-net-token-request.mjs} +0 -0
- package/{esm2015/models/request/credit-card.js → esm2020/models/request/credit-card.mjs} +0 -0
- package/{esm2015/models/response/authorize-net-response.js → esm2020/models/response/authorize-net-response.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/esm2020/services/accept-js-loading.service.mjs +40 -0
- package/{esm2015/services/accept-js-production.token.js → esm2020/services/accept-js-production.token.mjs} +0 -0
- package/{esm2015/services/public_api.js → esm2020/services/public_api.mjs} +0 -0
- package/{esm2015/state/actions/authorizenet.actions.js → esm2020/state/actions/authorizenet.actions.mjs} +0 -0
- package/esm2020/state/authorize-net-state.module.mjs +27 -0
- package/esm2020/state/daffodil-authorizenet-state.mjs +5 -0
- package/esm2020/state/effects/authorize-net.effects.mjs +44 -0
- package/{esm2015/state/facades/authorize-net-facade.interface.js → esm2020/state/facades/authorize-net-facade.interface.mjs} +0 -0
- package/esm2020/state/facades/authorize-net.facade.mjs +27 -0
- package/{esm2015/state/index.js → esm2020/state/index.mjs} +0 -0
- package/{esm2015/state/public_api.js → esm2020/state/public_api.mjs} +0 -0
- package/{esm2015/state/reducers/authorize-net/authorize-net-reducer.interface.js → esm2020/state/reducers/authorize-net/authorize-net-reducer.interface.mjs} +0 -0
- package/esm2020/state/reducers/authorize-net/authorize-net.reducer.mjs +43 -0
- package/{esm2015/state/reducers/authorize-net-reducers.interface.js → esm2020/state/reducers/authorize-net-reducers.interface.mjs} +0 -0
- package/{esm2015/state/reducers/authorize-net.reducers.js → esm2020/state/reducers/authorize-net.reducers.mjs} +0 -0
- package/{esm2015/state/reducers/authorizenet-store-feature-key.js → esm2020/state/reducers/authorizenet-store-feature-key.mjs} +0 -0
- package/{esm2015/state/reducers/public_api.js → esm2020/state/reducers/public_api.mjs} +0 -0
- package/esm2020/state/selectors/authorize-net.selector.mjs +43 -0
- package/esm2020/state/testing/authorize-net-testing.module.mjs +20 -0
- package/{esm2015/state/testing/daffodil-authorizenet-state-testing.js → esm2020/state/testing/daffodil-authorizenet-state-testing.mjs} +0 -0
- package/{esm2015/state/testing/index.js → esm2020/state/testing/index.mjs} +0 -0
- package/esm2020/state/testing/mock-authorize-net-facade.mjs +20 -0
- package/{esm2015/state/testing/public_api.js → esm2020/state/testing/public_api.mjs} +0 -0
- package/fesm2015/daffodil-authorizenet-driver-in-memory.mjs +86 -0
- package/fesm2015/daffodil-authorizenet-driver-in-memory.mjs.map +1 -0
- package/fesm2015/daffodil-authorizenet-driver-magento.mjs +111 -0
- package/fesm2015/daffodil-authorizenet-driver-magento.mjs.map +1 -0
- package/fesm2015/daffodil-authorizenet-driver-testing.mjs +53 -0
- package/fesm2015/daffodil-authorizenet-driver-testing.mjs.map +1 -0
- package/fesm2015/{daffodil-authorizenet-driver.js → daffodil-authorizenet-driver.mjs} +1 -1
- package/fesm2015/daffodil-authorizenet-driver.mjs.map +1 -0
- package/fesm2015/daffodil-authorizenet-state-testing.mjs +44 -0
- package/fesm2015/daffodil-authorizenet-state-testing.mjs.map +1 -0
- package/fesm2015/{daffodil-authorizenet-state.js → daffodil-authorizenet-state.mjs} +57 -62
- package/fesm2015/daffodil-authorizenet-state.mjs.map +1 -0
- package/fesm2015/daffodil-authorizenet.mjs +66 -0
- package/fesm2015/daffodil-authorizenet.mjs.map +1 -0
- package/fesm2020/daffodil-authorizenet-driver-in-memory.mjs +86 -0
- package/fesm2020/daffodil-authorizenet-driver-in-memory.mjs.map +1 -0
- package/{fesm2015/daffodil-authorizenet-driver-magento.js → fesm2020/daffodil-authorizenet-driver-magento.mjs} +28 -21
- package/fesm2020/daffodil-authorizenet-driver-magento.mjs.map +1 -0
- package/fesm2020/daffodil-authorizenet-driver-testing.mjs +53 -0
- package/fesm2020/daffodil-authorizenet-driver-testing.mjs.map +1 -0
- package/fesm2020/daffodil-authorizenet-driver.mjs +234 -0
- package/fesm2020/daffodil-authorizenet-driver.mjs.map +1 -0
- package/fesm2020/daffodil-authorizenet-state-testing.mjs +44 -0
- package/fesm2020/daffodil-authorizenet-state-testing.mjs.map +1 -0
- package/fesm2020/daffodil-authorizenet-state.mjs +247 -0
- package/fesm2020/daffodil-authorizenet-state.mjs.map +1 -0
- package/{fesm2015/daffodil-authorizenet.js → fesm2020/daffodil-authorizenet.mjs} +17 -13
- package/fesm2020/daffodil-authorizenet.mjs.map +1 -0
- package/package.json +75 -15
- package/services/accept-js-loading.service.d.ts +3 -0
- package/state/authorize-net-state.module.d.ts +6 -0
- package/state/daffodil-authorizenet-state.d.ts +1 -1
- package/state/effects/authorize-net.effects.d.ts +4 -1
- package/state/facades/authorize-net.facade.d.ts +3 -0
- package/state/package.json +5 -6
- package/state/testing/authorize-net-testing.module.d.ts +4 -0
- package/state/testing/daffodil-authorizenet-state-testing.d.ts +1 -0
- package/state/testing/mock-authorize-net-facade.d.ts +3 -0
- package/state/testing/package.json +5 -6
- package/bundles/daffodil-authorizenet-driver-in-memory.umd.js +0 -93
- package/bundles/daffodil-authorizenet-driver-in-memory.umd.js.map +0 -1
- package/bundles/daffodil-authorizenet-driver-in-memory.umd.min.js +0 -2
- package/bundles/daffodil-authorizenet-driver-in-memory.umd.min.js.map +0 -1
- package/bundles/daffodil-authorizenet-driver-magento.umd.js +0 -112
- package/bundles/daffodil-authorizenet-driver-magento.umd.js.map +0 -1
- package/bundles/daffodil-authorizenet-driver-magento.umd.min.js +0 -2
- package/bundles/daffodil-authorizenet-driver-magento.umd.min.js.map +0 -1
- package/bundles/daffodil-authorizenet-driver-testing.umd.js +0 -56
- package/bundles/daffodil-authorizenet-driver-testing.umd.js.map +0 -1
- package/bundles/daffodil-authorizenet-driver-testing.umd.min.js +0 -2
- package/bundles/daffodil-authorizenet-driver-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-authorizenet-driver.umd.js +0 -621
- package/bundles/daffodil-authorizenet-driver.umd.js.map +0 -1
- package/bundles/daffodil-authorizenet-driver.umd.min.js +0 -2
- package/bundles/daffodil-authorizenet-driver.umd.min.js.map +0 -1
- package/bundles/daffodil-authorizenet-state-testing.umd.js +0 -46
- package/bundles/daffodil-authorizenet-state-testing.umd.js.map +0 -1
- package/bundles/daffodil-authorizenet-state-testing.umd.min.js +0 -2
- package/bundles/daffodil-authorizenet-state-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-authorizenet-state.umd.js +0 -584
- package/bundles/daffodil-authorizenet-state.umd.js.map +0 -1
- package/bundles/daffodil-authorizenet-state.umd.min.js +0 -2
- package/bundles/daffodil-authorizenet-state.umd.min.js.map +0 -1
- package/bundles/daffodil-authorizenet.umd.js +0 -69
- package/bundles/daffodil-authorizenet.umd.js.map +0 -1
- package/bundles/daffodil-authorizenet.umd.min.js +0 -2
- package/bundles/daffodil-authorizenet.umd.min.js.map +0 -1
- package/daffodil-authorizenet.metadata.json +0 -1
- package/driver/daffodil-authorizenet-driver.metadata.json +0 -1
- package/driver/in-memory/daffodil-authorizenet-driver-in-memory.metadata.json +0 -1
- package/driver/magento/daffodil-authorizenet-driver-magento.metadata.json +0 -1
- package/driver/testing/daffodil-authorizenet-driver-testing.metadata.json +0 -1
- package/esm2015/driver/in-memory/backend/authorize-net.service.js +0 -24
- package/esm2015/driver/in-memory/drivers/authorize-net-driver.module.js +0 -30
- package/esm2015/driver/in-memory/drivers/authorize-net.service.js +0 -24
- package/esm2015/driver/magento/authorize-net.module.js +0 -37
- package/esm2015/driver/magento/authorize-net.service.js +0 -38
- package/esm2015/driver/testing/drivers/authorize-net-driver.module.js +0 -25
- package/esm2015/driver/testing/drivers/authorize-net.service.js +0 -15
- package/esm2015/services/accept-js-loading.service.js +0 -39
- package/esm2015/state/authorize-net-state.module.js +0 -17
- package/esm2015/state/daffodil-authorizenet-state.js +0 -6
- package/esm2015/state/effects/authorize-net.effects.js +0 -55
- package/esm2015/state/facades/authorize-net.facade.js +0 -29
- package/esm2015/state/reducers/authorize-net/authorize-net.reducer.js +0 -24
- package/esm2015/state/selectors/authorize-net.selector.js +0 -46
- package/esm2015/state/testing/authorize-net-testing.module.js +0 -13
- package/esm2015/state/testing/mock-authorize-net-facade.js +0 -18
- package/fesm2015/daffodil-authorizenet-driver-in-memory.js +0 -79
- package/fesm2015/daffodil-authorizenet-driver-in-memory.js.map +0 -1
- package/fesm2015/daffodil-authorizenet-driver-magento.js.map +0 -1
- package/fesm2015/daffodil-authorizenet-driver-testing.js +0 -44
- package/fesm2015/daffodil-authorizenet-driver-testing.js.map +0 -1
- package/fesm2015/daffodil-authorizenet-driver.js.map +0 -1
- package/fesm2015/daffodil-authorizenet-state-testing.js +0 -35
- package/fesm2015/daffodil-authorizenet-state-testing.js.map +0 -1
- package/fesm2015/daffodil-authorizenet-state.js.map +0 -1
- package/fesm2015/daffodil-authorizenet.js.map +0 -1
- package/state/daffodil-authorizenet-state.metadata.json +0 -1
- package/state/testing/daffodil-authorizenet-state-testing.metadata.json +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Injectable, NgModule } from '@angular/core';
|
|
4
|
+
import { DaffAuthorizeNetDriver } from '@daffodil/authorizenet/driver';
|
|
5
|
+
import { of } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
class DaffTestingAuthorizeNetService {
|
|
8
|
+
generateToken(tokenRequest) {
|
|
9
|
+
return of({ paymentInfo: 'paymentInfo' });
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/** @nocollapse */ /** @nocollapse */ DaffTestingAuthorizeNetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingAuthorizeNetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13
|
+
/** @nocollapse */ /** @nocollapse */ DaffTestingAuthorizeNetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingAuthorizeNetService, providedIn: 'root' });
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingAuthorizeNetService, decorators: [{
|
|
15
|
+
type: Injectable,
|
|
16
|
+
args: [{
|
|
17
|
+
providedIn: 'root',
|
|
18
|
+
}]
|
|
19
|
+
}] });
|
|
20
|
+
|
|
21
|
+
class DaffTestingAuthorizeNetDriverModule {
|
|
22
|
+
static forRoot() {
|
|
23
|
+
return {
|
|
24
|
+
ngModule: DaffTestingAuthorizeNetDriverModule,
|
|
25
|
+
providers: [
|
|
26
|
+
{
|
|
27
|
+
provide: DaffAuthorizeNetDriver,
|
|
28
|
+
useExisting: DaffTestingAuthorizeNetService,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** @nocollapse */ /** @nocollapse */ DaffTestingAuthorizeNetDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingAuthorizeNetDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
35
|
+
/** @nocollapse */ /** @nocollapse */ DaffTestingAuthorizeNetDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingAuthorizeNetDriverModule, imports: [CommonModule] });
|
|
36
|
+
/** @nocollapse */ /** @nocollapse */ DaffTestingAuthorizeNetDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingAuthorizeNetDriverModule, imports: [[
|
|
37
|
+
CommonModule,
|
|
38
|
+
]] });
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingAuthorizeNetDriverModule, decorators: [{
|
|
40
|
+
type: NgModule,
|
|
41
|
+
args: [{
|
|
42
|
+
imports: [
|
|
43
|
+
CommonModule,
|
|
44
|
+
],
|
|
45
|
+
}]
|
|
46
|
+
}] });
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Generated bundle index. Do not edit.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
export { DaffTestingAuthorizeNetDriverModule, DaffTestingAuthorizeNetService };
|
|
53
|
+
//# sourceMappingURL=daffodil-authorizenet-driver-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daffodil-authorizenet-driver-testing.mjs","sources":["../../../libs/authorizenet/driver/testing/src/drivers/authorize-net.service.ts","../../../libs/authorizenet/driver/testing/src/drivers/authorize-net-driver.module.ts","../../../libs/authorizenet/driver/testing/src/daffodil-authorizenet-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffAuthorizeNetTokenRequest } from '@daffodil/authorizenet';\nimport { DaffAuthorizeNetService } from '@daffodil/authorizenet/driver';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingAuthorizeNetService implements DaffAuthorizeNetService {\n\n generateToken(tokenRequest: DaffAuthorizeNetTokenRequest): Observable<any> {\n return of({ paymentInfo: 'paymentInfo' });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffAuthorizeNetDriver } from '@daffodil/authorizenet/driver';\n\nimport { DaffTestingAuthorizeNetService } from './authorize-net.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffTestingAuthorizeNetDriverModule {\n static forRoot(): ModuleWithProviders<DaffTestingAuthorizeNetDriverModule> {\n return {\n ngModule: DaffTestingAuthorizeNetDriverModule,\n providers: [\n {\n provide: DaffAuthorizeNetDriver,\n useExisting: DaffTestingAuthorizeNetService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAYa,8BAA8B,CAAA;AAEzC,IAAA,aAAa,CAAC,YAA0C,EAAA;QACtD,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC;KAC3C;;iKAJU,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA9B,sCAAA,8BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cAF7B,MAAM,EAAA,CAAA,CAAA;2FAEP,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;MCIY,mCAAmC,CAAA;AAC9C,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,mCAAmC;AAC7C,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,sBAAsB;AAC/B,oBAAA,WAAW,EAAE,8BAA8B;AAC5C,iBAAA;AACF,aAAA;SACF,CAAC;KACH;;sKAXU,mCAAmC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAnC,sCAAA,mCAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mCAAmC,YAH5C,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,sCAAA,mCAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mCAAmC,EAJrC,OAAA,EAAA,CAAA;YACP,YAAY;SACb,CAAA,EAAA,CAAA,CAAA;2FAEU,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAL/C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;iBACF,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -231,4 +231,4 @@ const DAFF_AUTHORIZE_NET_ERROR_CODE_MAP = {
|
|
|
231
231
|
*/
|
|
232
232
|
|
|
233
233
|
export { DAFF_AUTHORIZE_NET_ERROR_CODE_MAP, DaffAuthorizeNetAcceptjsInvalidError, DaffAuthorizeNetAcceptjsMissingError, DaffAuthorizeNetAuthFailedError, DaffAuthorizeNetConfigToken, DaffAuthorizeNetDriver, DaffAuthorizeNetDriverErrorCodes, DaffAuthorizeNetInputMissingError, DaffAuthorizeNetInsecureConnectionError, DaffAuthorizeNetInvalidAPIResponseError, DaffAuthorizeNetInvalidCCCVVError, DaffAuthorizeNetInvalidCCExpMonthError, DaffAuthorizeNetInvalidCCExpYearError, DaffAuthorizeNetInvalidCCNameError, DaffAuthorizeNetInvalidCCNumberError, DaffAuthorizeNetInvalidClientKeyError, DaffAuthorizeNetInvalidLoginIdError, DaffAuthorizeNetInvalidPostalCodeError, DaffAuthorizeNetPastCCExpirationError, DaffAuthorizeNetPaymentId };
|
|
234
|
-
//# sourceMappingURL=daffodil-authorizenet-driver.
|
|
234
|
+
//# sourceMappingURL=daffodil-authorizenet-driver.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daffodil-authorizenet-driver.mjs","sources":["../../../libs/authorizenet/driver/src/interfaces/authorize-net-config.interface.ts","../../../libs/authorizenet/driver/src/interfaces/authorize-net-service.interface.ts","../../../libs/authorizenet/driver/src/interfaces/authorize-net-payment-id.token.ts","../../../libs/authorizenet/driver/src/errors/error-codes.enum.ts","../../../libs/authorizenet/driver/src/errors/acceptjs_invalid.ts","../../../libs/authorizenet/driver/src/errors/acceptjs_missing.ts","../../../libs/authorizenet/driver/src/errors/auth-failed.ts","../../../libs/authorizenet/driver/src/errors/input-missing.ts","../../../libs/authorizenet/driver/src/errors/insecure-connection.ts","../../../libs/authorizenet/driver/src/errors/invalid-api-response.ts","../../../libs/authorizenet/driver/src/errors/invalid-cc-cvv.ts","../../../libs/authorizenet/driver/src/errors/invalid-cc-exp-month.ts","../../../libs/authorizenet/driver/src/errors/invalid-cc-exp-year.ts","../../../libs/authorizenet/driver/src/errors/invalid-cc-name.ts","../../../libs/authorizenet/driver/src/errors/invalid-cc-number.ts","../../../libs/authorizenet/driver/src/errors/invalid-client-key.ts","../../../libs/authorizenet/driver/src/errors/invalid-login-id.ts","../../../libs/authorizenet/driver/src/errors/invalid-postal-code.ts","../../../libs/authorizenet/driver/src/errors/past-cc-expiration.ts","../../../libs/authorizenet/driver/src/errors/error-code-map.ts","../../../libs/authorizenet/driver/src/daffodil-authorizenet-driver.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const DaffAuthorizeNetConfigToken = new InjectionToken<DaffAuthorizeNetConfig>('DaffAuthorizeNetConfigToken');\n\n/**\n * An interface for providing @daffodil/authorizenet with needed configurations specific to your authorizenet\n * endpoint.\n */\nexport interface DaffAuthorizeNetConfig {\n\tclientKey: string;\n\tapiLoginID: string;\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffAuthorizeNetTokenRequest } from '@daffodil/authorizenet';\n\nexport const DaffAuthorizeNetDriver = new InjectionToken<DaffAuthorizeNetService>('DaffAuthorizeNetDriver');\n\nexport interface DaffAuthorizeNetService<T extends DaffAuthorizeNetTokenRequest = DaffAuthorizeNetTokenRequest> {\n\tgenerateToken(paymentTokenRequest: T): Observable<any>;\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const DaffAuthorizeNetPaymentId = new InjectionToken<string>('DaffAuthorizeNetPaymentId');\n","/**\n * The error codes for Authorize.net driver errors.\n * See {@link DaffError} and {@link DaffStateError}.\n */\nexport enum DaffAuthorizeNetDriverErrorCodes {\n ACCEPTJS_INVALID = 'DAFF_AUTHORIZE_NET_ACCEPTJS_INVALID',\n ACCEPTJS_MISSING = 'DAFF_AUTHORIZE_NET_ACCEPTJS_MISSING',\n AUTH_FAILED = 'DAFF_AUTHORIZE_NET_AUTH_FAILED',\n INPUT_MISSING = 'DAFF_AUTHORIZE_NET_INPUT_MISSING',\n INSECURE_CONNECTION = 'DAFF_AUTHORIZE_NET_INSECURE_CONNECTION',\n INVALID_API_RESPONSE = 'DAFF_AUTHORIZE_NET_ACCEPTJS_INVALID',\n INVALID_CC_CVV = 'DAFF_AUTHORIZE_NET_INVALID_CC_CVV',\n INVALID_CC_EXP_MONTH = 'DAFF_AUTHORIZE_NET_INVALID_CC_EXP_MONTH',\n INVALID_CC_EXP_YEAR = 'DAFF_AUTHORIZE_NET_INVALID_CC_EXP_YEAR',\n INVALID_CC_NAME = 'DAFF_AUTHORIZE_NET_INVALID_CC_NAME',\n INVALID_CC_NUMBER = 'DAFF_AUTHORIZE_NET_INVALID_CC_NUMBER',\n INVALID_CLIENT_KEY = 'DAFF_AUTHORIZE_NET_INVALID_CLIENT_KEY',\n INVALID_LOGIN_ID = 'DAFF_AUTHORIZE_NET_INVALID_LOGIN_ID',\n INVALID_POSTAL_CODE = 'DAFF_AUTHORIZE_NET_INVALID_POSTAL_CODE',\n PAST_CC_EXPIRATION = 'DAFF_AUTHORIZE_NET_PAST_CC_EXPIRATION',\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when Accept.js has been loaded incorrectly.\n * This can be caused by the script being loaded from a local source\n * or when the browser or proxy has improperly cached an older version of the script.\n */\nexport class DaffAuthorizeNetAcceptjsInvalidError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.ACCEPTJS_INVALID;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when Accept.js has not been loaded.\n */\nexport class DaffAuthorizeNetAcceptjsMissingError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.ACCEPTJS_MISSING;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when either the API Login ID or Public Client Key values are incorrect.\n */\nexport class DaffAuthorizeNetAuthFailedError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.AUTH_FAILED;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when required information is missing from the request payload.\n */\nexport class DaffAuthorizeNetInputMissingError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INPUT_MISSING;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when requests are not made over HTTPS.\n */\nexport class DaffAuthorizeNetInsecureConnectionError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INSECURE_CONNECTION;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the platform response is missing key information or malformed in an unrecoverable way.\n */\nexport class DaffAuthorizeNetInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_API_RESPONSE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the credit card cvv number is invalid.\n */\nexport class DaffAuthorizeNetInvalidCCCVVError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CC_CVV;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the credit card expiration month is invalid.\n */\nexport class DaffAuthorizeNetInvalidCCExpMonthError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CC_EXP_MONTH;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the credit card expiration year is invalid.\n */\nexport class DaffAuthorizeNetInvalidCCExpYearError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CC_EXP_YEAR;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the cardholder name is invalid.\n * It should be no more than 64 characters in length.\n */\nexport class DaffAuthorizeNetInvalidCCNameError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CC_NAME;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the credit card number is invalid.\n */\nexport class DaffAuthorizeNetInvalidCCNumberError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CC_NUMBER;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the `clientKey` value with which the Authorize.net driver has been configured is invalid or missing.\n *\n * @see {@link DaffAuthorizeNetConfig}\n */\nexport class DaffAuthorizeNetInvalidClientKeyError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CLIENT_KEY;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the `apiLoginID` value with which the Authorize.net driver has been configured is invalid or missing.\n *\n * @see {@link DaffAuthorizeNetConfig}\n */\nexport class DaffAuthorizeNetInvalidLoginIdError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_LOGIN_ID;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the postal code is invalid.\n * It should be no more than 20 characters in length.\n */\nexport class DaffAuthorizeNetInvalidPostalCodeError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_POSTAL_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the credit card expiration date is in the past.\n */\nexport class DaffAuthorizeNetPastCCExpirationError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthorizeNetDriverErrorCodes.PAST_CC_EXPIRATION;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { DaffAuthorizeNetAcceptjsInvalidError } from './acceptjs_invalid';\nimport { DaffAuthorizeNetAcceptjsMissingError } from './acceptjs_missing';\nimport { DaffAuthorizeNetAuthFailedError } from './auth-failed';\nimport { DaffAuthorizeNetInputMissingError } from './input-missing';\nimport { DaffAuthorizeNetInsecureConnectionError } from './insecure-connection';\nimport { DaffAuthorizeNetInvalidCCCVVError } from './invalid-cc-cvv';\nimport { DaffAuthorizeNetInvalidCCExpMonthError } from './invalid-cc-exp-month';\nimport { DaffAuthorizeNetInvalidCCExpYearError } from './invalid-cc-exp-year';\nimport { DaffAuthorizeNetInvalidCCNameError } from './invalid-cc-name';\nimport { DaffAuthorizeNetInvalidCCNumberError } from './invalid-cc-number';\nimport { DaffAuthorizeNetInvalidClientKeyError } from './invalid-client-key';\nimport { DaffAuthorizeNetInvalidLoginIdError } from './invalid-login-id';\nimport { DaffAuthorizeNetInvalidPostalCodeError } from './invalid-postal-code';\nimport { DaffAuthorizeNetPastCCExpirationError } from './past-cc-expiration';\n\n/**\n * A mapping from the Authorize.net platform error codes to Daffodil driver error classes.\n */\nexport const DAFF_AUTHORIZE_NET_ERROR_CODE_MAP = {\n E_WC_01: DaffAuthorizeNetAcceptjsMissingError,\n E_WC_02: DaffAuthorizeNetInsecureConnectionError,\n E_WC_03: DaffAuthorizeNetAcceptjsInvalidError,\n E_WC_04: DaffAuthorizeNetInputMissingError,\n E_WC_05: DaffAuthorizeNetInvalidCCNumberError,\n E_WC_06: DaffAuthorizeNetInvalidCCExpMonthError,\n E_WC_07: DaffAuthorizeNetInvalidCCExpYearError,\n E_WC_08: DaffAuthorizeNetPastCCExpirationError,\n E_WC_10: DaffAuthorizeNetInvalidLoginIdError,\n E_WC_13: DaffAuthorizeNetAcceptjsInvalidError,\n E_WC_15: DaffAuthorizeNetInvalidCCCVVError,\n E_WC_16: DaffAuthorizeNetInvalidPostalCodeError,\n E_WC_17: DaffAuthorizeNetInvalidCCNameError,\n E_WC_18: DaffAuthorizeNetInvalidClientKeyError,\n E_WC_19: DaffAuthorizeNetInvalidLoginIdError,\n E_WC_21: DaffAuthorizeNetAuthFailedError,\n E_WC_23: DaffAuthorizeNetInputMissingError,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAEa,2BAA2B,GAAG,IAAI,cAAc,CAAyB,6BAA6B;;MCGtG,sBAAsB,GAAG,IAAI,cAAc,CAA0B,wBAAwB;;MCH7F,yBAAyB,GAAG,IAAI,cAAc,CAAS,2BAA2B;;ACF/F;;;AAGG;AACS,IAAA,iCAgBX;AAhBD,CAAA,UAAY,gCAAgC,EAAA;AAC1C,IAAA,gCAAA,CAAA,kBAAA,CAAA,GAAA,qCAAwD,CAAA;AACxD,IAAA,gCAAA,CAAA,kBAAA,CAAA,GAAA,qCAAwD,CAAA;AACxD,IAAA,gCAAA,CAAA,aAAA,CAAA,GAAA,gCAA8C,CAAA;AAC9C,IAAA,gCAAA,CAAA,eAAA,CAAA,GAAA,kCAAkD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,OAAO,EAAE,oCAAoC;AAC7C,IAAA,OAAO,EAAE,iCAAiC;AAC1C,IAAA,OAAO,EAAE,sCAAsC;AAC/C,IAAA,OAAO,EAAE,kCAAkC;AAC3C,IAAA,OAAO,EAAE,qCAAqC;AAC9C,IAAA,OAAO,EAAE,mCAAmC;AAC5C,IAAA,OAAO,EAAE,+BAA+B;AACxC,IAAA,OAAO,EAAE,iCAAiC;;;ACnC5C;;AAEG;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, NgModule } from '@angular/core';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
import { DaffAuthorizeNetFacade } from '@daffodil/authorizenet/state';
|
|
5
|
+
|
|
6
|
+
class MockDaffAuthorizeNetFacade {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.isAcceptJsLoaded$ = new BehaviorSubject(false);
|
|
9
|
+
this.loading$ = new BehaviorSubject(false);
|
|
10
|
+
this.paymentError$ = new BehaviorSubject(null);
|
|
11
|
+
this.acceptJsLoadError$ = new BehaviorSubject(null);
|
|
12
|
+
}
|
|
13
|
+
dispatch(action) { }
|
|
14
|
+
;
|
|
15
|
+
}
|
|
16
|
+
/** @nocollapse */ /** @nocollapse */ MockDaffAuthorizeNetFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffAuthorizeNetFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
17
|
+
/** @nocollapse */ /** @nocollapse */ MockDaffAuthorizeNetFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffAuthorizeNetFacade, providedIn: 'root' });
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffAuthorizeNetFacade, decorators: [{
|
|
19
|
+
type: Injectable,
|
|
20
|
+
args: [{ providedIn: 'root' }]
|
|
21
|
+
}] });
|
|
22
|
+
|
|
23
|
+
class DaffAuthorizeNetTestingModule {
|
|
24
|
+
}
|
|
25
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
26
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetTestingModule });
|
|
27
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetTestingModule, providers: [
|
|
28
|
+
{ provide: DaffAuthorizeNetFacade, useExisting: MockDaffAuthorizeNetFacade },
|
|
29
|
+
] });
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetTestingModule, decorators: [{
|
|
31
|
+
type: NgModule,
|
|
32
|
+
args: [{
|
|
33
|
+
providers: [
|
|
34
|
+
{ provide: DaffAuthorizeNetFacade, useExisting: MockDaffAuthorizeNetFacade },
|
|
35
|
+
],
|
|
36
|
+
}]
|
|
37
|
+
}] });
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Generated bundle index. Do not edit.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
export { DaffAuthorizeNetTestingModule, MockDaffAuthorizeNetFacade };
|
|
44
|
+
//# sourceMappingURL=daffodil-authorizenet-state-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daffodil-authorizenet-state-testing.mjs","sources":["../../../libs/authorizenet/state/testing/src/mock-authorize-net-facade.ts","../../../libs/authorizenet/state/testing/src/authorize-net-testing.module.ts","../../../libs/authorizenet/state/testing/src/daffodil-authorizenet-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffAuthorizeNetFacadeInterface } from '@daffodil/authorizenet/state';\nimport { DaffStateError } from '@daffodil/core/state';\n\n@Injectable({ providedIn: 'root' })\nexport class MockDaffAuthorizeNetFacade implements DaffAuthorizeNetFacadeInterface {\n isAcceptJsLoaded$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n loading$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n paymentError$: BehaviorSubject<DaffStateError> = new BehaviorSubject(null);\n acceptJsLoadError$: BehaviorSubject<DaffStateError> = new BehaviorSubject(null);\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffAuthorizeNetFacade } from '@daffodil/authorizenet/state';\n\nimport { MockDaffAuthorizeNetFacade } from './mock-authorize-net-facade';\n\n@NgModule({\n providers: [\n { provide: DaffAuthorizeNetFacade, useExisting: MockDaffAuthorizeNetFacade },\n ],\n})\nexport class DaffAuthorizeNetTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAQa,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;QAEE,IAAA,CAAA,iBAAiB,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;QACzE,IAAA,CAAA,QAAQ,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;QAChE,IAAA,CAAA,aAAa,GAAoC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC3E,IAAA,CAAA,kBAAkB,GAAoC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAGjF;IADC,QAAQ,CAAC,MAAc,EAAA,GAAI;;;6JANhB,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,sCAAA,0BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cADb,MAAM,EAAA,CAAA,CAAA;2FACnB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;MCIrB,6BAA6B,CAAA;;gKAA7B,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;iKAA7B,6BAA6B,EAAA,CAAA,CAAA;AAA7B,sCAAA,6BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,EAJ7B,SAAA,EAAA;AACT,QAAA,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,0BAA0B,EAAE;AAC7E,KAAA,EAAA,CAAA,CAAA;2FAEU,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBALzC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,0BAA0B,EAAE;AAC7E,qBAAA;iBACF,CAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import * as i1 from '@ngrx/store';
|
|
2
|
+
import { createFeatureSelector, createSelector, select, StoreModule } from '@ngrx/store';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Injectable, Inject, NgModule } from '@angular/core';
|
|
5
|
+
import * as i1$1 from '@ngrx/effects';
|
|
6
|
+
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
7
|
+
import { of } from 'rxjs';
|
|
6
8
|
import { switchMap, map, catchError, mapTo, tap } from 'rxjs/operators';
|
|
7
|
-
import
|
|
9
|
+
import * as i2 from '@daffodil/authorizenet';
|
|
10
|
+
import { DAFF_AUTHORIZENET_ERROR_MATCHER } from '@daffodil/authorizenet';
|
|
8
11
|
import { DaffAuthorizeNetDriver, DaffAuthorizeNetPaymentId } from '@daffodil/authorizenet/driver';
|
|
9
12
|
import { DaffCartPaymentUpdateWithBilling, DaffCartPaymentActionTypes } from '@daffodil/cart/state';
|
|
10
13
|
import { backoff } from '@daffodil/core';
|
|
@@ -139,14 +142,12 @@ const createAuthorizeNetSelectors = () => {
|
|
|
139
142
|
selectIsAcceptJsLoaded,
|
|
140
143
|
};
|
|
141
144
|
};
|
|
142
|
-
const
|
|
143
|
-
const ɵ1 = () => {
|
|
145
|
+
const daffAuthorizeNetSelectors = (() => {
|
|
144
146
|
let cache;
|
|
145
147
|
return () => cache = cache
|
|
146
148
|
? cache
|
|
147
149
|
: createAuthorizeNetSelectors();
|
|
148
|
-
};
|
|
149
|
-
const daffAuthorizeNetSelectors = (ɵ1)();
|
|
150
|
+
})();
|
|
150
151
|
|
|
151
152
|
class DaffAuthorizeNetFacade {
|
|
152
153
|
constructor(store) {
|
|
@@ -161,16 +162,14 @@ class DaffAuthorizeNetFacade {
|
|
|
161
162
|
this.store.dispatch(action);
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
|
-
/** @nocollapse */ DaffAuthorizeNetFacade.ɵ
|
|
165
|
-
DaffAuthorizeNetFacade
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
{ type: Store }
|
|
173
|
-
];
|
|
165
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
166
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetFacade, providedIn: 'root' });
|
|
167
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetFacade, decorators: [{
|
|
168
|
+
type: Injectable,
|
|
169
|
+
args: [{
|
|
170
|
+
providedIn: 'root',
|
|
171
|
+
}]
|
|
172
|
+
}], ctorParameters: function () { return [{ type: i1.Store }]; } });
|
|
174
173
|
|
|
175
174
|
class DaffAuthorizeNetEffects {
|
|
176
175
|
constructor(actions$, driver, authorizeNetPaymentId, errorMatcher, acceptJsLoadingService) {
|
|
@@ -179,57 +178,53 @@ class DaffAuthorizeNetEffects {
|
|
|
179
178
|
this.authorizeNetPaymentId = authorizeNetPaymentId;
|
|
180
179
|
this.errorMatcher = errorMatcher;
|
|
181
180
|
this.acceptJsLoadingService = acceptJsLoadingService;
|
|
182
|
-
this.updatePayment$ = this.actions$.pipe(ofType(DaffAuthorizeNetActionTypes.UpdatePaymentAction), switchMap((action) => this.driver.generateToken(action.tokenRequest).pipe(map(resp => new DaffCartPaymentUpdateWithBilling({
|
|
181
|
+
this.updatePayment$ = createEffect(() => this.actions$.pipe(ofType(DaffAuthorizeNetActionTypes.UpdatePaymentAction), switchMap((action) => this.driver.generateToken(action.tokenRequest).pipe(map(resp => new DaffCartPaymentUpdateWithBilling({
|
|
183
182
|
method: this.authorizeNetPaymentId,
|
|
184
183
|
payment_info: resp,
|
|
185
|
-
}, action.address)), catchError((error) => of(new DaffAuthorizeNetUpdatePaymentFailure(this.errorMatcher(error)))))));
|
|
186
|
-
this.updatePaymentSuccessSubstream$ = this.actions$.pipe(substream([DaffAuthorizeNetActionTypes.UpdatePaymentAction, DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction], DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction), mapTo(new DaffAuthorizeNetUpdatePaymentSuccess()));
|
|
187
|
-
this.updatePaymentFailureSubstream$ = this.actions$.pipe(substream([DaffAuthorizeNetActionTypes.UpdatePaymentAction, DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction], DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction), map(([updatePaymentAction, updatePaymentFailureAction]) => new DaffAuthorizeNetUpdatePaymentFailure(this.errorMatcher(updatePaymentFailureAction.payload))));
|
|
188
|
-
this.loadAcceptJs$ = (maxTries = 10, ms = 10) => this.actions$.pipe(ofType(DaffAuthorizeNetActionTypes.LoadAcceptJsAction), tap((action) => this.acceptJsLoadingService.load()), switchMap(() => of(null).pipe(map(() => this.acceptJsLoadingService.getAccept()), backoff(maxTries, ms), mapTo(new DaffLoadAcceptJsSuccess()), catchError((error) => of(new DaffLoadAcceptJsFailure(this.errorMatcher(error)))))));
|
|
184
|
+
}, action.address)), catchError((error) => of(new DaffAuthorizeNetUpdatePaymentFailure(this.errorMatcher(error))))))));
|
|
185
|
+
this.updatePaymentSuccessSubstream$ = createEffect(() => this.actions$.pipe(substream([DaffAuthorizeNetActionTypes.UpdatePaymentAction, DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction], DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction), mapTo(new DaffAuthorizeNetUpdatePaymentSuccess())));
|
|
186
|
+
this.updatePaymentFailureSubstream$ = createEffect(() => this.actions$.pipe(substream([DaffAuthorizeNetActionTypes.UpdatePaymentAction, DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction], DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction), map(([updatePaymentAction, updatePaymentFailureAction]) => new DaffAuthorizeNetUpdatePaymentFailure(this.errorMatcher(updatePaymentFailureAction.payload)))));
|
|
187
|
+
this.loadAcceptJs$ = createEffect(() => (maxTries = 10, ms = 10) => this.actions$.pipe(ofType(DaffAuthorizeNetActionTypes.LoadAcceptJsAction), tap((action) => this.acceptJsLoadingService.load()), switchMap(() => of(null).pipe(map(() => this.acceptJsLoadingService.getAccept()), backoff(maxTries, ms), mapTo(new DaffLoadAcceptJsSuccess()), catchError((error) => of(new DaffLoadAcceptJsFailure(this.errorMatcher(error))))))));
|
|
189
188
|
}
|
|
190
189
|
}
|
|
191
|
-
DaffAuthorizeNetEffects
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
]
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
]
|
|
206
|
-
|
|
207
|
-
Effect(),
|
|
208
|
-
__metadata("design:type", Observable)
|
|
209
|
-
], DaffAuthorizeNetEffects.prototype, "updatePaymentSuccessSubstream$", void 0);
|
|
210
|
-
__decorate([
|
|
211
|
-
Effect(),
|
|
212
|
-
__metadata("design:type", Observable)
|
|
213
|
-
], DaffAuthorizeNetEffects.prototype, "updatePaymentFailureSubstream$", void 0);
|
|
214
|
-
__decorate([
|
|
215
|
-
Effect(),
|
|
216
|
-
__metadata("design:type", Object)
|
|
217
|
-
], DaffAuthorizeNetEffects.prototype, "loadAcceptJs$", void 0);
|
|
190
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetEffects, deps: [{ token: i1$1.Actions }, { token: DaffAuthorizeNetDriver }, { token: DaffAuthorizeNetPaymentId }, { token: DAFF_AUTHORIZENET_ERROR_MATCHER }, { token: i2.DaffAcceptJsLoadingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
191
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetEffects });
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetEffects, decorators: [{
|
|
193
|
+
type: Injectable
|
|
194
|
+
}], ctorParameters: function () {
|
|
195
|
+
return [{ type: i1$1.Actions }, { type: undefined, decorators: [{
|
|
196
|
+
type: Inject,
|
|
197
|
+
args: [DaffAuthorizeNetDriver]
|
|
198
|
+
}] }, { type: undefined, decorators: [{
|
|
199
|
+
type: Inject,
|
|
200
|
+
args: [DaffAuthorizeNetPaymentId]
|
|
201
|
+
}] }, { type: undefined, decorators: [{
|
|
202
|
+
type: Inject,
|
|
203
|
+
args: [DAFF_AUTHORIZENET_ERROR_MATCHER]
|
|
204
|
+
}] }, { type: i2.DaffAcceptJsLoadingService }];
|
|
205
|
+
} });
|
|
218
206
|
|
|
219
207
|
class DaffAuthorizeNetStateModule {
|
|
220
208
|
}
|
|
221
|
-
DaffAuthorizeNetStateModule
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
209
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
210
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetStateModule, imports: [i1.StoreFeatureModule, i1$1.EffectsFeatureModule] });
|
|
211
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetStateModule, imports: [[
|
|
212
|
+
StoreModule.forFeature(DAFF_AUTHORIZENET_STORE_FEATURE_KEY, daffAuthorizeNetReducers),
|
|
213
|
+
EffectsModule.forFeature([DaffAuthorizeNetEffects]),
|
|
214
|
+
]] });
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetStateModule, decorators: [{
|
|
216
|
+
type: NgModule,
|
|
217
|
+
args: [{
|
|
218
|
+
imports: [
|
|
219
|
+
StoreModule.forFeature(DAFF_AUTHORIZENET_STORE_FEATURE_KEY, daffAuthorizeNetReducers),
|
|
220
|
+
EffectsModule.forFeature([DaffAuthorizeNetEffects]),
|
|
221
|
+
],
|
|
222
|
+
}]
|
|
223
|
+
}] });
|
|
229
224
|
|
|
230
225
|
/**
|
|
231
226
|
* Generated bundle index. Do not edit.
|
|
232
227
|
*/
|
|
233
228
|
|
|
234
|
-
export { DAFF_AUTHORIZENET_STORE_FEATURE_KEY, DaffAuthorizeNetActionTypes, DaffAuthorizeNetFacade, DaffAuthorizeNetStateModule, DaffAuthorizeNetUpdatePayment, DaffAuthorizeNetUpdatePaymentFailure, DaffAuthorizeNetUpdatePaymentSuccess, DaffLoadAcceptJs, DaffLoadAcceptJsFailure, DaffLoadAcceptJsSuccess, daffAuthorizeNetReducer, daffAuthorizeNetReducers, daffAuthorizeNetSelectors
|
|
235
|
-
//# sourceMappingURL=daffodil-authorizenet-state.
|
|
229
|
+
export { DAFF_AUTHORIZENET_STORE_FEATURE_KEY, DaffAuthorizeNetActionTypes, DaffAuthorizeNetFacade, DaffAuthorizeNetStateModule, DaffAuthorizeNetUpdatePayment, DaffAuthorizeNetUpdatePaymentFailure, DaffAuthorizeNetUpdatePaymentSuccess, DaffLoadAcceptJs, DaffLoadAcceptJsFailure, DaffLoadAcceptJsSuccess, daffAuthorizeNetReducer, daffAuthorizeNetReducers, daffAuthorizeNetSelectors };
|
|
230
|
+
//# sourceMappingURL=daffodil-authorizenet-state.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daffodil-authorizenet-state.mjs","sources":["../../../libs/authorizenet/state/src/actions/authorizenet.actions.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/selectors/authorize-net.selector.ts","../../../libs/authorizenet/state/src/facades/authorize-net.facade.ts","../../../libs/authorizenet/state/src/effects/authorize-net.effects.ts","../../../libs/authorizenet/state/src/authorize-net-state.module.ts","../../../libs/authorizenet/state/src/daffodil-authorizenet-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport { DaffAuthorizeNetTokenRequest } from '@daffodil/authorizenet';\nimport { DaffCartAddress } from '@daffodil/cart';\nimport { DaffStateError } from '@daffodil/core/state';\n\nexport enum DaffAuthorizeNetActionTypes {\n UpdatePaymentAction = '[Daff-Authorize-Net] Update Payment',\n UpdatePaymentSuccessAction = '[Daff-Authorize-Net] Update Payment Success',\n\tUpdatePaymentFailureAction = '[Daff-Authorize-Net] Update Payment Failure',\n\tLoadAcceptJsAction = '[Daff-Authorize-Net] Load Accept Js',\n\tLoadAcceptJsSuccessAction = '[Daff-Authorize-Net] Load Accept Js Success',\n\tLoadAcceptJsFailureAction = '[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\tT extends DaffAuthorizeNetTokenRequest = DaffAuthorizeNetTokenRequest,\n\tV extends DaffCartAddress = DaffCartAddress\n> implements Action {\n\treadonly type = DaffAuthorizeNetActionTypes.UpdatePaymentAction;\n\n\tconstructor(public tokenRequest: T, public address: 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\treadonly type = DaffAuthorizeNetActionTypes.UpdatePaymentFailureAction;\n\n\tconstructor(public payload: DaffStateError) { }\n}\n\nexport class DaffLoadAcceptJs implements Action {\n\treadonly type = DaffAuthorizeNetActionTypes.LoadAcceptJsAction;\n}\n\n/**\n * Indicates that the AcceptJs library has loaded successfully.\n */\nexport class DaffLoadAcceptJsSuccess implements Action {\n\treadonly type = DaffAuthorizeNetActionTypes.LoadAcceptJsSuccessAction;\n}\n\n/**\n * Indicates that the AcceptJs library has failed to load\n */\nexport class DaffLoadAcceptJsFailure implements Action {\n\treadonly type = DaffAuthorizeNetActionTypes.LoadAcceptJsFailureAction;\n\n\tconstructor(public payload: DaffStateError) {};\n}\n\nexport type DaffAuthorizeNetActions<\n\tT extends DaffAuthorizeNetTokenRequest = DaffAuthorizeNetTokenRequest\n> =\n\t| DaffAuthorizeNetUpdatePayment<T>\n\t| DaffAuthorizeNetUpdatePaymentSuccess\n\t| DaffAuthorizeNetUpdatePaymentFailure\n\t| DaffLoadAcceptJsSuccess\n\t| DaffLoadAcceptJsFailure\n\t| DaffLoadAcceptJs;\n","import { DaffAuthorizeNetTokenRequest } from '@daffodil/authorizenet';\n\nimport {\n DaffAuthorizeNetActions,\n DaffAuthorizeNetActionTypes,\n} from '../../actions/authorizenet.actions';\nimport { DaffAuthorizeNetReducerState } from './authorize-net-reducer.interface';\n\nexport const initialState: DaffAuthorizeNetReducerState = {\n isAcceptLoaded: false,\n paymentError: null,\n acceptJsLoadError: null,\n loading: false,\n};\n\nexport function daffAuthorizeNetReducer <T extends DaffAuthorizeNetTokenRequest>(\n state: DaffAuthorizeNetReducerState = initialState,\n action: DaffAuthorizeNetActions<T>,\n): DaffAuthorizeNetReducerState {\n switch (action.type) {\n case DaffAuthorizeNetActionTypes.UpdatePaymentAction:\n return {\n ...state,\n loading: true,\n };\n case DaffAuthorizeNetActionTypes.UpdatePaymentSuccessAction:\n return {\n ...state,\n loading: false,\n paymentError: null,\n };\n case DaffAuthorizeNetActionTypes.UpdatePaymentFailureAction:\n return {\n ...state,\n loading: false,\n paymentError: action.payload,\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 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\tselectAuthorizeNetFeatureState: MemoizedSelector<DaffAuthorizeNetStateRootSlice, DaffAuthorizeNetReducersState>;\n\tselectAuthorizeNetState: MemoizedSelector<DaffAuthorizeNetStateRootSlice, DaffAuthorizeNetReducerState> ;\n\tselectLoading: MemoizedSelector<DaffAuthorizeNetStateRootSlice, boolean>;\n\tselectPaymentError: MemoizedSelector<DaffAuthorizeNetStateRootSlice, DaffStateError>;\n\tselectAcceptJsLoadError: MemoizedSelector<DaffAuthorizeNetStateRootSlice, DaffStateError>;\n\tselectIsAcceptJsLoaded: 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 { 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 { DaffAuthorizeNetStateRootSlice } from '../reducers/authorize-net-reducers.interface';\nimport { daffAuthorizeNetSelectors } from '../selectors/authorize-net.selector';\nimport { DaffAuthorizeNetFacadeInterface } from './authorize-net-facade.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthorizeNetFacade implements DaffAuthorizeNetFacadeInterface {\n\n\tisAcceptJsLoaded$: 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 Observable,\n of,\n} from 'rxjs';\nimport {\n switchMap,\n catchError,\n map,\n tap,\n mapTo,\n} from 'rxjs/operators';\n\nimport {\n DaffAcceptJsLoadingService,\n DaffAuthorizeNetTokenRequest,\n DAFF_AUTHORIZENET_ERROR_MATCHER,\n} from '@daffodil/authorizenet';\nimport {\n DaffAuthorizeNetDriver,\n DaffAuthorizeNetService,\n DaffAuthorizeNetPaymentId,\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';\n\n@Injectable()\nexport class DaffAuthorizeNetEffects<T extends DaffAuthorizeNetTokenRequest = DaffAuthorizeNetTokenRequest> {\n\n constructor(\n private actions$: Actions,\n\t\t@Inject(DaffAuthorizeNetDriver) private driver: DaffAuthorizeNetService<T>,\n\t\t@Inject(DaffAuthorizeNetPaymentId) private authorizeNetPaymentId: string,\n\t\t@Inject(DAFF_AUTHORIZENET_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n\t\tprivate 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\tupdatePaymentSuccessSubstream$: Observable<any> = createEffect(() => this.actions$.pipe(\n\t substream(\n\t [DaffAuthorizeNetActionTypes.UpdatePaymentAction, DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction],\n\t DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction,\n\t ),\n\t mapTo(new DaffAuthorizeNetUpdatePaymentSuccess()),\n\t));\n\n\n\tupdatePaymentFailureSubstream$: 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)),\n\t ),\n\t));\n\n\n loadAcceptJs$ = createEffect(() => (maxTries = 10, ms = 10): Observable<any> => this.actions$.pipe(\n ofType(DaffAuthorizeNetActionTypes.LoadAcceptJsAction),\n tap((action: DaffLoadAcceptJs) => this.acceptJsLoadingService.load()),\n switchMap(() => of(null).pipe(\n map(() => this.acceptJsLoadingService.getAccept()),\n backoff(maxTries, ms),\n mapTo(new DaffLoadAcceptJsSuccess()),\n catchError((error: DaffError) => of(new DaffLoadAcceptJsFailure(this.errorMatcher(error)))),\n )),\n ));\n}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DaffAuthorizeNetEffects } from './effects/authorize-net.effects';\nimport { daffAuthorizeNetReducers } from './reducers/authorize-net.reducers';\nimport { DAFF_AUTHORIZENET_STORE_FEATURE_KEY } from './reducers/authorizenet-store-feature-key';\n\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_AUTHORIZENET_STORE_FEATURE_KEY, daffAuthorizeNetReducers),\n EffectsModule.forFeature([DaffAuthorizeNetEffects]),\n ],\n})\nexport class DaffAuthorizeNetStateModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;AAMY,IAAA,4BAOX;AAPD,CAAA,UAAY,2BAA2B,EAAA;AACrC,IAAA,2BAAA,CAAA,qBAAA,CAAA,GAAA,qCAA2D,CAAA;AAC3D,IAAA,2BAAA,CAAA,4BAAA,CAAA,GAAA,6CAA0E,CAAA;AAC3E,IAAA,2BAAA,CAAA,4BAAA,CAAA,GAAA,6CAA0E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;AACpD,qBAAA;iBACF,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, Injectable, Inject } from '@angular/core';
|
|
4
|
+
import { daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A token that represents the version to use for Accept.JS calls.
|
|
8
|
+
* A "true" value configures the package to use the production AcceptJs endpoint,
|
|
9
|
+
* and a "false" value configures it to use the Sandbox AcceptJs endpoint.
|
|
10
|
+
* By default, we assume you're using the sandbox (false).
|
|
11
|
+
*/
|
|
12
|
+
const DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION = new InjectionToken('DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION', {
|
|
13
|
+
providedIn: 'root',
|
|
14
|
+
factory: () => false,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const ACCEPT_JS_SANDBOX_URL = 'https://jstest.authorize.net/v1/Accept.js';
|
|
18
|
+
const ACCEPT_JS_PRODUCTION_URL = 'https://js.authorize.net/v1/Accept.js';
|
|
19
|
+
class DaffAcceptJsLoadingService {
|
|
20
|
+
constructor(production, doc) {
|
|
21
|
+
this.production = production;
|
|
22
|
+
this.doc = doc;
|
|
23
|
+
}
|
|
24
|
+
load() {
|
|
25
|
+
if (typeof Accept === 'undefined') {
|
|
26
|
+
const acceptJsScript = this.doc.createElement('script');
|
|
27
|
+
acceptJsScript.async = true;
|
|
28
|
+
acceptJsScript.setAttribute('type', 'text/javascript');
|
|
29
|
+
acceptJsScript.setAttribute('src', this.production ? ACCEPT_JS_PRODUCTION_URL : ACCEPT_JS_SANDBOX_URL);
|
|
30
|
+
acceptJsScript.setAttribute('charset', 'utf-8');
|
|
31
|
+
this.doc.body.appendChild(acceptJsScript);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
getAccept() {
|
|
35
|
+
return Accept;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** @nocollapse */ /** @nocollapse */ DaffAcceptJsLoadingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAcceptJsLoadingService, deps: [{ token: DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
39
|
+
/** @nocollapse */ /** @nocollapse */ DaffAcceptJsLoadingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAcceptJsLoadingService, providedIn: 'root' });
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAcceptJsLoadingService, decorators: [{
|
|
41
|
+
type: Injectable,
|
|
42
|
+
args: [{
|
|
43
|
+
providedIn: 'root',
|
|
44
|
+
}]
|
|
45
|
+
}], ctorParameters: function () {
|
|
46
|
+
return [{ type: undefined, decorators: [{
|
|
47
|
+
type: Inject,
|
|
48
|
+
args: [DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION]
|
|
49
|
+
}] }, { type: undefined, decorators: [{
|
|
50
|
+
type: Inject,
|
|
51
|
+
args: [DOCUMENT]
|
|
52
|
+
}] }];
|
|
53
|
+
} });
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
57
|
+
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
58
|
+
*/
|
|
59
|
+
const DAFF_AUTHORIZENET_ERROR_MATCHER = new InjectionToken('DAFF_AUTHORIZENET_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Generated bundle index. Do not edit.
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
export { DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION, DAFF_AUTHORIZENET_ERROR_MATCHER, DaffAcceptJsLoadingService };
|
|
66
|
+
//# sourceMappingURL=daffodil-authorizenet.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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/injection-tokens/error-matcher.token.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<\n\tboolean\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 { AcceptType } from '../models/acceptJs/accept';\nimport { DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION } from './accept-js-production.token';\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\t\t@Inject(DAFF_AUTHORIZENET_ACCEPT_JS_PRODUCTION) private production: boolean,\n\t\t@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","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","/**\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,WACwD,CAAA,UAAmB,EACjD,GAAG,EAAA;AAD2B,QAAA,IAAU,CAAA,UAAA,GAAV,UAAU,CAAS;AACjD,QAAA,IAAG,CAAA,GAAA,GAAH,GAAG,CAAA;KACzB;IAEJ,IAAI,GAAA;AACF,QAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AACxD,YAAA,cAAc,CAAC,KAAK,GAAG,IAAI,CAAC;AAC5B,YAAA,cAAc,CAAC,YAAY,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AACvD,YAAA,cAAc,CAAC,YAAY,CACzB,KAAK,EACL,IAAI,CAAC,UAAU,GAAG,wBAAwB,GAAG,qBAAqB,CACnE,CAAC;AACF,YAAA,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;AAC3C,SAAA;KACF;IAED,SAAS,GAAA;AACP,QAAA,OAAO,MAAM,CAAC;KACf;;6JAtBU,0BAA0B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAE7B,sCAAsC,EAAA,EAAA,EAAA,KAAA,EACtC,QAAQ,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAHL,sCAAA,0BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cAFzB,MAAM,EAAA,CAAA,CAAA;2FAEP,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAHtC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;8BAGE,MAAM;+BAAC,sCAAsC,CAAA;;8BAC7C,MAAM;+BAAC,QAAQ,CAAA;;;;AChBlB;;;AAGG;AACU,MAAA,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EACjC,EAAE,OAAO,EAAE,MAAM,8BAA8B,EAAE;;ACVnD;;AAEG;;;;"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Injectable, NgModule } from '@angular/core';
|
|
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 */ /** @nocollapse */ DaffInMemoryAuthorizeNetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryAuthorizeNetService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20
|
+
/** @nocollapse */ /** @nocollapse */ DaffInMemoryAuthorizeNetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryAuthorizeNetService, providedIn: 'root' });
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", 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 */ /** @nocollapse */ DaffAuthorizeNetInMemoryDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
46
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetInMemoryDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetInMemoryDriverModule, imports: [CommonModule] });
|
|
47
|
+
/** @nocollapse */ /** @nocollapse */ DaffAuthorizeNetInMemoryDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetInMemoryDriverModule, imports: [[
|
|
48
|
+
CommonModule,
|
|
49
|
+
]] });
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAuthorizeNetInMemoryDriverModule, decorators: [{
|
|
51
|
+
type: NgModule,
|
|
52
|
+
args: [{
|
|
53
|
+
imports: [
|
|
54
|
+
CommonModule,
|
|
55
|
+
],
|
|
56
|
+
}]
|
|
57
|
+
}] });
|
|
58
|
+
|
|
59
|
+
class DaffInMemoryBackendAuthorizenetService {
|
|
60
|
+
createDb() {
|
|
61
|
+
return {};
|
|
62
|
+
}
|
|
63
|
+
get(reqInfo) {
|
|
64
|
+
return reqInfo.utils.createResponse$(() => ({
|
|
65
|
+
body: {
|
|
66
|
+
code: DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID,
|
|
67
|
+
},
|
|
68
|
+
status: STATUS.OK,
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** @nocollapse */ /** @nocollapse */ DaffInMemoryBackendAuthorizenetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryBackendAuthorizenetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
73
|
+
/** @nocollapse */ /** @nocollapse */ DaffInMemoryBackendAuthorizenetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryBackendAuthorizenetService, providedIn: 'root' });
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryBackendAuthorizenetService, decorators: [{
|
|
75
|
+
type: Injectable,
|
|
76
|
+
args: [{
|
|
77
|
+
providedIn: 'root',
|
|
78
|
+
}]
|
|
79
|
+
}] });
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Generated bundle index. Do not edit.
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
export { DAFF_IN_MEMORY_AUTHORIZE_NET_PAYMENT_ID, DaffAuthorizeNetInMemoryDriverModule, DaffInMemoryAuthorizeNetService, DaffInMemoryBackendAuthorizenetService };
|
|
86
|
+
//# sourceMappingURL=daffodil-authorizenet-driver-in-memory.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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;;kKAPU,+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,sCAAA,+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,EAAE,+BAA+B;AAC7C,iBAAA;AACD,gB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