@ancon/wildcat-utils 1.40.45 → 1.40.47

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.
@@ -55,13 +55,17 @@ declare enum CheckoutPaymentErrorTranslationKey {
55
55
  PaymentPenguinNotEnoughLockers = "paymentPenguinNotEnoughLockers",
56
56
  PaymentPenguinTooManyItems = "paymentPenguinTooManyItems",
57
57
  PaymentPenguinProductInvalidUnits = "paymentPenguinProductInvalidUnits",
58
- PaymentCheckoutServiceTimeInPast = "paymentCheckoutServiceTimeInPast"
58
+ PaymentCheckoutServiceTimeInPast = "paymentCheckoutServiceTimeInPast",
59
+ PaymentNotAllowedForCompanyAccount = "paymentNotAllowedForCompanyAccount",
60
+ PaymentIntegrationNotFound = "paymentIntegrationNotFound",
61
+ PaymentIntegrationInactive = "paymentIntegrationInactive",
62
+ PaymentPenguinIntegrationUnauthorized = "paymentPenguinIntegrationUnauthorized"
59
63
  }
60
64
  declare type CheckoutPaymentErrorTranslation = {
61
65
  title: string;
62
66
  message: string;
63
67
  };
64
- declare type TranslationsWithMeta = Record<CheckoutPaymentErrorTranslationKey.PaymentRefusalReferral | CheckoutPaymentErrorTranslationKey.PaymentRefusalAcquirer | CheckoutPaymentErrorTranslationKey.PaymentRefusalSubmmissionAdyen | CheckoutPaymentErrorTranslationKey.PaymentRefusalDoNotHonor | CheckoutPaymentErrorTranslationKey.PaymentResultError | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeDataNotValid | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeErrorUnknownReason | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeCheckoutCaptured | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeCheckoutAuthorized | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeCaptureFailure | CheckoutPaymentErrorTranslationKey.PaymentActionErrorUnknownReason | CheckoutPaymentErrorTranslationKey.PaymentActionInvalidData | CheckoutPaymentErrorTranslationKey.PaymentActionCaptureFailure | CheckoutPaymentErrorTranslationKey.PaymentPaymentCheckoutCreated | CheckoutPaymentErrorTranslationKey.PaymentCheckoutPaymentFailure | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeNoItems | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeInvalidCustomer | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeInvalidDelivery | CheckoutPaymentErrorTranslationKey.PaymentPenguinProductInvalidUnits | CheckoutPaymentErrorTranslationKey.PaymentCheckoutServiceTimeInPast, ({ meta, }: {
68
+ declare type TranslationsWithMeta = Record<CheckoutPaymentErrorTranslationKey.PaymentRefusalReferral | CheckoutPaymentErrorTranslationKey.PaymentRefusalAcquirer | CheckoutPaymentErrorTranslationKey.PaymentRefusalSubmmissionAdyen | CheckoutPaymentErrorTranslationKey.PaymentRefusalDoNotHonor | CheckoutPaymentErrorTranslationKey.PaymentResultError | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeDataNotValid | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeErrorUnknownReason | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeCheckoutCaptured | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeCheckoutAuthorized | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeCaptureFailure | CheckoutPaymentErrorTranslationKey.PaymentActionErrorUnknownReason | CheckoutPaymentErrorTranslationKey.PaymentActionInvalidData | CheckoutPaymentErrorTranslationKey.PaymentActionCaptureFailure | CheckoutPaymentErrorTranslationKey.PaymentPaymentCheckoutCreated | CheckoutPaymentErrorTranslationKey.PaymentCheckoutPaymentFailure | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeNoItems | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeInvalidCustomer | CheckoutPaymentErrorTranslationKey.PaymentAuthorizeInvalidDelivery | CheckoutPaymentErrorTranslationKey.PaymentPenguinProductInvalidUnits | CheckoutPaymentErrorTranslationKey.PaymentCheckoutServiceTimeInPast | CheckoutPaymentErrorTranslationKey.PaymentIntegrationNotFound | CheckoutPaymentErrorTranslationKey.PaymentIntegrationInactive | CheckoutPaymentErrorTranslationKey.PaymentPenguinIntegrationUnauthorized, ({ meta, }: {
65
69
  key: CheckoutPaymentErrorTranslationKey;
66
70
  meta: {
67
71
  checkoutId: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@ancon/wildcat-types");require("axios");const l=require("../error/isSerializedAPIError.js");var s=(e=>(e.PaymentRefusalGeneral="paymentRefusalGeneral",e.PaymentRefusalTransactionRefused="paymentRefusalTransactionRefused",e.PaymentRefusalReferral="paymentRefusalReferral",e.PaymentRefusalAcquirer="paymentRefusalAcquirer",e.PaymentRefusalBlockedCard="paymentRefusalBlockedCard",e.PaymentRefusalExpiredCard="paymentRefusalExpiredCard",e.PaymentRefusalInvalidAmount="paymentRefusalInvalidAmount",e.PaymentRefusalInvalidCardnumber="paymentRefusalInvalidCardnumber",e.PaymentRefusalIssuerUnavailable="paymentRefusalIssuerUnavailable",e.PaymentRefusalBankNotSupported="paymentRefusalBankNotSupported",e.PaymentRefusal3dsecureAuthFailed="paymentRefusal3dsecureAuthFailed",e.PaymentRefusalNoEnoughBalance="paymentRefusalNoEnoughBalance",e.PaymentRefusalFraudDetected="paymentRefusalFraudDetected",e.PaymentRefusalCancelled="paymentRefusalCancelled",e.PaymentRefusalInvalidPin="paymentRefusalInvalidPin",e.PaymentRefusalPinRetryExceeded="paymentRefusalPinRetryExceeded",e.PaymentRefusalUnableValidatePin="paymentRefusalUnableValidatePin",e.PaymentRefusalSubmmissionAdyen="paymentRefusalSubmmissionAdyen",e.PaymentRefusalCvcDeclined="paymentRefusalCvcDeclined",e.PaymentRefusalRestrictedCard="paymentRefusalRestrictedCard",e.PaymentRefusalDoNotHonor="paymentRefusalDoNotHonor",e.PaymentRefusalWdrwAmountExceeded="paymentRefusalWdrwAmountExceeded",e.PaymentRefusalWdrwCountExceeded="paymentRefusalWdrwCountExceeded",e.PaymentRefusalAvsDeclined="paymentRefusalAvsDeclined",e.PaymentRefusalCardOnlinePin="paymentRefusalCardOnlinePin",e.PaymentRefusalNoAcctAtchdCard="paymentRefusalNoAcctAtchdCard",e.PaymentRefusalMobilePin="paymentRefusalMobilePin",e.PaymentRefusalContactlessFallback="paymentRefusalContactlessFallback",e.PaymentRefusalAuthRequired="paymentRefusalAuthRequired",e.PaymentResultCancelled="paymentResultCancelled",e.PaymentResultError="paymentResultError",e.PaymentResultRefused="paymentResultRefused",e.PaymentAuthorizeDataNotValid="paymentAuthorizeDataNotValid",e.PaymentAuthorizeErrorUnknownReason="paymentAuthorizeErrorUnknownReason",e.PaymentAuthorizeCheckoutCaptured="paymentAuthorizeCheckoutCaptured",e.PaymentAuthorizeCheckoutAuthorized="paymentAuthorizeCheckoutAuthorized",e.PaymentAuthorizeCaptureFailure="paymentAuthorizeCaptureFailure",e.PaymentAuthorizeCancelOrRefund="paymentAuthorizeCancelOrRefund",e.PaymentActionErrorUnknownReason="paymentActionErrorUnknownReason",e.PaymentActionInvalidData="paymentActionInvalidData",e.PaymentActionCaptureFailure="paymentActionCaptureFailure",e.PaymentActionCancelOrRefund="paymentActionCancelOrRefund",e.PaymentPaymentAppNotFound="paymentPaymentAppNotFound",e.PaymentPaymentCheckoutCreated="paymentPaymentCheckoutCreated",e.PaymentCheckoutPaymentFailure="paymentCheckoutPaymentFailure",e.PaymentDetailsNotSupported="paymentDetailsNotSupported",e.PaymentAuthorizeNoItems="paymentAuthorizeNoItems",e.PaymentAuthorizeInvalidCustomer="paymentAuthorizeInvalidCustomer",e.PaymentAuthorizeInvalidDelivery="paymentAuthorizeInvalidDelivery",e.PaymentPenguinInvalidStation="paymentPenguinInvalidStation",e.PaymentPenguinInvalidTimeSlot="paymentPenguinInvalidTimeSlot",e.PaymentPenguinNotEnoughLockers="paymentPenguinNotEnoughLockers",e.PaymentPenguinTooManyItems="paymentPenguinTooManyItems",e.PaymentPenguinProductInvalidUnits="paymentPenguinProductInvalidUnits",e.PaymentCheckoutServiceTimeInPast="paymentCheckoutServiceTimeInPast",e))(s||{});const d={paymentRefusalGeneral:()=>({title:"Payment failure",message:"The transaction was refused."}),paymentRefusalTransactionRefused:()=>({title:"Payment failure",message:"The transaction was refused."}),paymentRefusalReferral:({meta:e})=>({title:"Payment failure",message:`A referral error occurred. (${e.checkoutId})`}),paymentRefusalAcquirer:({meta:e})=>({title:"Payment failure",message:`An acquirer error occurred. (${e.checkoutId})`}),paymentRefusalBlockedCard:()=>({title:"Payment failure",message:"The provided card is blocked."}),paymentRefusalExpiredCard:()=>({title:"Payment failure",message:"The provided card is expired."}),paymentRefusalInvalidAmount:()=>({title:"Payment failure",message:"An invalid payment amount was provided."}),paymentRefusalInvalidCardnumber:()=>({title:"Payment failure",message:"An invalid card number was provided."}),paymentRefusalIssuerUnavailable:()=>({title:"Payment failure",message:"Card issuer not available."}),paymentRefusalBankNotSupported:()=>({title:"Payment failure",message:"CVC declined."}),paymentRefusal3dsecureAuthFailed:()=>({title:"Payment failure",message:"3D Secure was not authenticated."}),paymentRefusalNoEnoughBalance:()=>({title:"Payment failure",message:"Not enough balance."}),paymentRefusalFraudDetected:()=>({title:"Payment failure",message:"The provided card is not allowed."}),paymentRefusalCancelled:()=>({title:"Payment cancelled",message:"The payment was cancelled."}),paymentRefusalInvalidPin:()=>({title:"Payment failure",message:"Invalid PIN."}),paymentRefusalPinRetryExceeded:()=>({title:"Payment failure",message:"PIN tries exceeded."}),paymentRefusalUnableValidatePin:()=>({title:"Payment failure",message:"PIN validation was not possible."}),paymentRefusalSubmmissionAdyen:({meta:e})=>({title:"Payment failure",message:`Submission error. (${e.checkoutId})`}),paymentRefusalCvcDeclined:()=>({title:"Payment failure",message:"CVC declined."}),paymentRefusalRestrictedCard:()=>({title:"Payment failure",message:"Restricted card."}),paymentRefusalDoNotHonor:({meta:e})=>({title:"Payment failure",message:`The transaction was refused (do not honor). (${e.checkoutId})`}),paymentRefusalWdrwAmountExceeded:()=>({title:"Payment failure",message:"Withdrawal amount exceeded."}),paymentRefusalWdrwCountExceeded:()=>({title:"Payment failure",message:"Withdrawal count exceeded."}),paymentRefusalAvsDeclined:()=>({title:"Payment failure",message:"AVS declined."}),paymentRefusalCardOnlinePin:()=>({title:"Payment failure",message:"The provided card requires online PIN."}),paymentRefusalNoAcctAtchdCard:()=>({title:"Payment failure",message:"No account attached to the provided card."}),paymentRefusalMobilePin:()=>({title:"Payment failure",message:"Mobile PIN required."}),paymentRefusalContactlessFallback:()=>({title:"Payment failure",message:"Contactless fallback."}),paymentRefusalAuthRequired:()=>({title:"Payment failure",message:"Authentication required"}),paymentResultCancelled:()=>({title:"Payment cancelled",message:"The payment was cancelled."}),paymentResultError:({meta:e})=>({title:"Payment error",message:`There was an error processing your payment. (${e.checkoutId})`}),paymentResultRefused:()=>({title:"Payment refused",message:"The payment was refused."}),paymentAuthorizeDataNotValid:({meta:e})=>({title:"Authorization failed",message:`The provided data was invalid. (${e.checkoutId})`}),paymentAuthorizeErrorUnknownReason:({meta:e})=>({title:"Authorization failed",message:`Authorization failed because of an unknown error. (${e.checkoutId})`}),paymentAuthorizeCheckoutCaptured:({meta:e})=>({title:"Authorization failed",message:`The checkout has already been captured. (${e.checkoutId})`}),paymentAuthorizeCheckoutAuthorized:({meta:e})=>({title:"Authorization failed",message:`The checkout has already been authorized. (${e.checkoutId})`}),paymentAuthorizeCaptureFailure:({meta:e})=>({title:"Authorization failed",message:`Failed to capture checkout. (${e.checkoutId})`}),paymentAuthorizeCancelOrRefund:()=>({title:"Authorization failed",message:"The checkout has already been cancelled or refunded."}),paymentActionErrorUnknownReason:({meta:e})=>({title:"Action failed",message:`The action failed because of an unknown error. (${e.checkoutId})`}),paymentActionInvalidData:({meta:e})=>({title:"Action failed",message:`The provided data was invalid. (${e.checkoutId})`}),paymentActionCaptureFailure:({meta:e})=>({title:"Action failed",message:`Failed to capture checkout. (${e.checkoutId})`}),paymentActionCancelOrRefund:()=>({title:"Action failed",message:"The checkout has already been cancelled or refunded."}),paymentPaymentAppNotFound:()=>({title:"Payment failure",message:"The chosen payment method requires an app which is not installed."}),paymentPaymentCheckoutCreated:({meta:e})=>({title:"Payment failure",message:`The checkout is created, cannot make payment, make sure the customer is connected to this checkout. (${e.checkoutId})`}),paymentCheckoutPaymentFailure:({meta:e})=>({title:"Payment failure",message:`Unfortunately an error has occurred and your payment cannot be processed. (${e.checkoutId})`}),paymentDetailsNotSupported:()=>({title:"Payment failure",message:"The payment provider is not supported by this outlet."}),paymentAuthorizeNoItems:({meta:e})=>({title:"Payment failure",message:`The current checkout does not contain any products. (${e.checkoutId})`}),paymentAuthorizeInvalidCustomer:({meta:e})=>({title:"Payment failure",message:`Could not resolve the customer from database. (${e.checkoutId})`}),paymentAuthorizeInvalidDelivery:({meta:e})=>({title:"Payment failure",message:`Missing delivery information. (${e.checkoutId})`}),paymentPenguinInvalidStation:()=>({title:"Payment failure",message:"Invalid station."}),paymentPenguinInvalidTimeSlot:()=>({title:"Payment failure",message:"Invalid time slot."}),paymentPenguinNotEnoughLockers:()=>({title:"Payment failure",message:"Not enough lockers."}),paymentPenguinTooManyItems:()=>({title:"Payment failure",message:"The current checkout has too many items."}),paymentPenguinProductInvalidUnits:({meta:e})=>({title:"Payment failure",message:`The current checkout does not contain valid product storage configurations. (${e.checkoutId})`}),paymentCheckoutServiceTimeInPast:({meta:e})=>({title:"Payment failure",message:`The order time cannot be in the past. (${e.checkoutId})`})};function m(e){switch(e){case"0":return"paymentRefusalGeneral";case"2":case"23":return"paymentRefusalTransactionRefused";case"3":return"paymentRefusalReferral";case"4":return"paymentRefusalAcquirer";case"5":return"paymentRefusalBlockedCard";case"6":return"paymentRefusalExpiredCard";case"7":return"paymentRefusalInvalidAmount";case"8":return"paymentRefusalInvalidCardnumber";case"9":return"paymentRefusalIssuerUnavailable";case"10":return"paymentRefusalBankNotSupported";case"11":return"paymentRefusal3dsecureAuthFailed";case"12":return"paymentRefusalNoEnoughBalance";case"14":case"20":case"31":return"paymentRefusalFraudDetected";case"15":case"16":return"paymentRefusalCancelled";case"17":return"paymentRefusalInvalidPin";case"18":return"paymentRefusalPinRetryExceeded";case"19":return"paymentRefusalUnableValidatePin";case"21":return"paymentRefusalSubmmissionAdyen";case"24":return"paymentRefusalCvcDeclined";case"25":return"paymentRefusalRestrictedCard";case"27":return"paymentRefusalDoNotHonor";case"28":return"paymentRefusalWdrwAmountExceeded";case"29":return"paymentRefusalWdrwCountExceeded";case"32":return"paymentRefusalAvsDeclined";case"33":return"paymentRefusalCardOnlinePin";case"34":case"35":return"paymentRefusalNoAcctAtchdCard";case"36":return"paymentRefusalMobilePin";case"37":return"paymentRefusalContactlessFallback";case"38":return"paymentRefusalAuthRequired";default:return null}}function o(e){switch(e){case"Cancelled":return"paymentResultCancelled";case"Error":return"paymentResultError";case"Refused":return"paymentResultRefused";default:return null}}function c(e,a){if(l(e))switch(e.response.data.errorCode){case t.ErrorCode.AuthorizeDataNotValid:return["paymentAuthorizeDataNotValid",{checkoutId:a}];case t.ErrorCode.AuthorizeErrorUnknownReason:return["paymentAuthorizeErrorUnknownReason",{checkoutId:a}];case t.ErrorCode.AuthorizeCheckoutCaptured:return["paymentAuthorizeCheckoutCaptured",{checkoutId:a}];case t.ErrorCode.AuthorizeCheckoutAuthorized:return["paymentAuthorizeCheckoutAuthorized",{checkoutId:a}];case t.ErrorCode.AuthorizeCaptureFailure:return["paymentAuthorizeCaptureFailure",{checkoutId:a}];case t.ErrorCode.AuthorizeCancelOrRefund:return["paymentAuthorizeCancelOrRefund",{checkoutId:a}];case t.ErrorCode.ActionErrorUnknownReason:return["paymentActionErrorUnknownReason",{checkoutId:a}];case t.ErrorCode.ActionInvalidData:return["paymentActionInvalidData",{checkoutId:a}];case t.ErrorCode.ActionCaptureFailure:return["paymentActionCaptureFailure",{checkoutId:a}];case t.ErrorCode.ActionCancelOrRefund:return["paymentActionCancelOrRefund",{checkoutId:a}];case t.ErrorCode.AppNotFound:return["paymentPaymentAppNotFound",{checkoutId:a}];case t.ErrorCode.PaymentCheckoutCreated:return["paymentPaymentCheckoutCreated",{checkoutId:a}];case t.ErrorCode.PaymentAuthorizeNoItems:return["paymentAuthorizeNoItems",{checkoutId:a}];case t.ErrorCode.PaymentAuthorizeInvalidCustomer:return["paymentAuthorizeInvalidCustomer",{checkoutId:a}];case t.ErrorCode.PaymentAuthorizeInvalidDelivery:return["paymentAuthorizeInvalidDelivery",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinInvalidStation:return["paymentCheckoutPaymentFailure",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinInvalidTimeSlot:return["paymentPenguinInvalidTimeSlot",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinNotEnoughLockers:return["paymentPenguinNotEnoughLockers",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinTooManyItems:return["paymentPenguinTooManyItems",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinProductInvalidUnits:return["paymentPenguinProductInvalidUnits",{checkoutId:a}];case t.ErrorCode.ServiceTimeInThePast:return["paymentCheckoutServiceTimeInPast",{checkoutId:a}]}else{const u=m(e==null?void 0:e.refusalReasonCode);if(u)return[u,{checkoutId:a}];const n=o(e==null?void 0:e.resultCode);if(n)return[n,{checkoutId:a}]}return["paymentCheckoutPaymentFailure",{checkoutId:a}]}function p(e,a,u=d){const[n,r]=c(e,a),i=u[n]({key:n,meta:r});if(!i)throw new Error("Could not resolve translation in getCheckoutPaymentErrorTexts()");return[i,n]}exports.CheckoutPaymentErrorTranslationKey=s;exports.default=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@ancon/wildcat-types");require("axios");const l=require("../error/isSerializedAPIError.js");var r=(e=>(e.PaymentRefusalGeneral="paymentRefusalGeneral",e.PaymentRefusalTransactionRefused="paymentRefusalTransactionRefused",e.PaymentRefusalReferral="paymentRefusalReferral",e.PaymentRefusalAcquirer="paymentRefusalAcquirer",e.PaymentRefusalBlockedCard="paymentRefusalBlockedCard",e.PaymentRefusalExpiredCard="paymentRefusalExpiredCard",e.PaymentRefusalInvalidAmount="paymentRefusalInvalidAmount",e.PaymentRefusalInvalidCardnumber="paymentRefusalInvalidCardnumber",e.PaymentRefusalIssuerUnavailable="paymentRefusalIssuerUnavailable",e.PaymentRefusalBankNotSupported="paymentRefusalBankNotSupported",e.PaymentRefusal3dsecureAuthFailed="paymentRefusal3dsecureAuthFailed",e.PaymentRefusalNoEnoughBalance="paymentRefusalNoEnoughBalance",e.PaymentRefusalFraudDetected="paymentRefusalFraudDetected",e.PaymentRefusalCancelled="paymentRefusalCancelled",e.PaymentRefusalInvalidPin="paymentRefusalInvalidPin",e.PaymentRefusalPinRetryExceeded="paymentRefusalPinRetryExceeded",e.PaymentRefusalUnableValidatePin="paymentRefusalUnableValidatePin",e.PaymentRefusalSubmmissionAdyen="paymentRefusalSubmmissionAdyen",e.PaymentRefusalCvcDeclined="paymentRefusalCvcDeclined",e.PaymentRefusalRestrictedCard="paymentRefusalRestrictedCard",e.PaymentRefusalDoNotHonor="paymentRefusalDoNotHonor",e.PaymentRefusalWdrwAmountExceeded="paymentRefusalWdrwAmountExceeded",e.PaymentRefusalWdrwCountExceeded="paymentRefusalWdrwCountExceeded",e.PaymentRefusalAvsDeclined="paymentRefusalAvsDeclined",e.PaymentRefusalCardOnlinePin="paymentRefusalCardOnlinePin",e.PaymentRefusalNoAcctAtchdCard="paymentRefusalNoAcctAtchdCard",e.PaymentRefusalMobilePin="paymentRefusalMobilePin",e.PaymentRefusalContactlessFallback="paymentRefusalContactlessFallback",e.PaymentRefusalAuthRequired="paymentRefusalAuthRequired",e.PaymentResultCancelled="paymentResultCancelled",e.PaymentResultError="paymentResultError",e.PaymentResultRefused="paymentResultRefused",e.PaymentAuthorizeDataNotValid="paymentAuthorizeDataNotValid",e.PaymentAuthorizeErrorUnknownReason="paymentAuthorizeErrorUnknownReason",e.PaymentAuthorizeCheckoutCaptured="paymentAuthorizeCheckoutCaptured",e.PaymentAuthorizeCheckoutAuthorized="paymentAuthorizeCheckoutAuthorized",e.PaymentAuthorizeCaptureFailure="paymentAuthorizeCaptureFailure",e.PaymentAuthorizeCancelOrRefund="paymentAuthorizeCancelOrRefund",e.PaymentActionErrorUnknownReason="paymentActionErrorUnknownReason",e.PaymentActionInvalidData="paymentActionInvalidData",e.PaymentActionCaptureFailure="paymentActionCaptureFailure",e.PaymentActionCancelOrRefund="paymentActionCancelOrRefund",e.PaymentPaymentAppNotFound="paymentPaymentAppNotFound",e.PaymentPaymentCheckoutCreated="paymentPaymentCheckoutCreated",e.PaymentCheckoutPaymentFailure="paymentCheckoutPaymentFailure",e.PaymentDetailsNotSupported="paymentDetailsNotSupported",e.PaymentAuthorizeNoItems="paymentAuthorizeNoItems",e.PaymentAuthorizeInvalidCustomer="paymentAuthorizeInvalidCustomer",e.PaymentAuthorizeInvalidDelivery="paymentAuthorizeInvalidDelivery",e.PaymentPenguinInvalidStation="paymentPenguinInvalidStation",e.PaymentPenguinInvalidTimeSlot="paymentPenguinInvalidTimeSlot",e.PaymentPenguinNotEnoughLockers="paymentPenguinNotEnoughLockers",e.PaymentPenguinTooManyItems="paymentPenguinTooManyItems",e.PaymentPenguinProductInvalidUnits="paymentPenguinProductInvalidUnits",e.PaymentCheckoutServiceTimeInPast="paymentCheckoutServiceTimeInPast",e.PaymentNotAllowedForCompanyAccount="paymentNotAllowedForCompanyAccount",e.PaymentIntegrationNotFound="paymentIntegrationNotFound",e.PaymentIntegrationInactive="paymentIntegrationInactive",e.PaymentPenguinIntegrationUnauthorized="paymentPenguinIntegrationUnauthorized",e))(r||{});const o={paymentRefusalGeneral:()=>({title:"Payment failure",message:"The transaction was refused."}),paymentRefusalTransactionRefused:()=>({title:"Payment failure",message:"The transaction was refused."}),paymentRefusalReferral:({meta:e})=>({title:"Payment failure",message:`A referral error occurred. (${e.checkoutId})`}),paymentRefusalAcquirer:({meta:e})=>({title:"Payment failure",message:`An acquirer error occurred. (${e.checkoutId})`}),paymentRefusalBlockedCard:()=>({title:"Payment failure",message:"The provided card is blocked."}),paymentRefusalExpiredCard:()=>({title:"Payment failure",message:"The provided card is expired."}),paymentRefusalInvalidAmount:()=>({title:"Payment failure",message:"An invalid payment amount was provided."}),paymentRefusalInvalidCardnumber:()=>({title:"Payment failure",message:"An invalid card number was provided."}),paymentRefusalIssuerUnavailable:()=>({title:"Payment failure",message:"Card issuer not available."}),paymentRefusalBankNotSupported:()=>({title:"Payment failure",message:"CVC declined."}),paymentRefusal3dsecureAuthFailed:()=>({title:"Payment failure",message:"3D Secure was not authenticated."}),paymentRefusalNoEnoughBalance:()=>({title:"Payment failure",message:"Not enough balance."}),paymentRefusalFraudDetected:()=>({title:"Payment failure",message:"The provided card is not allowed."}),paymentRefusalCancelled:()=>({title:"Payment cancelled",message:"The payment was cancelled."}),paymentRefusalInvalidPin:()=>({title:"Payment failure",message:"Invalid PIN."}),paymentRefusalPinRetryExceeded:()=>({title:"Payment failure",message:"PIN tries exceeded."}),paymentRefusalUnableValidatePin:()=>({title:"Payment failure",message:"PIN validation was not possible."}),paymentRefusalSubmmissionAdyen:({meta:e})=>({title:"Payment failure",message:`Submission error. (${e.checkoutId})`}),paymentRefusalCvcDeclined:()=>({title:"Payment failure",message:"CVC declined."}),paymentRefusalRestrictedCard:()=>({title:"Payment failure",message:"Restricted card."}),paymentRefusalDoNotHonor:({meta:e})=>({title:"Payment failure",message:`The transaction was refused (do not honor). (${e.checkoutId})`}),paymentRefusalWdrwAmountExceeded:()=>({title:"Payment failure",message:"Withdrawal amount exceeded."}),paymentRefusalWdrwCountExceeded:()=>({title:"Payment failure",message:"Withdrawal count exceeded."}),paymentRefusalAvsDeclined:()=>({title:"Payment failure",message:"AVS declined."}),paymentRefusalCardOnlinePin:()=>({title:"Payment failure",message:"The provided card requires online PIN."}),paymentRefusalNoAcctAtchdCard:()=>({title:"Payment failure",message:"No account attached to the provided card."}),paymentRefusalMobilePin:()=>({title:"Payment failure",message:"Mobile PIN required."}),paymentRefusalContactlessFallback:()=>({title:"Payment failure",message:"Contactless fallback."}),paymentRefusalAuthRequired:()=>({title:"Payment failure",message:"Authentication required"}),paymentResultCancelled:()=>({title:"Payment cancelled",message:"The payment was cancelled."}),paymentResultError:({meta:e})=>({title:"Payment error",message:`There was an error processing your payment. (${e.checkoutId})`}),paymentResultRefused:()=>({title:"Payment refused",message:"The payment was refused."}),paymentAuthorizeDataNotValid:({meta:e})=>({title:"Authorization failed",message:`The provided data was invalid. (${e.checkoutId})`}),paymentAuthorizeErrorUnknownReason:({meta:e})=>({title:"Authorization failed",message:`Authorization failed because of an unknown error. (${e.checkoutId})`}),paymentAuthorizeCheckoutCaptured:({meta:e})=>({title:"Authorization failed",message:`The checkout has already been captured. (${e.checkoutId})`}),paymentAuthorizeCheckoutAuthorized:({meta:e})=>({title:"Authorization failed",message:`The checkout has already been authorized. (${e.checkoutId})`}),paymentAuthorizeCaptureFailure:({meta:e})=>({title:"Authorization failed",message:`Failed to capture checkout. (${e.checkoutId})`}),paymentAuthorizeCancelOrRefund:()=>({title:"Authorization failed",message:"The checkout has already been cancelled or refunded."}),paymentActionErrorUnknownReason:({meta:e})=>({title:"Action failed",message:`The action failed because of an unknown error. (${e.checkoutId})`}),paymentActionInvalidData:({meta:e})=>({title:"Action failed",message:`The provided data was invalid. (${e.checkoutId})`}),paymentActionCaptureFailure:({meta:e})=>({title:"Action failed",message:`Failed to capture checkout. (${e.checkoutId})`}),paymentActionCancelOrRefund:()=>({title:"Action failed",message:"The checkout has already been cancelled or refunded."}),paymentPaymentAppNotFound:()=>({title:"Payment failure",message:"The chosen payment method requires an app which is not installed."}),paymentPaymentCheckoutCreated:({meta:e})=>({title:"Payment failure",message:`The checkout is created, cannot make payment, make sure the customer is connected to this checkout. (${e.checkoutId})`}),paymentCheckoutPaymentFailure:({meta:e})=>({title:"Payment failure",message:`Unfortunately an error has occurred and your payment cannot be processed. (${e.checkoutId})`}),paymentDetailsNotSupported:()=>({title:"Payment failure",message:"The payment provider is not supported by this outlet."}),paymentAuthorizeNoItems:({meta:e})=>({title:"Payment failure",message:`The current checkout does not contain any products. (${e.checkoutId})`}),paymentAuthorizeInvalidCustomer:({meta:e})=>({title:"Payment failure",message:`Could not resolve the customer from database. (${e.checkoutId})`}),paymentAuthorizeInvalidDelivery:({meta:e})=>({title:"Payment failure",message:`Missing delivery information. (${e.checkoutId})`}),paymentPenguinInvalidStation:()=>({title:"Payment failure",message:"Invalid station."}),paymentPenguinInvalidTimeSlot:()=>({title:"Payment failure",message:"Invalid time slot."}),paymentPenguinNotEnoughLockers:()=>({title:"Payment failure",message:"Not enough lockers."}),paymentPenguinTooManyItems:()=>({title:"Payment failure",message:"The current checkout has too many items."}),paymentPenguinProductInvalidUnits:({meta:e})=>({title:"Payment failure",message:`The current checkout does not contain valid product storage configurations. (${e.checkoutId})`}),paymentCheckoutServiceTimeInPast:({meta:e})=>({title:"Payment failure",message:`The order time cannot be in the past. (${e.checkoutId})`}),paymentNotAllowedForCompanyAccount:()=>({title:"Payment not allowed",message:"Your company account can't make payments on this outlet. Please use private account or switch to a company account of this outlet."}),paymentIntegrationNotFound:({meta:e})=>({title:"Payment failure",message:`Unable to make the payment. Please ensure integration is available to proceed with the payment. (${e.checkoutId})`}),paymentIntegrationInactive:({meta:e})=>({title:"Payment failure",message:`Unable to make the payment. Please ensure integration is active to proceed with the payment. (${e.checkoutId})`}),paymentPenguinIntegrationUnauthorized:({meta:e})=>({title:"Payment failure",message:`Unable to make payment. Please ensure integration configurations are valid to proceed with the payment. (${e.checkoutId})`})};function m(e){switch(e){case"0":return"paymentRefusalGeneral";case"2":case"23":return"paymentRefusalTransactionRefused";case"3":return"paymentRefusalReferral";case"4":return"paymentRefusalAcquirer";case"5":return"paymentRefusalBlockedCard";case"6":return"paymentRefusalExpiredCard";case"7":return"paymentRefusalInvalidAmount";case"8":return"paymentRefusalInvalidCardnumber";case"9":return"paymentRefusalIssuerUnavailable";case"10":return"paymentRefusalBankNotSupported";case"11":return"paymentRefusal3dsecureAuthFailed";case"12":return"paymentRefusalNoEnoughBalance";case"14":case"20":case"31":return"paymentRefusalFraudDetected";case"15":case"16":return"paymentRefusalCancelled";case"17":return"paymentRefusalInvalidPin";case"18":return"paymentRefusalPinRetryExceeded";case"19":return"paymentRefusalUnableValidatePin";case"21":return"paymentRefusalSubmmissionAdyen";case"24":return"paymentRefusalCvcDeclined";case"25":return"paymentRefusalRestrictedCard";case"27":return"paymentRefusalDoNotHonor";case"28":return"paymentRefusalWdrwAmountExceeded";case"29":return"paymentRefusalWdrwCountExceeded";case"32":return"paymentRefusalAvsDeclined";case"33":return"paymentRefusalCardOnlinePin";case"34":case"35":return"paymentRefusalNoAcctAtchdCard";case"36":return"paymentRefusalMobilePin";case"37":return"paymentRefusalContactlessFallback";case"38":return"paymentRefusalAuthRequired";default:return null}}function d(e){switch(e){case"Cancelled":return"paymentResultCancelled";case"Error":return"paymentResultError";case"Refused":return"paymentResultRefused";default:return null}}function c(e,a){if(l(e))switch(e.response.data.errorCode){case t.ErrorCode.AuthorizeDataNotValid:return["paymentAuthorizeDataNotValid",{checkoutId:a}];case t.ErrorCode.AuthorizeErrorUnknownReason:return["paymentAuthorizeErrorUnknownReason",{checkoutId:a}];case t.ErrorCode.AuthorizeCheckoutCaptured:return["paymentAuthorizeCheckoutCaptured",{checkoutId:a}];case t.ErrorCode.AuthorizeCheckoutAuthorized:return["paymentAuthorizeCheckoutAuthorized",{checkoutId:a}];case t.ErrorCode.AuthorizeCaptureFailure:return["paymentAuthorizeCaptureFailure",{checkoutId:a}];case t.ErrorCode.AuthorizeCancelOrRefund:return["paymentAuthorizeCancelOrRefund",{checkoutId:a}];case t.ErrorCode.ActionErrorUnknownReason:return["paymentActionErrorUnknownReason",{checkoutId:a}];case t.ErrorCode.ActionInvalidData:return["paymentActionInvalidData",{checkoutId:a}];case t.ErrorCode.ActionCaptureFailure:return["paymentActionCaptureFailure",{checkoutId:a}];case t.ErrorCode.ActionCancelOrRefund:return["paymentActionCancelOrRefund",{checkoutId:a}];case t.ErrorCode.AppNotFound:return["paymentPaymentAppNotFound",{checkoutId:a}];case t.ErrorCode.PaymentCheckoutCreated:return["paymentPaymentCheckoutCreated",{checkoutId:a}];case t.ErrorCode.PaymentAuthorizeNoItems:return["paymentAuthorizeNoItems",{checkoutId:a}];case t.ErrorCode.PaymentAuthorizeInvalidCustomer:return["paymentAuthorizeInvalidCustomer",{checkoutId:a}];case t.ErrorCode.PaymentAuthorizeInvalidDelivery:return["paymentAuthorizeInvalidDelivery",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinInvalidStation:return["paymentCheckoutPaymentFailure",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinInvalidTimeSlot:return["paymentPenguinInvalidTimeSlot",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinNotEnoughLockers:return["paymentPenguinNotEnoughLockers",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinTooManyItems:return["paymentPenguinTooManyItems",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinProductInvalidUnits:return["paymentPenguinProductInvalidUnits",{checkoutId:a}];case t.ErrorCode.ServiceTimeInThePast:return["paymentCheckoutServiceTimeInPast",{checkoutId:a}];case t.ErrorCode.PaymentNotAllowedForProvidedCompanyAccount:return["paymentNotAllowedForCompanyAccount"];case t.ErrorCode.IntegrationNotFound:return["paymentIntegrationNotFound",{checkoutId:a}];case t.ErrorCode.IntegrationInactive:return["paymentIntegrationInactive",{checkoutId:a}];case t.ErrorCode.CheckoutPenguinUnauthorized:return["paymentPenguinIntegrationUnauthorized",{checkoutId:a}]}else{const u=m(e==null?void 0:e.refusalReasonCode);if(u)return[u,{checkoutId:a}];const n=d(e==null?void 0:e.resultCode);if(n)return[n,{checkoutId:a}]}return["paymentCheckoutPaymentFailure",{checkoutId:a}]}function p(e,a,u=o){const[n,s]=c(e,a),i=u[n]({key:n,meta:s});if(!i)throw new Error("Could not resolve translation in getCheckoutPaymentErrorTexts()");return[i,n]}exports.CheckoutPaymentErrorTranslationKey=r;exports.default=p;
@@ -1,8 +1,8 @@
1
1
  import { ErrorCode as t } from "@ancon/wildcat-types";
2
2
  import "axios";
3
3
  import l from "../error/isSerializedAPIError.mjs";
4
- var r = /* @__PURE__ */ ((e) => (e.PaymentRefusalGeneral = "paymentRefusalGeneral", e.PaymentRefusalTransactionRefused = "paymentRefusalTransactionRefused", e.PaymentRefusalReferral = "paymentRefusalReferral", e.PaymentRefusalAcquirer = "paymentRefusalAcquirer", e.PaymentRefusalBlockedCard = "paymentRefusalBlockedCard", e.PaymentRefusalExpiredCard = "paymentRefusalExpiredCard", e.PaymentRefusalInvalidAmount = "paymentRefusalInvalidAmount", e.PaymentRefusalInvalidCardnumber = "paymentRefusalInvalidCardnumber", e.PaymentRefusalIssuerUnavailable = "paymentRefusalIssuerUnavailable", e.PaymentRefusalBankNotSupported = "paymentRefusalBankNotSupported", e.PaymentRefusal3dsecureAuthFailed = "paymentRefusal3dsecureAuthFailed", e.PaymentRefusalNoEnoughBalance = "paymentRefusalNoEnoughBalance", e.PaymentRefusalFraudDetected = "paymentRefusalFraudDetected", e.PaymentRefusalCancelled = "paymentRefusalCancelled", e.PaymentRefusalInvalidPin = "paymentRefusalInvalidPin", e.PaymentRefusalPinRetryExceeded = "paymentRefusalPinRetryExceeded", e.PaymentRefusalUnableValidatePin = "paymentRefusalUnableValidatePin", e.PaymentRefusalSubmmissionAdyen = "paymentRefusalSubmmissionAdyen", e.PaymentRefusalCvcDeclined = "paymentRefusalCvcDeclined", e.PaymentRefusalRestrictedCard = "paymentRefusalRestrictedCard", e.PaymentRefusalDoNotHonor = "paymentRefusalDoNotHonor", e.PaymentRefusalWdrwAmountExceeded = "paymentRefusalWdrwAmountExceeded", e.PaymentRefusalWdrwCountExceeded = "paymentRefusalWdrwCountExceeded", e.PaymentRefusalAvsDeclined = "paymentRefusalAvsDeclined", e.PaymentRefusalCardOnlinePin = "paymentRefusalCardOnlinePin", e.PaymentRefusalNoAcctAtchdCard = "paymentRefusalNoAcctAtchdCard", e.PaymentRefusalMobilePin = "paymentRefusalMobilePin", e.PaymentRefusalContactlessFallback = "paymentRefusalContactlessFallback", e.PaymentRefusalAuthRequired = "paymentRefusalAuthRequired", e.PaymentResultCancelled = "paymentResultCancelled", e.PaymentResultError = "paymentResultError", e.PaymentResultRefused = "paymentResultRefused", e.PaymentAuthorizeDataNotValid = "paymentAuthorizeDataNotValid", e.PaymentAuthorizeErrorUnknownReason = "paymentAuthorizeErrorUnknownReason", e.PaymentAuthorizeCheckoutCaptured = "paymentAuthorizeCheckoutCaptured", e.PaymentAuthorizeCheckoutAuthorized = "paymentAuthorizeCheckoutAuthorized", e.PaymentAuthorizeCaptureFailure = "paymentAuthorizeCaptureFailure", e.PaymentAuthorizeCancelOrRefund = "paymentAuthorizeCancelOrRefund", e.PaymentActionErrorUnknownReason = "paymentActionErrorUnknownReason", e.PaymentActionInvalidData = "paymentActionInvalidData", e.PaymentActionCaptureFailure = "paymentActionCaptureFailure", e.PaymentActionCancelOrRefund = "paymentActionCancelOrRefund", e.PaymentPaymentAppNotFound = "paymentPaymentAppNotFound", e.PaymentPaymentCheckoutCreated = "paymentPaymentCheckoutCreated", e.PaymentCheckoutPaymentFailure = "paymentCheckoutPaymentFailure", e.PaymentDetailsNotSupported = "paymentDetailsNotSupported", e.PaymentAuthorizeNoItems = "paymentAuthorizeNoItems", e.PaymentAuthorizeInvalidCustomer = "paymentAuthorizeInvalidCustomer", e.PaymentAuthorizeInvalidDelivery = "paymentAuthorizeInvalidDelivery", e.PaymentPenguinInvalidStation = "paymentPenguinInvalidStation", e.PaymentPenguinInvalidTimeSlot = "paymentPenguinInvalidTimeSlot", e.PaymentPenguinNotEnoughLockers = "paymentPenguinNotEnoughLockers", e.PaymentPenguinTooManyItems = "paymentPenguinTooManyItems", e.PaymentPenguinProductInvalidUnits = "paymentPenguinProductInvalidUnits", e.PaymentCheckoutServiceTimeInPast = "paymentCheckoutServiceTimeInPast", e))(r || {});
5
- const m = {
4
+ var m = /* @__PURE__ */ ((e) => (e.PaymentRefusalGeneral = "paymentRefusalGeneral", e.PaymentRefusalTransactionRefused = "paymentRefusalTransactionRefused", e.PaymentRefusalReferral = "paymentRefusalReferral", e.PaymentRefusalAcquirer = "paymentRefusalAcquirer", e.PaymentRefusalBlockedCard = "paymentRefusalBlockedCard", e.PaymentRefusalExpiredCard = "paymentRefusalExpiredCard", e.PaymentRefusalInvalidAmount = "paymentRefusalInvalidAmount", e.PaymentRefusalInvalidCardnumber = "paymentRefusalInvalidCardnumber", e.PaymentRefusalIssuerUnavailable = "paymentRefusalIssuerUnavailable", e.PaymentRefusalBankNotSupported = "paymentRefusalBankNotSupported", e.PaymentRefusal3dsecureAuthFailed = "paymentRefusal3dsecureAuthFailed", e.PaymentRefusalNoEnoughBalance = "paymentRefusalNoEnoughBalance", e.PaymentRefusalFraudDetected = "paymentRefusalFraudDetected", e.PaymentRefusalCancelled = "paymentRefusalCancelled", e.PaymentRefusalInvalidPin = "paymentRefusalInvalidPin", e.PaymentRefusalPinRetryExceeded = "paymentRefusalPinRetryExceeded", e.PaymentRefusalUnableValidatePin = "paymentRefusalUnableValidatePin", e.PaymentRefusalSubmmissionAdyen = "paymentRefusalSubmmissionAdyen", e.PaymentRefusalCvcDeclined = "paymentRefusalCvcDeclined", e.PaymentRefusalRestrictedCard = "paymentRefusalRestrictedCard", e.PaymentRefusalDoNotHonor = "paymentRefusalDoNotHonor", e.PaymentRefusalWdrwAmountExceeded = "paymentRefusalWdrwAmountExceeded", e.PaymentRefusalWdrwCountExceeded = "paymentRefusalWdrwCountExceeded", e.PaymentRefusalAvsDeclined = "paymentRefusalAvsDeclined", e.PaymentRefusalCardOnlinePin = "paymentRefusalCardOnlinePin", e.PaymentRefusalNoAcctAtchdCard = "paymentRefusalNoAcctAtchdCard", e.PaymentRefusalMobilePin = "paymentRefusalMobilePin", e.PaymentRefusalContactlessFallback = "paymentRefusalContactlessFallback", e.PaymentRefusalAuthRequired = "paymentRefusalAuthRequired", e.PaymentResultCancelled = "paymentResultCancelled", e.PaymentResultError = "paymentResultError", e.PaymentResultRefused = "paymentResultRefused", e.PaymentAuthorizeDataNotValid = "paymentAuthorizeDataNotValid", e.PaymentAuthorizeErrorUnknownReason = "paymentAuthorizeErrorUnknownReason", e.PaymentAuthorizeCheckoutCaptured = "paymentAuthorizeCheckoutCaptured", e.PaymentAuthorizeCheckoutAuthorized = "paymentAuthorizeCheckoutAuthorized", e.PaymentAuthorizeCaptureFailure = "paymentAuthorizeCaptureFailure", e.PaymentAuthorizeCancelOrRefund = "paymentAuthorizeCancelOrRefund", e.PaymentActionErrorUnknownReason = "paymentActionErrorUnknownReason", e.PaymentActionInvalidData = "paymentActionInvalidData", e.PaymentActionCaptureFailure = "paymentActionCaptureFailure", e.PaymentActionCancelOrRefund = "paymentActionCancelOrRefund", e.PaymentPaymentAppNotFound = "paymentPaymentAppNotFound", e.PaymentPaymentCheckoutCreated = "paymentPaymentCheckoutCreated", e.PaymentCheckoutPaymentFailure = "paymentCheckoutPaymentFailure", e.PaymentDetailsNotSupported = "paymentDetailsNotSupported", e.PaymentAuthorizeNoItems = "paymentAuthorizeNoItems", e.PaymentAuthorizeInvalidCustomer = "paymentAuthorizeInvalidCustomer", e.PaymentAuthorizeInvalidDelivery = "paymentAuthorizeInvalidDelivery", e.PaymentPenguinInvalidStation = "paymentPenguinInvalidStation", e.PaymentPenguinInvalidTimeSlot = "paymentPenguinInvalidTimeSlot", e.PaymentPenguinNotEnoughLockers = "paymentPenguinNotEnoughLockers", e.PaymentPenguinTooManyItems = "paymentPenguinTooManyItems", e.PaymentPenguinProductInvalidUnits = "paymentPenguinProductInvalidUnits", e.PaymentCheckoutServiceTimeInPast = "paymentCheckoutServiceTimeInPast", e.PaymentNotAllowedForCompanyAccount = "paymentNotAllowedForCompanyAccount", e.PaymentIntegrationNotFound = "paymentIntegrationNotFound", e.PaymentIntegrationInactive = "paymentIntegrationInactive", e.PaymentPenguinIntegrationUnauthorized = "paymentPenguinIntegrationUnauthorized", e))(m || {});
5
+ const r = {
6
6
  paymentRefusalGeneral: () => ({
7
7
  title: "Payment failure",
8
8
  message: "The transaction was refused."
@@ -222,6 +222,22 @@ const m = {
222
222
  paymentCheckoutServiceTimeInPast: ({ meta: e }) => ({
223
223
  title: "Payment failure",
224
224
  message: `The order time cannot be in the past. (${e.checkoutId})`
225
+ }),
226
+ paymentNotAllowedForCompanyAccount: () => ({
227
+ title: "Payment not allowed",
228
+ message: "Your company account can't make payments on this outlet. Please use private account or switch to a company account of this outlet."
229
+ }),
230
+ paymentIntegrationNotFound: ({ meta: e }) => ({
231
+ title: "Payment failure",
232
+ message: `Unable to make the payment. Please ensure integration is available to proceed with the payment. (${e.checkoutId})`
233
+ }),
234
+ paymentIntegrationInactive: ({ meta: e }) => ({
235
+ title: "Payment failure",
236
+ message: `Unable to make the payment. Please ensure integration is active to proceed with the payment. (${e.checkoutId})`
237
+ }),
238
+ paymentPenguinIntegrationUnauthorized: ({ meta: e }) => ({
239
+ title: "Payment failure",
240
+ message: `Unable to make payment. Please ensure integration configurations are valid to proceed with the payment. (${e.checkoutId})`
225
241
  })
226
242
  };
227
243
  function d(e) {
@@ -413,6 +429,26 @@ function c(e, a) {
413
429
  "paymentCheckoutServiceTimeInPast",
414
430
  { checkoutId: a }
415
431
  ];
432
+ case t.PaymentNotAllowedForProvidedCompanyAccount:
433
+ return [
434
+ "paymentNotAllowedForCompanyAccount"
435
+ /* PaymentNotAllowedForCompanyAccount */
436
+ ];
437
+ case t.IntegrationNotFound:
438
+ return [
439
+ "paymentIntegrationNotFound",
440
+ { checkoutId: a }
441
+ ];
442
+ case t.IntegrationInactive:
443
+ return [
444
+ "paymentIntegrationInactive",
445
+ { checkoutId: a }
446
+ ];
447
+ case t.CheckoutPenguinUnauthorized:
448
+ return [
449
+ "paymentPenguinIntegrationUnauthorized",
450
+ { checkoutId: a }
451
+ ];
416
452
  }
417
453
  else {
418
454
  const u = d(
@@ -432,7 +468,7 @@ function c(e, a) {
432
468
  { checkoutId: a }
433
469
  ];
434
470
  }
435
- function R(e, a, u = m) {
471
+ function R(e, a, u = r) {
436
472
  const [n, s] = c(e, a), i = u[n]({ key: n, meta: s });
437
473
  if (!i)
438
474
  throw new Error(
@@ -441,6 +477,6 @@ function R(e, a, u = m) {
441
477
  return [i, n];
442
478
  }
443
479
  export {
444
- r as CheckoutPaymentErrorTranslationKey,
480
+ m as CheckoutPaymentErrorTranslationKey,
445
481
  R as default
446
482
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancon/wildcat-utils",
3
- "version": "1.40.45",
3
+ "version": "1.40.47",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",