@munchi_oy/core 1.9.96 → 1.9.97

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.
@@ -2677,6 +2677,42 @@ export interface ChargeDtoPaymentMethodDetails {
2677
2677
  */
2678
2678
  'affirmDetails'?: PaymentMethodDetailsDtoAffirmDetails;
2679
2679
  }
2680
+ /**
2681
+ *
2682
+ * @export
2683
+ * @enum {string}
2684
+ */
2685
+ export declare const ChargeStatusEnum: {
2686
+ readonly Pending: "pending";
2687
+ readonly Success: "success";
2688
+ readonly Failure: "failure";
2689
+ };
2690
+ export type ChargeStatusEnum = typeof ChargeStatusEnum[keyof typeof ChargeStatusEnum];
2691
+ /**
2692
+ *
2693
+ * @export
2694
+ * @interface ChargeStatusResponseDto
2695
+ */
2696
+ export interface ChargeStatusResponseDto {
2697
+ /**
2698
+ *
2699
+ * @type {ChargeStatusEnum}
2700
+ * @memberof ChargeStatusResponseDto
2701
+ */
2702
+ 'status': ChargeStatusEnum;
2703
+ /**
2704
+ *
2705
+ * @type {string}
2706
+ * @memberof ChargeStatusResponseDto
2707
+ */
2708
+ 'transactionId'?: string | null;
2709
+ /**
2710
+ *
2711
+ * @type {string}
2712
+ * @memberof ChargeStatusResponseDto
2713
+ */
2714
+ 'errorCode'?: string | null;
2715
+ }
2680
2716
  /**
2681
2717
  *
2682
2718
  * @export
@@ -6917,12 +6953,6 @@ export interface InitiateVivaSessionDto {
6917
6953
  * @memberof InitiateVivaSessionDto
6918
6954
  */
6919
6955
  'splitContext'?: CreateManualSessionDtoSplitContext;
6920
- /**
6921
- * Paired Munchi Pay terminal id (from @munchi_oy/pay-terminal-protocol pairing) that should execute this app-to-app charge. Bound onto the session so the paired terminal is discoverable/auditable; the POS still owns polling as source of truth. Distinct from the Viva cloud-terminal hardware id.
6922
- * @type {string}
6923
- * @memberof InitiateVivaSessionDto
6924
- */
6925
- 'payTerminalId'?: string;
6926
6956
  }
6927
6957
  /**
6928
6958
  *
@@ -19266,6 +19296,31 @@ export interface RefundedItemDto {
19266
19296
  */
19267
19297
  'amount': number;
19268
19298
  }
19299
+ /**
19300
+ *
19301
+ * @export
19302
+ * @interface RegisterChargeMappingDto
19303
+ */
19304
+ export interface RegisterChargeMappingDto {
19305
+ /**
19306
+ * POS-generated id for this charge attempt (from the pay-terminal Ably relay).
19307
+ * @type {string}
19308
+ * @memberof RegisterChargeMappingDto
19309
+ */
19310
+ 'chargeId': string;
19311
+ /**
19312
+ * The order this charge belongs to (matches the Viva session\'s referenceId).
19313
+ * @type {string}
19314
+ * @memberof RegisterChargeMappingDto
19315
+ */
19316
+ 'orderId': string;
19317
+ /**
19318
+ * The business the order belongs to.
19319
+ * @type {number}
19320
+ * @memberof RegisterChargeMappingDto
19321
+ */
19322
+ 'businessId': number;
19323
+ }
19269
19324
  /**
19270
19325
  *
19271
19326
  * @export
@@ -35411,6 +35466,22 @@ export declare const PaymentSessionApiAxiosParamCreator: (configuration?: Config
35411
35466
  * @throws {RequiredError}
35412
35467
  */
35413
35468
  initiateWorldlineSession: (initiateWorldlineSessionDto: InitiateWorldlineSessionDto, xIdempotencyKey?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
35469
+ /**
35470
+ * Fallback for when the pay-terminal Ably charge_result message is lost to a flaky connection. Returns \'pending\' until the backend observes the underlying PaymentSession reach a terminal state, regardless of either device\'s connectivity.
35471
+ * @summary Poll a charge\'s outcome by chargeId.
35472
+ * @param {string} chargeId
35473
+ * @param {*} [options] Override http request option.
35474
+ * @throws {RequiredError}
35475
+ */
35476
+ paymentSessionGetChargeStatus: (chargeId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
35477
+ /**
35478
+ * Called by the paying device (e.g. a paired Munchi Pay terminal) right as it starts a charge relayed from the POS over Ably, so the POS can fall back to polling if the Ably charge_result message never arrives.
35479
+ * @summary Register a POS-generated chargeId against an order so its outcome can be polled.
35480
+ * @param {RegisterChargeMappingDto} registerChargeMappingDto
35481
+ * @param {*} [options] Override http request option.
35482
+ * @throws {RequiredError}
35483
+ */
35484
+ paymentSessionRegisterChargeMapping: (registerChargeMappingDto: RegisterChargeMappingDto, options?: AxiosRequestConfig) => Promise<RequestArgs>;
35414
35485
  /**
35415
35486
  * Called by a Cloud Task (not the client). Holds the request open and long-polls Viva by sessionId for up to ~45s. As soon as the transaction is terminal it updates the session status and, on success, triggers order reconciliation — guarded by a CAS claim (tryClose) so a late webhook never double-writes the paymentEvent — so the order closes even if the webhook never arrives.
35416
35487
  * @summary Internal: long-poll Viva for a stuck payment session (Cloud Task callback)
@@ -35558,6 +35629,22 @@ export declare const PaymentSessionApiFp: (configuration?: Configuration) => {
35558
35629
  * @throws {RequiredError}
35559
35630
  */
35560
35631
  initiateWorldlineSession(initiateWorldlineSessionDto: InitiateWorldlineSessionDto, xIdempotencyKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InitiateWorldlineSessionResponseDto>>;
35632
+ /**
35633
+ * Fallback for when the pay-terminal Ably charge_result message is lost to a flaky connection. Returns \'pending\' until the backend observes the underlying PaymentSession reach a terminal state, regardless of either device\'s connectivity.
35634
+ * @summary Poll a charge\'s outcome by chargeId.
35635
+ * @param {string} chargeId
35636
+ * @param {*} [options] Override http request option.
35637
+ * @throws {RequiredError}
35638
+ */
35639
+ paymentSessionGetChargeStatus(chargeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChargeStatusResponseDto>>;
35640
+ /**
35641
+ * Called by the paying device (e.g. a paired Munchi Pay terminal) right as it starts a charge relayed from the POS over Ably, so the POS can fall back to polling if the Ably charge_result message never arrives.
35642
+ * @summary Register a POS-generated chargeId against an order so its outcome can be polled.
35643
+ * @param {RegisterChargeMappingDto} registerChargeMappingDto
35644
+ * @param {*} [options] Override http request option.
35645
+ * @throws {RequiredError}
35646
+ */
35647
+ paymentSessionRegisterChargeMapping(registerChargeMappingDto: RegisterChargeMappingDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
35561
35648
  /**
35562
35649
  * Called by a Cloud Task (not the client). Holds the request open and long-polls Viva by sessionId for up to ~45s. As soon as the transaction is terminal it updates the session status and, on success, triggers order reconciliation — guarded by a CAS claim (tryClose) so a late webhook never double-writes the paymentEvent — so the order closes even if the webhook never arrives.
35563
35650
  * @summary Internal: long-poll Viva for a stuck payment session (Cloud Task callback)
@@ -35705,6 +35792,22 @@ export declare const PaymentSessionApiFactory: (configuration?: Configuration, b
35705
35792
  * @throws {RequiredError}
35706
35793
  */
35707
35794
  initiateWorldlineSession(initiateWorldlineSessionDto: InitiateWorldlineSessionDto, xIdempotencyKey?: string, options?: any): AxiosPromise<InitiateWorldlineSessionResponseDto>;
35795
+ /**
35796
+ * Fallback for when the pay-terminal Ably charge_result message is lost to a flaky connection. Returns \'pending\' until the backend observes the underlying PaymentSession reach a terminal state, regardless of either device\'s connectivity.
35797
+ * @summary Poll a charge\'s outcome by chargeId.
35798
+ * @param {string} chargeId
35799
+ * @param {*} [options] Override http request option.
35800
+ * @throws {RequiredError}
35801
+ */
35802
+ paymentSessionGetChargeStatus(chargeId: string, options?: any): AxiosPromise<ChargeStatusResponseDto>;
35803
+ /**
35804
+ * Called by the paying device (e.g. a paired Munchi Pay terminal) right as it starts a charge relayed from the POS over Ably, so the POS can fall back to polling if the Ably charge_result message never arrives.
35805
+ * @summary Register a POS-generated chargeId against an order so its outcome can be polled.
35806
+ * @param {RegisterChargeMappingDto} registerChargeMappingDto
35807
+ * @param {*} [options] Override http request option.
35808
+ * @throws {RequiredError}
35809
+ */
35810
+ paymentSessionRegisterChargeMapping(registerChargeMappingDto: RegisterChargeMappingDto, options?: any): AxiosPromise<void>;
35708
35811
  /**
35709
35812
  * Called by a Cloud Task (not the client). Holds the request open and long-polls Viva by sessionId for up to ~45s. As soon as the transaction is terminal it updates the session status and, on success, triggers order reconciliation — guarded by a CAS claim (tryClose) so a late webhook never double-writes the paymentEvent — so the order closes even if the webhook never arrives.
35710
35813
  * @summary Internal: long-poll Viva for a stuck payment session (Cloud Task callback)
@@ -35860,6 +35963,24 @@ export interface PaymentSessionApiInterface {
35860
35963
  * @memberof PaymentSessionApiInterface
35861
35964
  */
35862
35965
  initiateWorldlineSession(initiateWorldlineSessionDto: InitiateWorldlineSessionDto, xIdempotencyKey?: string, options?: AxiosRequestConfig): AxiosPromise<InitiateWorldlineSessionResponseDto>;
35966
+ /**
35967
+ * Fallback for when the pay-terminal Ably charge_result message is lost to a flaky connection. Returns \'pending\' until the backend observes the underlying PaymentSession reach a terminal state, regardless of either device\'s connectivity.
35968
+ * @summary Poll a charge\'s outcome by chargeId.
35969
+ * @param {string} chargeId
35970
+ * @param {*} [options] Override http request option.
35971
+ * @throws {RequiredError}
35972
+ * @memberof PaymentSessionApiInterface
35973
+ */
35974
+ paymentSessionGetChargeStatus(chargeId: string, options?: AxiosRequestConfig): AxiosPromise<ChargeStatusResponseDto>;
35975
+ /**
35976
+ * Called by the paying device (e.g. a paired Munchi Pay terminal) right as it starts a charge relayed from the POS over Ably, so the POS can fall back to polling if the Ably charge_result message never arrives.
35977
+ * @summary Register a POS-generated chargeId against an order so its outcome can be polled.
35978
+ * @param {RegisterChargeMappingDto} registerChargeMappingDto
35979
+ * @param {*} [options] Override http request option.
35980
+ * @throws {RequiredError}
35981
+ * @memberof PaymentSessionApiInterface
35982
+ */
35983
+ paymentSessionRegisterChargeMapping(registerChargeMappingDto: RegisterChargeMappingDto, options?: AxiosRequestConfig): AxiosPromise<void>;
35863
35984
  /**
35864
35985
  * Called by a Cloud Task (not the client). Holds the request open and long-polls Viva by sessionId for up to ~45s. As soon as the transaction is terminal it updates the session status and, on success, triggers order reconciliation — guarded by a CAS claim (tryClose) so a late webhook never double-writes the paymentEvent — so the order closes even if the webhook never arrives.
35865
35986
  * @summary Internal: long-poll Viva for a stuck payment session (Cloud Task callback)
@@ -36026,6 +36147,24 @@ export declare class PaymentSessionApi extends BaseAPI implements PaymentSession
36026
36147
  * @memberof PaymentSessionApi
36027
36148
  */
36028
36149
  initiateWorldlineSession(initiateWorldlineSessionDto: InitiateWorldlineSessionDto, xIdempotencyKey?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InitiateWorldlineSessionResponseDto, any, {}>>;
36150
+ /**
36151
+ * Fallback for when the pay-terminal Ably charge_result message is lost to a flaky connection. Returns \'pending\' until the backend observes the underlying PaymentSession reach a terminal state, regardless of either device\'s connectivity.
36152
+ * @summary Poll a charge\'s outcome by chargeId.
36153
+ * @param {string} chargeId
36154
+ * @param {*} [options] Override http request option.
36155
+ * @throws {RequiredError}
36156
+ * @memberof PaymentSessionApi
36157
+ */
36158
+ paymentSessionGetChargeStatus(chargeId: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ChargeStatusResponseDto, any, {}>>;
36159
+ /**
36160
+ * Called by the paying device (e.g. a paired Munchi Pay terminal) right as it starts a charge relayed from the POS over Ably, so the POS can fall back to polling if the Ably charge_result message never arrives.
36161
+ * @summary Register a POS-generated chargeId against an order so its outcome can be polled.
36162
+ * @param {RegisterChargeMappingDto} registerChargeMappingDto
36163
+ * @param {*} [options] Override http request option.
36164
+ * @throws {RequiredError}
36165
+ * @memberof PaymentSessionApi
36166
+ */
36167
+ paymentSessionRegisterChargeMapping(registerChargeMappingDto: RegisterChargeMappingDto, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
36029
36168
  /**
36030
36169
  * Called by a Cloud Task (not the client). Holds the request open and long-polls Viva by sessionId for up to ~45s. As soon as the transaction is terminal it updates the session status and, on success, triggers order reconciliation — guarded by a CAS claim (tryClose) so a late webhook never double-writes the paymentEvent — so the order closes even if the webhook never arrives.
36031
36170
  * @summary Internal: long-poll Viva for a stuck payment session (Cloud Task callback)