@aptos-scp/scp-component-store-selling-features-domain-model 2.6.0 → 2.7.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.
@@ -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;
@@ -339,8 +340,13 @@ class TenderType {
339
340
  return tenderType;
340
341
  }
341
342
  signatureRequired(tenderAmount, authResponse) {
343
+ var _a;
342
344
  let sigRequired = false;
343
- switch (this.signatureCapturePolicy) {
345
+ //if the auth type is updateAuthorization then use signatureCapturePolicyForCallForAuth
346
+ const signatureCapturePolicy = ((_a = authResponse) === null || _a === void 0 ? void 0 : _a.requestType) === scp_types_commerce_devices_1.PaymentRequestType.UpdateAuthorization
347
+ ? this.signatureCapturePolicyForCallForAuth
348
+ : this.signatureCapturePolicy;
349
+ switch (signatureCapturePolicy) {
344
350
  case TenderSignatureCapturePolicy.AuthResponseOnly:
345
351
  sigRequired = !!(authResponse.signatureRequired || authResponse.signatureCaptureSupported);
346
352
  break;
@@ -455,6 +461,9 @@ class TenderType {
455
461
  get signatureCapturePolicy() {
456
462
  return this._signatureCapturePolicy;
457
463
  }
464
+ get signatureCapturePolicyForCallForAuth() {
465
+ return this._signatureCapturePolicyForCallForAuth;
466
+ }
458
467
  get requiresAuth() {
459
468
  return this._tenderAuthCategory !== Constants_1.TenderAuthCategory.None;
460
469
  }
@@ -507,7 +516,7 @@ class TenderType {
507
516
  .filter((configuredTender) => tenderIsActive(configuredTender, isRefund, withTransaction, withReference, withMappedTender, withOfflineTransaction, accountingCurrency))
508
517
  .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
518
  ? 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")
519
+ : 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
520
  ? new scp_component_business_core_1.Money(configuredTender.cashoutThreshold, accountingCurrency)
512
521
  : undefined));
513
522
  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.6.0",
3
+ "version": "2.7.1",
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",