@aptos-scp/scp-component-store-selling-features-domain-model 1.27.1 → 1.28.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/model/Constants.d.ts +4 -0
- package/lib/domain/model/Constants.js +4 -0
- package/lib/domain/model/TenderHandlingSession.d.ts +2 -0
- package/lib/domain/model/TenderType.js +91 -15
- package/lib/domain/model/tender/TenderAuthorizationStatusLine.d.ts +5 -1
- package/lib/domain/model/tender/TenderAuthorizationStatusLine.js +16 -4
- package/package.json +1 -1
|
@@ -302,6 +302,8 @@ export declare enum UiInputKey {
|
|
|
302
302
|
TENDER_TYPE_NAME = "input_tenderTypeName",
|
|
303
303
|
IS_TENDER_FALLBACK = "input_isTenderFallback",
|
|
304
304
|
MAPPED_REFUND_TENDER_TYPE_NAME = "input_mappedRefundTenderTypeName",
|
|
305
|
+
MAPPED_REFUND_CARD_TYPE_NAME = "input_mappedRefundCardTypeName",
|
|
306
|
+
EXCLUDED_REFUND_CARD_TYPE_NAMES = "input_excludedRefundCardTypeNames",
|
|
305
307
|
TRANSACTION_NUMBER_FIELD = "input_transactionNumberField",
|
|
306
308
|
TRANSACTION_REFERENCE_NUMBER_FIELD = "input_referenceNumberField",
|
|
307
309
|
CASH_DRAWER_KEY = "input_cashDrawerKey",
|
|
@@ -826,6 +828,8 @@ export declare enum CollectedDataKey {
|
|
|
826
828
|
DeliveryInterval = "DeliveryInterval",
|
|
827
829
|
DeliveryFrequencyText = "DeliveryFrequencyText",
|
|
828
830
|
MappedRefundTenderTypeName = "MappedRefundTenderTypeName",
|
|
831
|
+
MappedRefundCardTypeName = "MappedRefundCardTypeName",
|
|
832
|
+
ExcludedRefundCardTypeNames = "ExcludedRefundCardTypeNames",
|
|
829
833
|
VatNumberIsRequired = "VatNumberIsRequired",
|
|
830
834
|
FiscalSignatureRequired = "FiscalSignatureRequired",
|
|
831
835
|
FiscalTransactionRequired = "FiscalTransactionRequired",
|
|
@@ -305,6 +305,8 @@ var UiInputKey;
|
|
|
305
305
|
UiInputKey["TENDER_TYPE_NAME"] = "input_tenderTypeName";
|
|
306
306
|
UiInputKey["IS_TENDER_FALLBACK"] = "input_isTenderFallback";
|
|
307
307
|
UiInputKey["MAPPED_REFUND_TENDER_TYPE_NAME"] = "input_mappedRefundTenderTypeName";
|
|
308
|
+
UiInputKey["MAPPED_REFUND_CARD_TYPE_NAME"] = "input_mappedRefundCardTypeName";
|
|
309
|
+
UiInputKey["EXCLUDED_REFUND_CARD_TYPE_NAMES"] = "input_excludedRefundCardTypeNames";
|
|
308
310
|
UiInputKey["TRANSACTION_NUMBER_FIELD"] = "input_transactionNumberField";
|
|
309
311
|
UiInputKey["TRANSACTION_REFERENCE_NUMBER_FIELD"] = "input_referenceNumberField";
|
|
310
312
|
UiInputKey["CASH_DRAWER_KEY"] = "input_cashDrawerKey";
|
|
@@ -835,6 +837,8 @@ var CollectedDataKey;
|
|
|
835
837
|
CollectedDataKey["DeliveryInterval"] = "DeliveryInterval";
|
|
836
838
|
CollectedDataKey["DeliveryFrequencyText"] = "DeliveryFrequencyText";
|
|
837
839
|
CollectedDataKey["MappedRefundTenderTypeName"] = "MappedRefundTenderTypeName";
|
|
840
|
+
CollectedDataKey["MappedRefundCardTypeName"] = "MappedRefundCardTypeName";
|
|
841
|
+
CollectedDataKey["ExcludedRefundCardTypeNames"] = "ExcludedRefundCardTypeNames";
|
|
838
842
|
CollectedDataKey["VatNumberIsRequired"] = "VatNumberIsRequired";
|
|
839
843
|
CollectedDataKey["FiscalSignatureRequired"] = "FiscalSignatureRequired";
|
|
840
844
|
CollectedDataKey["FiscalTransactionRequired"] = "FiscalTransactionRequired";
|
|
@@ -41,6 +41,8 @@ export interface IOriginalTender {
|
|
|
41
41
|
tenderName: string;
|
|
42
42
|
tenderId: string;
|
|
43
43
|
tenderType?: TenderType;
|
|
44
|
+
cardType?: string;
|
|
45
|
+
excludedCardTypes?: string[];
|
|
44
46
|
tenderAuthCategory: TenderAuthCategory;
|
|
45
47
|
referenceNumber?: string;
|
|
46
48
|
maskedCardNumber?: string;
|
|
@@ -521,7 +521,8 @@ function combineOriginalUnreferencedAndMappedTenders(tender, unreferencedAndMapp
|
|
|
521
521
|
combinedTender.isMappedTender &&
|
|
522
522
|
tender.tenderAuthCategory !== Constants_1.TenderAuthCategory.None &&
|
|
523
523
|
tender.tenderAuthCategory !== Constants_1.TenderAuthCategory.StoredValueCertificateService &&
|
|
524
|
-
tender.tenderType === combinedTender.tenderType
|
|
524
|
+
tender.tenderType === combinedTender.tenderType &&
|
|
525
|
+
(!combinedTender.cardType || tender.cardType === combinedTender.cardType)));
|
|
525
526
|
if (matchingUnreferencedTender) {
|
|
526
527
|
if (tender.mappedOriginTenderId !== matchingUnreferencedTender.tenderId) {
|
|
527
528
|
matchingUnreferencedTender.refundedAmount = matchingUnreferencedTender.refundedAmount.plus(tender.refundedAmount);
|
|
@@ -625,23 +626,65 @@ function getConfiguredTender(originalTender, configurationManager) {
|
|
|
625
626
|
.getTendersValues()) === null || _a === void 0 ? void 0 : _a.tenderDefinitions) === null || _b === void 0 ? void 0 : _b.find((tender) => tender.tenderId === originalTender.tenderId);
|
|
626
627
|
}
|
|
627
628
|
function getConfiguredMappedTenders(originalTender, configurationManager, transactionId, originalTransactions, refundDue) {
|
|
628
|
-
var _a, _b, _c, _d, _e
|
|
629
|
+
var _a, _b, _c, _d, _e;
|
|
629
630
|
const mappedTenders = [];
|
|
630
631
|
const tenderConfig = (_a = configurationManager) === null || _a === void 0 ? void 0 : _a.getTendersValues();
|
|
631
632
|
const tenderTypeBehaviors = (_c = (_b = tenderConfig) === null || _b === void 0 ? void 0 : _b.tenderBehaviors) === null || _c === void 0 ? void 0 : _c.tenderTypeBehaviors;
|
|
632
633
|
const tenderDefinitions = (_d = tenderConfig) === null || _d === void 0 ? void 0 : _d.tenderDefinitions;
|
|
633
634
|
const configuredTender = getConfiguredTender(originalTender, configurationManager);
|
|
634
635
|
const tenderTypeBehavior = configuredTender && tenderTypeBehaviors && tenderTypeBehaviors[configuredTender.tenderType];
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
636
|
+
let refundCardTypes;
|
|
637
|
+
let refundTenderTypes;
|
|
638
|
+
let excludeCardTypes;
|
|
639
|
+
const cardTypeExceptionsForOriginalTender = getCardTypeExceptions(originalTender, tenderDefinitions, tenderTypeBehavior);
|
|
640
|
+
// If the card type for the original tender is defined in the cardTypeExceptions, then use that
|
|
641
|
+
if (!_.isEmpty(cardTypeExceptionsForOriginalTender)) {
|
|
642
|
+
refundTenderTypes = cardTypeExceptionsForOriginalTender.refundTenderTypes;
|
|
643
|
+
refundCardTypes = cardTypeExceptionsForOriginalTender.refundCardTypes;
|
|
644
|
+
const mappedCardTypeNames = getMappedCardTypeNames(originalTender, tenderConfig, refundCardTypes);
|
|
645
|
+
excludeCardTypes = mappedCardTypeNames;
|
|
646
|
+
addCardTypeTendersToMappedTenders(mappedCardTypeNames, tenderDefinitions, mappedTenders, originalTender, transactionId, originalTransactions);
|
|
647
|
+
}
|
|
648
|
+
else {
|
|
649
|
+
// otherwise use the refundTenderTypes from the root tenderTypeBehavior
|
|
650
|
+
refundTenderTypes = (_e = tenderTypeBehavior) === null || _e === void 0 ? void 0 : _e.refundTenderTypes;
|
|
651
|
+
// exclude ANY refundableCardTypes that exist under cardTypeExceptions
|
|
652
|
+
excludeCardTypes = getAllRefundableCardTypes(tenderTypeBehavior);
|
|
653
|
+
}
|
|
654
|
+
const mappedTenderTypeNames = getMappedTenderTypeNames(originalTender, tenderConfig, originalTransactions, refundDue, refundTenderTypes);
|
|
655
|
+
addTenderTypesToMappedTenders(mappedTenderTypeNames, tenderDefinitions, mappedTenders, originalTender, transactionId, originalTransactions, excludeCardTypes);
|
|
656
|
+
return mappedTenders;
|
|
657
|
+
}
|
|
658
|
+
function getAllRefundableCardTypes(tenderTypeBehavior) {
|
|
659
|
+
var _a, _b;
|
|
660
|
+
const refundableCardTypes = [];
|
|
661
|
+
if ((_b = (_a = tenderTypeBehavior) === null || _a === void 0 ? void 0 : _a.cardTypeExceptions) === null || _b === void 0 ? void 0 : _b.enabled) {
|
|
662
|
+
Object.keys(tenderTypeBehavior.cardTypeExceptions).forEach((cardType) => {
|
|
663
|
+
const refundCardTypes = tenderTypeBehavior.cardTypeExceptions[cardType].refundCardTypes;
|
|
664
|
+
if (refundCardTypes) {
|
|
665
|
+
Object.keys(refundCardTypes).forEach((refundCardType) => {
|
|
666
|
+
const refundCardTypeConfig = refundCardTypes[refundCardType];
|
|
667
|
+
if (refundCardTypeConfig.allowed) {
|
|
668
|
+
refundableCardTypes.push(refundCardType);
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
}
|
|
643
672
|
});
|
|
644
|
-
|
|
673
|
+
}
|
|
674
|
+
return refundableCardTypes;
|
|
675
|
+
}
|
|
676
|
+
function addCardTypeTendersToMappedTenders(mappedCardTypeNames, tenderDefinitions, mappedTenders, originalTender, transactionId, originalTransactions) {
|
|
677
|
+
var _a;
|
|
678
|
+
(_a = mappedCardTypeNames) === null || _a === void 0 ? void 0 : _a.forEach((cardType) => {
|
|
679
|
+
var _a;
|
|
680
|
+
const tenderDefs = tenderDefinitions.filter((tenderDef) => { var _a; return tenderDef.cardType === cardType && ((_a = tenderDef.allowRefund) === null || _a === void 0 ? void 0 : _a.indexOf("WhenMapped")) > -1; });
|
|
681
|
+
const tenderName = (_a = tenderDefs.find((tenderDef) => tenderDef.cardType === cardType)) === null || _a === void 0 ? void 0 : _a.tenderDescription;
|
|
682
|
+
mappedTenders.push(buildMappedOriginalTender(originalTender, tenderName, originalTender.tenderType, undefined, getTenderAuthCategoryFromTenderType(originalTender.tenderType), transactionId, originalTransactions, undefined, cardType));
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
function addTenderTypesToMappedTenders(mappedTenderTypeNames, tenderDefinitions, mappedTenders, originalTender, transactionId, originalTransactions, excludedCardTypes) {
|
|
686
|
+
var _a;
|
|
687
|
+
(_a = mappedTenderTypeNames) === null || _a === void 0 ? void 0 : _a.forEach((tenderType) => {
|
|
645
688
|
var _a;
|
|
646
689
|
// For TenderAuthCategory: None tenders and Value certificate tenders need to have a tenderId, so we'll have one mapped tender for each
|
|
647
690
|
// of those tenders.
|
|
@@ -662,15 +705,33 @@ function getConfiguredMappedTenders(originalTender, configurationManager, transa
|
|
|
662
705
|
defaultValue: tenderDef.tenderLabel.default,
|
|
663
706
|
})) ||
|
|
664
707
|
tenderDef.tenderName;
|
|
665
|
-
mappedTenders.push(buildMappedOriginalTender(originalTender, label, tenderDef.tenderType, tenderDef.tenderId, tenderDef.tenderAuthCategory, transactionId, originalTransactions, tenderDef.subType));
|
|
708
|
+
mappedTenders.push(buildMappedOriginalTender(originalTender, label, tenderDef.tenderType, tenderDef.tenderId, tenderDef.tenderAuthCategory, transactionId, originalTransactions, tenderDef.subType, undefined, excludedCardTypes));
|
|
666
709
|
});
|
|
667
710
|
}
|
|
668
711
|
else {
|
|
669
712
|
const tenderName = I18n.t(mapTenderTypeToI18nCode.get(tenderType), { defaultValue: tenderType });
|
|
670
|
-
mappedTenders.push(buildMappedOriginalTender(originalTender, tenderName, tenderType, undefined, getTenderAuthCategoryFromTenderType(tenderType), transactionId, originalTransactions, undefined));
|
|
713
|
+
mappedTenders.push(buildMappedOriginalTender(originalTender, tenderName, tenderType, undefined, getTenderAuthCategoryFromTenderType(tenderType), transactionId, originalTransactions, undefined, undefined, excludedCardTypes));
|
|
671
714
|
}
|
|
672
715
|
});
|
|
673
|
-
|
|
716
|
+
}
|
|
717
|
+
function getMappedTenderTypeNames(originalTender, tenderConfig, originalTransactions, refundDue, refundTenderTypes) {
|
|
718
|
+
return (refundTenderTypes &&
|
|
719
|
+
Object.keys(refundTenderTypes).filter((tenderType) => {
|
|
720
|
+
const mappedRefundTenderType = refundTenderTypes[tenderType];
|
|
721
|
+
return (mappedRefundTenderType &&
|
|
722
|
+
(!mappedRefundTenderType.hasOwnProperty("allowed") || mappedRefundTenderType["allowed"] === true) &&
|
|
723
|
+
allowMappedTender(tenderType, tenderConfig) &&
|
|
724
|
+
isOriginalTenderAmountAllowed(originalTender, mappedRefundTenderType, originalTransactions, refundDue));
|
|
725
|
+
}));
|
|
726
|
+
}
|
|
727
|
+
function getMappedCardTypeNames(originalTender, tenderConfig, refundCardTypes) {
|
|
728
|
+
return (refundCardTypes &&
|
|
729
|
+
Object.keys(refundCardTypes).filter((cardType) => {
|
|
730
|
+
const mappedRefundCardType = refundCardTypes[cardType];
|
|
731
|
+
return (mappedRefundCardType &&
|
|
732
|
+
allowMappedCardType(cardType, tenderConfig) &&
|
|
733
|
+
(!mappedRefundCardType.hasOwnProperty("allowed") || mappedRefundCardType["allowed"] === true));
|
|
734
|
+
}));
|
|
674
735
|
}
|
|
675
736
|
function getActiveTendersByConfiguredPaymentRestrictions(activeTenderTypes, saleItemTypes, diContainer, orderTypes, productAttributeTypes) {
|
|
676
737
|
let nonRestrictedTenderTypes = [];
|
|
@@ -925,11 +986,14 @@ function sortOriginalTenders(originalTenders) {
|
|
|
925
986
|
function allowMappedTender(tenderType, tenderConfig) {
|
|
926
987
|
return tenderConfig.tenderDefinitions.some((tender) => { var _a; return tender.tenderType === tenderType && ((_a = tender.allowRefund) === null || _a === void 0 ? void 0 : _a.indexOf("WhenMapped")) > -1; });
|
|
927
988
|
}
|
|
989
|
+
function allowMappedCardType(cardType, tenderConfig) {
|
|
990
|
+
return tenderConfig.tenderDefinitions.some((tender) => { var _a; return tender.cardType === cardType && ((_a = tender.allowRefund) === null || _a === void 0 ? void 0 : _a.indexOf("WhenMapped")) > -1; });
|
|
991
|
+
}
|
|
928
992
|
function adjustAmount(amount, adjustmentAmount) {
|
|
929
993
|
var _a;
|
|
930
994
|
return (adjustmentAmount && ((_a = amount) === null || _a === void 0 ? void 0 : _a.plus(adjustmentAmount))) || amount;
|
|
931
995
|
}
|
|
932
|
-
function buildMappedOriginalTender(originalTender, tenderName, tenderType, tenderId, tenderAuthCategory, transactionId, originalTransactions, subType) {
|
|
996
|
+
function buildMappedOriginalTender(originalTender, tenderName, tenderType, tenderId, tenderAuthCategory, transactionId, originalTransactions, subType, cardType, excludedCardTypes) {
|
|
933
997
|
var _a;
|
|
934
998
|
const originalTran = (_a = originalTransactions) === null || _a === void 0 ? void 0 : _a.find((origTran) => origTran.originalTransactionId === transactionId);
|
|
935
999
|
const returnTotalAmount = getReturnOrCancelTotalAmount(originalTran);
|
|
@@ -942,6 +1006,8 @@ function buildMappedOriginalTender(originalTender, tenderName, tenderType, tende
|
|
|
942
1006
|
tenderName,
|
|
943
1007
|
tenderType: tenderTypeName,
|
|
944
1008
|
subType,
|
|
1009
|
+
cardType,
|
|
1010
|
+
excludedCardTypes,
|
|
945
1011
|
originalTransactionReferences: isOriginalTenderFullyRefunded(originalTender, returnTotalAmount)
|
|
946
1012
|
? undefined
|
|
947
1013
|
: TenderHandlingSession_1.getOriginalTransactionReferences(transactionId, originalTender.originalLineReferences),
|
|
@@ -1403,4 +1469,14 @@ function getChangeAmount(balanceDue, tenderAmount) {
|
|
|
1403
1469
|
return tenderAmount.minus(balanceDue);
|
|
1404
1470
|
}
|
|
1405
1471
|
}
|
|
1472
|
+
function getCardTypeExceptions(originalTender, tenderDefinitions, tenderTypeBehavior) {
|
|
1473
|
+
var _a, _b;
|
|
1474
|
+
// Find the tender definition for the original tender
|
|
1475
|
+
const originalTenderDefinition = tenderDefinitions.find((tender) => tender.tenderId === originalTender.tenderId);
|
|
1476
|
+
// If
|
|
1477
|
+
if (originalTenderDefinition && ((_b = (_a = tenderTypeBehavior) === null || _a === void 0 ? void 0 : _a.cardTypeExceptions) === null || _b === void 0 ? void 0 : _b.enabled)) {
|
|
1478
|
+
// Is there an entry for the card type in the cardTypeExceptions?
|
|
1479
|
+
return tenderTypeBehavior.cardTypeExceptions[originalTenderDefinition.cardType];
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1406
1482
|
//# sourceMappingURL=TenderType.js.map
|
|
@@ -29,6 +29,8 @@ export declare class TenderAuthorizationStatusLine extends BaseTransactionLine i
|
|
|
29
29
|
private _actionType;
|
|
30
30
|
private _originalTenderLineReferences;
|
|
31
31
|
private _mappedRefundTenderTypeName;
|
|
32
|
+
private _mappedRefundCardTypeName;
|
|
33
|
+
private _excludedRefundCardTypeNames;
|
|
32
34
|
private _subType;
|
|
33
35
|
private readonly _isChangeProcessing;
|
|
34
36
|
static create(lineNumber: number, lineType: string, uiBusinessEvent: UiBusinessEvent, collectedData: Readonly<Map<string, any>>): TenderAuthorizationStatusLine;
|
|
@@ -58,8 +60,10 @@ export declare class TenderAuthorizationStatusLine extends BaseTransactionLine i
|
|
|
58
60
|
get actionType(): ActionType;
|
|
59
61
|
get subType(): TenderSubType;
|
|
60
62
|
get mappedRefundTenderTypeName(): string;
|
|
63
|
+
get mappedRefundCardTypeName(): string;
|
|
64
|
+
get excludedRefundCardTypeNames(): string[];
|
|
61
65
|
get isTenderAuthorizationFallback(): boolean;
|
|
62
|
-
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, subType: TenderSubType, isChangeProcessing: boolean, isTenderAuthorizationFallback: boolean);
|
|
66
|
+
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);
|
|
63
67
|
protected newTransactionLine(): TenderAuthorizationStatusLine;
|
|
64
68
|
}
|
|
65
69
|
export declare function isTenderAuthorizationStatusLine(transactionLine: ITransactionLine): transactionLine is TenderAuthorizationStatusLine;
|
|
@@ -9,7 +9,7 @@ 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, subType, isChangeProcessing, isTenderAuthorizationFallback) {
|
|
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) {
|
|
13
13
|
super(lineNumber, lineType);
|
|
14
14
|
this._status = status;
|
|
15
15
|
this._tenderAmount = tenderAmount;
|
|
@@ -31,6 +31,8 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
|
|
|
31
31
|
this._originalTenderLineReferences = originalTenderLineReferences;
|
|
32
32
|
this._actionType = actionType;
|
|
33
33
|
this._mappedRefundTenderTypeName = mappedRefundTenderTypeName;
|
|
34
|
+
this._mappedRefundCardTypeName = mappedRefundCardTypeName;
|
|
35
|
+
this._excludedRefundCardTypeNames = excludedRefundCardTypeNames;
|
|
34
36
|
this._subType = subType;
|
|
35
37
|
this._isChangeProcessing = isChangeProcessing;
|
|
36
38
|
this._isTenderAuthorizationFallback = isTenderAuthorizationFallback;
|
|
@@ -60,10 +62,12 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
|
|
|
60
62
|
const tenderReversalFailed = collectedData.get(Constants_1.CollectedDataKey.TenderReversalFailed);
|
|
61
63
|
const actionType = collectedData.get(Constants_1.CollectedDataKey.ActionType);
|
|
62
64
|
const mappedRefundTenderTypeName = collectedData.get(Constants_1.CollectedDataKey.MappedRefundTenderTypeName);
|
|
65
|
+
const mappedRefundCardTypeNames = collectedData.get(Constants_1.CollectedDataKey.MappedRefundCardTypeName);
|
|
66
|
+
const excludedRefundCardTypeNames = collectedData.get(Constants_1.CollectedDataKey.ExcludedRefundCardTypeNames);
|
|
63
67
|
const subType = collectedData.get(Constants_1.CollectedDataKey.TenderSubType);
|
|
64
68
|
const isChangeProcessing = collectedData.get(Constants_1.CollectedDataKey.IsChangeProcessing);
|
|
65
69
|
const isTenderAuthorizationFallback = collectedData.get(Constants_1.CollectedDataKey.IsTenderFallback);
|
|
66
|
-
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, subType, isChangeProcessing, isTenderAuthorizationFallback);
|
|
70
|
+
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);
|
|
67
71
|
}
|
|
68
72
|
static createFromJsonObject(transactionLineJsonObj) {
|
|
69
73
|
const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
|
|
@@ -84,6 +88,8 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
|
|
|
84
88
|
const tenderReversalFailed = transactionLineJsonObj._tenderReversalFailed;
|
|
85
89
|
const actionType = transactionLineJsonObj._actionType;
|
|
86
90
|
const mappedRefundTenderTypeName = transactionLineJsonObj._mappedRefundTenderTypeName;
|
|
91
|
+
const mappedRefundCardTypeName = transactionLineJsonObj._mappedRefundCardTypeName;
|
|
92
|
+
const excludedRefundCardTypeNames = transactionLineJsonObj._excludedRefundCardTypeNames;
|
|
87
93
|
const subType = transactionLineJsonObj._subType;
|
|
88
94
|
const isChangeProcessing = transactionLineJsonObj._isChangeProcessing;
|
|
89
95
|
const isTenderAuthorizationFallback = transactionLineJsonObj._isTenderAuthorizationFallback;
|
|
@@ -105,7 +111,7 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
|
|
|
105
111
|
}
|
|
106
112
|
const status = scp_types_commerce_transaction_1.TenderAuthorizationStatus[transactionLineJsonObj._status];
|
|
107
113
|
const failureReasonCode = scp_types_commerce_transaction_1.TenderAuthFailureReasonCode[transactionLineJsonObj._failureReasonCode];
|
|
108
|
-
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, subType, isChangeProcessing, isTenderAuthorizationFallback);
|
|
114
|
+
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);
|
|
109
115
|
tenderAuthorizationStatusLine.loadFromJsonObject(transactionLineJsonObj);
|
|
110
116
|
return tenderAuthorizationStatusLine;
|
|
111
117
|
}
|
|
@@ -184,11 +190,17 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
|
|
|
184
190
|
get mappedRefundTenderTypeName() {
|
|
185
191
|
return this._mappedRefundTenderTypeName;
|
|
186
192
|
}
|
|
193
|
+
get mappedRefundCardTypeName() {
|
|
194
|
+
return this._mappedRefundCardTypeName;
|
|
195
|
+
}
|
|
196
|
+
get excludedRefundCardTypeNames() {
|
|
197
|
+
return this._excludedRefundCardTypeNames;
|
|
198
|
+
}
|
|
187
199
|
get isTenderAuthorizationFallback() {
|
|
188
200
|
return this._isTenderAuthorizationFallback;
|
|
189
201
|
}
|
|
190
202
|
newTransactionLine() {
|
|
191
|
-
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._subType, this._isChangeProcessing, this._isTenderAuthorizationFallback);
|
|
203
|
+
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);
|
|
192
204
|
}
|
|
193
205
|
}
|
|
194
206
|
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": "1.
|
|
3
|
+
"version": "1.28.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",
|