@aptos-scp/scp-component-store-selling-features-domain-model 2.2.1 → 2.4.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.
@@ -137,6 +137,7 @@ export declare const SHIPPING_FEE_EVENT = "ShippingFee";
137
137
  export declare const SHIPPING_FEE_CHANGE_EVENT = "ShippingFeeChange";
138
138
  export declare const ADD_SHIPPING_FEE_EVENT = "AddShippingFee";
139
139
  export declare const APPLY_FEE_DISCOUNT_EVENT = "ApplyFeeDiscount";
140
+ export declare const PAYMENT_ACCOUNT_HOLDER_MISMATCH_STATUS_EVENT: string;
140
141
  export declare const PAYMENT_ACCOUNT_HOLDER_VALIDATE_EVENT: string;
141
142
  export declare const SHIPPING_FEE_REFUND_EVENT: string;
142
143
  export declare const RETURN_ITEM_EVENT: string;
@@ -140,6 +140,7 @@ exports.SHIPPING_FEE_EVENT = "ShippingFee";
140
140
  exports.SHIPPING_FEE_CHANGE_EVENT = "ShippingFeeChange";
141
141
  exports.ADD_SHIPPING_FEE_EVENT = "AddShippingFee";
142
142
  exports.APPLY_FEE_DISCOUNT_EVENT = "ApplyFeeDiscount";
143
+ exports.PAYMENT_ACCOUNT_HOLDER_MISMATCH_STATUS_EVENT = "PaymentAccountHolderMismatchStatus";
143
144
  exports.PAYMENT_ACCOUNT_HOLDER_VALIDATE_EVENT = "PaymentAccountHolderValidate";
144
145
  exports.SHIPPING_FEE_REFUND_EVENT = "ShippingFeeRefund";
145
146
  exports.RETURN_ITEM_EVENT = "ReturnItem";
@@ -99,6 +99,7 @@ export declare enum UiInputKey {
99
99
  ASSIGN_CUSTOMER = "input_assignCustomer",
100
100
  ASSIGN_TO_TRANSACTION = "input_assignToTransaction",
101
101
  AUTHORIZATION_DEVICE_ID = "input_authorizationDeviceId",
102
+ AMOUNT_DUE = "input_amountDue",
102
103
  BUSINESS_DAY_DATE = "input_businessDayDate",
103
104
  SAME_AS_BILLTO = "input_sameAsBillTo",
104
105
  BILLING = "input_billing",
@@ -217,6 +218,8 @@ export declare enum UiInputKey {
217
218
  OFFLINE_BUSINESS_DAY_DATE = "input_offlineBusinessDayDate",
218
219
  ORIGINAL_ITEM = "input_originalItem",
219
220
  ORIGINAL_TRANSACTION_LINE_REFERENCES = "input_originalTransactionLineReferences",
221
+ PAYMENT_ACCOUNT_HOLDER_MISMATCH_ACTION = "input_paymentAccountHolderMismatchAction",
222
+ PAYMENT_ACCOUNT_HOLDER_VALIDATE = "input_paymentAccountHolderValidate",
220
223
  PAID_AMOUNT = "input_paidAmount",
221
224
  PAID_OUT_REFERENCE = "input_paidOutReference",
222
225
  ATTACHMENTS = "input_attachments",
@@ -462,6 +465,7 @@ export declare enum CollectedDataKey {
462
465
  ApplyDiscountToBasePrice = "ApplyDiscountToBasePrice",
463
466
  AuthorizationDeviceId = "AuthorizationDeviceId",
464
467
  AutoApplied = "AutoApplied",
468
+ AmountDue = "AmountDue",
465
469
  BalanceInquiry = "BalanceInquiry",
466
470
  Billing = "Billing",
467
471
  SameAsBillTo = "SameAsBillTo",
@@ -662,6 +666,8 @@ export declare enum CollectedDataKey {
662
666
  TenderPaymentIsCompleted = "tenderPaymentIsCompleted",
663
667
  PaginationMetadata = "paginationMetadata",
664
668
  PaidAmount = "PaidAmount",
669
+ PaymentAccountHolderMismatchAction = "paymentAccountHolderMismatchAction",
670
+ PaymentAccountHolderValidationLineReference = "paymentAccountHolderValidationLineReference",
665
671
  PaymentAccountLookupLineReference = "paymentAccountLookupLineReference",
666
672
  PaidOutReference = "paidOutReference",
667
673
  PhoneNumber = "phoneNumber",
@@ -101,6 +101,7 @@ var UiInputKey;
101
101
  UiInputKey["ASSIGN_CUSTOMER"] = "input_assignCustomer";
102
102
  UiInputKey["ASSIGN_TO_TRANSACTION"] = "input_assignToTransaction";
103
103
  UiInputKey["AUTHORIZATION_DEVICE_ID"] = "input_authorizationDeviceId";
104
+ UiInputKey["AMOUNT_DUE"] = "input_amountDue";
104
105
  UiInputKey["BUSINESS_DAY_DATE"] = "input_businessDayDate";
105
106
  UiInputKey["SAME_AS_BILLTO"] = "input_sameAsBillTo";
106
107
  UiInputKey["BILLING"] = "input_billing";
@@ -219,6 +220,8 @@ var UiInputKey;
219
220
  UiInputKey["OFFLINE_BUSINESS_DAY_DATE"] = "input_offlineBusinessDayDate";
220
221
  UiInputKey["ORIGINAL_ITEM"] = "input_originalItem";
221
222
  UiInputKey["ORIGINAL_TRANSACTION_LINE_REFERENCES"] = "input_originalTransactionLineReferences";
223
+ UiInputKey["PAYMENT_ACCOUNT_HOLDER_MISMATCH_ACTION"] = "input_paymentAccountHolderMismatchAction";
224
+ UiInputKey["PAYMENT_ACCOUNT_HOLDER_VALIDATE"] = "input_paymentAccountHolderValidate";
222
225
  UiInputKey["PAID_AMOUNT"] = "input_paidAmount";
223
226
  UiInputKey["PAID_OUT_REFERENCE"] = "input_paidOutReference";
224
227
  UiInputKey["ATTACHMENTS"] = "input_attachments";
@@ -470,6 +473,7 @@ var CollectedDataKey;
470
473
  CollectedDataKey["ApplyDiscountToBasePrice"] = "ApplyDiscountToBasePrice";
471
474
  CollectedDataKey["AuthorizationDeviceId"] = "AuthorizationDeviceId";
472
475
  CollectedDataKey["AutoApplied"] = "AutoApplied";
476
+ CollectedDataKey["AmountDue"] = "AmountDue";
473
477
  CollectedDataKey["BalanceInquiry"] = "BalanceInquiry";
474
478
  CollectedDataKey["Billing"] = "Billing";
475
479
  CollectedDataKey["SameAsBillTo"] = "SameAsBillTo";
@@ -670,6 +674,8 @@ var CollectedDataKey;
670
674
  CollectedDataKey["TenderPaymentIsCompleted"] = "tenderPaymentIsCompleted";
671
675
  CollectedDataKey["PaginationMetadata"] = "paginationMetadata";
672
676
  CollectedDataKey["PaidAmount"] = "PaidAmount";
677
+ CollectedDataKey["PaymentAccountHolderMismatchAction"] = "paymentAccountHolderMismatchAction";
678
+ CollectedDataKey["PaymentAccountHolderValidationLineReference"] = "paymentAccountHolderValidationLineReference";
673
679
  CollectedDataKey["PaymentAccountLookupLineReference"] = "paymentAccountLookupLineReference";
674
680
  CollectedDataKey["PaidOutReference"] = "paidOutReference";
675
681
  CollectedDataKey["PhoneNumber"] = "phoneNumber";
@@ -1,3 +1,4 @@
1
+ import { Money } from "@aptos-scp/scp-component-business-core";
1
2
  import { DeviceIdentity, ITransaction, ITransactionLine, ITransactionLineFactory, IUser } from "@aptos-scp/scp-component-store-selling-core";
2
3
  import { IFiscalSignature } from "@aptos-scp/scp-types-commerce-transaction";
3
4
  import { ITransactionReferenceFormatter } from "../service";
@@ -27,6 +28,7 @@ export declare class TenderControlTransaction extends RetailTransaction {
27
28
  get fiscalTransactionNumber(): string;
28
29
  get fiscalSignature(): IFiscalSignature;
29
30
  get fiscalError(): IFiscalError;
31
+ get transactionChangeDue(): Money | undefined;
30
32
  findLineByLineNumber(lineNumber: number): ITransactionLine;
31
33
  toJSON(): object;
32
34
  protected newTransaction(): RetailTransaction;
@@ -34,3 +36,5 @@ export declare class TenderControlTransaction extends RetailTransaction {
34
36
  private generateTransactionReferenceNumber;
35
37
  }
36
38
  export declare const isTenderControlTransaction: (transaction: ITransaction) => transaction is TenderControlTransaction;
39
+ export declare const isPayOnAccountTransaction: (transaction: ITransaction) => transaction is TenderControlTransaction;
40
+ export declare const isCompletePayOnAccountTransaction: (transaction: ITransaction) => transaction is TenderControlTransaction;
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _ = require("lodash");
4
+ const scp_component_business_core_1 = require("@aptos-scp/scp-component-business-core");
3
5
  const scp_component_store_selling_core_1 = require("@aptos-scp/scp-component-store-selling-core");
6
+ const scp_types_commerce_devices_1 = require("@aptos-scp/scp-types-commerce-devices");
4
7
  const scp_types_commerce_transaction_1 = require("@aptos-scp/scp-types-commerce-transaction");
5
8
  const config_1 = require("../../config");
6
9
  const RetailTransaction_1 = require("./RetailTransaction");
@@ -102,6 +105,33 @@ class TenderControlTransaction extends RetailTransaction_1.RetailTransaction {
102
105
  get fiscalError() {
103
106
  return this._fiscalError;
104
107
  }
108
+ get transactionChangeDue() {
109
+ var _a, _b;
110
+ let changeDue;
111
+ // For Account payments there are 3 possible amounts but only 2 that need to be considered:
112
+ // 1. the amount the customer wants to pay on the account (requestedAmount in the TenderAuthStatus result line)
113
+ // - this could be less than the tendered amount and/or more than the amount actually applied to the account for partial approvals (unlikely with cash)
114
+ // 2. the amount of Cash tendered (tenderAmount in the TenderExchangeInLine)
115
+ // - amount tendered by the customer, could be more than the requested amount.
116
+ // - amount approved by the processor, could be less than both the requested and tendered amounts
117
+ // 3. approved amount (tenderAmount in the TenderExchangeOutLine)
118
+ // - amount approved by the processor, could be less than both the requested and tendered amounts
119
+ // To calculate the change due, we need the difference between the tendered amount #3 and the applied amount #2.
120
+ if (this.isAccountPaymentTransaction && !_.isEmpty(this.lines)) {
121
+ const tenderExchangeInLine = _.last(this.lines.filter((line) => line.lineType === tender_1.TENDER_EXCHANGE_IN_LINE_TYPE));
122
+ if (((_a = tenderExchangeInLine) === null || _a === void 0 ? void 0 : _a.tenderTypeName) === scp_types_commerce_devices_1.TenderType.Cash &&
123
+ tenderExchangeInLine.tenderAmount && ((_b = tenderExchangeInLine.transactionLineReference) === null || _b === void 0 ? void 0 : _b.lineNumber)) {
124
+ const tenderExchangeOutLine = _.last(this.lines.filter((line) => line.lineType === tender_1.TENDER_EXCHANGE_OUT_LINE_TYPE));
125
+ if (tenderExchangeOutLine) {
126
+ changeDue = tenderExchangeInLine.tenderAmount.minus(tenderExchangeOutLine.tenderAmount);
127
+ }
128
+ }
129
+ }
130
+ if (!changeDue && this._accountingCurrency) {
131
+ changeDue = new scp_component_business_core_1.Money(0, this._accountingCurrency);
132
+ }
133
+ return changeDue;
134
+ }
105
135
  findLineByLineNumber(lineNumber) {
106
136
  if (lineNumber && super.lines.length > 0) {
107
137
  return super.findLineByLineNumber(lineNumber);
@@ -161,4 +191,10 @@ exports.isTenderControlTransaction = (transaction) => {
161
191
  return (transaction instanceof TenderControlTransaction ||
162
192
  ((_a = transaction) === null || _a === void 0 ? void 0 : _a.transactionType) === exports.TENDER_CONTROL_TRANSACTION_TYPE);
163
193
  };
194
+ exports.isPayOnAccountTransaction = (transaction) => {
195
+ return exports.isTenderControlTransaction(transaction) && transaction.isAccountPaymentTransaction;
196
+ };
197
+ exports.isCompletePayOnAccountTransaction = (transaction) => {
198
+ return exports.isTenderControlTransaction(transaction) && transaction.isCompleteAccountPaymentTransaction;
199
+ };
164
200
  //# sourceMappingURL=TenderControlTransaction.js.map
@@ -0,0 +1,6 @@
1
+ import { ITransactionLine } from "@aptos-scp/scp-component-store-selling-core";
2
+ import { ISameTransactionLineReference, PaymentAccountHolderMismatchAction } from "@aptos-scp/scp-types-commerce-transaction";
3
+ export interface IPaymentAccountHolderMismatchStatusLine extends ITransactionLine {
4
+ readonly action: PaymentAccountHolderMismatchAction;
5
+ readonly paymentAccountHolderValidationLineReference: ISameTransactionLineReference;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IPaymentAccountHolderMismatchStatusLine.js.map
@@ -0,0 +1,17 @@
1
+ import { ITransactionLine, UiBusinessEvent } from "@aptos-scp/scp-component-store-selling-core";
2
+ import { ISameTransactionLineReference, PaymentAccountHolderMismatchAction } from "@aptos-scp/scp-types-commerce-transaction";
3
+ import { BaseTransactionLine } from "../BaseTransactionLine";
4
+ import { IPaymentAccountHolderMismatchStatusLine } from "./IPaymentAccountHolderMismatchStatusLine";
5
+ export declare const PAYMENT_ACCOUNT_HOLDER_MISMATCH_STATUS_LINE_TYPE: string;
6
+ export declare class PaymentAccountHolderMismatchStatusLine extends BaseTransactionLine implements IPaymentAccountHolderMismatchStatusLine {
7
+ private readonly _action;
8
+ private readonly _paymentAccountHolderValidationLineReference?;
9
+ static create(lineNumber: number, lineType: string, uiBusinessEvent: UiBusinessEvent, collectedData: Readonly<Map<string, any>>): PaymentAccountHolderMismatchStatusLine;
10
+ static createFromJsonObject(transactionLineJsonObj: any): PaymentAccountHolderMismatchStatusLine;
11
+ get couldAffectPricing(): boolean;
12
+ get action(): PaymentAccountHolderMismatchAction;
13
+ get paymentAccountHolderValidationLineReference(): ISameTransactionLineReference | undefined;
14
+ constructor(lineNumber: number, lineType: string, action: PaymentAccountHolderMismatchAction, paymentAccountHolderValidationLineReference: ISameTransactionLineReference);
15
+ protected newTransactionLine(): PaymentAccountHolderMismatchStatusLine;
16
+ }
17
+ export declare function isPaymentAccountHolderMismatchStatusLine(transactionLine: ITransactionLine): transactionLine is IPaymentAccountHolderMismatchStatusLine;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const BaseTransactionLine_1 = require("../BaseTransactionLine");
4
+ const Constants_1 = require("../Constants");
5
+ exports.PAYMENT_ACCOUNT_HOLDER_MISMATCH_STATUS_LINE_TYPE = "PaymentAccountHolderMismatchStatus";
6
+ class PaymentAccountHolderMismatchStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
7
+ constructor(lineNumber, lineType, action, paymentAccountHolderValidationLineReference) {
8
+ super(lineNumber, lineType);
9
+ this._action = action;
10
+ this._paymentAccountHolderValidationLineReference = paymentAccountHolderValidationLineReference;
11
+ }
12
+ static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
13
+ const action = collectedData.get(Constants_1.CollectedDataKey.PaymentAccountHolderMismatchAction);
14
+ const paymentAccountHolderValidationLineReference = collectedData.get(Constants_1.CollectedDataKey.PaymentAccountHolderValidationLineReference);
15
+ return new PaymentAccountHolderMismatchStatusLine(lineNumber, lineType, action, paymentAccountHolderValidationLineReference);
16
+ }
17
+ static createFromJsonObject(transactionLineJsonObj) {
18
+ const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
19
+ const lineType = BaseTransactionLine_1.BaseTransactionLine.lineTypeFromJsonObject(transactionLineJsonObj);
20
+ const action = transactionLineJsonObj._action;
21
+ const paymentAccountHolderValidationLineReference = transactionLineJsonObj._paymentAccountHolderValidationLineReference;
22
+ return new PaymentAccountHolderMismatchStatusLine(lineNumber, lineType, action, paymentAccountHolderValidationLineReference);
23
+ }
24
+ get couldAffectPricing() {
25
+ return false;
26
+ }
27
+ get action() {
28
+ return this._action;
29
+ }
30
+ get paymentAccountHolderValidationLineReference() {
31
+ return this._paymentAccountHolderValidationLineReference;
32
+ }
33
+ newTransactionLine() {
34
+ return new PaymentAccountHolderMismatchStatusLine(this.lineNumber, this.lineType, this._action, this._paymentAccountHolderValidationLineReference);
35
+ }
36
+ }
37
+ exports.PaymentAccountHolderMismatchStatusLine = PaymentAccountHolderMismatchStatusLine;
38
+ function isPaymentAccountHolderMismatchStatusLine(transactionLine) {
39
+ return (transactionLine instanceof PaymentAccountHolderMismatchStatusLine ||
40
+ transactionLine.lineType === exports.PAYMENT_ACCOUNT_HOLDER_MISMATCH_STATUS_LINE_TYPE);
41
+ }
42
+ exports.isPaymentAccountHolderMismatchStatusLine = isPaymentAccountHolderMismatchStatusLine;
43
+ //# sourceMappingURL=PaymentAccountHolderMismatchStatusLine.js.map
@@ -3,3 +3,5 @@ export * from "./IPaymentAccountLookupLine";
3
3
  export * from "./PaymentAccountSession";
4
4
  export * from "./PaymentAccountHolderValidationLine";
5
5
  export * from "./IPaymentAccountHolderValidationLine";
6
+ export * from "./PaymentAccountHolderMismatchStatusLine";
7
+ export * from "./IPaymentAccountHolderMismatchStatusLine";
@@ -6,4 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  __export(require("./PaymentAccountLookupLine"));
7
7
  __export(require("./PaymentAccountSession"));
8
8
  __export(require("./PaymentAccountHolderValidationLine"));
9
+ __export(require("./PaymentAccountHolderMismatchStatusLine"));
9
10
  //# sourceMappingURL=index.js.map
@@ -10,6 +10,7 @@ export declare const TENDER_AUTH_STATUS_LINE_TYPE: string;
10
10
  export declare class TenderAuthorizationStatusLine extends BaseTransactionLine implements ITransactionLineReference {
11
11
  private _status;
12
12
  private _tenderAmount;
13
+ private _amountDue;
13
14
  private _authResponse;
14
15
  private _failureReasonCode;
15
16
  private _authorizationDeviceId;
@@ -40,6 +41,7 @@ export declare class TenderAuthorizationStatusLine extends BaseTransactionLine i
40
41
  get couldAffectPricing(): boolean;
41
42
  get status(): TenderAuthorizationStatus;
42
43
  get tenderAmount(): Money;
44
+ get amountDue(): Money;
43
45
  get authResponse(): IAuthorizationResponse;
44
46
  get failureReasonCode(): TenderAuthFailureReasonCode;
45
47
  get authorizationDeviceId(): string;
@@ -67,7 +69,7 @@ export declare class TenderAuthorizationStatusLine extends BaseTransactionLine i
67
69
  get isTenderAuthorizationFallback(): boolean;
68
70
  get payByLinkCustomer(): IPayByLinkCustomer;
69
71
  get storeLanguage(): string;
70
- protected constructor(lineNumber: number, lineType: string, status: TenderAuthorizationStatus, tenderAmount: Money, authResponse: IAuthorizationResponse, failureReasonCode: TenderAuthFailureReasonCode, authorizationDeviceId: string, transactionLineReference: ITransactionLineReferenceType, forcedAuthorizationApproval: boolean, cardNumber: string, giftCardPin: string, valueCertificateNumber: string, offlineAuthorizationCode: string, offlineApprovalCode: string, tenderAuthCategory: TenderAuthCategory, tenderType: TenderType, tenderTypeName: string, entryMethod: EntryMethod, tenderReversalFailed: boolean, originalTenderLineReferences: IOriginalTransactionRefundReference[], actionType: ActionType, mappedRefundTenderTypeName: string, mappedRefundCardTypeName: string, excludedRefundCardTypeNames: string[], subType: TenderSubType, isChangeProcessing: boolean, isTenderAuthorizationFallback: boolean, payByLinkCustomer: IPayByLinkCustomer, storeLanguage: string);
72
+ protected constructor(lineNumber: number, lineType: string, status: TenderAuthorizationStatus, tenderAmount: Money, amountDue: Money, authResponse: IAuthorizationResponse, failureReasonCode: TenderAuthFailureReasonCode, authorizationDeviceId: string, transactionLineReference: ITransactionLineReferenceType, forcedAuthorizationApproval: boolean, cardNumber: string, giftCardPin: string, valueCertificateNumber: string, offlineAuthorizationCode: string, offlineApprovalCode: string, tenderAuthCategory: TenderAuthCategory, tenderType: TenderType, tenderTypeName: string, entryMethod: EntryMethod, tenderReversalFailed: boolean, originalTenderLineReferences: IOriginalTransactionRefundReference[], actionType: ActionType, mappedRefundTenderTypeName: string, mappedRefundCardTypeName: string, excludedRefundCardTypeNames: string[], subType: TenderSubType, isChangeProcessing: boolean, isTenderAuthorizationFallback: boolean, payByLinkCustomer: IPayByLinkCustomer, storeLanguage: string);
71
73
  protected newTransactionLine(): TenderAuthorizationStatusLine;
72
74
  }
73
75
  export declare function isTenderAuthorizationStatusLine(transactionLine: ITransactionLine): transactionLine is TenderAuthorizationStatusLine;
@@ -9,10 +9,11 @@ const Constants_1 = require("../Constants");
9
9
  const TenderType_1 = require("../TenderType");
10
10
  exports.TENDER_AUTH_STATUS_LINE_TYPE = "TenderAuthorizationStatus";
11
11
  class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
12
- constructor(lineNumber, lineType, status, tenderAmount, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeName, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback, payByLinkCustomer, storeLanguage) {
12
+ constructor(lineNumber, lineType, status, tenderAmount, amountDue, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeName, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback, payByLinkCustomer, storeLanguage) {
13
13
  super(lineNumber, lineType);
14
14
  this._status = status;
15
15
  this._tenderAmount = tenderAmount;
16
+ this._amountDue = amountDue;
16
17
  this._authResponse = authResponse;
17
18
  this._failureReasonCode = failureReasonCode;
18
19
  this._authorizationDeviceId = authorizationDeviceId;
@@ -43,6 +44,7 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
43
44
  var _a;
44
45
  const status = collectedData.get(Constants_1.CollectedDataKey.TenderAuthorizationStatus);
45
46
  const tenderAmount = collectedData.get(Constants_1.CollectedDataKey.TenderAmount);
47
+ const amountDue = collectedData.get(Constants_1.CollectedDataKey.AmountDue);
46
48
  const authResponse = collectedData.get(Constants_1.CollectedDataKey.TenderAuthResponse);
47
49
  const failureReasonCode = collectedData.get(Constants_1.CollectedDataKey.TenderAuthFailureReasonCode);
48
50
  const authorizationDeviceId = collectedData.get(Constants_1.CollectedDataKey.AuthorizationDeviceId);
@@ -71,7 +73,7 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
71
73
  const isTenderAuthorizationFallback = collectedData.get(Constants_1.CollectedDataKey.IsTenderFallback);
72
74
  const payByLinkCustomer = collectedData.get(Constants_1.CollectedDataKey.PayByLinkCustomer);
73
75
  const storeLanguage = collectedData.get(Constants_1.CollectedDataKey.PrimaryLanguage);
74
- return new TenderAuthorizationStatusLine(lineNumber, lineType, status, tenderAmount, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeNames, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback, payByLinkCustomer, storeLanguage);
76
+ return new TenderAuthorizationStatusLine(lineNumber, lineType, status, tenderAmount, amountDue, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeNames, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback, payByLinkCustomer, storeLanguage);
75
77
  }
76
78
  static createFromJsonObject(transactionLineJsonObj) {
77
79
  const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
@@ -101,6 +103,10 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
101
103
  if (transactionLineJsonObj._tenderAmount) {
102
104
  tenderAmount = new scp_component_business_core_1.Money(transactionLineJsonObj._tenderAmount);
103
105
  }
106
+ let amountDue;
107
+ if (transactionLineJsonObj._amountDue) {
108
+ amountDue = new scp_component_business_core_1.Money(transactionLineJsonObj._amountDue);
109
+ }
104
110
  const authResponse = transactionLineJsonObj._authResponse;
105
111
  if (transactionLineJsonObj._authResponse) {
106
112
  if (transactionLineJsonObj._authResponse.balance) {
@@ -117,7 +123,7 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
117
123
  const failureReasonCode = scp_types_commerce_transaction_1.TenderAuthFailureReasonCode[transactionLineJsonObj._failureReasonCode];
118
124
  const payByLinkCustomer = transactionLineJsonObj._payByLinkCustomer;
119
125
  const storeLanguage = transactionLineJsonObj._storeLanguage;
120
- const tenderAuthorizationStatusLine = new TenderAuthorizationStatusLine(lineNumber, lineType, status, tenderAmount, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeName, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback, payByLinkCustomer, storeLanguage);
126
+ const tenderAuthorizationStatusLine = new TenderAuthorizationStatusLine(lineNumber, lineType, status, tenderAmount, amountDue, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeName, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback, payByLinkCustomer, storeLanguage);
121
127
  tenderAuthorizationStatusLine.loadFromJsonObject(transactionLineJsonObj);
122
128
  return tenderAuthorizationStatusLine;
123
129
  }
@@ -130,6 +136,9 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
130
136
  get tenderAmount() {
131
137
  return this._tenderAmount;
132
138
  }
139
+ get amountDue() {
140
+ return this._amountDue;
141
+ }
133
142
  get authResponse() {
134
143
  return this._authResponse;
135
144
  }
@@ -212,7 +221,7 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
212
221
  return this._storeLanguage;
213
222
  }
214
223
  newTransactionLine() {
215
- return new TenderAuthorizationStatusLine(this.lineNumber, this.lineType, this.status, this.tenderAmount, this.authResponse, this.failureReasonCode, this.authorizationDeviceId, this.transactionLineReference, this.forcedAuthorizationApproval, this.cardNumber, this.giftCardPin, this._valueCertificateNumber, this.offlineAuthorizationCode, this.offlineApprovalCode, this.tenderAuthCategory, this._tenderType, this.tenderTypeName, this._entryMethod, this._tenderReversalFailed, this._originalTenderLineReferences, this._actionType, this._mappedRefundTenderTypeName, this._mappedRefundCardTypeName, this._excludedRefundCardTypeNames, this._subType, this._isChangeProcessing, this._isTenderAuthorizationFallback, this._payByLinkCustomer, this._storeLanguage);
224
+ return new TenderAuthorizationStatusLine(this.lineNumber, this.lineType, this.status, this.tenderAmount, this.amountDue, this.authResponse, this.failureReasonCode, this.authorizationDeviceId, this.transactionLineReference, this.forcedAuthorizationApproval, this.cardNumber, this.giftCardPin, this._valueCertificateNumber, this.offlineAuthorizationCode, this.offlineApprovalCode, this.tenderAuthCategory, this._tenderType, this.tenderTypeName, this._entryMethod, this._tenderReversalFailed, this._originalTenderLineReferences, this._actionType, this._mappedRefundTenderTypeName, this._mappedRefundCardTypeName, this._excludedRefundCardTypeNames, this._subType, this._isChangeProcessing, this._isTenderAuthorizationFallback, this._payByLinkCustomer, this._storeLanguage);
216
225
  }
217
226
  }
218
227
  exports.TenderAuthorizationStatusLine = TenderAuthorizationStatusLine;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-scp/scp-component-store-selling-features-domain-model",
3
- "version": "2.2.1",
3
+ "version": "2.4.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",
@@ -84,7 +84,7 @@
84
84
  "@aptos-scp/scp-component-user": "^1.4.0",
85
85
  "@aptos-scp/scp-types-client-registration": "^1.4.0",
86
86
  "@aptos-scp/scp-types-commerce-devices": "^6.0.0",
87
- "@aptos-scp/scp-types-commerce-transaction": "^1.77.0",
87
+ "@aptos-scp/scp-types-commerce-transaction": "^1.78.0",
88
88
  "@aptos-scp/scp-types-core": "^1.0.5",
89
89
  "@aptos-scp/scp-types-core-config": "^2.2.1",
90
90
  "@aptos-scp/scp-types-currency-conversion": "^1.2.0",