@aptos-scp/scp-component-store-selling-features-domain-model 3.3.1 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/domain/UIBusinessEventTypes.d.ts +1 -0
- package/lib/domain/UIBusinessEventTypes.js +1 -0
- package/lib/domain/model/Constants.d.ts +6 -2
- package/lib/domain/model/Constants.js +4 -0
- package/lib/domain/model/PaymentNotificationSession.d.ts +31 -0
- package/lib/domain/model/PaymentNotificationSession.js +83 -0
- package/lib/domain/model/index.d.ts +1 -0
- package/lib/domain/model/index.js +1 -0
- package/package.json +1 -1
|
@@ -343,3 +343,4 @@ export declare const COUNTRY_BOX_START_TRANSACTION_EVENT: string;
|
|
|
343
343
|
export declare const COUNTRY_BOX_FINISH_TRANSACTION_EVENT: string;
|
|
344
344
|
export declare const FULFILLMENT_AUTHORIZATION_EVENT: string;
|
|
345
345
|
export declare const COUNTRY_BOX_REPORT_GENERATION_EVENT: string;
|
|
346
|
+
export declare const PAYMENT_NOTIFICATION_START_EVENT: string;
|
|
@@ -350,4 +350,5 @@ exports.COUNTRY_BOX_START_TRANSACTION_EVENT = "CountryBoxStartTransactionEvent";
|
|
|
350
350
|
exports.COUNTRY_BOX_FINISH_TRANSACTION_EVENT = "CountryBoxFinishTransactionEvent";
|
|
351
351
|
exports.FULFILLMENT_AUTHORIZATION_EVENT = "FulfillmentAuthorization";
|
|
352
352
|
exports.COUNTRY_BOX_REPORT_GENERATION_EVENT = "CountryBoxReportGenerationEvent";
|
|
353
|
+
exports.PAYMENT_NOTIFICATION_START_EVENT = "PaymentNotificationStart";
|
|
353
354
|
//# sourceMappingURL=UIBusinessEventTypes.js.map
|
|
@@ -478,7 +478,9 @@ export declare enum UiInputKey {
|
|
|
478
478
|
FEE_LINE_FOR_REFUND = "input_feeLineForRefund",
|
|
479
479
|
FEE_REFUND_SOURCE = "input_feeRefundSource",
|
|
480
480
|
FEE_REFUNDABLE_AMOUNT = "input_feeRefundableAmount",
|
|
481
|
-
ITEM_TERMS_AND_CONDITIONS_ACCEPTED = "input_itemTermsAndConditionsAccepted"
|
|
481
|
+
ITEM_TERMS_AND_CONDITIONS_ACCEPTED = "input_itemTermsAndConditionsAccepted",
|
|
482
|
+
PAYMENT_AUTHORIZATION_REQUEST = "input_paymentAuthorizationRequest",
|
|
483
|
+
PAYMENT_AUTHORIZATION_RESPONSE = "input_paymentAuthorizationResponse"
|
|
482
484
|
}
|
|
483
485
|
export declare enum CollectedDataKey {
|
|
484
486
|
Abort = "abort",
|
|
@@ -1028,7 +1030,8 @@ export declare enum CollectedDataKey {
|
|
|
1028
1030
|
CustomerInputMode = "customerInputMode",
|
|
1029
1031
|
PreAuthCapture = "preAuthCapture",
|
|
1030
1032
|
PreOrder = "preOrder",
|
|
1031
|
-
PreOrderAvailableDate = "preOrderAvailableDate"
|
|
1033
|
+
PreOrderAvailableDate = "preOrderAvailableDate",
|
|
1034
|
+
PaymentAuthorizationResponse = "paymentAuthorizationResponse"
|
|
1032
1035
|
}
|
|
1033
1036
|
export declare enum ItemLookupType {
|
|
1034
1037
|
ProductInquiryDetail = "ProductInquiryDetail",
|
|
@@ -1055,6 +1058,7 @@ export declare const TRANSACTION_RESUMING_ON_STARTUP_EVENT: string;
|
|
|
1055
1058
|
export declare const STORED_VALUE_REVERSAL_COMPLETED_EVENT_TYPE: string;
|
|
1056
1059
|
export declare const STORED_VALUE_CERTIFICATE_REVERSAL_COMPLETED_EVENT_TYPE: string;
|
|
1057
1060
|
export declare const PAYMENT_AUTH_INITIALIZE_START_EVENT_TYPE: string;
|
|
1061
|
+
export declare const PAYMENT_AUTH_CANCEL_START_EVENT_TYPE: string;
|
|
1058
1062
|
export declare const PAYMENT_AUTH_START_EVENT_TYPE: string;
|
|
1059
1063
|
export declare const TENDER_CHANGE_CANCEL_EVENT_TYPE: string;
|
|
1060
1064
|
export declare const CASH_DRAWER_SELECTED_EVENT: string;
|
|
@@ -480,6 +480,8 @@ var UiInputKey;
|
|
|
480
480
|
UiInputKey["FEE_REFUND_SOURCE"] = "input_feeRefundSource";
|
|
481
481
|
UiInputKey["FEE_REFUNDABLE_AMOUNT"] = "input_feeRefundableAmount";
|
|
482
482
|
UiInputKey["ITEM_TERMS_AND_CONDITIONS_ACCEPTED"] = "input_itemTermsAndConditionsAccepted";
|
|
483
|
+
UiInputKey["PAYMENT_AUTHORIZATION_REQUEST"] = "input_paymentAuthorizationRequest";
|
|
484
|
+
UiInputKey["PAYMENT_AUTHORIZATION_RESPONSE"] = "input_paymentAuthorizationResponse";
|
|
483
485
|
})(UiInputKey = exports.UiInputKey || (exports.UiInputKey = {}));
|
|
484
486
|
//
|
|
485
487
|
// Keys for use in relaying data collectedData (qualification) and nonContextualData (action).
|
|
@@ -1036,6 +1038,7 @@ var CollectedDataKey;
|
|
|
1036
1038
|
CollectedDataKey["PreAuthCapture"] = "preAuthCapture";
|
|
1037
1039
|
CollectedDataKey["PreOrder"] = "preOrder";
|
|
1038
1040
|
CollectedDataKey["PreOrderAvailableDate"] = "preOrderAvailableDate";
|
|
1041
|
+
CollectedDataKey["PaymentAuthorizationResponse"] = "paymentAuthorizationResponse";
|
|
1039
1042
|
})(CollectedDataKey = exports.CollectedDataKey || (exports.CollectedDataKey = {}));
|
|
1040
1043
|
var ItemLookupType;
|
|
1041
1044
|
(function (ItemLookupType) {
|
|
@@ -1066,6 +1069,7 @@ exports.TRANSACTION_RESUMING_ON_STARTUP_EVENT = "Transaction.ResumingOnStartup";
|
|
|
1066
1069
|
exports.STORED_VALUE_REVERSAL_COMPLETED_EVENT_TYPE = "StoredValue.ReversalCompleted";
|
|
1067
1070
|
exports.STORED_VALUE_CERTIFICATE_REVERSAL_COMPLETED_EVENT_TYPE = "StoredValueCertificate.ReversalCompleted";
|
|
1068
1071
|
exports.PAYMENT_AUTH_INITIALIZE_START_EVENT_TYPE = "PaymentAuth.InitializeStart";
|
|
1072
|
+
exports.PAYMENT_AUTH_CANCEL_START_EVENT_TYPE = "PaymentAuth.CancelStart";
|
|
1069
1073
|
exports.PAYMENT_AUTH_START_EVENT_TYPE = "PaymentAuth.Start";
|
|
1070
1074
|
exports.TENDER_CHANGE_CANCEL_EVENT_TYPE = "TenderChange.Cancel";
|
|
1071
1075
|
exports.CASH_DRAWER_SELECTED_EVENT = "CashDrawer.Selected";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IState } from "@aptos-scp/scp-component-store-selling-core";
|
|
2
|
+
export declare const PAYMENT_NOTIFICATION_SESSION: string;
|
|
3
|
+
export declare enum PaymentNotificationSessionState {
|
|
4
|
+
Inactive = "Inactive",
|
|
5
|
+
Initializing = "Initializing",
|
|
6
|
+
InProgress = "InProgress",
|
|
7
|
+
Cancelled = "Cancelled",
|
|
8
|
+
Completed = "Completed"
|
|
9
|
+
}
|
|
10
|
+
export declare class PaymentNotificationSession implements IState {
|
|
11
|
+
private readonly _type;
|
|
12
|
+
private readonly _state;
|
|
13
|
+
private readonly _paymentAuthorizationResponse;
|
|
14
|
+
private readonly _authorizationServiceRequestId;
|
|
15
|
+
static createFromJsonObject(paymentNotificationSessionJsonObj: any): PaymentNotificationSession;
|
|
16
|
+
/**
|
|
17
|
+
* @param requestId Optional idempotency key (`serviceProcessing.requestID`) for pay-by-link before an authorization response exists.
|
|
18
|
+
*/
|
|
19
|
+
static create(requestId?: string): PaymentNotificationSession;
|
|
20
|
+
get type(): string;
|
|
21
|
+
get state(): PaymentNotificationSessionState;
|
|
22
|
+
get paymentAuthorizationResponse(): any;
|
|
23
|
+
get authorizationServiceRequestId(): string | undefined;
|
|
24
|
+
get isCancelled(): boolean;
|
|
25
|
+
get stateValues(): Readonly<Map<string, any>>;
|
|
26
|
+
initialize(): PaymentNotificationSession;
|
|
27
|
+
inProgress(lastPaymentAuthorizationResponse?: any): PaymentNotificationSession;
|
|
28
|
+
complete(): PaymentNotificationSession;
|
|
29
|
+
cancelled(): PaymentNotificationSession;
|
|
30
|
+
private constructor();
|
|
31
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const scp_component_logging_1 = require("@aptos-scp/scp-component-logging");
|
|
4
|
+
const logger = scp_component_logging_1.LogManager.getLogger("com.aptos.storesellingfeatures.domain.model.PaymentNotificationSession");
|
|
5
|
+
exports.PAYMENT_NOTIFICATION_SESSION = "PaymentNotificationSession";
|
|
6
|
+
var PaymentNotificationSessionState;
|
|
7
|
+
(function (PaymentNotificationSessionState) {
|
|
8
|
+
PaymentNotificationSessionState["Inactive"] = "Inactive";
|
|
9
|
+
PaymentNotificationSessionState["Initializing"] = "Initializing";
|
|
10
|
+
PaymentNotificationSessionState["InProgress"] = "InProgress";
|
|
11
|
+
PaymentNotificationSessionState["Cancelled"] = "Cancelled";
|
|
12
|
+
PaymentNotificationSessionState["Completed"] = "Completed";
|
|
13
|
+
})(PaymentNotificationSessionState = exports.PaymentNotificationSessionState || (exports.PaymentNotificationSessionState = {}));
|
|
14
|
+
class PaymentNotificationSession {
|
|
15
|
+
constructor(state, paymentAuthorizationResponse, authorizationServiceRequestId) {
|
|
16
|
+
this._type = exports.PAYMENT_NOTIFICATION_SESSION;
|
|
17
|
+
this._state = state;
|
|
18
|
+
if (state === PaymentNotificationSessionState.Initializing ||
|
|
19
|
+
state === PaymentNotificationSessionState.Completed) {
|
|
20
|
+
this._paymentAuthorizationResponse = undefined;
|
|
21
|
+
this._authorizationServiceRequestId = undefined;
|
|
22
|
+
}
|
|
23
|
+
else if (state === PaymentNotificationSessionState.Cancelled) {
|
|
24
|
+
this._paymentAuthorizationResponse = undefined;
|
|
25
|
+
this._authorizationServiceRequestId = authorizationServiceRequestId;
|
|
26
|
+
}
|
|
27
|
+
else if (paymentAuthorizationResponse) {
|
|
28
|
+
this._paymentAuthorizationResponse = paymentAuthorizationResponse;
|
|
29
|
+
this._authorizationServiceRequestId = authorizationServiceRequestId;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this._paymentAuthorizationResponse = undefined;
|
|
33
|
+
this._authorizationServiceRequestId = authorizationServiceRequestId;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
static createFromJsonObject(paymentNotificationSessionJsonObj) {
|
|
37
|
+
logger.traceEntry("createFromJsonObject");
|
|
38
|
+
return new PaymentNotificationSession(paymentNotificationSessionJsonObj._state, paymentNotificationSessionJsonObj._paymentAuthorizationResponse, paymentNotificationSessionJsonObj._authorizationServiceRequestId);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @param requestId Optional idempotency key (`serviceProcessing.requestID`) for pay-by-link before an authorization response exists.
|
|
42
|
+
*/
|
|
43
|
+
static create(requestId) {
|
|
44
|
+
logger.traceEntry("create");
|
|
45
|
+
return new PaymentNotificationSession(PaymentNotificationSessionState.Inactive, undefined, requestId);
|
|
46
|
+
}
|
|
47
|
+
get type() {
|
|
48
|
+
return this._type;
|
|
49
|
+
}
|
|
50
|
+
get state() {
|
|
51
|
+
return this._state;
|
|
52
|
+
}
|
|
53
|
+
get paymentAuthorizationResponse() {
|
|
54
|
+
return this._paymentAuthorizationResponse;
|
|
55
|
+
}
|
|
56
|
+
get authorizationServiceRequestId() {
|
|
57
|
+
return this._authorizationServiceRequestId;
|
|
58
|
+
}
|
|
59
|
+
get isCancelled() {
|
|
60
|
+
return this._state === PaymentNotificationSessionState.Cancelled;
|
|
61
|
+
}
|
|
62
|
+
get stateValues() {
|
|
63
|
+
return new Map([
|
|
64
|
+
["PaymentNotificationSession.state", this._state],
|
|
65
|
+
["PaymentNotificationSession.paymentAuthorizationResponse", this._paymentAuthorizationResponse],
|
|
66
|
+
["PaymentNotificationSession.authorizationServiceRequestId", this._authorizationServiceRequestId],
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
initialize() {
|
|
70
|
+
return new PaymentNotificationSession(PaymentNotificationSessionState.Initializing);
|
|
71
|
+
}
|
|
72
|
+
inProgress(lastPaymentAuthorizationResponse) {
|
|
73
|
+
return new PaymentNotificationSession(PaymentNotificationSessionState.InProgress, lastPaymentAuthorizationResponse, this._authorizationServiceRequestId);
|
|
74
|
+
}
|
|
75
|
+
complete() {
|
|
76
|
+
return new PaymentNotificationSession(PaymentNotificationSessionState.Completed);
|
|
77
|
+
}
|
|
78
|
+
cancelled() {
|
|
79
|
+
return new PaymentNotificationSession(PaymentNotificationSessionState.Cancelled, undefined, this._authorizationServiceRequestId);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.PaymentNotificationSession = PaymentNotificationSession;
|
|
83
|
+
//# sourceMappingURL=PaymentNotificationSession.js.map
|
|
@@ -38,6 +38,7 @@ export * from "./MerchandiseTransaction";
|
|
|
38
38
|
export * from "./TenderControlTransaction";
|
|
39
39
|
export * from "./ApplicationControlTransaction";
|
|
40
40
|
export * from "./ReceiptSession";
|
|
41
|
+
export * from "./PaymentNotificationSession";
|
|
41
42
|
export * from "./ReprintReceiptTransaction";
|
|
42
43
|
export * from "./ResumeTransactionSession";
|
|
43
44
|
export * from "./StoredValueCardSession";
|
|
@@ -40,6 +40,7 @@ __export(require("./MerchandiseTransaction"));
|
|
|
40
40
|
__export(require("./TenderControlTransaction"));
|
|
41
41
|
__export(require("./ApplicationControlTransaction"));
|
|
42
42
|
__export(require("./ReceiptSession"));
|
|
43
|
+
__export(require("./PaymentNotificationSession"));
|
|
43
44
|
__export(require("./ReprintReceiptTransaction"));
|
|
44
45
|
__export(require("./ResumeTransactionSession"));
|
|
45
46
|
__export(require("./StoredValueCardSession"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-scp/scp-component-store-selling-features-domain-model",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "This component library provides the common components to handle the coordination of processing the business events from the UI.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|