@daffodil/payment 0.94.1 → 0.95.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,119 +1,152 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, NgModule } from '@angular/core';
3
- import * as i2 from 'angular-in-memory-web-api';
4
- import { STATUS } from 'angular-in-memory-web-api';
5
- import * as i1 from '@daffodil/payment/testing';
6
- import { DaffPaymentTestingModule } from '@daffodil/payment/testing';
7
- import * as i1$1 from '@angular/common/http';
8
- import { DaffInMemoryDriverBase, provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';
9
- import { CommonModule } from '@angular/common';
10
- import { provideDaffPaymentDriver } from '@daffodil/payment/driver';
1
+ import * as i0 from "@angular/core";
2
+ import { Injectable, NgModule, makeEnvironmentProviders } from "@angular/core";
3
+ import * as i2 from "angular-in-memory-web-api";
4
+ import { STATUS } from "angular-in-memory-web-api";
5
+ import * as i1$1 from "@daffodil/payment/testing";
6
+ import { provideDaffPaymentTesting } from "@daffodil/payment/testing";
7
+ import * as i1 from "@angular/common/http";
8
+ import { DaffInMemoryDriverBase, provideDaffInMemoryBackends } from "@daffodil/driver/in-memory";
9
+ import { CommonModule } from "@angular/common";
10
+ import { provideDaffPaymentDriver } from "@daffodil/payment/driver";
11
+ const DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME = "payment";
12
+ var DaffPaymentInMemoryBackendService = class DaffPaymentInMemoryBackendService {
13
+ constructor(factory) {
14
+ this.factory = factory;
15
+ this.collectionName = DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME;
16
+ }
17
+ parseRequestUrl(url, utils) {
18
+ return utils.parseRequestUrl(url);
19
+ }
20
+ createDb() {
21
+ return {};
22
+ }
23
+ get(reqInfo) {
24
+ return reqInfo.utils.createResponse$(() => ({
25
+ status: STATUS.OK,
26
+ body: this.factory.create()
27
+ }));
28
+ }
29
+ static {
30
+ this.ɵfac = i0.ɵɵngDeclareFactory({
31
+ minVersion: "12.0.0",
32
+ version: "22.2.4",
33
+ ngImport: i0,
34
+ type: DaffPaymentInMemoryBackendService,
35
+ deps: [{ token: i1$1.DaffPaymentResponseKindFactory }],
36
+ target: i0.ɵɵFactoryTarget.Injectable
37
+ });
38
+ }
39
+ static {
40
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
41
+ minVersion: "12.0.0",
42
+ version: "22.2.4",
43
+ ngImport: i0,
44
+ type: DaffPaymentInMemoryBackendService,
45
+ providedIn: "root"
46
+ });
47
+ }
48
+ };
49
+ i0.ɵɵngDeclareClassMetadata({
50
+ minVersion: "12.0.0",
51
+ version: "22.2.4",
52
+ ngImport: i0,
53
+ type: DaffPaymentInMemoryBackendService,
54
+ decorators: [{
55
+ type: Injectable,
56
+ args: [{ providedIn: "root" }]
57
+ }],
58
+ ctorParameters: () => [{ type: i1$1.DaffPaymentResponseKindFactory }]
59
+ });
60
+ var DaffPaymentInMemoryDriver = class DaffPaymentInMemoryDriver extends DaffInMemoryDriverBase {
61
+ constructor(http, config) {
62
+ super(config, DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME);
63
+ this.http = http;
64
+ }
65
+ generateToken(request) {
66
+ return this.http.get(this.url);
67
+ }
68
+ static {
69
+ this.ɵfac = i0.ɵɵngDeclareFactory({
70
+ minVersion: "12.0.0",
71
+ version: "22.2.4",
72
+ ngImport: i0,
73
+ type: DaffPaymentInMemoryDriver,
74
+ deps: [{ token: i1.HttpClient }, { token: i2.InMemoryBackendConfig }],
75
+ target: i0.ɵɵFactoryTarget.Injectable
76
+ });
77
+ }
78
+ static {
79
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
80
+ minVersion: "12.0.0",
81
+ version: "22.2.4",
82
+ ngImport: i0,
83
+ type: DaffPaymentInMemoryDriver,
84
+ providedIn: "root"
85
+ });
86
+ }
87
+ };
88
+ i0.ɵɵngDeclareClassMetadata({
89
+ minVersion: "12.0.0",
90
+ version: "22.2.4",
91
+ ngImport: i0,
92
+ type: DaffPaymentInMemoryDriver,
93
+ decorators: [{
94
+ type: Injectable,
95
+ args: [{ providedIn: "root" }]
96
+ }],
97
+ ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.InMemoryBackendConfig }]
98
+ });
99
+ const provideDaffPaymentInMemoryDriver = () => makeEnvironmentProviders([
100
+ provideDaffPaymentTesting(),
101
+ provideDaffPaymentDriver(DaffPaymentInMemoryDriver),
102
+ provideDaffInMemoryBackends(DaffPaymentInMemoryBackendService)
103
+ ]);
104
+ var DaffPaymentInMemoryDriverModule = class DaffPaymentInMemoryDriverModule {
105
+ static forRoot() {
106
+ return {
107
+ ngModule: DaffPaymentInMemoryDriverModule,
108
+ providers: [provideDaffPaymentInMemoryDriver()]
109
+ };
110
+ }
111
+ static {
112
+ this.ɵfac = i0.ɵɵngDeclareFactory({
113
+ minVersion: "12.0.0",
114
+ version: "22.2.4",
115
+ ngImport: i0,
116
+ type: DaffPaymentInMemoryDriverModule,
117
+ deps: [],
118
+ target: i0.ɵɵFactoryTarget.NgModule
119
+ });
120
+ }
121
+ static {
122
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
123
+ minVersion: "14.0.0",
124
+ version: "22.2.4",
125
+ ngImport: i0,
126
+ type: DaffPaymentInMemoryDriverModule,
127
+ imports: [CommonModule]
128
+ });
129
+ }
130
+ static {
131
+ this.ɵinj = i0.ɵɵngDeclareInjector({
132
+ minVersion: "12.0.0",
133
+ version: "22.2.4",
134
+ ngImport: i0,
135
+ type: DaffPaymentInMemoryDriverModule,
136
+ imports: [CommonModule]
137
+ });
138
+ }
139
+ };
140
+ i0.ɵɵngDeclareClassMetadata({
141
+ minVersion: "12.0.0",
142
+ version: "22.2.4",
143
+ ngImport: i0,
144
+ type: DaffPaymentInMemoryDriverModule,
145
+ decorators: [{
146
+ type: NgModule,
147
+ args: [{ imports: [CommonModule] }]
148
+ }]
149
+ });
150
+ export { DaffPaymentInMemoryBackendService, DaffPaymentInMemoryDriver, DaffPaymentInMemoryDriverModule, provideDaffPaymentInMemoryDriver };
11
151
 
12
- const DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME = 'payment';
13
-
14
- /**
15
- * An in-memory service that delegates payment queries to child backends
16
- * via the {@link DAFF_PAYMENT_IN_MEMORY_BACKENDS}.
17
- */
18
- class DaffPaymentInMemoryBackendService {
19
- constructor(factory) {
20
- this.factory = factory;
21
- this.collectionName = DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME;
22
- }
23
- /**
24
- * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
25
- *
26
- * @param url initial url
27
- * @param utils utility to parse url
28
- * @returns ParsedRequestUrl
29
- * @docs-private
30
- */
31
- parseRequestUrl(url, utils) {
32
- return utils.parseRequestUrl(url);
33
- }
34
- /**
35
- * @docs-private
36
- */
37
- createDb() {
38
- return {};
39
- }
40
- /**
41
- * Generates a token from a processor backend.
42
- *
43
- * @param reqInfo request object
44
- * @returns An http response object
45
- */
46
- get(reqInfo) {
47
- return reqInfo.utils.createResponse$(() => ({
48
- status: STATUS.OK,
49
- body: this.factory.create(),
50
- }));
51
- }
52
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentInMemoryBackendService, deps: [{ token: i1.DaffPaymentResponseKindFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
53
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentInMemoryBackendService, providedIn: 'root' }); }
54
- }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentInMemoryBackendService, decorators: [{
56
- type: Injectable,
57
- args: [{
58
- providedIn: 'root',
59
- }]
60
- }], ctorParameters: () => [{ type: i1.DaffPaymentResponseKindFactory }] });
61
-
62
- /**
63
- * The payment inmemory driver to mock the payment backend service.
64
- *
65
- * @inheritdoc
66
- */
67
- class DaffPaymentInMemoryDriver extends DaffInMemoryDriverBase {
68
- constructor(http, config) {
69
- super(config, DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME);
70
- this.http = http;
71
- }
72
- generateToken(request) {
73
- return this.http.get(this.url);
74
- }
75
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentInMemoryDriver, deps: [{ token: i1$1.HttpClient }, { token: i2.InMemoryBackendConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
76
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentInMemoryDriver, providedIn: 'root' }); }
77
- }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentInMemoryDriver, decorators: [{
79
- type: Injectable,
80
- args: [{
81
- providedIn: 'root',
82
- }]
83
- }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i2.InMemoryBackendConfig }] });
84
-
85
- /**
86
- * Provides the {@link DaffPaymentInMemoryDriver} as the {@link DaffPaymentDriver}.
87
- */
88
- class DaffPaymentInMemoryDriverModule {
89
- static forRoot() {
90
- return {
91
- ngModule: DaffPaymentInMemoryDriverModule,
92
- providers: [
93
- provideDaffPaymentDriver(DaffPaymentInMemoryDriver),
94
- provideDaffInMemoryBackends(DaffPaymentInMemoryBackendService),
95
- ],
96
- };
97
- }
98
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
99
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentInMemoryDriverModule, imports: [CommonModule,
100
- DaffPaymentTestingModule] }); }
101
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentInMemoryDriverModule, imports: [CommonModule,
102
- DaffPaymentTestingModule] }); }
103
- }
104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentInMemoryDriverModule, decorators: [{
105
- type: NgModule,
106
- args: [{
107
- imports: [
108
- CommonModule,
109
- DaffPaymentTestingModule,
110
- ],
111
- }]
112
- }] });
113
-
114
- /**
115
- * Generated bundle index. Do not edit.
116
- */
117
-
118
- export { DaffPaymentInMemoryBackendService, DaffPaymentInMemoryDriver, DaffPaymentInMemoryDriverModule };
119
- //# sourceMappingURL=daffodil-payment-driver-in-memory.mjs.map
152
+ //# sourceMappingURL=daffodil-payment-driver-in-memory.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-payment-driver-in-memory.mjs","sources":["../../../libs/payment/driver/in-memory/src/collection-name.const.ts","../../../libs/payment/driver/in-memory/src/backend/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment-driver.module.ts","../../../libs/payment/driver/in-memory/src/daffodil-payment-driver-in-memory.ts"],"sourcesContent":["export const DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME = 'payment';\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n RequestInfo,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\nimport { DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * An in-memory service that delegates payment queries to child backends\n * via the {@link DAFF_PAYMENT_IN_MEMORY_BACKENDS}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME;\n\n constructor(\n private factory: DaffPaymentResponseKindFactory,\n ) {}\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * @docs-private\n */\n createDb(): any {\n return {};\n }\n\n /**\n * Generates a token from a processor backend.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: RequestInfo) {\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.OK,\n body: this.factory.create(),\n }));\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\n\nimport { DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * The payment inmemory driver to mock the payment backend service.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryDriver extends DaffInMemoryDriverBase implements DaffPaymentDriverInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME);\n }\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return this.http.get<DaffPaymentResponse>(this.url);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\nimport { provideDaffPaymentDriver } from '@daffodil/payment/driver';\nimport { DaffPaymentTestingModule } from '@daffodil/payment/testing';\n\nimport { DaffPaymentInMemoryDriver } from './payment.service';\nimport { DaffPaymentInMemoryBackendService } from '../backend/payment.service';\n\n/**\n * Provides the {@link DaffPaymentInMemoryDriver} as the {@link DaffPaymentDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffPaymentTestingModule,\n ],\n})\nexport class DaffPaymentInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentInMemoryDriverModule> {\n return {\n ngModule: DaffPaymentInMemoryDriverModule,\n providers: [\n provideDaffPaymentDriver(DaffPaymentInMemoryDriver),\n provideDaffInMemoryBackends(DaffPaymentInMemoryBackendService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;AAAO,MAAM,sCAAsC,GAAG,SAAS;;ACc/D;;;AAGG;MAIU,iCAAiC,CAAA;AAG5C,IAAA,WAAA,CACU,OAAuC,EAAA;QAAvC,IAAA,CAAA,OAAO,GAAP,OAAO;QAHR,IAAA,CAAA,cAAc,GAAG,sCAAsC;IAI7D;AAEH;;;;;;;AAOG;IACH,eAAe,CAAC,GAAW,EAAE,KAA2B,EAAA;AACtD,QAAA,OAAO,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC;IACnC;AAEA;;AAEG;IACH,QAAQ,GAAA;AACN,QAAA,OAAO,EAAE;IACX;AAEA;;;;;AAKG;AACH,IAAA,GAAG,CAAC,OAAoB,EAAA;QACtB,OAAO,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO;YAC1C,MAAM,EAAE,MAAM,CAAC,EAAE;AACjB,YAAA,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;AAC5B,SAAA,CAAC,CAAC;IACL;iIArCW,iCAAiC,EAAA,IAAA,EAAA,CA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,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACRD;;AAEG;MAOU,+BAA+B,CAAA;AAC1C,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,+BAA+B;AACzC,YAAA,SAAS,EAAE;gBACT,wBAAwB,CAAC,yBAAyB,CAAC;gBACnD,2BAA2B,CAAC,iCAAiC,CAAC;AAC/D,aAAA;SACF;IACH;iIATW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA/B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,YAJxC,YAAY;YACZ,wBAAwB,CAAA,EAAA,CAAA,CAAA;AAGf,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,YAJxC,YAAY;YACZ,wBAAwB,CAAA,EAAA,CAAA,CAAA;;2FAGf,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAN3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,wBAAwB;AACzB,qBAAA;AACF,iBAAA;;;ACrBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-payment-driver-in-memory.mjs","names":["i1"],"sources":["../../../libs/payment/driver/in-memory/src/collection-name.const.ts","../../../libs/payment/driver/in-memory/src/backend/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment.service.ts","../../../libs/payment/driver/in-memory/src/provider.ts","../../../libs/payment/driver/in-memory/src/driver/payment-driver.module.ts"],"sourcesContent":["export const DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME = 'payment';\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n RequestInfo,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\nimport { DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * An in-memory service that delegates payment queries to child backends\n * via the {@link DAFF_PAYMENT_IN_MEMORY_BACKENDS}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME;\n\n constructor(\n private factory: DaffPaymentResponseKindFactory,\n ) {}\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * @docs-private\n */\n createDb(): any {\n return {};\n }\n\n /**\n * Generates a token from a processor backend.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: RequestInfo) {\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.OK,\n body: this.factory.create(),\n }));\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\n\nimport { DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * The payment inmemory driver to mock the payment backend service.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryDriver extends DaffInMemoryDriverBase implements DaffPaymentDriverInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME);\n }\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return this.http.get<DaffPaymentResponse>(this.url);\n }\n}\n","import {\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\nimport { provideDaffPaymentDriver } from '@daffodil/payment/driver';\nimport { provideDaffPaymentTesting } from '@daffodil/payment/testing';\n\nimport { DaffPaymentInMemoryBackendService } from './backend/payment.service';\nimport { DaffPaymentInMemoryDriver } from './driver/payment.service';\n\n/**\n * Provides the {@link DaffPaymentInMemoryDriver} as the {@link DaffPaymentDriver}.\n * Includes {@link provideDaffPaymentTesting}.\n */\nexport const provideDaffPaymentInMemoryDriver = (): EnvironmentProviders => makeEnvironmentProviders([\n provideDaffPaymentTesting(),\n provideDaffPaymentDriver(DaffPaymentInMemoryDriver),\n provideDaffInMemoryBackends(DaffPaymentInMemoryBackendService),\n]);\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffPaymentInMemoryDriver } from '../provider';\n\n/**\n * Provides the {@link DaffPaymentInMemoryDriver} as the {@link DaffPaymentDriver}.\n *\n * @deprecated in favor of {@link provideDaffPaymentInMemoryDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffPaymentInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentInMemoryDriverModule> {\n return {\n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AA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAzB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAyB,YAFxB;EAAM,CAAA;CAAA;;AAEP,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAyB,YAAA,CAAA;EAHrC,MAAA;EAAW,MAAA,CAAA,EACV,YAAY,OACb,CAAA;;;;ACLD,MAAa,yCAA+D,yBAAyB;CACnG,0BAAyB;CACzB,yBAAyB,yBAAyB;CAClD,4BAA4B,iCAAiC;AAC9D,CAAA;ACFD,IAAa,kCAAb,MAAa,gCAA+B;CAC1C,OAAO,UAAO;EACZ,OAAO;GACL,UAAU;GACV,WAAW,CACT,iCAAgC,CACjC;EACF;CACH;CARW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA+B,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAA/B;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA+B,SAAA,CAHxC,YAAY;EAAA,CAAA;CAAA;CAGH;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA+B,SAAA,CAHxC,YAAY;EAAA,CAAA;CAAA;;AAGH,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA+B,YAAA,CAAA;EAL3C,MAAA;EAAS,MAAA,CAAA,EACR,SAAS,CACP,YACD,EACF,CAAA"}
@@ -1,61 +1,94 @@
1
- import { CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Injectable, NgModule } from '@angular/core';
4
- import { provideDaffPaymentDriver } from '@daffodil/payment/driver';
5
- import { of } from 'rxjs';
6
- import * as i1 from '@daffodil/payment/testing';
1
+ import { CommonModule } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Injectable, NgModule, makeEnvironmentProviders } from "@angular/core";
4
+ import { provideDaffPaymentDriver } from "@daffodil/payment/driver";
5
+ import { of } from "rxjs";
6
+ import * as i1 from "@daffodil/payment/testing";
7
+ var DaffPaymentTestingDriver = class DaffPaymentTestingDriver {
8
+ constructor(paymentResponseFactory) {
9
+ this.paymentResponseFactory = paymentResponseFactory;
10
+ }
11
+ generateToken(request) {
12
+ return of(this.paymentResponseFactory.create());
13
+ }
14
+ static {
15
+ this.ɵfac = i0.ɵɵngDeclareFactory({
16
+ minVersion: "12.0.0",
17
+ version: "22.2.4",
18
+ ngImport: i0,
19
+ type: DaffPaymentTestingDriver,
20
+ deps: [{ token: i1.DaffPaymentResponseKindFactory }],
21
+ target: i0.ɵɵFactoryTarget.Injectable
22
+ });
23
+ }
24
+ static {
25
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
26
+ minVersion: "12.0.0",
27
+ version: "22.2.4",
28
+ ngImport: i0,
29
+ type: DaffPaymentTestingDriver,
30
+ providedIn: "root"
31
+ });
32
+ }
33
+ };
34
+ i0.ɵɵngDeclareClassMetadata({
35
+ minVersion: "12.0.0",
36
+ version: "22.2.4",
37
+ ngImport: i0,
38
+ type: DaffPaymentTestingDriver,
39
+ decorators: [{
40
+ type: Injectable,
41
+ args: [{ providedIn: "root" }]
42
+ }],
43
+ ctorParameters: () => [{ type: i1.DaffPaymentResponseKindFactory }]
44
+ });
45
+ const provideDaffPaymentTestingDriver = () => makeEnvironmentProviders([provideDaffPaymentDriver(DaffPaymentTestingDriver)]);
46
+ var DaffPaymentTestingDriverModule = class DaffPaymentTestingDriverModule {
47
+ static forRoot() {
48
+ return {
49
+ ngModule: DaffPaymentTestingDriverModule,
50
+ providers: [provideDaffPaymentTestingDriver()]
51
+ };
52
+ }
53
+ static {
54
+ this.ɵfac = i0.ɵɵngDeclareFactory({
55
+ minVersion: "12.0.0",
56
+ version: "22.2.4",
57
+ ngImport: i0,
58
+ type: DaffPaymentTestingDriverModule,
59
+ deps: [],
60
+ target: i0.ɵɵFactoryTarget.NgModule
61
+ });
62
+ }
63
+ static {
64
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
65
+ minVersion: "14.0.0",
66
+ version: "22.2.4",
67
+ ngImport: i0,
68
+ type: DaffPaymentTestingDriverModule,
69
+ imports: [CommonModule]
70
+ });
71
+ }
72
+ static {
73
+ this.ɵinj = i0.ɵɵngDeclareInjector({
74
+ minVersion: "12.0.0",
75
+ version: "22.2.4",
76
+ ngImport: i0,
77
+ type: DaffPaymentTestingDriverModule,
78
+ imports: [CommonModule]
79
+ });
80
+ }
81
+ };
82
+ i0.ɵɵngDeclareClassMetadata({
83
+ minVersion: "12.0.0",
84
+ version: "22.2.4",
85
+ ngImport: i0,
86
+ type: DaffPaymentTestingDriverModule,
87
+ decorators: [{
88
+ type: NgModule,
89
+ args: [{ imports: [CommonModule] }]
90
+ }]
91
+ });
92
+ export { DaffPaymentTestingDriver, DaffPaymentTestingDriverModule, provideDaffPaymentTestingDriver };
7
93
 
8
- /**
9
- * A basic payment driver that creates mock payment results of different kinds.
10
- * For testing purposes.
11
- *
12
- * @inheritdoc
13
- */
14
- class DaffPaymentTestingDriver {
15
- constructor(paymentResponseFactory) {
16
- this.paymentResponseFactory = paymentResponseFactory;
17
- }
18
- generateToken(request) {
19
- return of(this.paymentResponseFactory.create());
20
- }
21
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentTestingDriver, deps: [{ token: i1.DaffPaymentResponseKindFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
22
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentTestingDriver, providedIn: 'root' }); }
23
- }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentTestingDriver, decorators: [{
25
- type: Injectable,
26
- args: [{
27
- providedIn: 'root',
28
- }]
29
- }], ctorParameters: () => [{ type: i1.DaffPaymentResponseKindFactory }] });
30
-
31
- /**
32
- * Provides the {@link DaffPaymentTestingDriver} as the {@link DaffPaymentDriver}.
33
- */
34
- class DaffPaymentTestingDriverModule {
35
- static forRoot() {
36
- return {
37
- ngModule: DaffPaymentTestingDriverModule,
38
- providers: [
39
- provideDaffPaymentDriver(DaffPaymentTestingDriver),
40
- ],
41
- };
42
- }
43
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
44
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentTestingDriverModule, imports: [CommonModule] }); }
45
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentTestingDriverModule, imports: [CommonModule] }); }
46
- }
47
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaymentTestingDriverModule, decorators: [{
48
- type: NgModule,
49
- args: [{
50
- imports: [
51
- CommonModule,
52
- ],
53
- }]
54
- }] });
55
-
56
- /**
57
- * Generated bundle index. Do not edit.
58
- */
59
-
60
- export { DaffPaymentTestingDriver, DaffPaymentTestingDriverModule };
61
- //# sourceMappingURL=daffodil-payment-driver-testing.mjs.map
94
+ //# sourceMappingURL=daffodil-payment-driver-testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-payment-driver-testing.mjs","sources":["../../../libs/payment/driver/testing/src/drivers/payment.service.ts","../../../libs/payment/driver/testing/src/drivers/payment-driver.module.ts","../../../libs/payment/driver/testing/src/daffodil-payment-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\n/**\n * A basic payment driver that creates mock payment results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentTestingDriver implements DaffPaymentDriverInterface {\n\n constructor(\n private paymentResponseFactory: DaffPaymentResponseKindFactory,\n ) {}\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return of(this.paymentResponseFactory.create());\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffPaymentDriver } from '@daffodil/payment/driver';\n\nimport { DaffPaymentTestingDriver } from './payment.service';\n\n/**\n * Provides the {@link DaffPaymentTestingDriver} as the {@link DaffPaymentDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffPaymentTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentTestingDriverModule> {\n return {\n ngModule: DaffPaymentTestingDriverModule,\n providers: [\n provideDaffPaymentDriver(DaffPaymentTestingDriver),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAaA;;;;;AAKG;MAIU,wBAAwB,CAAA;AAEnC,IAAA,WAAA,CACU,sBAAsD,EAAA;QAAtD,IAAA,CAAA,sBAAsB,GAAtB,sBAAsB;IAC7B;AAEH,IAAA,aAAa,CAAC,OAA2B,EAAA;QACvC,OAAO,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,EAAE,CAAC;IACjD;iIARW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,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACjBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-payment-driver-testing.mjs","names":[],"sources":["../../../libs/payment/driver/testing/src/drivers/payment.service.ts","../../../libs/payment/driver/testing/src/drivers/provider.ts","../../../libs/payment/driver/testing/src/drivers/payment-driver.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\n/**\n * A basic payment driver that creates mock payment results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentTestingDriver implements DaffPaymentDriverInterface {\n\n constructor(\n private paymentResponseFactory: DaffPaymentResponseKindFactory,\n ) {}\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return of(this.paymentResponseFactory.create());\n }\n}\n","import {\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport { provideDaffPaymentDriver } from '@daffodil/payment/driver';\n\nimport { DaffPaymentTestingDriver } from './payment.service';\n\n/**\n * Provides the {@link DaffPaymentTestingDriver} as the {@link DaffPaymentDriver}.\n */\nexport const provideDaffPaymentTestingDriver = (): EnvironmentProviders => makeEnvironmentProviders([\n provideDaffPaymentDriver(DaffPaymentTestingDriver),\n]);\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffPaymentTestingDriver } from './provider';\n\n/**\n * Provides the {@link DaffPaymentTestingDriver} as the {@link DaffPaymentDriver}.\n *\n * @deprecated in favor of {@link provideDaffPaymentTestingDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffPaymentTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentTestingDriverModule> {\n return {\n ngModule: DaffPaymentTestingDriverModule,\n providers: [\n provideDaffPaymentTestingDriver(),\n ],\n };\n }\n}\n"],"mappings":";;;;;;AAsBA,IAAa,2BAAb,MAAa,yBAAwB;CAEnC,YACU,wBAAsD;EAAtD,KAAA,yBAAA;CACP;CAEH,cAAc,SAA2B;EACvC,OAAO,GAAG,KAAK,uBAAuB,OAAM,CAAE;CAChD;CARW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAwB,MAAA,CAAA,EAAA,OAAA,GAAA,+BAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAxB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAwB,YAFvB;EAAM,CAAA;CAAA;;AAEP,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAwB,YAAA,CAAA;EAHpC,MAAA;EAAW,MAAA,CAAA,EACV,YAAY,OACb,CAAA;;;;ACTD,MAAa,wCAA8D,yBAAyB,CAClG,yBAAyB,wBAAwB,CAClD,CAAA;ACID,IAAa,iCAAb,MAAa,+BAA8B;CACzC,OAAO,UAAO;EACZ,OAAO;GACL,UAAU;GACV,WAAW,CACT,gCAA+B,CAChC;EACF;CACH;CARW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA8B,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAA9B;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA8B,SAAA,CAHvC,YAAY;EAAA,CAAA;CAAA;CAGH;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA8B,SAAA,CAHvC,YAAY;EAAA,CAAA;CAAA;;AAGH,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA8B,YAAA,CAAA;EAL1C,MAAA;EAAS,MAAA,CAAA,EACR,SAAS,CACP,YACD,EACF,CAAA"}
@@ -1,37 +1,14 @@
1
- import { createSingletonInjectionToken, DaffInheritableError } from '@daffodil/core';
2
-
3
- const {
4
- /**
5
- * An injection token for the payment driver.
6
- */
7
- token: DaffPaymentDriver,
8
- /**
9
- * Provider function for {@link DaffPaymentDriver}.
10
- */
11
- provider: provideDaffPaymentDriver, } = createSingletonInjectionToken('DaffPaymentDriver');
12
-
13
- const DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_PAYMENT_INVALID_API_RESPONSE';
14
- /**
15
- * A general error indicating that the platform returned a response which cannot be processed.
16
- */
17
- class DaffPaymentInvalidAPIResponseError extends DaffInheritableError {
18
- constructor(message) {
19
- super(message);
20
- this.message = message;
21
- this.code = DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE;
22
- }
23
- }
24
-
25
- /**
26
- * A mapping from error codes to error class constructors.
27
- */
28
- const DaffPaymentDriverErrorMap = {
29
- [DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE]: DaffPaymentInvalidAPIResponseError,
1
+ import { DaffInheritableError, createSingletonInjectionToken } from "@daffodil/core";
2
+ const { token: DaffPaymentDriver, provider: provideDaffPaymentDriver } = createSingletonInjectionToken("DaffPaymentDriver");
3
+ const DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE = "DAFF_PAYMENT_INVALID_API_RESPONSE";
4
+ var DaffPaymentInvalidAPIResponseError = class extends DaffInheritableError {
5
+ constructor(message) {
6
+ super(message);
7
+ this.message = message;
8
+ this.code = DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE;
9
+ }
30
10
  };
31
-
32
- /**
33
- * Generated bundle index. Do not edit.
34
- */
35
-
11
+ const DaffPaymentDriverErrorMap = { [DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE]: DaffPaymentInvalidAPIResponseError };
36
12
  export { DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE, DaffPaymentDriver, DaffPaymentDriverErrorMap, DaffPaymentInvalidAPIResponseError, provideDaffPaymentDriver };
37
- //# sourceMappingURL=daffodil-payment-driver.mjs.map
13
+
14
+ //# sourceMappingURL=daffodil-payment-driver.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-payment-driver.mjs","sources":["../../../libs/payment/driver/src/interfaces/payment-service.interface.ts","../../../libs/payment/driver/src/errors/invalid-api-response.ts","../../../libs/payment/driver/src/errors/map.ts","../../../libs/payment/driver/src/daffodil-payment-driver.ts"],"sourcesContent":["import { Observable } from 'rxjs';\n\nimport { createSingletonInjectionToken } from '@daffodil/core';\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\n\nexport const {\n /**\n * An injection token for the payment driver.\n */\n token: DaffPaymentDriver,\n /**\n * Provider function for {@link DaffPaymentDriver}.\n */\n provider: provideDaffPaymentDriver,\n} = createSingletonInjectionToken<DaffPaymentDriverInterface>('DaffPaymentDriver');\n\n/**\n * The payment driver is responsible for taking user payment input and generating a token for use with the platform.\n */\nexport interface DaffPaymentDriverInterface<\n T extends DaffPaymentResponse = DaffPaymentResponse,\n> {\n /**\n * Generate a payment token.\n */\n generateToken(request: DaffPaymentRequest): Observable<T>;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_PAYMENT_INVALID_API_RESPONSE';\n\n/**\n * A general error indicating that the platform returned a response which cannot be processed.\n */\nexport class DaffPaymentInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffPaymentInvalidAPIResponseError,\n DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE,\n} from './invalid-api-response';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffPaymentDriverErrorMap = {\n [DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE]: DaffPaymentInvalidAPIResponseError,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAQO,MAAM;AACX;;AAEG;AACH,KAAK,EAAE,iBAAiB;AACxB;;AAEG;AACH,QAAQ,EAAE,wBAAwB,GACnC,GAAG,6BAA6B,CAA6B,mBAAmB;;ACZ1E,MAAM,4CAA4C,GAAG;AAE5D;;AAEG;AACG,MAAO,kCAAmC,SAAQ,oBAAoB,CAAA;AAG1E,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC;QADG,IAAA,CAAA,OAAO,GAAP,OAAO;QAFV,IAAA,CAAA,IAAI,GAAW,4CAA4C;IAI3E;AACD;;ACXD;;AAEG;AACI,MAAM,yBAAyB,GAAG;IACvC,CAAC,4CAA4C,GAAG,kCAAkC;;;ACTpF;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-payment-driver.mjs","names":[],"sources":["../../../libs/payment/driver/src/interfaces/payment-service.interface.ts","../../../libs/payment/driver/src/errors/invalid-api-response.ts","../../../libs/payment/driver/src/errors/map.ts"],"sourcesContent":["import { Observable } from 'rxjs';\n\nimport { createSingletonInjectionToken } from '@daffodil/core';\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\n\nexport const {\n /**\n * An injection token for the payment driver.\n */\n token: DaffPaymentDriver,\n /**\n * Provider function for {@link DaffPaymentDriver}.\n */\n provider: provideDaffPaymentDriver,\n} = createSingletonInjectionToken<DaffPaymentDriverInterface>('DaffPaymentDriver');\n\n/**\n * The payment driver is responsible for taking user payment input and generating a token for use with the platform.\n */\nexport interface DaffPaymentDriverInterface<\n T extends DaffPaymentResponse = DaffPaymentResponse,\n> {\n /**\n * Generate a payment token.\n */\n generateToken(request: DaffPaymentRequest): Observable<T>;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_PAYMENT_INVALID_API_RESPONSE';\n\n/**\n * A general error indicating that the platform returned a response which cannot be processed.\n */\nexport class DaffPaymentInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffPaymentInvalidAPIResponseError,\n DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE,\n} from './invalid-api-response';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffPaymentDriverErrorMap = {\n [DAFF_PAYMENT_INVALID_API_RESPONSE_ERROR_CODE]: DaffPaymentInvalidAPIResponseError,\n};\n"],"mappings":";AAQA,MAAa,EAIX,OAAO,mBAIP,UAAU,6BACR,8BAA0D,mBAAmB;ACZjF,MAAa,+CAA+C;AAK5D,IAAa,qCAAb,cAAwD,qBAAoB;CAG1E,YAAmB,SAAe;EAChC,MAAM,OAAO;EADI,KAAA,UAAA;EAFH,KAAA,OAAe;CAI/B;AACD;ACRD,MAAa,4BAA4B,GACtC,+CAA+C,mCACjD"}