@aptos-scp/scp-component-store-selling-features-domain-model 2.6.0 → 2.7.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.
|
@@ -67,6 +67,7 @@ export declare class TenderType {
|
|
|
67
67
|
private _cardType;
|
|
68
68
|
private _customCardType;
|
|
69
69
|
private _signatureCapturePolicy;
|
|
70
|
+
private _signatureCapturePolicyForCallForAuth;
|
|
70
71
|
private _signatureCaptureFloorLimit;
|
|
71
72
|
private _printDeclineTenderDetails;
|
|
72
73
|
private _printDeclineTenderReceipt;
|
|
@@ -111,7 +112,7 @@ export declare class TenderType {
|
|
|
111
112
|
static getOriginalRefundableTenders(container: Container, accountingCurrency: string, originalTransactionsDetails: IOriginalTransactionDetails[], balanceDue: Money, itemTypes?: string[], orderTypes?: string[], isRefund?: boolean, productAttributeTypes?: string[], displayInfo?: any): IOriginalTender[];
|
|
112
113
|
static getDefaultConfiguredTenderType(container: Container, accountingCurrency: string): TenderType;
|
|
113
114
|
static createFromJsonObject(tenderTypeFromJson: any): TenderType;
|
|
114
|
-
constructor(id: string, tenderName: string, tenderTypeName: string, tenderAuthCategory: TenderAuthCategory, additionalTenderAuthCategories: TenderAuthCategory[], cardType: CardType, signatureCapturePolicy: TenderSignatureCapturePolicy, signatureCaptureFloorLimit: Money, printDeclineTenderDetails: boolean, printDeclineTenderReceipt: boolean, printStoreTenderReceipt: boolean, allowPostVoid: boolean, allowCallForAuthorization: boolean, allowRefund: AllowRefund[], pluralTenderName?: string, fiscalCode?: string, fiscalType?: string, tenderLabel?: ILabel, actions?: ITenderActions, overTenderRule?: OverTenderRule, subType?: TenderSubType, customCardType?: string, promptOnPartialApproval?: string, pinRules?: IPinRules, subscriptionEntryMethods?: EntryMethod[], changeBehavior?: string, isForeignTender?: boolean, currencyCode?: string, eligibleForTaxLottery?: boolean, printVoidTenderDetails?: boolean, printVoidTenderReceipt?: boolean, cashoutThreshold?: Money);
|
|
115
|
+
constructor(id: string, tenderName: string, tenderTypeName: string, tenderAuthCategory: TenderAuthCategory, additionalTenderAuthCategories: TenderAuthCategory[], cardType: CardType, signatureCapturePolicy: TenderSignatureCapturePolicy, signatureCaptureFloorLimit: Money, printDeclineTenderDetails: boolean, printDeclineTenderReceipt: boolean, printStoreTenderReceipt: boolean, allowPostVoid: boolean, allowCallForAuthorization: boolean, allowRefund: AllowRefund[], signatureCapturePolicyForCallForAuth?: TenderSignatureCapturePolicy, pluralTenderName?: string, fiscalCode?: string, fiscalType?: string, tenderLabel?: ILabel, actions?: ITenderActions, overTenderRule?: OverTenderRule, subType?: TenderSubType, customCardType?: string, promptOnPartialApproval?: string, pinRules?: IPinRules, subscriptionEntryMethods?: EntryMethod[], changeBehavior?: string, isForeignTender?: boolean, currencyCode?: string, eligibleForTaxLottery?: boolean, printVoidTenderDetails?: boolean, printVoidTenderReceipt?: boolean, cashoutThreshold?: Money);
|
|
115
116
|
signatureRequired(tenderAmount: Money, authResponse: IAuthorizationResponse): boolean;
|
|
116
117
|
getChangeTenderType(container: Container, accountingCurrency: string, balanceDue?: Money, tenderAmount?: Money, authorizationFailed?: boolean, changeDueAmount?: Money): TenderType[];
|
|
117
118
|
get id(): string;
|
|
@@ -132,6 +133,7 @@ export declare class TenderType {
|
|
|
132
133
|
get promptOnPartialApproval(): string;
|
|
133
134
|
get signatureCaptureFloorLimit(): Money;
|
|
134
135
|
get signatureCapturePolicy(): TenderSignatureCapturePolicy;
|
|
136
|
+
get signatureCapturePolicyForCallForAuth(): TenderSignatureCapturePolicy;
|
|
135
137
|
get requiresAuth(): boolean;
|
|
136
138
|
get allowPostVoid(): boolean;
|
|
137
139
|
get overTenderRule(): OverTenderRule;
|
|
@@ -34,7 +34,7 @@ var TenderSignatureCapturePolicy;
|
|
|
34
34
|
TenderSignatureCapturePolicy["AuthResponseOrConfiguration"] = "AuthResponseOrConfiguration";
|
|
35
35
|
})(TenderSignatureCapturePolicy = exports.TenderSignatureCapturePolicy || (exports.TenderSignatureCapturePolicy = {}));
|
|
36
36
|
class TenderType {
|
|
37
|
-
constructor(id, tenderName, tenderTypeName, tenderAuthCategory, additionalTenderAuthCategories, cardType, signatureCapturePolicy, signatureCaptureFloorLimit, printDeclineTenderDetails, printDeclineTenderReceipt, printStoreTenderReceipt, allowPostVoid, allowCallForAuthorization, allowRefund, pluralTenderName, fiscalCode, fiscalType, tenderLabel, actions, overTenderRule, subType, customCardType, promptOnPartialApproval, pinRules, subscriptionEntryMethods, changeBehavior, isForeignTender, currencyCode, eligibleForTaxLottery, printVoidTenderDetails, printVoidTenderReceipt, cashoutThreshold) {
|
|
37
|
+
constructor(id, tenderName, tenderTypeName, tenderAuthCategory, additionalTenderAuthCategories, cardType, signatureCapturePolicy, signatureCaptureFloorLimit, printDeclineTenderDetails, printDeclineTenderReceipt, printStoreTenderReceipt, allowPostVoid, allowCallForAuthorization, allowRefund, signatureCapturePolicyForCallForAuth, pluralTenderName, fiscalCode, fiscalType, tenderLabel, actions, overTenderRule, subType, customCardType, promptOnPartialApproval, pinRules, subscriptionEntryMethods, changeBehavior, isForeignTender, currencyCode, eligibleForTaxLottery, printVoidTenderDetails, printVoidTenderReceipt, cashoutThreshold) {
|
|
38
38
|
this._id = id;
|
|
39
39
|
this._tenderName = tenderName;
|
|
40
40
|
this._tenderTypeName = tenderTypeName;
|
|
@@ -42,6 +42,7 @@ class TenderType {
|
|
|
42
42
|
this._additionalTenderAuthCategories = additionalTenderAuthCategories;
|
|
43
43
|
this._cardType = cardType;
|
|
44
44
|
this._signatureCapturePolicy = signatureCapturePolicy;
|
|
45
|
+
this._signatureCapturePolicyForCallForAuth = signatureCapturePolicyForCallForAuth;
|
|
45
46
|
this._signatureCaptureFloorLimit = signatureCaptureFloorLimit;
|
|
46
47
|
this._printDeclineTenderDetails = printDeclineTenderDetails;
|
|
47
48
|
this._printDeclineTenderReceipt = printDeclineTenderReceipt;
|
|
@@ -331,7 +332,7 @@ class TenderType {
|
|
|
331
332
|
if (tenderTypeFromJson) {
|
|
332
333
|
tenderType = new TenderType(tenderTypeFromJson._id, tenderTypeFromJson._tenderName, tenderTypeFromJson._tenderTypeName, Constants_1.TenderAuthCategory[tenderTypeFromJson._tenderAuthCategory], tenderTypeFromJson._additionalTenderAuthCategories, scp_types_commerce_devices_1.CardType[tenderTypeFromJson._cardType], TenderSignatureCapturePolicy[tenderTypeFromJson._signatureCapturePolicy], tenderTypeFromJson._signatureCaptureFloorLimit
|
|
333
334
|
? new scp_component_business_core_1.Money(tenderTypeFromJson._signatureCaptureFloorLimit)
|
|
334
|
-
: undefined, tenderTypeFromJson._printDeclineTenderDetails, tenderTypeFromJson._printDeclineTenderReceipt, tenderTypeFromJson._printStoreTenderReceipt, tenderTypeFromJson._allowPostVoid, tenderTypeFromJson._allowCallForAuthorization, tenderTypeFromJson._allowRefund, tenderTypeFromJson._pluralTenderName, tenderTypeFromJson._fiscalCode, tenderTypeFromJson._fiscalType, tenderTypeFromJson._tenderLabel, tenderTypeFromJson._actions, tenderTypeFromJson._overTenderRule, tenderTypeFromJson._subType, tenderTypeFromJson._customCardType, tenderTypeFromJson._promptOnPartialApproval, tenderTypeFromJson._pinRules, tenderTypeFromJson._subscriptionEntryMethods, tenderTypeFromJson._changeBehavior, tenderTypeFromJson._isForeignTender, tenderTypeFromJson._currencyCode, tenderTypeFromJson._eligibleForTaxLottery, tenderTypeFromJson._printVoidTenderDetails, tenderTypeFromJson._printVoidTenderReceipt, tenderTypeFromJson._cashoutThreshold ? new scp_component_business_core_1.Money(tenderTypeFromJson._cashoutThreshold) : undefined);
|
|
335
|
+
: undefined, tenderTypeFromJson._printDeclineTenderDetails, tenderTypeFromJson._printDeclineTenderReceipt, tenderTypeFromJson._printStoreTenderReceipt, tenderTypeFromJson._allowPostVoid, tenderTypeFromJson._allowCallForAuthorization, tenderTypeFromJson._allowRefund, TenderSignatureCapturePolicy[tenderTypeFromJson._signatureCapturePolicyForCallForAuth], tenderTypeFromJson._pluralTenderName, tenderTypeFromJson._fiscalCode, tenderTypeFromJson._fiscalType, tenderTypeFromJson._tenderLabel, tenderTypeFromJson._actions, tenderTypeFromJson._overTenderRule, tenderTypeFromJson._subType, tenderTypeFromJson._customCardType, tenderTypeFromJson._promptOnPartialApproval, tenderTypeFromJson._pinRules, tenderTypeFromJson._subscriptionEntryMethods, tenderTypeFromJson._changeBehavior, tenderTypeFromJson._isForeignTender, tenderTypeFromJson._currencyCode, tenderTypeFromJson._eligibleForTaxLottery, tenderTypeFromJson._printVoidTenderDetails, tenderTypeFromJson._printVoidTenderReceipt, tenderTypeFromJson._cashoutThreshold ? new scp_component_business_core_1.Money(tenderTypeFromJson._cashoutThreshold) : undefined);
|
|
335
336
|
}
|
|
336
337
|
else if (tenderTypeFromJson === null) {
|
|
337
338
|
tenderType = null;
|
|
@@ -340,7 +341,11 @@ class TenderType {
|
|
|
340
341
|
}
|
|
341
342
|
signatureRequired(tenderAmount, authResponse) {
|
|
342
343
|
let sigRequired = false;
|
|
343
|
-
|
|
344
|
+
//if the auth type is updateAuthorization then use signatureCapturePolicyForCallForAuth
|
|
345
|
+
const signatureCapturePolicy = authResponse.requestType === scp_types_commerce_devices_1.PaymentRequestType.UpdateAuthorization
|
|
346
|
+
? this.signatureCapturePolicyForCallForAuth
|
|
347
|
+
: this.signatureCapturePolicy;
|
|
348
|
+
switch (signatureCapturePolicy) {
|
|
344
349
|
case TenderSignatureCapturePolicy.AuthResponseOnly:
|
|
345
350
|
sigRequired = !!(authResponse.signatureRequired || authResponse.signatureCaptureSupported);
|
|
346
351
|
break;
|
|
@@ -455,6 +460,9 @@ class TenderType {
|
|
|
455
460
|
get signatureCapturePolicy() {
|
|
456
461
|
return this._signatureCapturePolicy;
|
|
457
462
|
}
|
|
463
|
+
get signatureCapturePolicyForCallForAuth() {
|
|
464
|
+
return this._signatureCapturePolicyForCallForAuth;
|
|
465
|
+
}
|
|
458
466
|
get requiresAuth() {
|
|
459
467
|
return this._tenderAuthCategory !== Constants_1.TenderAuthCategory.None;
|
|
460
468
|
}
|
|
@@ -507,7 +515,7 @@ class TenderType {
|
|
|
507
515
|
.filter((configuredTender) => tenderIsActive(configuredTender, isRefund, withTransaction, withReference, withMappedTender, withOfflineTransaction, accountingCurrency))
|
|
508
516
|
.map((configuredTender) => new TenderType(configuredTender.tenderId, configuredTender.tenderName, configuredTender.tenderType, Constants_1.TenderAuthCategory[configuredTender.tenderAuthCategory], configuredTender.additionalTenderAuthCategories, scp_types_commerce_devices_1.CardType[configuredTender.cardType], TenderSignatureCapturePolicy[configuredTender.signatureCapturePolicy], configuredTender.hasOwnProperty("signatureCaptureFloorLimit")
|
|
509
517
|
? new scp_component_business_core_1.Money(configuredTender.signatureCaptureFloorLimit, accountingCurrency)
|
|
510
|
-
: undefined, configuredTender.printDeclineTenderDetails, configuredTender.printDeclineTenderReceipt, configuredTender.printStoreTenderReceipt, configuredTender.allowPostVoid, configuredTender.allowCallForAuthorization !== false, configuredTender.allowRefund, configuredTender.pluralTenderName, configuredTender.fiscalCode, configuredTender.fiscalType, configuredTender.tenderLabel, configuredTender.actions, configuredTender.overTenderRule && Constants_1.OverTenderRule[configuredTender.overTenderRule], configuredTender.subType, configuredTender.customCardType, configuredTender.promptOnPartialApproval, configuredTender.pinRules, configuredTender.subscriptionEntryMethods, configuredTender.changeBehavior, configuredTender.isForeignTender, configuredTender.currencyCode, configuredTender.eligibleForTaxLottery, configuredTender.printVoidTenderDetails, configuredTender.printVoidTenderReceipt, configuredTender.hasOwnProperty("cashoutThreshold")
|
|
518
|
+
: undefined, configuredTender.printDeclineTenderDetails, configuredTender.printDeclineTenderReceipt, configuredTender.printStoreTenderReceipt, configuredTender.allowPostVoid, configuredTender.allowCallForAuthorization !== false, configuredTender.allowRefund, TenderSignatureCapturePolicy[configuredTender.signatureCapturePolicyForCallForAuth], configuredTender.pluralTenderName, configuredTender.fiscalCode, configuredTender.fiscalType, configuredTender.tenderLabel, configuredTender.actions, configuredTender.overTenderRule && Constants_1.OverTenderRule[configuredTender.overTenderRule], configuredTender.subType, configuredTender.customCardType, configuredTender.promptOnPartialApproval, configuredTender.pinRules, configuredTender.subscriptionEntryMethods, configuredTender.changeBehavior, configuredTender.isForeignTender, configuredTender.currencyCode, configuredTender.eligibleForTaxLottery, configuredTender.printVoidTenderDetails, configuredTender.printVoidTenderReceipt, configuredTender.hasOwnProperty("cashoutThreshold")
|
|
511
519
|
? new scp_component_business_core_1.Money(configuredTender.cashoutThreshold, accountingCurrency)
|
|
512
520
|
: undefined));
|
|
513
521
|
return activeTenders;
|
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.
|
|
3
|
+
"version": "2.7.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",
|