@bondsports/types 2.4.88 → 2.4.89

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.
@@ -4,6 +4,7 @@ import { PlatformsEnum } from '../../services/enums.service';
4
4
  import { TerminalActionCancelRequestReasonEnum } from '../types/enums/terminal-action.enums';
5
5
  import { TerminalReaderActionStatusEnum, TerminalReaderActionTypeEnum } from '../types/enums/terminal-readers.enums';
6
6
  import { TerminalPresentPaymentMethodTypeEnum } from './terminal-actions.enums';
7
+ export declare const TERMINAL_IDEMPOTENCY_KEY_MAX_LENGTH = 128;
7
8
  export declare class TerminalPaymentIntentDto {
8
9
  amount: number;
9
10
  customer: string;
@@ -23,7 +24,8 @@ export declare class TerminalProcessSetupIntentOverrideConfigDto {
23
24
  allow_redisplay: 'always' | 'limited' | 'unspecified';
24
25
  }
25
26
  export declare class ProcessTerminalPaymentDto {
26
- paymentIntent: TerminalPaymentIntentDto;
27
+ paymentIntent?: TerminalPaymentIntentDto;
28
+ paymentIntentId?: string;
27
29
  force?: boolean;
28
30
  overrideConfig?: TerminalProcessPaymentOverrideConfigDto;
29
31
  idempotencyKey?: string;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TerminalCancelActionResponseDto = exports.TerminalActionResponseDto = exports.TerminalOverrideResultDto = exports.TerminalOverridePreviousActionDto = exports.TerminalActionInitiatedByDto = exports.TerminalActionStateDto = exports.ProcessTerminalRefundDto = exports.ProcessTerminalSetupIntentDto = exports.PresentTerminalPaymentMethodDto = exports.CollectTerminalInputsDto = exports.TerminalCollectInputTypeEnum = exports.CancelTerminalActionDto = exports.ProcessTerminalPaymentDto = exports.TerminalProcessSetupIntentOverrideConfigDto = exports.TerminalProcessPaymentOverrideConfigDto = exports.TerminalProcessPaymentTippingDto = exports.TerminalPaymentIntentDto = void 0;
3
+ exports.TerminalCancelActionResponseDto = exports.TerminalActionResponseDto = exports.TerminalOverrideResultDto = exports.TerminalOverridePreviousActionDto = exports.TerminalActionInitiatedByDto = exports.TerminalActionStateDto = exports.ProcessTerminalRefundDto = exports.ProcessTerminalSetupIntentDto = exports.PresentTerminalPaymentMethodDto = exports.CollectTerminalInputsDto = exports.TerminalCollectInputTypeEnum = exports.CancelTerminalActionDto = exports.ProcessTerminalPaymentDto = exports.TerminalProcessSetupIntentOverrideConfigDto = exports.TerminalProcessPaymentOverrideConfigDto = exports.TerminalProcessPaymentTippingDto = exports.TerminalPaymentIntentDto = exports.TERMINAL_IDEMPOTENCY_KEY_MAX_LENGTH = void 0;
4
4
  const TERMINAL_PAYMENT_METHOD_TYPES_MAX = 10;
5
- const TERMINAL_IDEMPOTENCY_KEY_MAX_LENGTH = 128;
5
+ exports.TERMINAL_IDEMPOTENCY_KEY_MAX_LENGTH = 128;
6
6
  const TERMINAL_CARD_NUMBER_MAX_LENGTH = 19;
7
7
  class TerminalPaymentIntentDto {
8
8
  }
@@ -16,6 +16,13 @@ exports.TerminalProcessPaymentOverrideConfigDto = TerminalProcessPaymentOverride
16
16
  class TerminalProcessSetupIntentOverrideConfigDto {
17
17
  }
18
18
  exports.TerminalProcessSetupIntentOverrideConfigDto = TerminalProcessSetupIntentOverrideConfigDto;
19
+ /**
20
+ * Whether `idempotencyKey`'s validators should run on a process-payment body. They always run when the
21
+ * client supplied a key, and additionally when `paymentIntentId` is set, which makes the key mandatory:
22
+ * a reserved intent id holds the rest of the Stripe key steady across attempts, so without a rotating
23
+ * client key Stripe replays the first attempt's cached response — including its error — for 24 hours.
24
+ */
25
+ const requiresIdempotencyKeyValidation = (dto) => Boolean(dto.paymentIntentId) || dto.idempotencyKey !== undefined;
19
26
  class ProcessTerminalPaymentDto {
20
27
  }
21
28
  exports.ProcessTerminalPaymentDto = ProcessTerminalPaymentDto;
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-actions.dto.js","sourceRoot":"","sources":["../../../../src/types/terminal/dto/terminal-actions.dto.ts"],"names":[],"mappings":";;;AASA,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAC7C,MAAM,mCAAmC,GAAG,GAAG,CAAC;AAChD,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAE3C,MAAa,wBAAwB;CAYpC;AAZD,4DAYC;AAED,MAAa,gCAAgC;CAE5C;AAFD,4EAEC;AAED,MAAa,uCAAuC;CAInD;AAJD,0FAIC;AAED,MAAa,2CAA2C;CAEvD;AAFD,kGAEC;AAED,MAAa,yBAAyB;CAQrC;AARD,8DAQC;AAED,MAAa,uBAAuB;CAEnC;AAFD,0DAEC;AAED,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACvC,uEAAuC,CAAA;IACvC,+DAA+B,CAAA;AAChC,CAAC,EAHW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAGvC;AAED,MAAa,wBAAwB;CAIpC;AAJD,4DAIC;AAED,MAAa,+BAA+B;CAM3C;AAND,0EAMC;AAED,MAAa,6BAA6B;CAQzC;AARD,sEAQC;AAED,MAAa,wBAAwB;CAQpC;AARD,4DAQC;AAED,MAAa,sBAAsB;CAIlC;AAJD,wDAIC;AAED,MAAa,4BAA4B;CAMxC;AAND,oEAMC;AAED,MAAa,iCAAiC;CAI7C;AAJD,8EAIC;AAED,MAAa,yBAAyB;CAIrC;AAJD,8DAIC;AAED,MAAa,yBAAyB;CAcrC;AAdD,8DAcC;AAED,MAAa,+BAA+B;CAM3C;AAND,0EAMC"}
1
+ {"version":3,"file":"terminal-actions.dto.js","sourceRoot":"","sources":["../../../../src/types/terminal/dto/terminal-actions.dto.ts"],"names":[],"mappings":";;;AASA,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAChC,QAAA,mCAAmC,GAAG,GAAG,CAAC;AACvD,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAE3C,MAAa,wBAAwB;CAYpC;AAZD,4DAYC;AAED,MAAa,gCAAgC;CAE5C;AAFD,4EAEC;AAED,MAAa,uCAAuC;CAInD;AAJD,0FAIC;AAED,MAAa,2CAA2C;CAEvD;AAFD,kGAEC;AAED;;;;;GAKG;AACH,MAAM,gCAAgC,GAAG,CAAC,GAA8B,EAAW,EAAE,CACpF,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC;AAElE,MAAa,yBAAyB;CAUrC;AAVD,8DAUC;AAED,MAAa,uBAAuB;CAEnC;AAFD,0DAEC;AAED,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACvC,uEAAuC,CAAA;IACvC,+DAA+B,CAAA;AAChC,CAAC,EAHW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAGvC;AAED,MAAa,wBAAwB;CAIpC;AAJD,4DAIC;AAED,MAAa,+BAA+B;CAM3C;AAND,0EAMC;AAED,MAAa,6BAA6B;CAQzC;AARD,sEAQC;AAED,MAAa,wBAAwB;CAQpC;AARD,4DAQC;AAED,MAAa,sBAAsB;CAIlC;AAJD,wDAIC;AAED,MAAa,4BAA4B;CAMxC;AAND,oEAMC;AAED,MAAa,iCAAiC;CAI7C;AAJD,8EAIC;AAED,MAAa,yBAAyB;CAIrC;AAJD,8DAIC;AAED,MAAa,yBAAyB;CAcrC;AAdD,8DAcC;AAED,MAAa,+BAA+B;CAM3C;AAND,0EAMC"}
@@ -1,3 +1,4 @@
1
+ import Stripe from 'stripe';
1
2
  export declare const ACTIVE_ACTION_TTL_SECONDS = 300;
2
3
  export declare const GHOST_CANCEL_TTL_SECONDS = 300;
3
4
  export declare const GHOST_CANCEL_RETRY_COOLDOWN_MS = 30000;
@@ -6,3 +7,10 @@ export declare const STRIPE_PAYMENT_INTENT_UNEXPECTED_STATE_CODE = "payment_inte
6
7
  export declare const STRIPE_TERMINAL_READER_BUSY_CODE = "terminal_reader_busy";
7
8
  export declare const STRIPE_TERMINAL_READER_OFFLINE_CODE = "terminal_reader_offline";
8
9
  export declare const STRIPE_TERMINAL_READER_TIMEOUT_CODE = "terminal_reader_timeout";
10
+ /**
11
+ * Statuses a PaymentIntent may hold when it is handed to a reader for `process_payment_intent`.
12
+ * A declined charge returns the intent to `requires_payment_method`, so retries stay dispatchable,
13
+ * while `processing`, `requires_capture`, `succeeded`, and `canceled` are all past the point where
14
+ * another reader charge is safe.
15
+ */
16
+ export declare const DISPATCHABLE_PAYMENT_INTENT_STATUSES: ReadonlySet<Stripe.PaymentIntent.Status>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STRIPE_TERMINAL_READER_TIMEOUT_CODE = exports.STRIPE_TERMINAL_READER_OFFLINE_CODE = exports.STRIPE_TERMINAL_READER_BUSY_CODE = exports.STRIPE_PAYMENT_INTENT_UNEXPECTED_STATE_CODE = exports.LOCK_TTL_MS = exports.GHOST_CANCEL_RETRY_COOLDOWN_MS = exports.GHOST_CANCEL_TTL_SECONDS = exports.ACTIVE_ACTION_TTL_SECONDS = void 0;
3
+ exports.DISPATCHABLE_PAYMENT_INTENT_STATUSES = exports.STRIPE_TERMINAL_READER_TIMEOUT_CODE = exports.STRIPE_TERMINAL_READER_OFFLINE_CODE = exports.STRIPE_TERMINAL_READER_BUSY_CODE = exports.STRIPE_PAYMENT_INTENT_UNEXPECTED_STATE_CODE = exports.LOCK_TTL_MS = exports.GHOST_CANCEL_RETRY_COOLDOWN_MS = exports.GHOST_CANCEL_TTL_SECONDS = exports.ACTIVE_ACTION_TTL_SECONDS = void 0;
4
4
  exports.ACTIVE_ACTION_TTL_SECONDS = 300;
5
5
  exports.GHOST_CANCEL_TTL_SECONDS = 300;
6
6
  exports.GHOST_CANCEL_RETRY_COOLDOWN_MS = 30000;
@@ -9,4 +9,14 @@ exports.STRIPE_PAYMENT_INTENT_UNEXPECTED_STATE_CODE = 'payment_intent_unexpected
9
9
  exports.STRIPE_TERMINAL_READER_BUSY_CODE = 'terminal_reader_busy';
10
10
  exports.STRIPE_TERMINAL_READER_OFFLINE_CODE = 'terminal_reader_offline';
11
11
  exports.STRIPE_TERMINAL_READER_TIMEOUT_CODE = 'terminal_reader_timeout';
12
+ /**
13
+ * Statuses a PaymentIntent may hold when it is handed to a reader for `process_payment_intent`.
14
+ * A declined charge returns the intent to `requires_payment_method`, so retries stay dispatchable,
15
+ * while `processing`, `requires_capture`, `succeeded`, and `canceled` are all past the point where
16
+ * another reader charge is safe.
17
+ */
18
+ exports.DISPATCHABLE_PAYMENT_INTENT_STATUSES = new Set([
19
+ 'requires_payment_method',
20
+ 'requires_confirmation',
21
+ ]);
12
22
  //# sourceMappingURL=terminal-action.consts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-action.consts.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/consts/terminal-action.consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,yBAAyB,GAAG,GAAG,CAAC;AAEhC,QAAA,wBAAwB,GAAG,GAAG,CAAC;AAE/B,QAAA,8BAA8B,GAAG,KAAM,CAAC;AAExC,QAAA,WAAW,GAAG,KAAM,CAAC;AAErB,QAAA,2CAA2C,GAAG,iCAAiC,CAAC;AAEhF,QAAA,gCAAgC,GAAG,sBAAsB,CAAC;AAE1D,QAAA,mCAAmC,GAAG,yBAAyB,CAAC;AAEhE,QAAA,mCAAmC,GAAG,yBAAyB,CAAC"}
1
+ {"version":3,"file":"terminal-action.consts.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/consts/terminal-action.consts.ts"],"names":[],"mappings":";;;AAEa,QAAA,yBAAyB,GAAG,GAAG,CAAC;AAEhC,QAAA,wBAAwB,GAAG,GAAG,CAAC;AAE/B,QAAA,8BAA8B,GAAG,KAAM,CAAC;AAExC,QAAA,WAAW,GAAG,KAAM,CAAC;AAErB,QAAA,2CAA2C,GAAG,iCAAiC,CAAC;AAEhF,QAAA,gCAAgC,GAAG,sBAAsB,CAAC;AAE1D,QAAA,mCAAmC,GAAG,yBAAyB,CAAC;AAEhE,QAAA,mCAAmC,GAAG,yBAAyB,CAAC;AAE7E;;;;;GAKG;AACU,QAAA,oCAAoC,GAA6C,IAAI,GAAG,CAAC;IACrG,yBAAyB;IACzB,uBAAuB;CACvB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bondsports/types",
3
- "version": "2.4.88",
3
+ "version": "2.4.89",
4
4
  "description": "backend types module for Bond-Sports",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {