rebill-web-components-sdk 1.10.11 → 1.10.12

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.
Files changed (34) hide show
  1. package/dist/cjs/index-C-VTnc0I.js.map +1 -1
  2. package/dist/cjs/{payment-error-mapper-DMma7xTr.js → payment-error-mapper-BBaiDgUx.js} +4 -2
  3. package/dist/cjs/payment-error-mapper-BBaiDgUx.js.map +1 -0
  4. package/dist/cjs/rebill-checkout.cjs.entry.js +1 -1
  5. package/dist/cjs/rebill-renewal.cjs.entry.js +1 -1
  6. package/dist/collection/models/enums/payment-status.enum.js +1 -0
  7. package/dist/collection/models/enums/payment-status.enum.js.map +1 -1
  8. package/dist/collection/utils/payment-error-mapper.js +1 -0
  9. package/dist/collection/utils/payment-error-mapper.js.map +1 -1
  10. package/dist/components/p-8BpuJ_V5.js.map +1 -1
  11. package/dist/components/{p-tTo6r99B.js → p-Dkw3idq6.js} +4 -2
  12. package/dist/components/p-Dkw3idq6.js.map +1 -0
  13. package/dist/components/rebill-checkout.js +1 -1
  14. package/dist/components/rebill-renewal.js +1 -1
  15. package/dist/esm/index-BTZ7D7jU.js.map +1 -1
  16. package/dist/esm/{payment-error-mapper-CtMCCzwd.js → payment-error-mapper-lsQ45Ggo.js} +4 -2
  17. package/dist/esm/payment-error-mapper-lsQ45Ggo.js.map +1 -0
  18. package/dist/esm/rebill-checkout.entry.js +1 -1
  19. package/dist/esm/rebill-renewal.entry.js +1 -1
  20. package/dist/rebill-web-components-sdk/{p-648d0204.entry.js → p-4b4e2e73.entry.js} +2 -2
  21. package/dist/rebill-web-components-sdk/p-BTZ7D7jU.js.map +1 -1
  22. package/dist/rebill-web-components-sdk/p-BXKxstSq.js +2 -0
  23. package/dist/rebill-web-components-sdk/p-BXKxstSq.js.map +1 -0
  24. package/dist/rebill-web-components-sdk/{p-b3a695df.entry.js → p-ecd698bc.entry.js} +2 -2
  25. package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
  26. package/dist/types/models/enums/payment-status.enum.d.ts +1 -0
  27. package/package.json +1 -1
  28. package/dist/cjs/payment-error-mapper-DMma7xTr.js.map +0 -1
  29. package/dist/components/p-tTo6r99B.js.map +0 -1
  30. package/dist/esm/payment-error-mapper-CtMCCzwd.js.map +0 -1
  31. package/dist/rebill-web-components-sdk/p-GqGHZ54B.js +0 -2
  32. package/dist/rebill-web-components-sdk/p-GqGHZ54B.js.map +0 -1
  33. /package/dist/rebill-web-components-sdk/{p-648d0204.entry.js.map → p-4b4e2e73.entry.js.map} +0 -0
  34. /package/dist/rebill-web-components-sdk/{p-b3a695df.entry.js.map → p-ecd698bc.entry.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{P as r,I as e}from"./p-DPLmRWqO.js";var n;(function(r){r["PENDING"]="PENDING";r["APPROVED"]="APPROVED";r["REJECTED"]="REJECTED";r["ERROR"]="ERROR"})(n||(n={}));var t;(function(r){r["PENDING"]="pending";r["APPROVED"]="approved";r["REJECTED"]="rejected";r["DECLINED"]="declined";r["ERROR"]="error";r["REFUNDED"]="refunded";r["CANCELLED"]="cancelled";r["PARTIALLY_REFUNDED"]="partially_refunded";r["EXPIRED"]="expired";r["GENERIC_REJECT"]="generic_reject";r["INVALID_CARD"]="invalid_card";r["INVALID_CARD_NUMBER"]="invalid_card_number";r["INVALID_CARD_HOLDER_NAME"]="invalid_card_holder_name";r["INVALID_CARD_EXPIRATION_DATE"]="invalid_card_expiration_date";r["INVALID_CARD_CVC"]="invalid_card_cvc";r["INSUFFICIENT_FUNDS"]="insufficient_funds";r["BLACKLISTED_CARD"]="blacklisted_card";r["INVALID_CUSTOMER_EMAIL"]="invalid_customer_email";r["INVALID_CUSTOMER_PHONE"]="invalid_customer_phone";r["INVALID_CUSTOMER_BILLING_ADDRESS"]="invalid_customer_billing_address";r["REQUIRED_CUSTOMER_EMAIL"]="required_customer_email";r["REQUIRED_CUSTOMER_PHONE"]="required_customer_phone";r["REQUIRED_CUSTOMER_BILLING_ADDRESS"]="required_customer_billing_address";r["INVALID_CHECKOUT_REQUEST"]="invalid_checkout_request";r["UNAVAILABLE_PAYMENT_METHOD"]="unavailable_payment_method";r["INVALID_AMOUNT"]="invalid_amount";r["INVALID_CURRENCY"]="invalid_currency";r["INVALID_COUNTRY"]="invalid_country";r["MAX_ATTEMPTS"]="max_attempts";r["PAYMENT_EXPIRED"]="payment_expired";r["FRAUD_HIGH_RISK"]="fraud_high_risk";r["INTERNAL_ERROR"]="internal_error";r["INVALID_SESSION"]="invalid_session";r["APM_MESSAGE_ERROR"]="apm_message_error";r["APM_ERROR_GENERIC"]="apm_error_generic";r["APM_ERROR_BANK_TRANSFER"]="apm_error_bank_transfer";r["PROVIDER_ERROR"]="provider_error";r["BANK_REJECTED"]="bank_rejected";r["DO_NOT_HONOR"]="do_not_honor";r["CALL_BANK_FOR_AUTHORIZE"]="call_bank_for_authorize";r["REQUIRED_3DS"]="required_3ds";r["BLACKLISTED"]="blacklisted";r["HARD_DECLINE"]="hard-decline";r["SOFT_DECLINE"]="soft-decline";r["HUMAN_DECLINE"]="human-decline";r["INTERNAL"]="internal";r["INVALID_CARD_TOKENIZE_COUNTRY"]="invalid_card_tokenize_country";r["INVALID_CUSTOMER_ADDRESS"]="invalid_customer_address";r["INVALID_CUSTOMER_CITY"]="invalid_customer_city";r["INVALID_CUSTOMER_STATE"]="invalid_customer_state";r["INVALID_CUSTOMER_ZIP"]="invalid_customer_zip";r["INVALID_CUSTOMER_COUNTRY"]="invalid_customer_country";r["INVALID_CUSTOMER_DOCUMENT"]="invalid_customer_document";r["INVALID_CUSTOMER_DOCUMENT_NUMBER"]="invalid_customer_document_number";r["INVALID_CUSTOMER_DOCUMENT_TYPE"]="invalid_customer_document_type";r["INVALID_CHECKOUT_PAYMENT_METHOD"]="invalid_checkout_payment_method";r["REQUIRED_CUSTOMER_ADDRESS"]="required_customer_address";r["REQUIRED_CUSTOMER_CITY"]="required_customer_city";r["REQUIRED_CUSTOMER_STATE"]="required_customer_state";r["REQUIRED_CUSTOMER_ZIP"]="required_customer_zip";r["REQUIRED_CUSTOMER_COUNTRY"]="required_customer_country";r["REQUIRED_CUSTOMER_DOCUMENT"]="required_customer_document";r["REQUIRED_CUSTOMER_DOCUMENT_NUMBER"]="required_customer_document_number";r["REQUIRED_CUSTOMER_DOCUMENT_TYPE"]="required_customer_document_type";r["EXPIRED_CARD"]="expired_card";r["SANDBOX_ERROR"]="sandbox_error"})(t||(t={}));const a=()=>`idmp_${Date.now()}_${Math.random().toString(36).substring(2,11)}`;class i{static getErrorMessage(n,a,o){if(!n||!Object.values(t).includes(n)||n===t.GENERIC_REJECT){if(a===r.CARD){return e.translate("paymentErrors.genericErrorCard")}if(a===r.BANK_TRANSFER){if(o==="BR"){return e.translate("paymentErrors.genericErrorMessagePIX")}if(o==="AR"){return e.translate("paymentErrors.genericErrorMessageQR")}if(o==="CO"){return e.translate("paymentErrors.genericErrorMessagePSE")}return e.translate("paymentErrors.genericErrorMessageBankTransfer")}return e.translate("paymentErrors.genericErrorMessage")}return i.getMessage(n)}static getErrorTitle(n,a,o){if(o&&!(o in t)){return i.getMessage(o)}if(n===r.CARD){return e.translate("paymentErrors.genericErrorTitleCard")}if(n===r.BANK_TRANSFER){if(a==="BR"){return e.translate("paymentErrors.genericErrorTitlePIX")}if(a==="AR"){return e.translate("paymentErrors.genericErrorTitleQR")}if(a==="CO"){return e.translate("paymentErrors.genericErrorTitlePSE")}}return e.translate("paymentErrors.genericErrorTitleBankTransfer")}static getMessage(r){const n={[t.PENDING]:e.translate("paymentErrors.pending"),[t.APPROVED]:e.translate("paymentErrors.approved"),[t.REJECTED]:e.translate("paymentErrors.rejected"),[t.DECLINED]:e.translate("paymentErrors.declined"),[t.ERROR]:e.translate("paymentErrors.error"),[t.REFUNDED]:e.translate("paymentErrors.refunded"),[t.CANCELLED]:e.translate("paymentErrors.cancelled"),[t.PARTIALLY_REFUNDED]:e.translate("paymentErrors.partiallyRefunded"),[t.EXPIRED]:e.translate("paymentErrors.expired"),[t.GENERIC_REJECT]:e.translate("paymentErrors.genericReject"),[t.INVALID_CARD]:e.translate("paymentErrors.invalidCard"),[t.INVALID_CARD_NUMBER]:e.translate("paymentErrors.invalidCardNumber"),[t.INVALID_CARD_HOLDER_NAME]:e.translate("paymentErrors.invalidCardHolderName"),[t.INVALID_CARD_EXPIRATION_DATE]:e.translate("paymentErrors.invalidCardExpirationDate"),[t.INVALID_CARD_CVC]:e.translate("paymentErrors.invalidCardCvc"),[t.INSUFFICIENT_FUNDS]:e.translate("paymentErrors.insufficientFunds"),[t.BLACKLISTED_CARD]:e.translate("paymentErrors.blacklistedCard"),[t.INVALID_CUSTOMER_EMAIL]:e.translate("paymentErrors.invalidCustomerEmail"),[t.INVALID_CUSTOMER_PHONE]:e.translate("paymentErrors.invalidCustomerPhone"),[t.INVALID_CUSTOMER_BILLING_ADDRESS]:e.translate("paymentErrors.invalidCustomerBillingAddress"),[t.REQUIRED_CUSTOMER_EMAIL]:e.translate("paymentErrors.requiredCustomerEmail"),[t.REQUIRED_CUSTOMER_PHONE]:e.translate("paymentErrors.requiredCustomerPhone"),[t.REQUIRED_CUSTOMER_BILLING_ADDRESS]:e.translate("paymentErrors.requiredCustomerBillingAddress"),[t.INVALID_CHECKOUT_REQUEST]:e.translate("paymentErrors.invalidCheckoutRequest"),[t.UNAVAILABLE_PAYMENT_METHOD]:e.translate("paymentErrors.unavailablePaymentMethod"),[t.INVALID_AMOUNT]:e.translate("paymentErrors.invalidAmount"),[t.INVALID_CURRENCY]:e.translate("paymentErrors.invalidCurrency"),[t.INVALID_COUNTRY]:e.translate("paymentErrors.invalidCountry"),[t.MAX_ATTEMPTS]:e.translate("paymentErrors.maxAttempts"),[t.PAYMENT_EXPIRED]:e.translate("paymentErrors.paymentExpired"),[t.INTERNAL_ERROR]:e.translate("paymentErrors.internalError"),[t.INVALID_SESSION]:e.translate("paymentErrors.invalidSession"),[t.APM_MESSAGE_ERROR]:e.translate("paymentErrors.APMMessageError"),[t.APM_ERROR_GENERIC]:e.translate("paymentErrors.APMErrorGeneric"),[t.APM_ERROR_BANK_TRANSFER]:e.translate("paymentErrors.APMErrorBankTransfer"),[t.PROVIDER_ERROR]:e.translate("paymentErrors.providerError"),[t.BANK_REJECTED]:e.translate("paymentErrors.bankRejected"),[t.DO_NOT_HONOR]:e.translate("paymentErrors.bankRejected"),[t.FRAUD_HIGH_RISK]:e.translate("paymentErrors.fraudHighRisk"),[t.CALL_BANK_FOR_AUTHORIZE]:e.translate("paymentErrors.callBankForAuthorize"),[t.REQUIRED_3DS]:e.translate("paymentErrors.required3ds"),[t.BLACKLISTED]:e.translate("paymentErrors.blacklisted"),[t.HARD_DECLINE]:e.translate("paymentErrors.hardDecline"),[t.SOFT_DECLINE]:e.translate("paymentErrors.softDecline"),[t.HUMAN_DECLINE]:e.translate("paymentErrors.humanDecline"),[t.INTERNAL]:e.translate("paymentErrors.internal"),[t.INVALID_CARD_TOKENIZE_COUNTRY]:e.translate("paymentErrors.invalidCardTokenizeCountry"),[t.INVALID_CUSTOMER_ADDRESS]:e.translate("paymentErrors.invalidCustomerAddress"),[t.INVALID_CUSTOMER_CITY]:e.translate("paymentErrors.invalidCustomerCity"),[t.INVALID_CUSTOMER_STATE]:e.translate("paymentErrors.invalidCustomerState"),[t.INVALID_CUSTOMER_ZIP]:e.translate("paymentErrors.invalidCustomerZip"),[t.INVALID_CUSTOMER_COUNTRY]:e.translate("paymentErrors.invalidCustomerCountry"),[t.INVALID_CUSTOMER_DOCUMENT]:e.translate("paymentErrors.invalidCustomerDocument"),[t.INVALID_CUSTOMER_DOCUMENT_NUMBER]:e.translate("paymentErrors.invalidCustomerDocumentNumber"),[t.INVALID_CUSTOMER_DOCUMENT_TYPE]:e.translate("paymentErrors.invalidCustomerDocumentType"),[t.INVALID_CHECKOUT_PAYMENT_METHOD]:e.translate("paymentErrors.invalidCheckoutPaymentMethod"),[t.REQUIRED_CUSTOMER_ADDRESS]:e.translate("paymentErrors.requiredCustomerAddress"),[t.REQUIRED_CUSTOMER_CITY]:e.translate("paymentErrors.requiredCustomerCity"),[t.REQUIRED_CUSTOMER_STATE]:e.translate("paymentErrors.requiredCustomerState"),[t.REQUIRED_CUSTOMER_ZIP]:e.translate("paymentErrors.requiredCustomerZip"),[t.REQUIRED_CUSTOMER_COUNTRY]:e.translate("paymentErrors.requiredCustomerCountry"),[t.REQUIRED_CUSTOMER_DOCUMENT]:e.translate("paymentErrors.requiredCustomerDocument"),[t.REQUIRED_CUSTOMER_DOCUMENT_NUMBER]:e.translate("paymentErrors.requiredCustomerDocumentNumber"),[t.REQUIRED_CUSTOMER_DOCUMENT_TYPE]:e.translate("paymentErrors.requiredCustomerDocumentType"),[t.EXPIRED_CARD]:e.translate("paymentErrors.expiredCard"),[t.SANDBOX_ERROR]:e.translate("paymentErrors.sandboxError")};return n[r]||e.translate("paymentErrors.genericError")}}export{n as C,t as P,i as a,a as g};
2
+ //# sourceMappingURL=p-BXKxstSq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"p-BXKxstSq.js","sources":["src/api/entities/checkout/types.ts","src/models/enums/payment-status.enum.ts","src/utils/generate-idempotency-key.ts","src/utils/payment-error-mapper.ts"],"sourcesContent":["import { PaymentMethodNameE } from '../../../models/enums/payment-method-name.enum';\nimport { STATUS_REQ_CHECKOUT_APM } from '../../../models/enums/status-req-checkout-apm.enum';\n\n// Checkout request status\nexport enum CheckoutStatusE {\n PENDING = 'PENDING',\n APPROVED = 'APPROVED',\n REJECTED = 'REJECTED',\n ERROR = 'ERROR',\n}\n\n// APM Transaction interface (based on documentation)\nexport interface APMTransaction {\n name?: { text: string; language: string }[];\n description?: { text: string; language: string }[];\n isPriceFixed?: boolean;\n tiers?: any[];\n plan?: any;\n quantity: number;\n amount?: number;\n currency?: string;\n productId?: string;\n planId?: string;\n couponCode?: string;\n}\n\n// APM Customer interface (based on documentation)\nexport interface APMCustomer {\n firstName: string;\n lastName: string;\n email: string;\n phone: {\n countryCode: string;\n number: string;\n };\n shippingAddress?: APMAddress;\n}\n\n// APM Address interface (based on documentation)\nexport interface APMAddress {\n country: string;\n state: string;\n city: string;\n zipCode: string;\n lineOne: string;\n lineTwo?: string;\n}\n\n// APM Redirect URLs interface (based on documentation)\nexport interface APMRedirect {\n approved: string;\n rejected: string;\n}\n\n// Metadata interface\nexport interface Metadata {\n [key: string]: unknown;\n}\n\n// Create APM checkout request interface (based on documentation)\nexport interface CreateAPMCheckoutRequest {\n transaction: APMTransaction;\n method: PaymentMethodNameE;\n customer?: APMCustomer; // Optional for authenticated users\n billingDetails?: {\n address: {\n lineOne: string;\n lineTwo?: string;\n city: string;\n state: string;\n zipCode: string;\n country: string;\n };\n identification: {\n type: string;\n value: string;\n };\n };\n redirect: APMRedirect;\n paymentMetadata?: Metadata;\n subscriptionMetadata?: Metadata;\n customAttributes?: {\n bank?: string;\n };\n targetCurrency?: string;\n}\n\n// Legacy interfaces for backward compatibility\nexport interface Transaction {\n amount: number;\n currency: string;\n description: string;\n}\n\nexport interface Customer {\n email: string;\n name: string;\n phone: string;\n documentType?: string;\n documentNumber?: string;\n shippingAddress: Address;\n}\n\nexport interface Address {\n lineOne: string;\n lineTwo?: string;\n city: string;\n state: string;\n zipCode: string;\n country: string;\n}\n\nexport interface Redirect {\n successUrl: string;\n failureUrl: string;\n cancelUrl: string;\n}\n\nexport interface CreateCardCheckoutRequest {\n transaction: {\n quantity: number;\n currency?: string;\n amount?: number;\n couponCode?: string;\n };\n installments?: number;\n cardTokenId?: string | null; // Optional, if card is saved\n cardId?: string | null; // Optional, if card is saved\n customer?: {\n firstName: string;\n lastName: string;\n email: string;\n phone: {\n countryCode: string;\n number: string;\n };\n };\n billingDetails?: {\n address: {\n lineOne: string;\n lineTwo?: string;\n city: string;\n state: string;\n zipCode: string;\n country: string;\n };\n identification: {\n type: string;\n value: string;\n };\n };\n paymentMetadata?: {\n bankCode?: string;\n };\n customAttributes?: {\n deviceId?: string;\n };\n saveCard?: boolean;\n}\nexport interface CreateCardCheckoutResponse {\n traceId: string;\n date: string;\n result?: {\n paymentId: string;\n status: CheckoutStatusE;\n subscriptionId: string;\n cardId: string;\n cardLastFour: string;\n customerId: string;\n statusDetail?: string;\n type?: string;\n };\n error: {\n traceId: string;\n date: string;\n error: {\n message: string;\n type: string;\n };\n statusCode: number;\n };\n}\nexport interface Card {\n cardHolderName: string;\n cardExpirationMonth: string;\n cardExpirationYear: string;\n securityCode: string;\n number: string;\n identification: {\n type: string;\n value: string;\n };\n saveCard: boolean;\n}\n// Instruction interface for payment reference\nexport interface PaymentInstruction {\n text: string;\n language: string;\n}\n\n// Bank transfer data interface\nexport interface BankTransferData {\n bbvAccountNumber?: string;\n account: string; // CLABE\n bankName: string;\n reference: string;\n}\n\n// Checkout data interface (provider-specific)\nexport interface CheckoutData {\n // For QR codes\n qrCode?: string;\n\n // For barcodes\n barcode?: string;\n\n // For bank transfer payments (new - multiple data sets)\n bankTransferData?: BankTransferData[];\n\n // For reference payments\n referenceId?: string;\n instructions?: PaymentInstruction[];\n\n // For redirect payments\n url?: string;\n message?: string;\n // For vouchers\n voucherUrl?: string;\n\n // Additional provider-specific data\n [key: string]: any;\n}\n\n// Checkout result interface\nexport interface CheckoutResult {\n checkoutRequestId: string;\n status: CheckoutStatusE;\n data: CheckoutData;\n}\n\n// Error interface\nexport interface CheckoutError {\n message: string;\n type: string;\n}\n\n// Bank interface for PSE payments\nexport interface Bank {\n code: string;\n name: string;\n}\n\n// Required fields request interface\nexport interface RequiredFieldsRequest {\n currency: string;\n method: string;\n bin?: number;\n}\n\n// Required fields response interface\nexport type RequiredFieldsResponse = {\n name: string;\n values?: {\n code: string;\n name: string;\n }[];\n}[];\n\n// Create APM checkout response interface\nexport interface CreateAPMCheckoutResponse {\n traceId: string;\n date: string;\n result?: CheckoutResult;\n error?: CheckoutError;\n}\n\nexport interface PaymentMethod {\n name: string;\n type: string;\n}\n\nexport interface TrackingData {\n locale: string;\n utmTerm: string;\n referrer: string;\n ipAddress: string;\n}\nexport interface Source {\n source: string;\n version: string;\n}\n\nexport interface APMSession {\n country: string;\n createdAt: string;\n deviceId: string;\n email: string | null;\n expiresAt: string;\n id: string;\n isCreatedDuringCheckout: boolean;\n metadata: Record<string, unknown>;\n organizationId: string;\n paymentLinkId: string;\n paymentMethods: PaymentMethod[];\n planId: string;\n priceId: string;\n productId: string | null;\n providerKey: string;\n source: Source;\n status: string;\n trackingData: TrackingData;\n updatedAt: string;\n}\n\nexport interface CheckoutRequestPayment {\n id: string;\n createdAt: string;\n updatedAt: string;\n organizationId: string;\n amount: number;\n currency: string;\n customer: {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n phoneNumbers: {\n number: string;\n countryCode: string;\n }[];\n };\n status: string;\n metadata: Record<string, unknown>;\n paymentMethodType: string;\n paymentMethodMetadata: Record<string, unknown>;\n card: {\n id: string;\n name: string;\n expiration: {\n month: string;\n year: string;\n };\n lastFour: string;\n brand: string;\n };\n quantity: number;\n paymentProviderReference: string | null;\n paymentProviderDescription: string | null;\n installments: number | null;\n priceFixedIn: string | null;\n conversionRate: number | null;\n couponId: string | null;\n description: [\n {\n text: string;\n language: string;\n },\n ];\n processingMode: string;\n processingFee: number | null;\n country: string;\n timezone: string;\n}\n\nexport interface CheckoutRequestPaymentAPM {\n checkoutRequestId: string;\n status: STATUS_REQ_CHECKOUT_APM;\n type: string;\n data: {\n message: string;\n url: string;\n };\n session: APMSession;\n payment: CheckoutRequestPayment | null;\n}\n","export enum PaymentMessageE {\n PENDING = 'pending',\n APPROVED = 'approved',\n REJECTED = 'rejected',\n DECLINED = 'declined',\n ERROR = 'error',\n REFUNDED = 'refunded',\n CANCELLED = 'cancelled',\n PARTIALLY_REFUNDED = 'partially_refunded',\n EXPIRED = 'expired',\n GENERIC_REJECT = 'generic_reject',\n INVALID_CARD = 'invalid_card',\n INVALID_CARD_NUMBER = 'invalid_card_number',\n INVALID_CARD_HOLDER_NAME = 'invalid_card_holder_name',\n INVALID_CARD_EXPIRATION_DATE = 'invalid_card_expiration_date',\n INVALID_CARD_CVC = 'invalid_card_cvc',\n INSUFFICIENT_FUNDS = 'insufficient_funds',\n\n BLACKLISTED_CARD = 'blacklisted_card',\n INVALID_CUSTOMER_EMAIL = 'invalid_customer_email',\n INVALID_CUSTOMER_PHONE = 'invalid_customer_phone',\n INVALID_CUSTOMER_BILLING_ADDRESS = 'invalid_customer_billing_address',\n REQUIRED_CUSTOMER_EMAIL = 'required_customer_email',\n REQUIRED_CUSTOMER_PHONE = 'required_customer_phone',\n REQUIRED_CUSTOMER_BILLING_ADDRESS = 'required_customer_billing_address',\n INVALID_CHECKOUT_REQUEST = 'invalid_checkout_request',\n UNAVAILABLE_PAYMENT_METHOD = 'unavailable_payment_method',\n INVALID_AMOUNT = 'invalid_amount',\n INVALID_CURRENCY = 'invalid_currency',\n INVALID_COUNTRY = 'invalid_country',\n MAX_ATTEMPTS = 'max_attempts',\n PAYMENT_EXPIRED = 'payment_expired',\n FRAUD_HIGH_RISK = 'fraud_high_risk',\n INTERNAL_ERROR = 'internal_error',\n INVALID_SESSION = 'invalid_session',\n APM_MESSAGE_ERROR = 'apm_message_error',\n APM_ERROR_GENERIC = 'apm_error_generic',\n APM_ERROR_BANK_TRANSFER = 'apm_error_bank_transfer',\n PROVIDER_ERROR = 'provider_error',\n BANK_REJECTED = 'bank_rejected',\n DO_NOT_HONOR = 'do_not_honor',\n CALL_BANK_FOR_AUTHORIZE = 'call_bank_for_authorize',\n REQUIRED_3DS = 'required_3ds',\n BLACKLISTED = 'blacklisted',\n HARD_DECLINE = 'hard-decline',\n SOFT_DECLINE = 'soft-decline',\n HUMAN_DECLINE = 'human-decline',\n INTERNAL = 'internal',\n INVALID_CARD_TOKENIZE_COUNTRY = 'invalid_card_tokenize_country',\n INVALID_CUSTOMER_ADDRESS = 'invalid_customer_address',\n INVALID_CUSTOMER_CITY = 'invalid_customer_city',\n INVALID_CUSTOMER_STATE = 'invalid_customer_state',\n INVALID_CUSTOMER_ZIP = 'invalid_customer_zip',\n INVALID_CUSTOMER_COUNTRY = 'invalid_customer_country',\n INVALID_CUSTOMER_DOCUMENT = 'invalid_customer_document',\n INVALID_CUSTOMER_DOCUMENT_NUMBER = 'invalid_customer_document_number',\n INVALID_CUSTOMER_DOCUMENT_TYPE = 'invalid_customer_document_type',\n INVALID_CHECKOUT_PAYMENT_METHOD = 'invalid_checkout_payment_method',\n REQUIRED_CUSTOMER_ADDRESS = 'required_customer_address',\n REQUIRED_CUSTOMER_CITY = 'required_customer_city',\n REQUIRED_CUSTOMER_STATE = 'required_customer_state',\n REQUIRED_CUSTOMER_ZIP = 'required_customer_zip',\n REQUIRED_CUSTOMER_COUNTRY = 'required_customer_country',\n REQUIRED_CUSTOMER_DOCUMENT = 'required_customer_document',\n REQUIRED_CUSTOMER_DOCUMENT_NUMBER = 'required_customer_document_number',\n REQUIRED_CUSTOMER_DOCUMENT_TYPE = 'required_customer_document_type',\n EXPIRED_CARD = 'expired_card',\n SANDBOX_ERROR = 'sandbox_error',\n}\n","export const generateIdempotencyKey = () => {\n return `idmp_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;\n};\n","import { I18nService } from '../i18n/i18n.service';\nimport { PAYMENT_METHOD_ENUM } from '../models/enums/payment-methods.enum';\nimport { PaymentMessageE } from '../models/enums/payment-status.enum';\n\nexport interface AlertErrorKeys {\n alertTitle?: PaymentMessageE;\n message: PaymentMessageE;\n}\n\n//currency country\n\nexport class PaymentErrorMapper {\n static getErrorMessage(\n errorMessageKey: AlertErrorKeys['message'] | null,\n paymentMethod: PAYMENT_METHOD_ENUM,\n currencyCountry?: string,\n ): string {\n if (\n !errorMessageKey ||\n !Object.values(PaymentMessageE).includes(errorMessageKey as PaymentMessageE) ||\n errorMessageKey === PaymentMessageE.GENERIC_REJECT\n ) {\n if (paymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n return I18nService.translate('paymentErrors.genericErrorCard');\n }\n if (paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER) {\n if (currencyCountry === 'BR') {\n return I18nService.translate('paymentErrors.genericErrorMessagePIX');\n }\n if (currencyCountry === 'AR') {\n return I18nService.translate('paymentErrors.genericErrorMessageQR');\n }\n if (currencyCountry === 'CO') {\n return I18nService.translate('paymentErrors.genericErrorMessagePSE');\n }\n return I18nService.translate('paymentErrors.genericErrorMessageBankTransfer');\n }\n return I18nService.translate('paymentErrors.genericErrorMessage');\n }\n return PaymentErrorMapper.getMessage(errorMessageKey);\n }\n\n static getErrorTitle(\n paymentMethod: PAYMENT_METHOD_ENUM,\n currencyCountry: string,\n errorTitleKey?: AlertErrorKeys['alertTitle'],\n ): string {\n if (errorTitleKey && !(errorTitleKey in PaymentMessageE)) {\n return PaymentErrorMapper.getMessage(errorTitleKey);\n }\n if (paymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n return I18nService.translate('paymentErrors.genericErrorTitleCard');\n }\n if (paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER) {\n if (currencyCountry === 'BR') {\n return I18nService.translate('paymentErrors.genericErrorTitlePIX');\n }\n if (currencyCountry === 'AR') {\n return I18nService.translate('paymentErrors.genericErrorTitleQR');\n }\n if (currencyCountry === 'CO') {\n return I18nService.translate('paymentErrors.genericErrorTitlePSE');\n }\n }\n return I18nService.translate('paymentErrors.genericErrorTitleBankTransfer');\n }\n\n private static getMessage(errorMessageKey: PaymentMessageE): string {\n const messageMap: Record<PaymentMessageE, string> = {\n [PaymentMessageE.PENDING]: I18nService.translate('paymentErrors.pending'),\n [PaymentMessageE.APPROVED]: I18nService.translate('paymentErrors.approved'),\n [PaymentMessageE.REJECTED]: I18nService.translate('paymentErrors.rejected'),\n [PaymentMessageE.DECLINED]: I18nService.translate('paymentErrors.declined'),\n [PaymentMessageE.ERROR]: I18nService.translate('paymentErrors.error'),\n [PaymentMessageE.REFUNDED]: I18nService.translate('paymentErrors.refunded'),\n [PaymentMessageE.CANCELLED]: I18nService.translate('paymentErrors.cancelled'),\n [PaymentMessageE.PARTIALLY_REFUNDED]: I18nService.translate(\n 'paymentErrors.partiallyRefunded',\n ),\n [PaymentMessageE.EXPIRED]: I18nService.translate('paymentErrors.expired'),\n [PaymentMessageE.GENERIC_REJECT]: I18nService.translate('paymentErrors.genericReject'),\n [PaymentMessageE.INVALID_CARD]: I18nService.translate('paymentErrors.invalidCard'),\n [PaymentMessageE.INVALID_CARD_NUMBER]: I18nService.translate(\n 'paymentErrors.invalidCardNumber',\n ),\n [PaymentMessageE.INVALID_CARD_HOLDER_NAME]: I18nService.translate(\n 'paymentErrors.invalidCardHolderName',\n ),\n [PaymentMessageE.INVALID_CARD_EXPIRATION_DATE]: I18nService.translate(\n 'paymentErrors.invalidCardExpirationDate',\n ),\n [PaymentMessageE.INVALID_CARD_CVC]: I18nService.translate('paymentErrors.invalidCardCvc'),\n [PaymentMessageE.INSUFFICIENT_FUNDS]: I18nService.translate(\n 'paymentErrors.insufficientFunds',\n ),\n [PaymentMessageE.BLACKLISTED_CARD]: I18nService.translate('paymentErrors.blacklistedCard'),\n [PaymentMessageE.INVALID_CUSTOMER_EMAIL]: I18nService.translate(\n 'paymentErrors.invalidCustomerEmail',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_PHONE]: I18nService.translate(\n 'paymentErrors.invalidCustomerPhone',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_BILLING_ADDRESS]: I18nService.translate(\n 'paymentErrors.invalidCustomerBillingAddress',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_EMAIL]: I18nService.translate(\n 'paymentErrors.requiredCustomerEmail',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_PHONE]: I18nService.translate(\n 'paymentErrors.requiredCustomerPhone',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_BILLING_ADDRESS]: I18nService.translate(\n 'paymentErrors.requiredCustomerBillingAddress',\n ),\n [PaymentMessageE.INVALID_CHECKOUT_REQUEST]: I18nService.translate(\n 'paymentErrors.invalidCheckoutRequest',\n ),\n [PaymentMessageE.UNAVAILABLE_PAYMENT_METHOD]: I18nService.translate(\n 'paymentErrors.unavailablePaymentMethod',\n ),\n [PaymentMessageE.INVALID_AMOUNT]: I18nService.translate('paymentErrors.invalidAmount'),\n [PaymentMessageE.INVALID_CURRENCY]: I18nService.translate('paymentErrors.invalidCurrency'),\n [PaymentMessageE.INVALID_COUNTRY]: I18nService.translate('paymentErrors.invalidCountry'),\n [PaymentMessageE.MAX_ATTEMPTS]: I18nService.translate('paymentErrors.maxAttempts'),\n [PaymentMessageE.PAYMENT_EXPIRED]: I18nService.translate('paymentErrors.paymentExpired'),\n\n [PaymentMessageE.INTERNAL_ERROR]: I18nService.translate('paymentErrors.internalError'),\n [PaymentMessageE.INVALID_SESSION]: I18nService.translate('paymentErrors.invalidSession'),\n [PaymentMessageE.APM_MESSAGE_ERROR]: I18nService.translate('paymentErrors.APMMessageError'),\n [PaymentMessageE.APM_ERROR_GENERIC]: I18nService.translate('paymentErrors.APMErrorGeneric'),\n [PaymentMessageE.APM_ERROR_BANK_TRANSFER]: I18nService.translate(\n 'paymentErrors.APMErrorBankTransfer',\n ),\n [PaymentMessageE.PROVIDER_ERROR]: I18nService.translate('paymentErrors.providerError'),\n [PaymentMessageE.BANK_REJECTED]: I18nService.translate('paymentErrors.bankRejected'),\n [PaymentMessageE.DO_NOT_HONOR]: I18nService.translate('paymentErrors.bankRejected'),\n\n [PaymentMessageE.FRAUD_HIGH_RISK]: I18nService.translate('paymentErrors.fraudHighRisk'),\n [PaymentMessageE.CALL_BANK_FOR_AUTHORIZE]: I18nService.translate(\n 'paymentErrors.callBankForAuthorize',\n ),\n [PaymentMessageE.REQUIRED_3DS]: I18nService.translate('paymentErrors.required3ds'),\n [PaymentMessageE.BLACKLISTED]: I18nService.translate('paymentErrors.blacklisted'),\n [PaymentMessageE.HARD_DECLINE]: I18nService.translate('paymentErrors.hardDecline'),\n [PaymentMessageE.SOFT_DECLINE]: I18nService.translate('paymentErrors.softDecline'),\n [PaymentMessageE.HUMAN_DECLINE]: I18nService.translate('paymentErrors.humanDecline'),\n [PaymentMessageE.INTERNAL]: I18nService.translate('paymentErrors.internal'),\n [PaymentMessageE.INVALID_CARD_TOKENIZE_COUNTRY]: I18nService.translate(\n 'paymentErrors.invalidCardTokenizeCountry',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_ADDRESS]: I18nService.translate(\n 'paymentErrors.invalidCustomerAddress',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_CITY]: I18nService.translate(\n 'paymentErrors.invalidCustomerCity',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_STATE]: I18nService.translate(\n 'paymentErrors.invalidCustomerState',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_ZIP]: I18nService.translate(\n 'paymentErrors.invalidCustomerZip',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_COUNTRY]: I18nService.translate(\n 'paymentErrors.invalidCustomerCountry',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_DOCUMENT]: I18nService.translate(\n 'paymentErrors.invalidCustomerDocument',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_DOCUMENT_NUMBER]: I18nService.translate(\n 'paymentErrors.invalidCustomerDocumentNumber',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_DOCUMENT_TYPE]: I18nService.translate(\n 'paymentErrors.invalidCustomerDocumentType',\n ),\n [PaymentMessageE.INVALID_CHECKOUT_PAYMENT_METHOD]: I18nService.translate(\n 'paymentErrors.invalidCheckoutPaymentMethod',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_ADDRESS]: I18nService.translate(\n 'paymentErrors.requiredCustomerAddress',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_CITY]: I18nService.translate(\n 'paymentErrors.requiredCustomerCity',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_STATE]: I18nService.translate(\n 'paymentErrors.requiredCustomerState',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_ZIP]: I18nService.translate(\n 'paymentErrors.requiredCustomerZip',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_COUNTRY]: I18nService.translate(\n 'paymentErrors.requiredCustomerCountry',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_DOCUMENT]: I18nService.translate(\n 'paymentErrors.requiredCustomerDocument',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_DOCUMENT_NUMBER]: I18nService.translate(\n 'paymentErrors.requiredCustomerDocumentNumber',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_DOCUMENT_TYPE]: I18nService.translate(\n 'paymentErrors.requiredCustomerDocumentType',\n ),\n [PaymentMessageE.EXPIRED_CARD]: I18nService.translate('paymentErrors.expiredCard'),\n [PaymentMessageE.SANDBOX_ERROR]: I18nService.translate('paymentErrors.sandboxError'),\n };\n\n return messageMap[errorMessageKey] || I18nService.translate('paymentErrors.genericError');\n }\n}\n"],"names":[],"mappings":";;AAGA;AACY,IAAA;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EALW,eAAe,KAAf,eAAe,GAK1B,EAAA,CAAA,CAAA;;ACTW,IAAA;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;A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AAC,eAAe,CAAC,+BAA+B,GAAG,WAAW,CAAC,SAAS,CACtE,4CAA4C,CAC7C;YACD,CAAC,eAAe,CAAC,YAAY,GAAG,WAAW,CAAC,SAAS,CAAC,2BAA2B,CAAC;YAClF,CAAC,eAAe,CAAC,aAAa,GAAG,WAAW,CAAC,SAAS,CAAC,4BAA4B,CAAC;SACrF;QAED,OAAO,UAAU,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,SAAS,CAAC,4BAA4B,CAAC;;AAE5F;;;;"}
@@ -1,2 +1,2 @@
1
- import{r as e,c as t,h as i}from"./p-BTZ7D7jU.js";import{c as r}from"./p-MMCcKmy_.js";import{a as o}from"./p-CV0wqtJM.js";import{g as n,C as s,P as a,a as l}from"./p-GqGHZ54B.js";import{P as c,I as d}from"./p-DPLmRWqO.js";import{S as h}from"./p-vsLqF4hk.js";import{r as m,R as u,o as p}from"./p-neQ-hFWj.js";import{B as f,g as b,i as g}from"./p-Do_vNuMa.js";import{C as y}from"./p-C5Pu-n-i.js";import{G as x}from"./p-CMSUR2TZ.js";import{P as w}from"./p-_K6gh3MX.js";import{i as k,g as v}from"./p-B076eOjt.js";import{g as C,a as q}from"./p-Cq2cEUlR.js";import"./p-E-ZsRS8r.js";import"./p-CzeVW03r.js";const j=":root{--rebill-color-primary:#0056f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-link:#3b82f6;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}@media (max-width: 1024px){.rebill-checkout-renewal{flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section .left-section{width:100%;height:100%;background:var(--rebill-color-background)}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;gap:24px;height:100%;margin-top:24px}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}}@media (min-width: 1025px){.rebill-checkout-renewal{width:100vw;min-height:100vh;display:flex;flex-direction:row;justify-content:center;overflow-y:auto}.left-section{display:flex;width:60%;background:var(--rebill-color-background-left);justify-content:space-around}.right-section{display:flex;padding-top:72px;width:40%;background:var(--rebill-color-background-right);position:sticky;top:0;justify-content:center}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;margin-bottom:36px;margin-top:24px;gap:32px}.left-section-container{max-width:450px;min-width:450px;margin:2.5rem 2rem 1.5rem 2rem;display:flex;flex-direction:column}.checkout-summary-section{max-width:450px;min-width:350px;margin:0rem 2rem;background:var(--rebill-color-background-right);display:flex;flex-direction:column;justify-content:flex-start;width:100%}.checkout-form-section user-information,.checkout-form-section payment-method-selector,.checkout-form-section rebill-address,.checkout-summary-section rebill-summary{width:100%}.pac-container{border-radius:4px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border:1px solid #e0e0e0;margin-top:4px;font-family:inherit}.pac-item{padding:10px 12px;cursor:pointer;border-top:none}.pac-item:first-child{border-top:none}.pac-item:hover{background-color:#f5f5f5}.pac-item-query{font-weight:500}.pac-icon{display:none}}.payment-button-container{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.animated-component{transition:all 0.3s ease-in-out;overflow:visible}.fade-in{animation:fadeIn 0.4s ease-in-out}.slide-in{animation:slideIn 0.5s ease-out}@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{from{opacity:0;transform:translateX(-20px);max-height:0}to{opacity:1;transform:translateX(0);max-height:450px}}.animated-component.hide{animation:fadeOut 0.3s ease-in-out forwards}@keyframes fadeOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}rebill-mode-sandbox{position:fixed;bottom:50px;left:50%;transform:translateX(-50%);z-index:1000}@media (max-width: 1024px){rebill-test-mode-chip{bottom:46px}}@media (min-width: 1025px){rebill-test-mode-chip{bottom:46px}}.mode-sandbox-mobile-container{display:flex;align-items:center;width:100%;padding:0;margin:0;box-sizing:border-box}@media (min-width: 1451px){.left-section-container{min-width:450px;margin:2.5rem 5rem 1.5rem 5rem}.checkout-summary-section{min-width:450px;margin:0rem 5rem}}";const M=class{constructor(i){e(this,i);this.success=t(this,"success");this.paymentError=t(this,"paymentError");this.paymentMethodSelected=t(this,"paymentMethodSelected")}renewalData;renewalToken;currentPaymentMethod=c.CARD;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;errorMessage=null;breakpoint=f.DESKTOP;errorPaymentCard=false;errorPaymentAPM=false;initialData={};checkoutResponse=null;currentApmPaymentMethod=null;countries=[];allRequiredFields={};currentRequiredFields=[];errorCardInvalid=false;cardMode="select";success;paymentError;paymentMethodSelected;validationSchema={phoneNumber:r().when([],{is:()=>k("phoneNumber",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.phoneRequired"),otherwise:e=>e.notRequired()}),"billing-country":r().when([],{is:()=>k("billing-country",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.countryRequired"),otherwise:e=>e.notRequired()}),"billing-state":r().when([],{is:()=>k("billing-state",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.stateRequired"),otherwise:e=>e.notRequired()}),"billing-address":r().when([],{is:()=>k("billing-address",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.addressRequired"),otherwise:e=>e.notRequired()}),"billing-city":r().when([],{is:()=>k("billing-city",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.cityRequired"),otherwise:e=>e.notRequired()}),"billing-zip":r().when([],{is:()=>k("billing-zip",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.zipRequired"),otherwise:e=>e.notRequired()}),bankId:r().when([],{is:()=>k("bankId",this.currentRequiredFields),then:e=>e.required("validation.bankRequired"),otherwise:e=>e.notRequired()}),documentType:r().when([],{is:()=>k("documentType",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.documentTypeRequired"),otherwise:e=>e.notRequired()}),documentNumber:r().when([],{is:()=>k("documentNumber",this.currentRequiredFields)&&this.cardMode==="input",then:e=>{const t=e.required("validation.documentNumberRequired").min(7,"validation.documentInvalid");if(m.data?.price?.country==="BR"){return t.test("numeric-only","validation.documentNumberNumericOnly",(e=>{if(!e)return true;return/^\d+$/.test(e)}))}return t},otherwise:e=>e.notRequired()})};resizeHandler=()=>{this.breakpoint=b(window.innerWidth)};async componentWillLoad(){this.resizeHandler();window.addEventListener("resize",this.resizeHandler);const e=typeof this.renewalData==="string"?JSON.parse(this.renewalData):this.renewalData;u.initializeRenewal({...e,token:this.renewalToken});x.loadGoogleMapsScript();try{const e=await o.data.getCountries();this.countries=e.data}catch(e){console.error("Error loading countries:",e)}try{this.allRequiredFields=await C()}catch(e){console.error("Error loading required fields:",e)}if(m.data.paymentMethods.length>0){let e=null;if(m.data.subscription?.paymentMethod){const t=m.data.subscription.paymentMethod.toLowerCase();const i=t==="card"?c.CARD:t==="bank_transfer"?c.BANK_TRANSFER:null;if(i){const t=m.data.paymentMethods.some((e=>e.type===i));if(t){e=i}}}if(!e){e=m.data.paymentMethods[0].type}this.currentPaymentMethod=e;u.setSelectedPaymentMethod(e);if(e!==c.CARD){this.cardMode="input";u.setCardMode("input")}try{this.currentRequiredFields=q(e,this.allRequiredFields).fields}catch(e){console.error("Error getting required fields for method:",e)}await this.initializeFingerprint(e)}this.initialData=this.getInitialData();p("cardMode",(()=>{this.cardMode=m.cardMode}))}disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler)}async handlePaymentMethodSelected(e){e.stopPropagation();if(this.currentPaymentMethod===e.detail){return}this.currentPaymentMethod=e.detail;u.setSelectedPaymentMethod(this.currentPaymentMethod);if(this.currentPaymentMethod!==c.CARD){this.cardMode="input";u.setCardMode("input")}try{this.currentRequiredFields=q(this.currentPaymentMethod,this.allRequiredFields).fields}catch(e){console.error("Error getting required fields for method:",e)}await this.initializeFingerprint(this.currentPaymentMethod);this.paymentMethodSelected.emit(e.detail)}async initializeFingerprint(e){if(e===c.CARD&&!m.deviceId){try{const e=crypto.randomUUID();const t=await o.fingerPrint.getFingerPrint(e);u.setDeviceId(e);const i=t.result.script;const r=document.createElement("script");r.innerHTML=i;document.body.appendChild(r)}catch(e){console.error("Failed to initialize fingerprint:",e)}}}handleBankSelected(e){e.stopPropagation();u.setSelectedBankId(e.detail)}handleCardSelected(e){const{card:t,cvv:i}=e.detail;u.setSelectedCard(t);u.setCvv(i||"")}get currentPaymentError(){if(this.currentPaymentMethod===c.CARD){return this.errorPaymentCard}else if(this.currentPaymentMethod===c.CASH||this.currentPaymentMethod===c.BANK_TRANSFER){return this.errorPaymentAPM}return false}async handleSubmit(e){if(this.isSubmitting){return}if(this.currentPaymentMethod===c.CARD){await this.handleCardRenewal(e)}else{await this.handleAPMRenewal(e)}}async handleCardRenewal(e){const t=e?.detail||this.getInitialData();if(!m.data.cardId&&!m.data.cardTokenId){this.errorCardInvalid=true;return}if(!m.data.cardInformation&&!m.data.cardId){this.errorCardInvalid=true;return}this.errorCardInvalid=false;this.isSubmitting=true;this.isCardSubmitting=true;u.setLoading(true);try{const e={transaction:{quantity:1},...m.data.cardId&&{cardId:m.data.cardId},...m.data.cardTokenId&&{cardTokenId:m.data.cardTokenId},customAttributes:{...m.deviceId&&{deviceId:m.deviceId}},...this.cardMode==="input"&&{customer:{firstName:t.fullName?.split(" ")[0]||m.data.subscription.customerName?.split(" ")[0],lastName:t.fullName?.split(" ").slice(1).join(" ")||m.data.subscription.customerName?.split(" ").slice(1).join(" "),email:t.email||m.data.subscription.customerEmail,phone:{countryCode:t.countryCodePhoneNumber||"",number:t.phoneNumber||""}},billingDetails:{address:{lineOne:t["billing-address"]||"",city:t["billing-city"]||"",state:t["billing-state"]||"",country:t["billing-country"]||"",zipCode:t["billing-zip"]||""},identification:{type:t.documentType||"",value:t.documentNumber||""}}}};const i=n();const r=await o.checkout.createCardCheckoutRequest(m.data.id,i,e,m.token);this.isSubmitting=false;this.isCardSubmitting=false;u.setLoading(false);u.setCheckoutResponse(r.data);if(r.data.result?.status.toUpperCase()===s.APPROVED){this.isCardSuccess=true}else{this.isCardSuccess=false;this.errorPaymentCard=true;this.errorMessage={message:r.data.error?.error?.message}}}catch(e){this.isSubmitting=false;this.isCardSubmitting=false;u.setLoading(false);this.errorPaymentCard=true;this.errorMessage={message:e.data?.error?.message}}}async handleAPMRenewal(e){this.isSubmitting=true;u.setLoading(true);try{const t=w.mapToAPMPaymentMethod(this.currentPaymentMethod,m.data.price.country);const i=e?.detail||this.getFormData();const r={address:{country:i["billing-country"],state:i["billing-state"]||"",city:i["billing-city"]||"",zipCode:i["billing-zip"]||"",lineOne:i["billing-address"]||""},identification:{type:i.documentType||"dni",value:i.documentNumber||""}};const a={transaction:{quantity:1},method:t,billingDetails:r,redirect:{approved:window.location.origin+"/renewal/success",rejected:window.location.origin+"/renewal/failure"},paymentMetadata:{orderId:m.data.id,source:"renewal-web"},customAttributes:{bank:i.bankId||""}};a.customer={firstName:i.fullName?.split(" ")[0]||m.data.subscription.customerName.split(" ")[0]||"",lastName:i.fullName?.split(" ").slice(1).join(" ")||m.data.subscription.customerName.split(" ").slice(1).join(" ")||"",email:i.email||m.data.subscription.customerEmail,phone:{countryCode:i.countryCodePhoneNumber||"",number:i.phoneNumber||""}};const l=n();const c=await o.checkout.createAPMCheckoutRequest(m.data.id,l,a);this.isSubmitting=false;u.setLoading(false);u.setCheckoutResponse(c.data);this.checkoutResponse=c.data;const d=c.data.result?.status?.toString().toLowerCase();const p=d===s.APPROVED.toLowerCase();const f=d===h.PENDING_CUSTOMER_CHARGE;if(p){this.isCardSuccess=true;this.errorPaymentAPM=false;this.errorMessage=null}else if(f){this.isCardSuccess=false;this.errorPaymentAPM=false;this.errorMessage=null}else{this.paymentError.emit(c.data);u.setCheckoutResponse(c.data);this.errorPaymentAPM=true;this.errorMessage={alertTitle:c.data?.error?.message,message:c.data.error?.message}}}catch(e){this.isSubmitting=false;u.setLoading(false);this.paymentError.emit(e);this.errorPaymentAPM=true;this.errorMessage={alertTitle:e.data?.error?.message,message:e.data?.error?.message}}}getFormData=()=>this.initialData;getInitialData=()=>({email:m.data.subscription.customerEmail,fullName:m.data.subscription.customerName,card:"","billing-country":"","billing-state":"","billing-address":"","billing-city":"","billing-zip":"",bankId:"",phoneNumber:"",countryCodePhoneNumber:"",documentType:"",documentNumber:""});hasPrefilledAddress=()=>{const e=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return e.some((e=>{const t=this.initialData[e];return t&&t.trim()!==""}))};getPaymentDate=()=>{const e=m.form.checkoutResponse;if(!e)return"";if("date"in e){return e.date}return""};getReferenceNumber=()=>{const e=m.form.checkoutResponse;if(!e)return"";if("traceId"in e){return e.traceId}return""};get isAPMCheckoutVisible(){return!this.isCardSuccess&&!this.errorPaymentAPM&&!!this.checkoutResponse?.result&&(this.currentPaymentMethod===c.CASH||this.currentPaymentMethod===c.BANK_TRANSFER)}handlePaymentStatusChange=e=>{if(e.isCompleted){if(e.status===h.APPROVED){this.isCardSuccess=true;this.errorPaymentAPM=false;this.errorMessage=null;this.success.emit({paymentMethod:this.currentPaymentMethod,data:this.checkoutResponse})}else if(e.status===h.REJECTED){this.errorPaymentAPM=true;this.errorMessage={alertTitle:a.APM_ERROR_GENERIC,message:a.APM_MESSAGE_ERROR}}}};render(){if(!m.isInitialized){return i("div",{class:"loading"},d.translate("renewal.loading"))}const e=e=>i("renewal-summary",{totalAmount:m.data.price.amount,subTotalAmount:m.data.subscription.subTotalAmount,currency:m.data.price.currency,subscriptionTitle:m.data.subscription.name[0]?.text||"Subscription",subscriptionAmount:m.data.subscription.amount,nextChargeDate:m.data.subscription.nextChargeDate,frequency:m.data.subscription.frequency,couponCode:m.data.price.couponCode,discountAmount:m.data.price.discountedAmount,discountPercentage:m.data.price.discountPercentage,...e});return i(i.Fragment,null,i("rebill-processing-payment",{style:{display:this.isCardSubmitting?"block":"none"}}),this.isCardSuccess?i("renewal-success-page",{typePaymentMethod:this.currentPaymentMethod,paymentDate:this.getPaymentDate(),referenceNumber:this.getReferenceNumber(),cardLastFour:m.data.subscription.cardLastFour,country:m.data.price.country,paymentMethodName:w.mapToAPMPaymentMethod(this.currentPaymentMethod,m.data?.price?.country),bank:m.form?.selectedBankId||""}):i("rebill-checkout-form",{style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:e=>this.handleSubmit(e),renderForm:({submit:t,formData:r,errors:o})=>i("div",{class:"rebill-checkout-renewal"},i("div",{class:"left-section"},i("div",{class:"left-section-container"},i("organization-logo",{organization:m.data.organization}),i("div",{class:"checkout-form-section"},i("user-information-static",{userInfo:{customerName:m.data.subscription.customerName,customerEmail:m.data.subscription.customerEmail}}),g(this.breakpoint,f.DESKTOP)&&e({displayedComponents:"header"}),g(this.breakpoint,f.DESKTOP)&&e({displayedComponents:"details"}),i("div",{style:{display:"flex",flexDirection:"column",gap:"32px"}},i("payment-method-selector",{enabledPaymentMethods:[...new Set(m.data.paymentMethods.map((e=>e.type)))],defaultSelected:this.currentPaymentMethod,errorComponent:{showErrorComponent:this.currentPaymentError,alertTitle:l.getErrorTitle(this.currentPaymentMethod,m.data.price.country,this.errorMessage?.alertTitle),message:l.getErrorMessage(this.errorMessage?.message,this.currentPaymentMethod,m.data.price.country)},cardError:{showCardInvalid:this.errorCardInvalid,type:null},country:m.data.price.country,documentTypeError:o?.documentType,documentNumberError:o?.documentNumber,showDocument:!this.isAPMCheckoutVisible&&this.cardMode==="input"&&(k("documentType",this.currentRequiredFields)||k("documentNumber",this.currentRequiredFields))}),this.currentPaymentMethod!==c.CARD&&m.data.subscription?.paymentMethod===c.CARD&&i("rebill-alert",{type:"info",message:d.translate("renewal.paymentMethodAlert",{cardLastFour:m.data?.subscription?.cardLastFour||"****"}),icon:"calendar-edit",variant:"outlined",colorIcon:y.PRIMARY}),!this.isAPMCheckoutVisible&&this.cardMode==="input"&&k("bankId",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("rebill-bank-selector",{banks:v("bank",this.allRequiredFields[this.currentPaymentMethod]?.original)||[],defaultSelectedBankId:r.bankId||"",error:o?.bankId}))),!this.isAPMCheckoutVisible&&this.cardMode==="input"&&(k("billing-country",this.currentRequiredFields)||k("billing-state",this.currentRequiredFields)||k("billing-address",this.currentRequiredFields)||k("billing-city",this.currentRequiredFields)||k("billing-zip",this.currentRequiredFields))&&i("div",{class:"animated-component slide-in"},i("rebill-address",{countryOptions:this.countries.map((e=>({label:e.country,value:e.isoCountryCode}))),billingView:this.hasPrefilledAddress()?"form":"search",errors:{"billing-country":o["billing-country"],"billing-state":o["billing-state"],"billing-address":o["billing-address"],"billing-city":o["billing-city"],"billing-zip":o["billing-zip"]}})),!this.isAPMCheckoutVisible&&this.cardMode==="input"&&k("phoneNumber",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("user-information-phone",{error:o?.phoneNumber})),this.isAPMCheckoutVisible&&i("apm-checkout",{paymentMethod:this.currentPaymentMethod,referenceId:this.currentPaymentMethod===c.CASH?this.checkoutResponse.result.data.referenceId:undefined,qrCodeData:this.currentPaymentMethod===c.BANK_TRANSFER?this.checkoutResponse.result.data.qrCode:undefined,code:this.checkoutResponse?.result?.data?.code,providerName:m.data.organization?.name||"",expirationDate:(()=>{const e=new Date;e.setDate(e.getDate()+30);return e.toISOString()})(),country:m.data.price.country,redirectUrl:this.checkoutResponse.result.data.url,checkoutRequestId:this.checkoutResponse?.result?.checkoutRequestId,bearerToken:this.checkoutResponse?.result?.data?.bearerToken,onPaymentStatusChange:e=>this.handlePaymentStatusChange(e.detail)}),g(this.breakpoint,f.DESKTOP)&&e({displayedComponents:"summary"}),i("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},!this.isAPMCheckoutVisible&&i("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,isRenewal:true,trialPeriodDays:m.data.subscription.trialPeriodDays,redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:5e3,country:m.data.price.country,isDisabled:m.fetchingInstallments,onSubmit:()=>t()}),i("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:d.translate("otp.secureMessage")}))),i("rebill-footer",{style:{marginTop:g(this.breakpoint,f.DESKTOP)?"24px":"auto"}}))),!g(this.breakpoint,f.DESKTOP)&&i("div",{class:"right-section"},i("div",{class:"checkout-summary-section"},e({displayedComponents:["header","details","summary"]}))))}))}};M.style=j;export{M as rebill_renewal};
2
- //# sourceMappingURL=p-b3a695df.entry.js.map
1
+ import{r as e,c as t,h as i}from"./p-BTZ7D7jU.js";import{c as r}from"./p-MMCcKmy_.js";import{a as o}from"./p-CV0wqtJM.js";import{g as n,C as s,P as a,a as l}from"./p-BXKxstSq.js";import{P as c,I as d}from"./p-DPLmRWqO.js";import{S as h}from"./p-vsLqF4hk.js";import{r as m,R as u,o as p}from"./p-neQ-hFWj.js";import{B as f,g as b,i as g}from"./p-Do_vNuMa.js";import{C as y}from"./p-C5Pu-n-i.js";import{G as x}from"./p-CMSUR2TZ.js";import{P as w}from"./p-_K6gh3MX.js";import{i as k,g as v}from"./p-B076eOjt.js";import{g as C,a as q}from"./p-Cq2cEUlR.js";import"./p-E-ZsRS8r.js";import"./p-CzeVW03r.js";const j=":root{--rebill-color-primary:#0056f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-link:#3b82f6;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}@media (max-width: 1024px){.rebill-checkout-renewal{flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section .left-section{width:100%;height:100%;background:var(--rebill-color-background)}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;gap:24px;height:100%;margin-top:24px}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}}@media (min-width: 1025px){.rebill-checkout-renewal{width:100vw;min-height:100vh;display:flex;flex-direction:row;justify-content:center;overflow-y:auto}.left-section{display:flex;width:60%;background:var(--rebill-color-background-left);justify-content:space-around}.right-section{display:flex;padding-top:72px;width:40%;background:var(--rebill-color-background-right);position:sticky;top:0;justify-content:center}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;margin-bottom:36px;margin-top:24px;gap:32px}.left-section-container{max-width:450px;min-width:450px;margin:2.5rem 2rem 1.5rem 2rem;display:flex;flex-direction:column}.checkout-summary-section{max-width:450px;min-width:350px;margin:0rem 2rem;background:var(--rebill-color-background-right);display:flex;flex-direction:column;justify-content:flex-start;width:100%}.checkout-form-section user-information,.checkout-form-section payment-method-selector,.checkout-form-section rebill-address,.checkout-summary-section rebill-summary{width:100%}.pac-container{border-radius:4px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border:1px solid #e0e0e0;margin-top:4px;font-family:inherit}.pac-item{padding:10px 12px;cursor:pointer;border-top:none}.pac-item:first-child{border-top:none}.pac-item:hover{background-color:#f5f5f5}.pac-item-query{font-weight:500}.pac-icon{display:none}}.payment-button-container{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.animated-component{transition:all 0.3s ease-in-out;overflow:visible}.fade-in{animation:fadeIn 0.4s ease-in-out}.slide-in{animation:slideIn 0.5s ease-out}@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{from{opacity:0;transform:translateX(-20px);max-height:0}to{opacity:1;transform:translateX(0);max-height:450px}}.animated-component.hide{animation:fadeOut 0.3s ease-in-out forwards}@keyframes fadeOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}rebill-mode-sandbox{position:fixed;bottom:50px;left:50%;transform:translateX(-50%);z-index:1000}@media (max-width: 1024px){rebill-test-mode-chip{bottom:46px}}@media (min-width: 1025px){rebill-test-mode-chip{bottom:46px}}.mode-sandbox-mobile-container{display:flex;align-items:center;width:100%;padding:0;margin:0;box-sizing:border-box}@media (min-width: 1451px){.left-section-container{min-width:450px;margin:2.5rem 5rem 1.5rem 5rem}.checkout-summary-section{min-width:450px;margin:0rem 5rem}}";const M=class{constructor(i){e(this,i);this.success=t(this,"success");this.paymentError=t(this,"paymentError");this.paymentMethodSelected=t(this,"paymentMethodSelected")}renewalData;renewalToken;currentPaymentMethod=c.CARD;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;errorMessage=null;breakpoint=f.DESKTOP;errorPaymentCard=false;errorPaymentAPM=false;initialData={};checkoutResponse=null;currentApmPaymentMethod=null;countries=[];allRequiredFields={};currentRequiredFields=[];errorCardInvalid=false;cardMode="select";success;paymentError;paymentMethodSelected;validationSchema={phoneNumber:r().when([],{is:()=>k("phoneNumber",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.phoneRequired"),otherwise:e=>e.notRequired()}),"billing-country":r().when([],{is:()=>k("billing-country",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.countryRequired"),otherwise:e=>e.notRequired()}),"billing-state":r().when([],{is:()=>k("billing-state",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.stateRequired"),otherwise:e=>e.notRequired()}),"billing-address":r().when([],{is:()=>k("billing-address",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.addressRequired"),otherwise:e=>e.notRequired()}),"billing-city":r().when([],{is:()=>k("billing-city",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.cityRequired"),otherwise:e=>e.notRequired()}),"billing-zip":r().when([],{is:()=>k("billing-zip",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.zipRequired"),otherwise:e=>e.notRequired()}),bankId:r().when([],{is:()=>k("bankId",this.currentRequiredFields),then:e=>e.required("validation.bankRequired"),otherwise:e=>e.notRequired()}),documentType:r().when([],{is:()=>k("documentType",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.documentTypeRequired"),otherwise:e=>e.notRequired()}),documentNumber:r().when([],{is:()=>k("documentNumber",this.currentRequiredFields)&&this.cardMode==="input",then:e=>{const t=e.required("validation.documentNumberRequired").min(7,"validation.documentInvalid");if(m.data?.price?.country==="BR"){return t.test("numeric-only","validation.documentNumberNumericOnly",(e=>{if(!e)return true;return/^\d+$/.test(e)}))}return t},otherwise:e=>e.notRequired()})};resizeHandler=()=>{this.breakpoint=b(window.innerWidth)};async componentWillLoad(){this.resizeHandler();window.addEventListener("resize",this.resizeHandler);const e=typeof this.renewalData==="string"?JSON.parse(this.renewalData):this.renewalData;u.initializeRenewal({...e,token:this.renewalToken});x.loadGoogleMapsScript();try{const e=await o.data.getCountries();this.countries=e.data}catch(e){console.error("Error loading countries:",e)}try{this.allRequiredFields=await C()}catch(e){console.error("Error loading required fields:",e)}if(m.data.paymentMethods.length>0){let e=null;if(m.data.subscription?.paymentMethod){const t=m.data.subscription.paymentMethod.toLowerCase();const i=t==="card"?c.CARD:t==="bank_transfer"?c.BANK_TRANSFER:null;if(i){const t=m.data.paymentMethods.some((e=>e.type===i));if(t){e=i}}}if(!e){e=m.data.paymentMethods[0].type}this.currentPaymentMethod=e;u.setSelectedPaymentMethod(e);if(e!==c.CARD){this.cardMode="input";u.setCardMode("input")}try{this.currentRequiredFields=q(e,this.allRequiredFields).fields}catch(e){console.error("Error getting required fields for method:",e)}await this.initializeFingerprint(e)}this.initialData=this.getInitialData();p("cardMode",(()=>{this.cardMode=m.cardMode}))}disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler)}async handlePaymentMethodSelected(e){e.stopPropagation();if(this.currentPaymentMethod===e.detail){return}this.currentPaymentMethod=e.detail;u.setSelectedPaymentMethod(this.currentPaymentMethod);if(this.currentPaymentMethod!==c.CARD){this.cardMode="input";u.setCardMode("input")}try{this.currentRequiredFields=q(this.currentPaymentMethod,this.allRequiredFields).fields}catch(e){console.error("Error getting required fields for method:",e)}await this.initializeFingerprint(this.currentPaymentMethod);this.paymentMethodSelected.emit(e.detail)}async initializeFingerprint(e){if(e===c.CARD&&!m.deviceId){try{const e=crypto.randomUUID();const t=await o.fingerPrint.getFingerPrint(e);u.setDeviceId(e);const i=t.result.script;const r=document.createElement("script");r.innerHTML=i;document.body.appendChild(r)}catch(e){console.error("Failed to initialize fingerprint:",e)}}}handleBankSelected(e){e.stopPropagation();u.setSelectedBankId(e.detail)}handleCardSelected(e){const{card:t,cvv:i}=e.detail;u.setSelectedCard(t);u.setCvv(i||"")}get currentPaymentError(){if(this.currentPaymentMethod===c.CARD){return this.errorPaymentCard}else if(this.currentPaymentMethod===c.CASH||this.currentPaymentMethod===c.BANK_TRANSFER){return this.errorPaymentAPM}return false}async handleSubmit(e){if(this.isSubmitting){return}if(this.currentPaymentMethod===c.CARD){await this.handleCardRenewal(e)}else{await this.handleAPMRenewal(e)}}async handleCardRenewal(e){const t=e?.detail||this.getInitialData();if(!m.data.cardId&&!m.data.cardTokenId){this.errorCardInvalid=true;return}if(!m.data.cardInformation&&!m.data.cardId){this.errorCardInvalid=true;return}this.errorCardInvalid=false;this.isSubmitting=true;this.isCardSubmitting=true;u.setLoading(true);try{const e={transaction:{quantity:1},...m.data.cardId&&{cardId:m.data.cardId},...m.data.cardTokenId&&{cardTokenId:m.data.cardTokenId},customAttributes:{...m.deviceId&&{deviceId:m.deviceId}},...this.cardMode==="input"&&{customer:{firstName:t.fullName?.split(" ")[0]||m.data.subscription.customerName?.split(" ")[0],lastName:t.fullName?.split(" ").slice(1).join(" ")||m.data.subscription.customerName?.split(" ").slice(1).join(" "),email:t.email||m.data.subscription.customerEmail,phone:{countryCode:t.countryCodePhoneNumber||"",number:t.phoneNumber||""}},billingDetails:{address:{lineOne:t["billing-address"]||"",city:t["billing-city"]||"",state:t["billing-state"]||"",country:t["billing-country"]||"",zipCode:t["billing-zip"]||""},identification:{type:t.documentType||"",value:t.documentNumber||""}}}};const i=n();const r=await o.checkout.createCardCheckoutRequest(m.data.id,i,e,m.token);this.isSubmitting=false;this.isCardSubmitting=false;u.setLoading(false);u.setCheckoutResponse(r.data);if(r.data.result?.status.toUpperCase()===s.APPROVED){this.isCardSuccess=true}else{this.isCardSuccess=false;this.errorPaymentCard=true;this.errorMessage={message:r.data.error?.error?.message}}}catch(e){this.isSubmitting=false;this.isCardSubmitting=false;u.setLoading(false);this.errorPaymentCard=true;this.errorMessage={message:e.data?.error?.message}}}async handleAPMRenewal(e){this.isSubmitting=true;u.setLoading(true);try{const t=w.mapToAPMPaymentMethod(this.currentPaymentMethod,m.data.price.country);const i=e?.detail||this.getFormData();const r={address:{country:i["billing-country"],state:i["billing-state"]||"",city:i["billing-city"]||"",zipCode:i["billing-zip"]||"",lineOne:i["billing-address"]||""},identification:{type:i.documentType||"dni",value:i.documentNumber||""}};const a={transaction:{quantity:1},method:t,billingDetails:r,redirect:{approved:window.location.origin+"/renewal/success",rejected:window.location.origin+"/renewal/failure"},paymentMetadata:{orderId:m.data.id,source:"renewal-web"},customAttributes:{bank:i.bankId||""}};a.customer={firstName:i.fullName?.split(" ")[0]||m.data.subscription.customerName.split(" ")[0]||"",lastName:i.fullName?.split(" ").slice(1).join(" ")||m.data.subscription.customerName.split(" ").slice(1).join(" ")||"",email:i.email||m.data.subscription.customerEmail,phone:{countryCode:i.countryCodePhoneNumber||"",number:i.phoneNumber||""}};const l=n();const c=await o.checkout.createAPMCheckoutRequest(m.data.id,l,a);this.isSubmitting=false;u.setLoading(false);u.setCheckoutResponse(c.data);this.checkoutResponse=c.data;const d=c.data.result?.status?.toString().toLowerCase();const p=d===s.APPROVED.toLowerCase();const f=d===h.PENDING_CUSTOMER_CHARGE;if(p){this.isCardSuccess=true;this.errorPaymentAPM=false;this.errorMessage=null}else if(f){this.isCardSuccess=false;this.errorPaymentAPM=false;this.errorMessage=null}else{this.paymentError.emit(c.data);u.setCheckoutResponse(c.data);this.errorPaymentAPM=true;this.errorMessage={alertTitle:c.data?.error?.message,message:c.data.error?.message}}}catch(e){this.isSubmitting=false;u.setLoading(false);this.paymentError.emit(e);this.errorPaymentAPM=true;this.errorMessage={alertTitle:e.data?.error?.message,message:e.data?.error?.message}}}getFormData=()=>this.initialData;getInitialData=()=>({email:m.data.subscription.customerEmail,fullName:m.data.subscription.customerName,card:"","billing-country":"","billing-state":"","billing-address":"","billing-city":"","billing-zip":"",bankId:"",phoneNumber:"",countryCodePhoneNumber:"",documentType:"",documentNumber:""});hasPrefilledAddress=()=>{const e=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return e.some((e=>{const t=this.initialData[e];return t&&t.trim()!==""}))};getPaymentDate=()=>{const e=m.form.checkoutResponse;if(!e)return"";if("date"in e){return e.date}return""};getReferenceNumber=()=>{const e=m.form.checkoutResponse;if(!e)return"";if("traceId"in e){return e.traceId}return""};get isAPMCheckoutVisible(){return!this.isCardSuccess&&!this.errorPaymentAPM&&!!this.checkoutResponse?.result&&(this.currentPaymentMethod===c.CASH||this.currentPaymentMethod===c.BANK_TRANSFER)}handlePaymentStatusChange=e=>{if(e.isCompleted){if(e.status===h.APPROVED){this.isCardSuccess=true;this.errorPaymentAPM=false;this.errorMessage=null;this.success.emit({paymentMethod:this.currentPaymentMethod,data:this.checkoutResponse})}else if(e.status===h.REJECTED){this.errorPaymentAPM=true;this.errorMessage={alertTitle:a.APM_ERROR_GENERIC,message:a.APM_MESSAGE_ERROR}}}};render(){if(!m.isInitialized){return i("div",{class:"loading"},d.translate("renewal.loading"))}const e=e=>i("renewal-summary",{totalAmount:m.data.price.amount,subTotalAmount:m.data.subscription.subTotalAmount,currency:m.data.price.currency,subscriptionTitle:m.data.subscription.name[0]?.text||"Subscription",subscriptionAmount:m.data.subscription.amount,nextChargeDate:m.data.subscription.nextChargeDate,frequency:m.data.subscription.frequency,couponCode:m.data.price.couponCode,discountAmount:m.data.price.discountedAmount,discountPercentage:m.data.price.discountPercentage,...e});return i(i.Fragment,null,i("rebill-processing-payment",{style:{display:this.isCardSubmitting?"block":"none"}}),this.isCardSuccess?i("renewal-success-page",{typePaymentMethod:this.currentPaymentMethod,paymentDate:this.getPaymentDate(),referenceNumber:this.getReferenceNumber(),cardLastFour:m.data.subscription.cardLastFour,country:m.data.price.country,paymentMethodName:w.mapToAPMPaymentMethod(this.currentPaymentMethod,m.data?.price?.country),bank:m.form?.selectedBankId||""}):i("rebill-checkout-form",{style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:e=>this.handleSubmit(e),renderForm:({submit:t,formData:r,errors:o})=>i("div",{class:"rebill-checkout-renewal"},i("div",{class:"left-section"},i("div",{class:"left-section-container"},i("organization-logo",{organization:m.data.organization}),i("div",{class:"checkout-form-section"},i("user-information-static",{userInfo:{customerName:m.data.subscription.customerName,customerEmail:m.data.subscription.customerEmail}}),g(this.breakpoint,f.DESKTOP)&&e({displayedComponents:"header"}),g(this.breakpoint,f.DESKTOP)&&e({displayedComponents:"details"}),i("div",{style:{display:"flex",flexDirection:"column",gap:"32px"}},i("payment-method-selector",{enabledPaymentMethods:[...new Set(m.data.paymentMethods.map((e=>e.type)))],defaultSelected:this.currentPaymentMethod,errorComponent:{showErrorComponent:this.currentPaymentError,alertTitle:l.getErrorTitle(this.currentPaymentMethod,m.data.price.country,this.errorMessage?.alertTitle),message:l.getErrorMessage(this.errorMessage?.message,this.currentPaymentMethod,m.data.price.country)},cardError:{showCardInvalid:this.errorCardInvalid,type:null},country:m.data.price.country,documentTypeError:o?.documentType,documentNumberError:o?.documentNumber,showDocument:!this.isAPMCheckoutVisible&&this.cardMode==="input"&&(k("documentType",this.currentRequiredFields)||k("documentNumber",this.currentRequiredFields))}),this.currentPaymentMethod!==c.CARD&&m.data.subscription?.paymentMethod===c.CARD&&i("rebill-alert",{type:"info",message:d.translate("renewal.paymentMethodAlert",{cardLastFour:m.data?.subscription?.cardLastFour||"****"}),icon:"calendar-edit",variant:"outlined",colorIcon:y.PRIMARY}),!this.isAPMCheckoutVisible&&this.cardMode==="input"&&k("bankId",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("rebill-bank-selector",{banks:v("bank",this.allRequiredFields[this.currentPaymentMethod]?.original)||[],defaultSelectedBankId:r.bankId||"",error:o?.bankId}))),!this.isAPMCheckoutVisible&&this.cardMode==="input"&&(k("billing-country",this.currentRequiredFields)||k("billing-state",this.currentRequiredFields)||k("billing-address",this.currentRequiredFields)||k("billing-city",this.currentRequiredFields)||k("billing-zip",this.currentRequiredFields))&&i("div",{class:"animated-component slide-in"},i("rebill-address",{countryOptions:this.countries.map((e=>({label:e.country,value:e.isoCountryCode}))),billingView:this.hasPrefilledAddress()?"form":"search",errors:{"billing-country":o["billing-country"],"billing-state":o["billing-state"],"billing-address":o["billing-address"],"billing-city":o["billing-city"],"billing-zip":o["billing-zip"]}})),!this.isAPMCheckoutVisible&&this.cardMode==="input"&&k("phoneNumber",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("user-information-phone",{error:o?.phoneNumber})),this.isAPMCheckoutVisible&&i("apm-checkout",{paymentMethod:this.currentPaymentMethod,referenceId:this.currentPaymentMethod===c.CASH?this.checkoutResponse.result.data.referenceId:undefined,qrCodeData:this.currentPaymentMethod===c.BANK_TRANSFER?this.checkoutResponse.result.data.qrCode:undefined,code:this.checkoutResponse?.result?.data?.code,providerName:m.data.organization?.name||"",expirationDate:(()=>{const e=new Date;e.setDate(e.getDate()+30);return e.toISOString()})(),country:m.data.price.country,redirectUrl:this.checkoutResponse.result.data.url,checkoutRequestId:this.checkoutResponse?.result?.checkoutRequestId,bearerToken:this.checkoutResponse?.result?.data?.bearerToken,onPaymentStatusChange:e=>this.handlePaymentStatusChange(e.detail)}),g(this.breakpoint,f.DESKTOP)&&e({displayedComponents:"summary"}),i("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},!this.isAPMCheckoutVisible&&i("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,isRenewal:true,trialPeriodDays:m.data.subscription.trialPeriodDays,redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:5e3,country:m.data.price.country,isDisabled:m.fetchingInstallments,onSubmit:()=>t()}),i("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:d.translate("otp.secureMessage")}))),i("rebill-footer",{style:{marginTop:g(this.breakpoint,f.DESKTOP)?"24px":"auto"}}))),!g(this.breakpoint,f.DESKTOP)&&i("div",{class:"right-section"},i("div",{class:"checkout-summary-section"},e({displayedComponents:["header","details","summary"]}))))}))}};M.style=j;export{M as rebill_renewal};
2
+ //# sourceMappingURL=p-ecd698bc.entry.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,b as t}from"./p-BTZ7D7jU.js";export{s as setNonce}from"./p-BTZ7D7jU.js";import{g as r}from"./p-DQuL1Twl.js";var a=()=>{const t=import.meta.url;const r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};a().then((async e=>{await r();return t(JSON.parse('[["p-648d0204",[[256,"rebill-checkout",{"productId":[1,"product-id"],"planId":[1,"plan-id"],"publicKey":[1,"public-key"],"instantProduct":[1,"instant-product"],"instantPlan":[1,"instant-plan"],"display":[1],"customerInformation":[1,"customer-information"],"oneClickCheckout":[4,"one-click-checkout"],"css":[1],"language":[1],"checkoutLandingSession":[1,"checkout-landing-session"],"externalPayment":[1,"external-payment"],"rejectedPaymentCard":[32],"rejectedPaymentAPM":[32],"countries":[32],"currentPaymentMethod":[32],"checkoutResponse":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"isAPMSubmitting":[32],"isAPMSuccess":[32],"storedCheckoutResults":[32],"alertErrorKeys":[32],"currentApmPaymentMethod":[32],"breakpoint":[32],"showRefreshModal":[32],"cardError":[32],"initialData":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"customerExists":[32],"showOtp":[32],"otpVerified":[32],"responseCheckoutCard":[32],"cardMode":[32],"submit":[64]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"input","handleInputChange"],[0,"onRebillAccountClick","handleRebillAccountClick"],[0,"returnForm","handleReturnForm"],[0,"signOut","handleSignOut"],[0,"codeVerified","handleCodeVerified"]],{"language":["handleLanguageChange"]}]]],["p-b3a695df",[[256,"rebill-renewal",{"renewalData":[1,"renewal-data"],"renewalToken":[1,"renewal-token"],"currentPaymentMethod":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"errorPaymentAPM":[32],"initialData":[32],"checkoutResponse":[32],"currentApmPaymentMethod":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"bankSelected","handleBankSelected"],[0,"cardSelected","handleCardSelected"]]]]],["p-8be61ab2",[[256,"rebill-change-card",{"changeCardData":[1,"change-card-data"],"changeCardToken":[1,"change-card-token"],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"initialData":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32],"completedAt":[32]}]]],["p-fa325b0b",[[256,"root-component",{"isLoading":[32],"currentLang":[32],"formData":[32]}]]],["p-1f253272",[[256,"rebill-card-carousel",{"interval":[2],"size":[1],"color":[1],"showAllCards":[4,"show-all-cards"],"currentIndex":[32]}]]],["p-b350f63e",[[260,"rebill-flex-container",{"direction":[1],"wrap":[1],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-d73d7c39",[[260,"rebill-grid-container",{"columns":[2],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-eccb88e1",[[260,"rebill-typography",{"variant":[1],"color":[1],"align":[1],"noWrap":[4,"no-wrap"],"gutterBottom":[4,"gutter-bottom"],"paragraph":[4]}],[256,"rebill-icon",{"name":[1],"size":[1],"color":[1],"svgContent":[32]}]]],["p-d7499bf3",[[256,"renewal-success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}]]],["p-ac0c7ebe",[[256,"change-card-success",{"customerName":[1,"customer-name"],"cardLastFour":[1,"card-last-four"],"cardBrand":[1,"card-brand"],"paymentDate":[1,"payment-date"],"customerEmail":[1,"customer-email"],"currentLocale":[32]}]]],["p-80c48c77",[[256,"discount-coupon",{"hideLabel":[4,"hide-label"],"displayMode":[1,"display-mode"],"readonlyCouponCode":[1,"readonly-coupon-code"],"readonlyDiscountAmount":[2,"readonly-discount-amount"],"readonlyCurrency":[1,"readonly-currency"],"couponCode":[32],"actionStatus":[32],"isLoading":[32],"isError":[32],"currentLocale":[32]}],[256,"rebill-divider"],[260,"collapsible-card",{"header":[1],"open":[4],"variant":[1],"isOpen":[32]}]]],["p-691b91be",[[256,"renewal-summary",{"displayedComponents":[16],"totalAmount":[2,"total-amount"],"subTotalAmount":[2,"sub-total-amount"],"subscriptionTitle":[1,"subscription-title"],"subscriptionAmount":[2,"subscription-amount"],"nextChargeDate":[1,"next-charge-date"],"frequency":[16],"currency":[1],"couponCode":[1,"coupon-code"],"discountAmount":[2,"discount-amount"],"discountPercentage":[2,"discount-percentage"],"titleKey":[1,"title-key"],"forceUpdate":[32]}]]],["p-dd44d494",[[256,"input-otp",{"error":[1],"otp":[1],"clearable":[4],"placeholder":[1],"otpValue":[32]}]]],["p-11ee0328",[[260,"rebill-container",{"maxWidth":[1,"max-width"],"padding":[1],"fluid":[4]}],[256,"rebill-input-checkbox",{"label":[1],"checked":[1540],"error":[1],"id":[1],"disabled":[4]},[[4,"change","handleFormChange"]]]]],["p-130877f9",[[256,"rebill-timeline-debit-day",{"debitDay":[2,"debit-day"],"totalAmount":[2,"total-amount"],"planAmount":[2,"plan-amount"],"currency":[1],"debitStrategy":[1,"debit-strategy"],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}],[256,"rebill-timeline-free-trial",{"trialPeriodEndsAt":[1,"trial-period-ends-at"],"trialPeriodEndsReminderAt":[1,"trial-period-ends-reminder-at"],"trialPeriodDays":[2,"trial-period-days"],"subtotal":[2],"currency":[1],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}]]],["p-be004b4f",[[256,"rebill-mode-sandbox",{"isPanelVisible":[32],"isPanelClosing":[32],"isCardsPanelVisible":[32],"isCardsPanelClosing":[32],"currentLanguage":[32]}],[256,"rebill-mode-sandbox-mobile",{"isPanelVisible":[32],"currentLanguage":[32]}]]],["p-5d0a2e14",[[256,"rebill-card",{"cardTitle":[1,"card-title"],"cardLabels":[16]}],[256,"rebill-input-email",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"clearable":[4],"variant":[1],"emailSuggestions":[32],"highlightedSuggestionIndex":[32],"emailCorrectionSuggestion":[32],"dropdownPosition":[32],"getInputElement":[64]},[[4,"change","handleFormChange"],[4,"click","handleDocumentClick"],[5,"touchend","handleDocumentTouchEnd"]]]]],["p-4355b35a",[[256,"rebill-vertical-divider",{"height":[1],"color":[1],"thickness":[1],"dashed":[4],"connectorActive":[4,"connector-active"],"withDot":[4,"with-dot"]}]]],["p-82c4171e",[[256,"rebill-alert",{"type":[1],"message":[1],"alertTitle":[1,"alert-title"],"icon":[1],"variant":[1],"size":[1],"colorIcon":[1,"color-icon"]}]]],["p-e54f571c",[[256,"rebill-input-text",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"rightIcon":[1,"right-icon"],"clearable":[4],"variant":[1],"uppercase":[4],"getInputElement":[64]},[[4,"change","handleFormChange"]]]]],["p-6eede717",[[256,"rebill-input-select",{"label":[1],"options":[16],"value":[1537],"error":[1],"id":[1],"disabled":[4],"placeholder":[1],"variant":[1],"arrowIcon":[1,"arrow-icon"],"dropPosition":[1,"drop-position"],"fontSize":[1,"font-size"],"backgroundColor":[1,"background-color"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"loading":[4],"isOpen":[32],"componentId":[32],"highlightedIndex":[32],"searchTerm":[32],"filteredOptions":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"],[0,"keydown","handleKeyDown"]]]]],["p-ba1b35fb",[[260,"rebill-button",{"type":[1],"disabled":[4],"id":[1],"loading":[4],"showSpinnerWithText":[4,"show-spinner-with-text"],"nonClickable":[4,"non-clickable"],"variant":[1],"theme":[1],"size":[1],"icon":[1],"iconColor":[1,"icon-color"]}]]],["p-796342db",[[256,"rebill-card-icon",{"cardBrand":[1,"card-brand"],"width":[2],"height":[2]}],[260,"rebill-checkout-single-column"],[256,"rebill-footer",{"breakpoint":[32]}],[256,"organization-logo",{"organization":[16]}]]],["p-86484768",[[256,"rebill-summary",{"totalAmount":[8,"total-amount"],"itemTitle":[1,"item-title"],"itemDescription":[1,"item-description"],"itemAmount":[8,"item-amount"],"planFrequency":[1,"plan-frequency"],"planFrequencyCount":[2,"plan-frequency-count"],"subtotal":[8],"discount":[8],"currency":[1],"displayedComponents":[16],"allowCoupon":[4,"allow-coupon"],"currentBreakpoint":[1,"current-breakpoint"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"discountApplied":[32]},[[0,"discountApplied","handleDiscountApplied"]]],[256,"success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}],[256,"user-information",{"userInformation":[16],"errors":[16],"customerExists":[4,"customer-exists"],"disabled":[4]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]]],[256,"otp-component",{"timeLeft":[32],"isTimerRunning":[32],"codeResent":[32],"isVerifying":[32],"otpValue":[32],"error":[32]}],[256,"rebill-modal-overlay",{"visible":[32],"languageUpdateTrigger":[32]}]]],["p-1c000e38",[[260,"rebill-autofill-detector",{"targetSelector":[1,"target-selector"],"disabled":[4],"browserAutocompleteDetected":[32],"disabledDetector":[32]}]]],["p-e6df1fe2",[[260,"rebill-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"formData":[32],"errors":[32],"submitForm":[64],"resetValidation":[64],"clearError":[64]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]],{"initialData":["handleInitialDataChange"],"validationSchema":["handleValidationSchemaChange"]}]]],["p-16e7646e",[[256,"card-fields-wrapper",{"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"showDocument":[4,"show-document"],"customCSS":[1,"custom-c-s-s"]}],[256,"rebill-address-form",{"addressType":[1,"address-type"],"countryOptions":[16],"stateOptions":[16],"errors":[16],"disabled":[4],"showAdditionalInformation":[32]}],[256,"rebill-address-search",{"addressType":[1,"address-type"],"placeholder":[1],"error":[1],"disabled":[4],"isInitialized":[32],"currentLocale":[32]}],[256,"single-payment-method",{"paymentMethod":[1,"payment-method"],"currencyCountry":[1,"currency-country"],"paymentMethodDetails":[16],"icons":[16]}],[256,"rebill-input-phone",{"placeholder":[1],"value":[1537],"error":[1],"phoneNumberId":[1,"phone-number-id"],"countryCodeId":[1,"country-code-id"],"validationErrorId":[1,"validation-error-id"],"disabled":[4],"initialCountry":[1,"initial-country"],"required":[4],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"selectedCountry":[32],"isDropdownOpen":[32],"validationError":[32],"searchTerm":[32],"filteredCountries":[32],"componentId":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[260,"selectable-card",{"selected":[4],"label":[1],"cardKey":[1,"card-key"],"disabled":[4]}],[256,"rebill-installments",{"error":[1],"currentValue":[32],"isDisabled":[32],"value":[32],"placeholder":[32]}],[256,"card-identification",{"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"disabled":[4],"documentTypes":[32],"country":[32],"currentLanguage":[32]}],[256,"card-iframe",{"customCSS":[1,"custom-c-s-s"],"iframeLoaded":[32],"currentLang":[32],"initialLang":[32],"iframeHeight":[32]}],[256,"rebill-input-combo",{"label":[1],"options":[16],"selectValue":[1537,"select-value"],"inputValue":[1537,"input-value"],"inputPlaceholder":[1,"input-placeholder"],"selectPlaceholder":[1,"select-placeholder"],"error":[1],"selectId":[1,"select-id"],"inputId":[1,"input-id"],"disabled":[4],"selectWidth":[1,"select-width"],"isOpen":[32],"highlightedIndex":[32],"componentId":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[256,"card-skeleton"]]],["p-46fcc15f",[[256,"apm-checkout",{"paymentMethod":[1,"payment-method"],"referenceId":[1,"reference-id"],"qrCodeData":[1,"qr-code-data"],"code":[1],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"country":[1],"redirectUrl":[1,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"checkoutRequestId":[1,"checkout-request-id"],"bearerToken":[1,"bearer-token"],"bankTransferData":[8,"bank-transfer-data"],"barcode":[1],"showRedirectMessage":[32],"isPolling":[32],"minutesLeft":[32],"qrStartTime":[32],"downloadData":[32]}],[256,"rebill-bank-selector",{"banks":[16],"defaultSelectedBankId":[1,"default-selected-bank-id"],"error":[1],"disabled":[4],"selectedBankId":[32],"languageUpdateTrigger":[32]}],[256,"payment-method-selector",{"enabledPaymentMethods":[16],"defaultSelected":[1,"default-selected"],"showErrorComponent":[4,"show-error-component"],"cardError":[16],"country":[1],"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"showDocument":[4,"show-document"],"documentNumberError":[1,"document-number-error"],"customCSS":[1,"custom-c-s-s"],"errorComponent":[16],"disabled":[4],"icon":[32],"selectedPaymentMethod":[32],"saveCard":[32]},[[0,"selectableCardClick","handleSelectableCardClick"]]],[256,"rebill-address",{"billingView":[1537,"billing-view"],"disabled":[4],"countryOptions":[16],"errors":[16],"currentBillingStateOptions":[32],"isLoadingAddress":[32]}],[256,"rebill-processing-payment",{"titleKey":[1,"title-key"],"subtitleKey":[1,"subtitle-key"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32]}],[256,"bank-transfer",{"bankTransferData":[8,"bank-transfer-data"]}],[256,"qr-code",{"qrCodeData":[1,"qr-code-data"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"paymentMethod":[1,"payment-method"],"code":[1],"qrCodeSvg":[32],"isImage":[32],"timeLeft":[32],"formattedTime":[32],"hasCopied":[32]}],[256,"user-information-static",{"userInfo":[16],"variant":[1]}],[256,"apm-download",{"data":[16]}],[256,"payment-button",{"isDisabled":[4,"is-disabled"],"isLoading":[4,"is-loading"],"paymentMethod":[1,"payment-method"],"isRenewal":[4,"is-renewal"],"isChangeCard":[4,"is-change-card"],"trialPeriodDays":[2,"trial-period-days"],"redirectUrl":[4,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"country":[1],"currentLanguage":[32],"countdownSeconds":[32],"paymentMethodDisplayName":[32]},null,{"redirectUrl":["onRedirectPropsChange"],"timeToRedirect":["onRedirectPropsChange"]}],[256,"user-information-phone",{"error":[1],"countryCode":[1,"country-code"],"disabled":[4],"languageUpdateTrigger":[32]}],[256,"boleto-payment",{"barcode":[1],"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32],"hasCopied":[32]}],[256,"rebill-checkout-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"resetValidation":[64]},[[0,"change","handleFormChange"]]],[256,"reference-code",{"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32]}]]]]'),e)}));
1
+ import{p as e,b as t}from"./p-BTZ7D7jU.js";export{s as setNonce}from"./p-BTZ7D7jU.js";import{g as r}from"./p-DQuL1Twl.js";var a=()=>{const t=import.meta.url;const r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};a().then((async e=>{await r();return t(JSON.parse('[["p-4b4e2e73",[[256,"rebill-checkout",{"productId":[1,"product-id"],"planId":[1,"plan-id"],"publicKey":[1,"public-key"],"instantProduct":[1,"instant-product"],"instantPlan":[1,"instant-plan"],"display":[1],"customerInformation":[1,"customer-information"],"oneClickCheckout":[4,"one-click-checkout"],"css":[1],"language":[1],"checkoutLandingSession":[1,"checkout-landing-session"],"externalPayment":[1,"external-payment"],"rejectedPaymentCard":[32],"rejectedPaymentAPM":[32],"countries":[32],"currentPaymentMethod":[32],"checkoutResponse":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"isAPMSubmitting":[32],"isAPMSuccess":[32],"storedCheckoutResults":[32],"alertErrorKeys":[32],"currentApmPaymentMethod":[32],"breakpoint":[32],"showRefreshModal":[32],"cardError":[32],"initialData":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"customerExists":[32],"showOtp":[32],"otpVerified":[32],"responseCheckoutCard":[32],"cardMode":[32],"submit":[64]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"input","handleInputChange"],[0,"onRebillAccountClick","handleRebillAccountClick"],[0,"returnForm","handleReturnForm"],[0,"signOut","handleSignOut"],[0,"codeVerified","handleCodeVerified"]],{"language":["handleLanguageChange"]}]]],["p-ecd698bc",[[256,"rebill-renewal",{"renewalData":[1,"renewal-data"],"renewalToken":[1,"renewal-token"],"currentPaymentMethod":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"errorPaymentAPM":[32],"initialData":[32],"checkoutResponse":[32],"currentApmPaymentMethod":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"bankSelected","handleBankSelected"],[0,"cardSelected","handleCardSelected"]]]]],["p-8be61ab2",[[256,"rebill-change-card",{"changeCardData":[1,"change-card-data"],"changeCardToken":[1,"change-card-token"],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"initialData":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32],"completedAt":[32]}]]],["p-fa325b0b",[[256,"root-component",{"isLoading":[32],"currentLang":[32],"formData":[32]}]]],["p-1f253272",[[256,"rebill-card-carousel",{"interval":[2],"size":[1],"color":[1],"showAllCards":[4,"show-all-cards"],"currentIndex":[32]}]]],["p-b350f63e",[[260,"rebill-flex-container",{"direction":[1],"wrap":[1],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-d73d7c39",[[260,"rebill-grid-container",{"columns":[2],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-eccb88e1",[[260,"rebill-typography",{"variant":[1],"color":[1],"align":[1],"noWrap":[4,"no-wrap"],"gutterBottom":[4,"gutter-bottom"],"paragraph":[4]}],[256,"rebill-icon",{"name":[1],"size":[1],"color":[1],"svgContent":[32]}]]],["p-d7499bf3",[[256,"renewal-success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}]]],["p-ac0c7ebe",[[256,"change-card-success",{"customerName":[1,"customer-name"],"cardLastFour":[1,"card-last-four"],"cardBrand":[1,"card-brand"],"paymentDate":[1,"payment-date"],"customerEmail":[1,"customer-email"],"currentLocale":[32]}]]],["p-80c48c77",[[256,"discount-coupon",{"hideLabel":[4,"hide-label"],"displayMode":[1,"display-mode"],"readonlyCouponCode":[1,"readonly-coupon-code"],"readonlyDiscountAmount":[2,"readonly-discount-amount"],"readonlyCurrency":[1,"readonly-currency"],"couponCode":[32],"actionStatus":[32],"isLoading":[32],"isError":[32],"currentLocale":[32]}],[256,"rebill-divider"],[260,"collapsible-card",{"header":[1],"open":[4],"variant":[1],"isOpen":[32]}]]],["p-691b91be",[[256,"renewal-summary",{"displayedComponents":[16],"totalAmount":[2,"total-amount"],"subTotalAmount":[2,"sub-total-amount"],"subscriptionTitle":[1,"subscription-title"],"subscriptionAmount":[2,"subscription-amount"],"nextChargeDate":[1,"next-charge-date"],"frequency":[16],"currency":[1],"couponCode":[1,"coupon-code"],"discountAmount":[2,"discount-amount"],"discountPercentage":[2,"discount-percentage"],"titleKey":[1,"title-key"],"forceUpdate":[32]}]]],["p-dd44d494",[[256,"input-otp",{"error":[1],"otp":[1],"clearable":[4],"placeholder":[1],"otpValue":[32]}]]],["p-11ee0328",[[260,"rebill-container",{"maxWidth":[1,"max-width"],"padding":[1],"fluid":[4]}],[256,"rebill-input-checkbox",{"label":[1],"checked":[1540],"error":[1],"id":[1],"disabled":[4]},[[4,"change","handleFormChange"]]]]],["p-130877f9",[[256,"rebill-timeline-debit-day",{"debitDay":[2,"debit-day"],"totalAmount":[2,"total-amount"],"planAmount":[2,"plan-amount"],"currency":[1],"debitStrategy":[1,"debit-strategy"],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}],[256,"rebill-timeline-free-trial",{"trialPeriodEndsAt":[1,"trial-period-ends-at"],"trialPeriodEndsReminderAt":[1,"trial-period-ends-reminder-at"],"trialPeriodDays":[2,"trial-period-days"],"subtotal":[2],"currency":[1],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}]]],["p-be004b4f",[[256,"rebill-mode-sandbox",{"isPanelVisible":[32],"isPanelClosing":[32],"isCardsPanelVisible":[32],"isCardsPanelClosing":[32],"currentLanguage":[32]}],[256,"rebill-mode-sandbox-mobile",{"isPanelVisible":[32],"currentLanguage":[32]}]]],["p-5d0a2e14",[[256,"rebill-card",{"cardTitle":[1,"card-title"],"cardLabels":[16]}],[256,"rebill-input-email",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"clearable":[4],"variant":[1],"emailSuggestions":[32],"highlightedSuggestionIndex":[32],"emailCorrectionSuggestion":[32],"dropdownPosition":[32],"getInputElement":[64]},[[4,"change","handleFormChange"],[4,"click","handleDocumentClick"],[5,"touchend","handleDocumentTouchEnd"]]]]],["p-4355b35a",[[256,"rebill-vertical-divider",{"height":[1],"color":[1],"thickness":[1],"dashed":[4],"connectorActive":[4,"connector-active"],"withDot":[4,"with-dot"]}]]],["p-82c4171e",[[256,"rebill-alert",{"type":[1],"message":[1],"alertTitle":[1,"alert-title"],"icon":[1],"variant":[1],"size":[1],"colorIcon":[1,"color-icon"]}]]],["p-e54f571c",[[256,"rebill-input-text",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"rightIcon":[1,"right-icon"],"clearable":[4],"variant":[1],"uppercase":[4],"getInputElement":[64]},[[4,"change","handleFormChange"]]]]],["p-6eede717",[[256,"rebill-input-select",{"label":[1],"options":[16],"value":[1537],"error":[1],"id":[1],"disabled":[4],"placeholder":[1],"variant":[1],"arrowIcon":[1,"arrow-icon"],"dropPosition":[1,"drop-position"],"fontSize":[1,"font-size"],"backgroundColor":[1,"background-color"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"loading":[4],"isOpen":[32],"componentId":[32],"highlightedIndex":[32],"searchTerm":[32],"filteredOptions":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"],[0,"keydown","handleKeyDown"]]]]],["p-ba1b35fb",[[260,"rebill-button",{"type":[1],"disabled":[4],"id":[1],"loading":[4],"showSpinnerWithText":[4,"show-spinner-with-text"],"nonClickable":[4,"non-clickable"],"variant":[1],"theme":[1],"size":[1],"icon":[1],"iconColor":[1,"icon-color"]}]]],["p-796342db",[[256,"rebill-card-icon",{"cardBrand":[1,"card-brand"],"width":[2],"height":[2]}],[260,"rebill-checkout-single-column"],[256,"rebill-footer",{"breakpoint":[32]}],[256,"organization-logo",{"organization":[16]}]]],["p-86484768",[[256,"rebill-summary",{"totalAmount":[8,"total-amount"],"itemTitle":[1,"item-title"],"itemDescription":[1,"item-description"],"itemAmount":[8,"item-amount"],"planFrequency":[1,"plan-frequency"],"planFrequencyCount":[2,"plan-frequency-count"],"subtotal":[8],"discount":[8],"currency":[1],"displayedComponents":[16],"allowCoupon":[4,"allow-coupon"],"currentBreakpoint":[1,"current-breakpoint"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"discountApplied":[32]},[[0,"discountApplied","handleDiscountApplied"]]],[256,"success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}],[256,"user-information",{"userInformation":[16],"errors":[16],"customerExists":[4,"customer-exists"],"disabled":[4]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]]],[256,"otp-component",{"timeLeft":[32],"isTimerRunning":[32],"codeResent":[32],"isVerifying":[32],"otpValue":[32],"error":[32]}],[256,"rebill-modal-overlay",{"visible":[32],"languageUpdateTrigger":[32]}]]],["p-1c000e38",[[260,"rebill-autofill-detector",{"targetSelector":[1,"target-selector"],"disabled":[4],"browserAutocompleteDetected":[32],"disabledDetector":[32]}]]],["p-e6df1fe2",[[260,"rebill-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"formData":[32],"errors":[32],"submitForm":[64],"resetValidation":[64],"clearError":[64]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]],{"initialData":["handleInitialDataChange"],"validationSchema":["handleValidationSchemaChange"]}]]],["p-16e7646e",[[256,"card-fields-wrapper",{"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"showDocument":[4,"show-document"],"customCSS":[1,"custom-c-s-s"]}],[256,"rebill-address-form",{"addressType":[1,"address-type"],"countryOptions":[16],"stateOptions":[16],"errors":[16],"disabled":[4],"showAdditionalInformation":[32]}],[256,"rebill-address-search",{"addressType":[1,"address-type"],"placeholder":[1],"error":[1],"disabled":[4],"isInitialized":[32],"currentLocale":[32]}],[256,"single-payment-method",{"paymentMethod":[1,"payment-method"],"currencyCountry":[1,"currency-country"],"paymentMethodDetails":[16],"icons":[16]}],[256,"rebill-input-phone",{"placeholder":[1],"value":[1537],"error":[1],"phoneNumberId":[1,"phone-number-id"],"countryCodeId":[1,"country-code-id"],"validationErrorId":[1,"validation-error-id"],"disabled":[4],"initialCountry":[1,"initial-country"],"required":[4],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"selectedCountry":[32],"isDropdownOpen":[32],"validationError":[32],"searchTerm":[32],"filteredCountries":[32],"componentId":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[260,"selectable-card",{"selected":[4],"label":[1],"cardKey":[1,"card-key"],"disabled":[4]}],[256,"rebill-installments",{"error":[1],"currentValue":[32],"isDisabled":[32],"value":[32],"placeholder":[32]}],[256,"card-identification",{"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"disabled":[4],"documentTypes":[32],"country":[32],"currentLanguage":[32]}],[256,"card-iframe",{"customCSS":[1,"custom-c-s-s"],"iframeLoaded":[32],"currentLang":[32],"initialLang":[32],"iframeHeight":[32]}],[256,"rebill-input-combo",{"label":[1],"options":[16],"selectValue":[1537,"select-value"],"inputValue":[1537,"input-value"],"inputPlaceholder":[1,"input-placeholder"],"selectPlaceholder":[1,"select-placeholder"],"error":[1],"selectId":[1,"select-id"],"inputId":[1,"input-id"],"disabled":[4],"selectWidth":[1,"select-width"],"isOpen":[32],"highlightedIndex":[32],"componentId":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[256,"card-skeleton"]]],["p-46fcc15f",[[256,"apm-checkout",{"paymentMethod":[1,"payment-method"],"referenceId":[1,"reference-id"],"qrCodeData":[1,"qr-code-data"],"code":[1],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"country":[1],"redirectUrl":[1,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"checkoutRequestId":[1,"checkout-request-id"],"bearerToken":[1,"bearer-token"],"bankTransferData":[8,"bank-transfer-data"],"barcode":[1],"showRedirectMessage":[32],"isPolling":[32],"minutesLeft":[32],"qrStartTime":[32],"downloadData":[32]}],[256,"rebill-bank-selector",{"banks":[16],"defaultSelectedBankId":[1,"default-selected-bank-id"],"error":[1],"disabled":[4],"selectedBankId":[32],"languageUpdateTrigger":[32]}],[256,"payment-method-selector",{"enabledPaymentMethods":[16],"defaultSelected":[1,"default-selected"],"showErrorComponent":[4,"show-error-component"],"cardError":[16],"country":[1],"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"showDocument":[4,"show-document"],"documentNumberError":[1,"document-number-error"],"customCSS":[1,"custom-c-s-s"],"errorComponent":[16],"disabled":[4],"icon":[32],"selectedPaymentMethod":[32],"saveCard":[32]},[[0,"selectableCardClick","handleSelectableCardClick"]]],[256,"rebill-address",{"billingView":[1537,"billing-view"],"disabled":[4],"countryOptions":[16],"errors":[16],"currentBillingStateOptions":[32],"isLoadingAddress":[32]}],[256,"rebill-processing-payment",{"titleKey":[1,"title-key"],"subtitleKey":[1,"subtitle-key"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32]}],[256,"bank-transfer",{"bankTransferData":[8,"bank-transfer-data"]}],[256,"qr-code",{"qrCodeData":[1,"qr-code-data"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"paymentMethod":[1,"payment-method"],"code":[1],"qrCodeSvg":[32],"isImage":[32],"timeLeft":[32],"formattedTime":[32],"hasCopied":[32]}],[256,"user-information-static",{"userInfo":[16],"variant":[1]}],[256,"apm-download",{"data":[16]}],[256,"payment-button",{"isDisabled":[4,"is-disabled"],"isLoading":[4,"is-loading"],"paymentMethod":[1,"payment-method"],"isRenewal":[4,"is-renewal"],"isChangeCard":[4,"is-change-card"],"trialPeriodDays":[2,"trial-period-days"],"redirectUrl":[4,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"country":[1],"currentLanguage":[32],"countdownSeconds":[32],"paymentMethodDisplayName":[32]},null,{"redirectUrl":["onRedirectPropsChange"],"timeToRedirect":["onRedirectPropsChange"]}],[256,"user-information-phone",{"error":[1],"countryCode":[1,"country-code"],"disabled":[4],"languageUpdateTrigger":[32]}],[256,"boleto-payment",{"barcode":[1],"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32],"hasCopied":[32]}],[256,"rebill-checkout-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"resetValidation":[64]},[[0,"change","handleFormChange"]]],[256,"reference-code",{"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32]}]]]]'),e)}));
2
2
  //# sourceMappingURL=rebill-web-components-sdk.esm.js.map
@@ -37,6 +37,7 @@ export declare enum PaymentMessageE {
37
37
  APM_ERROR_BANK_TRANSFER = "apm_error_bank_transfer",
38
38
  PROVIDER_ERROR = "provider_error",
39
39
  BANK_REJECTED = "bank_rejected",
40
+ DO_NOT_HONOR = "do_not_honor",
40
41
  CALL_BANK_FOR_AUTHORIZE = "call_bank_for_authorize",
41
42
  REQUIRED_3DS = "required_3ds",
42
43
  BLACKLISTED = "blacklisted",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rebill-web-components-sdk",
3
- "version": "1.10.11",
3
+ "version": "1.10.12",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment-error-mapper-DMma7xTr.js","sources":["src/api/entities/checkout/types.ts","src/models/enums/payment-status.enum.ts","src/utils/generate-idempotency-key.ts","src/utils/payment-error-mapper.ts"],"sourcesContent":["import { PaymentMethodNameE } from '../../../models/enums/payment-method-name.enum';\nimport { STATUS_REQ_CHECKOUT_APM } from '../../../models/enums/status-req-checkout-apm.enum';\n\n// Checkout request status\nexport enum CheckoutStatusE {\n PENDING = 'PENDING',\n APPROVED = 'APPROVED',\n REJECTED = 'REJECTED',\n ERROR = 'ERROR',\n}\n\n// APM Transaction interface (based on documentation)\nexport interface APMTransaction {\n name?: { text: string; language: string }[];\n description?: { text: string; language: string }[];\n isPriceFixed?: boolean;\n tiers?: any[];\n plan?: any;\n quantity: number;\n amount?: number;\n currency?: string;\n productId?: string;\n planId?: string;\n couponCode?: string;\n}\n\n// APM Customer interface (based on documentation)\nexport interface APMCustomer {\n firstName: string;\n lastName: string;\n email: string;\n phone: {\n countryCode: string;\n number: string;\n };\n shippingAddress?: APMAddress;\n}\n\n// APM Address interface (based on documentation)\nexport interface APMAddress {\n country: string;\n state: string;\n city: string;\n zipCode: string;\n lineOne: string;\n lineTwo?: string;\n}\n\n// APM Redirect URLs interface (based on documentation)\nexport interface APMRedirect {\n approved: string;\n rejected: string;\n}\n\n// Metadata interface\nexport interface Metadata {\n [key: string]: unknown;\n}\n\n// Create APM checkout request interface (based on documentation)\nexport interface CreateAPMCheckoutRequest {\n transaction: APMTransaction;\n method: PaymentMethodNameE;\n customer?: APMCustomer; // Optional for authenticated users\n billingDetails?: {\n address: {\n lineOne: string;\n lineTwo?: string;\n city: string;\n state: string;\n zipCode: string;\n country: string;\n };\n identification: {\n type: string;\n value: string;\n };\n };\n redirect: APMRedirect;\n paymentMetadata?: Metadata;\n subscriptionMetadata?: Metadata;\n customAttributes?: {\n bank?: string;\n };\n targetCurrency?: string;\n}\n\n// Legacy interfaces for backward compatibility\nexport interface Transaction {\n amount: number;\n currency: string;\n description: string;\n}\n\nexport interface Customer {\n email: string;\n name: string;\n phone: string;\n documentType?: string;\n documentNumber?: string;\n shippingAddress: Address;\n}\n\nexport interface Address {\n lineOne: string;\n lineTwo?: string;\n city: string;\n state: string;\n zipCode: string;\n country: string;\n}\n\nexport interface Redirect {\n successUrl: string;\n failureUrl: string;\n cancelUrl: string;\n}\n\nexport interface CreateCardCheckoutRequest {\n transaction: {\n quantity: number;\n currency?: string;\n amount?: number;\n couponCode?: string;\n };\n installments?: number;\n cardTokenId?: string | null; // Optional, if card is saved\n cardId?: string | null; // Optional, if card is saved\n customer?: {\n firstName: string;\n lastName: string;\n email: string;\n phone: {\n countryCode: string;\n number: string;\n };\n };\n billingDetails?: {\n address: {\n lineOne: string;\n lineTwo?: string;\n city: string;\n state: string;\n zipCode: string;\n country: string;\n };\n identification: {\n type: string;\n value: string;\n };\n };\n paymentMetadata?: {\n bankCode?: string;\n };\n customAttributes?: {\n deviceId?: string;\n };\n saveCard?: boolean;\n}\nexport interface CreateCardCheckoutResponse {\n traceId: string;\n date: string;\n result?: {\n paymentId: string;\n status: CheckoutStatusE;\n subscriptionId: string;\n cardId: string;\n cardLastFour: string;\n customerId: string;\n statusDetail?: string;\n type?: string;\n };\n error: {\n traceId: string;\n date: string;\n error: {\n message: string;\n type: string;\n };\n statusCode: number;\n };\n}\nexport interface Card {\n cardHolderName: string;\n cardExpirationMonth: string;\n cardExpirationYear: string;\n securityCode: string;\n number: string;\n identification: {\n type: string;\n value: string;\n };\n saveCard: boolean;\n}\n// Instruction interface for payment reference\nexport interface PaymentInstruction {\n text: string;\n language: string;\n}\n\n// Bank transfer data interface\nexport interface BankTransferData {\n bbvAccountNumber?: string;\n account: string; // CLABE\n bankName: string;\n reference: string;\n}\n\n// Checkout data interface (provider-specific)\nexport interface CheckoutData {\n // For QR codes\n qrCode?: string;\n\n // For barcodes\n barcode?: string;\n\n // For bank transfer payments (new - multiple data sets)\n bankTransferData?: BankTransferData[];\n\n // For reference payments\n referenceId?: string;\n instructions?: PaymentInstruction[];\n\n // For redirect payments\n url?: string;\n message?: string;\n // For vouchers\n voucherUrl?: string;\n\n // Additional provider-specific data\n [key: string]: any;\n}\n\n// Checkout result interface\nexport interface CheckoutResult {\n checkoutRequestId: string;\n status: CheckoutStatusE;\n data: CheckoutData;\n}\n\n// Error interface\nexport interface CheckoutError {\n message: string;\n type: string;\n}\n\n// Bank interface for PSE payments\nexport interface Bank {\n code: string;\n name: string;\n}\n\n// Required fields request interface\nexport interface RequiredFieldsRequest {\n currency: string;\n method: string;\n bin?: number;\n}\n\n// Required fields response interface\nexport type RequiredFieldsResponse = {\n name: string;\n values?: {\n code: string;\n name: string;\n }[];\n}[];\n\n// Create APM checkout response interface\nexport interface CreateAPMCheckoutResponse {\n traceId: string;\n date: string;\n result?: CheckoutResult;\n error?: CheckoutError;\n}\n\nexport interface PaymentMethod {\n name: string;\n type: string;\n}\n\nexport interface TrackingData {\n locale: string;\n utmTerm: string;\n referrer: string;\n ipAddress: string;\n}\nexport interface Source {\n source: string;\n version: string;\n}\n\nexport interface APMSession {\n country: string;\n createdAt: string;\n deviceId: string;\n email: string | null;\n expiresAt: string;\n id: string;\n isCreatedDuringCheckout: boolean;\n metadata: Record<string, unknown>;\n organizationId: string;\n paymentLinkId: string;\n paymentMethods: PaymentMethod[];\n planId: string;\n priceId: string;\n productId: string | null;\n providerKey: string;\n source: Source;\n status: string;\n trackingData: TrackingData;\n updatedAt: string;\n}\n\nexport interface CheckoutRequestPayment {\n id: string;\n createdAt: string;\n updatedAt: string;\n organizationId: string;\n amount: number;\n currency: string;\n customer: {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n phoneNumbers: {\n number: string;\n countryCode: string;\n }[];\n };\n status: string;\n metadata: Record<string, unknown>;\n paymentMethodType: string;\n paymentMethodMetadata: Record<string, unknown>;\n card: {\n id: string;\n name: string;\n expiration: {\n month: string;\n year: string;\n };\n lastFour: string;\n brand: string;\n };\n quantity: number;\n paymentProviderReference: string | null;\n paymentProviderDescription: string | null;\n installments: number | null;\n priceFixedIn: string | null;\n conversionRate: number | null;\n couponId: string | null;\n description: [\n {\n text: string;\n language: string;\n },\n ];\n processingMode: string;\n processingFee: number | null;\n country: string;\n timezone: string;\n}\n\nexport interface CheckoutRequestPaymentAPM {\n checkoutRequestId: string;\n status: STATUS_REQ_CHECKOUT_APM;\n type: string;\n data: {\n message: string;\n url: string;\n };\n session: APMSession;\n payment: CheckoutRequestPayment | null;\n}\n","export enum PaymentMessageE {\n PENDING = 'pending',\n APPROVED = 'approved',\n REJECTED = 'rejected',\n DECLINED = 'declined',\n ERROR = 'error',\n REFUNDED = 'refunded',\n CANCELLED = 'cancelled',\n PARTIALLY_REFUNDED = 'partially_refunded',\n EXPIRED = 'expired',\n GENERIC_REJECT = 'generic_reject',\n INVALID_CARD = 'invalid_card',\n INVALID_CARD_NUMBER = 'invalid_card_number',\n INVALID_CARD_HOLDER_NAME = 'invalid_card_holder_name',\n INVALID_CARD_EXPIRATION_DATE = 'invalid_card_expiration_date',\n INVALID_CARD_CVC = 'invalid_card_cvc',\n INSUFFICIENT_FUNDS = 'insufficient_funds',\n\n BLACKLISTED_CARD = 'blacklisted_card',\n INVALID_CUSTOMER_EMAIL = 'invalid_customer_email',\n INVALID_CUSTOMER_PHONE = 'invalid_customer_phone',\n INVALID_CUSTOMER_BILLING_ADDRESS = 'invalid_customer_billing_address',\n REQUIRED_CUSTOMER_EMAIL = 'required_customer_email',\n REQUIRED_CUSTOMER_PHONE = 'required_customer_phone',\n REQUIRED_CUSTOMER_BILLING_ADDRESS = 'required_customer_billing_address',\n INVALID_CHECKOUT_REQUEST = 'invalid_checkout_request',\n UNAVAILABLE_PAYMENT_METHOD = 'unavailable_payment_method',\n INVALID_AMOUNT = 'invalid_amount',\n INVALID_CURRENCY = 'invalid_currency',\n INVALID_COUNTRY = 'invalid_country',\n MAX_ATTEMPTS = 'max_attempts',\n PAYMENT_EXPIRED = 'payment_expired',\n FRAUD_HIGH_RISK = 'fraud_high_risk',\n INTERNAL_ERROR = 'internal_error',\n INVALID_SESSION = 'invalid_session',\n APM_MESSAGE_ERROR = 'apm_message_error',\n APM_ERROR_GENERIC = 'apm_error_generic',\n APM_ERROR_BANK_TRANSFER = 'apm_error_bank_transfer',\n PROVIDER_ERROR = 'provider_error',\n BANK_REJECTED = 'bank_rejected',\n CALL_BANK_FOR_AUTHORIZE = 'call_bank_for_authorize',\n REQUIRED_3DS = 'required_3ds',\n BLACKLISTED = 'blacklisted',\n HARD_DECLINE = 'hard-decline',\n SOFT_DECLINE = 'soft-decline',\n HUMAN_DECLINE = 'human-decline',\n INTERNAL = 'internal',\n INVALID_CARD_TOKENIZE_COUNTRY = 'invalid_card_tokenize_country',\n INVALID_CUSTOMER_ADDRESS = 'invalid_customer_address',\n INVALID_CUSTOMER_CITY = 'invalid_customer_city',\n INVALID_CUSTOMER_STATE = 'invalid_customer_state',\n INVALID_CUSTOMER_ZIP = 'invalid_customer_zip',\n INVALID_CUSTOMER_COUNTRY = 'invalid_customer_country',\n INVALID_CUSTOMER_DOCUMENT = 'invalid_customer_document',\n INVALID_CUSTOMER_DOCUMENT_NUMBER = 'invalid_customer_document_number',\n INVALID_CUSTOMER_DOCUMENT_TYPE = 'invalid_customer_document_type',\n INVALID_CHECKOUT_PAYMENT_METHOD = 'invalid_checkout_payment_method',\n REQUIRED_CUSTOMER_ADDRESS = 'required_customer_address',\n REQUIRED_CUSTOMER_CITY = 'required_customer_city',\n REQUIRED_CUSTOMER_STATE = 'required_customer_state',\n REQUIRED_CUSTOMER_ZIP = 'required_customer_zip',\n REQUIRED_CUSTOMER_COUNTRY = 'required_customer_country',\n REQUIRED_CUSTOMER_DOCUMENT = 'required_customer_document',\n REQUIRED_CUSTOMER_DOCUMENT_NUMBER = 'required_customer_document_number',\n REQUIRED_CUSTOMER_DOCUMENT_TYPE = 'required_customer_document_type',\n EXPIRED_CARD = 'expired_card',\n SANDBOX_ERROR = 'sandbox_error',\n}\n","export const generateIdempotencyKey = () => {\n return `idmp_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;\n};\n","import { I18nService } from '../i18n/i18n.service';\nimport { PAYMENT_METHOD_ENUM } from '../models/enums/payment-methods.enum';\nimport { PaymentMessageE } from '../models/enums/payment-status.enum';\n\nexport interface AlertErrorKeys {\n alertTitle?: PaymentMessageE;\n message: PaymentMessageE;\n}\n\n//currency country\n\nexport class PaymentErrorMapper {\n static getErrorMessage(\n errorMessageKey: AlertErrorKeys['message'] | null,\n paymentMethod: PAYMENT_METHOD_ENUM,\n currencyCountry?: string,\n ): string {\n if (\n !errorMessageKey ||\n !Object.values(PaymentMessageE).includes(errorMessageKey as PaymentMessageE) ||\n errorMessageKey === PaymentMessageE.GENERIC_REJECT\n ) {\n if (paymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n return I18nService.translate('paymentErrors.genericErrorCard');\n }\n if (paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER) {\n if (currencyCountry === 'BR') {\n return I18nService.translate('paymentErrors.genericErrorMessagePIX');\n }\n if (currencyCountry === 'AR') {\n return I18nService.translate('paymentErrors.genericErrorMessageQR');\n }\n if (currencyCountry === 'CO') {\n return I18nService.translate('paymentErrors.genericErrorMessagePSE');\n }\n return I18nService.translate('paymentErrors.genericErrorMessageBankTransfer');\n }\n return I18nService.translate('paymentErrors.genericErrorMessage');\n }\n return PaymentErrorMapper.getMessage(errorMessageKey);\n }\n\n static getErrorTitle(\n paymentMethod: PAYMENT_METHOD_ENUM,\n currencyCountry: string,\n errorTitleKey?: AlertErrorKeys['alertTitle'],\n ): string {\n if (errorTitleKey && !(errorTitleKey in PaymentMessageE)) {\n return PaymentErrorMapper.getMessage(errorTitleKey);\n }\n if (paymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n return I18nService.translate('paymentErrors.genericErrorTitleCard');\n }\n if (paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER) {\n if (currencyCountry === 'BR') {\n return I18nService.translate('paymentErrors.genericErrorTitlePIX');\n }\n if (currencyCountry === 'AR') {\n return I18nService.translate('paymentErrors.genericErrorTitleQR');\n }\n if (currencyCountry === 'CO') {\n return I18nService.translate('paymentErrors.genericErrorTitlePSE');\n }\n }\n return I18nService.translate('paymentErrors.genericErrorTitleBankTransfer');\n }\n\n private static getMessage(errorMessageKey: PaymentMessageE): string {\n const messageMap: Record<PaymentMessageE, string> = {\n [PaymentMessageE.PENDING]: I18nService.translate('paymentErrors.pending'),\n [PaymentMessageE.APPROVED]: I18nService.translate('paymentErrors.approved'),\n [PaymentMessageE.REJECTED]: I18nService.translate('paymentErrors.rejected'),\n [PaymentMessageE.DECLINED]: I18nService.translate('paymentErrors.declined'),\n [PaymentMessageE.ERROR]: I18nService.translate('paymentErrors.error'),\n [PaymentMessageE.REFUNDED]: I18nService.translate('paymentErrors.refunded'),\n [PaymentMessageE.CANCELLED]: I18nService.translate('paymentErrors.cancelled'),\n [PaymentMessageE.PARTIALLY_REFUNDED]: I18nService.translate(\n 'paymentErrors.partiallyRefunded',\n ),\n [PaymentMessageE.EXPIRED]: I18nService.translate('paymentErrors.expired'),\n [PaymentMessageE.GENERIC_REJECT]: I18nService.translate('paymentErrors.genericReject'),\n [PaymentMessageE.INVALID_CARD]: I18nService.translate('paymentErrors.invalidCard'),\n [PaymentMessageE.INVALID_CARD_NUMBER]: I18nService.translate(\n 'paymentErrors.invalidCardNumber',\n ),\n [PaymentMessageE.INVALID_CARD_HOLDER_NAME]: I18nService.translate(\n 'paymentErrors.invalidCardHolderName',\n ),\n [PaymentMessageE.INVALID_CARD_EXPIRATION_DATE]: I18nService.translate(\n 'paymentErrors.invalidCardExpirationDate',\n ),\n [PaymentMessageE.INVALID_CARD_CVC]: I18nService.translate('paymentErrors.invalidCardCvc'),\n [PaymentMessageE.INSUFFICIENT_FUNDS]: I18nService.translate(\n 'paymentErrors.insufficientFunds',\n ),\n [PaymentMessageE.BLACKLISTED_CARD]: I18nService.translate('paymentErrors.blacklistedCard'),\n [PaymentMessageE.INVALID_CUSTOMER_EMAIL]: I18nService.translate(\n 'paymentErrors.invalidCustomerEmail',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_PHONE]: I18nService.translate(\n 'paymentErrors.invalidCustomerPhone',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_BILLING_ADDRESS]: I18nService.translate(\n 'paymentErrors.invalidCustomerBillingAddress',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_EMAIL]: I18nService.translate(\n 'paymentErrors.requiredCustomerEmail',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_PHONE]: I18nService.translate(\n 'paymentErrors.requiredCustomerPhone',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_BILLING_ADDRESS]: I18nService.translate(\n 'paymentErrors.requiredCustomerBillingAddress',\n ),\n [PaymentMessageE.INVALID_CHECKOUT_REQUEST]: I18nService.translate(\n 'paymentErrors.invalidCheckoutRequest',\n ),\n [PaymentMessageE.UNAVAILABLE_PAYMENT_METHOD]: I18nService.translate(\n 'paymentErrors.unavailablePaymentMethod',\n ),\n [PaymentMessageE.INVALID_AMOUNT]: I18nService.translate('paymentErrors.invalidAmount'),\n [PaymentMessageE.INVALID_CURRENCY]: I18nService.translate('paymentErrors.invalidCurrency'),\n [PaymentMessageE.INVALID_COUNTRY]: I18nService.translate('paymentErrors.invalidCountry'),\n [PaymentMessageE.MAX_ATTEMPTS]: I18nService.translate('paymentErrors.maxAttempts'),\n [PaymentMessageE.PAYMENT_EXPIRED]: I18nService.translate('paymentErrors.paymentExpired'),\n\n [PaymentMessageE.INTERNAL_ERROR]: I18nService.translate('paymentErrors.internalError'),\n [PaymentMessageE.INVALID_SESSION]: I18nService.translate('paymentErrors.invalidSession'),\n [PaymentMessageE.APM_MESSAGE_ERROR]: I18nService.translate('paymentErrors.APMMessageError'),\n [PaymentMessageE.APM_ERROR_GENERIC]: I18nService.translate('paymentErrors.APMErrorGeneric'),\n [PaymentMessageE.APM_ERROR_BANK_TRANSFER]: I18nService.translate(\n 'paymentErrors.APMErrorBankTransfer',\n ),\n [PaymentMessageE.PROVIDER_ERROR]: I18nService.translate('paymentErrors.providerError'),\n [PaymentMessageE.BANK_REJECTED]: I18nService.translate('paymentErrors.bankRejected'),\n\n [PaymentMessageE.FRAUD_HIGH_RISK]: I18nService.translate('paymentErrors.fraudHighRisk'),\n [PaymentMessageE.CALL_BANK_FOR_AUTHORIZE]: I18nService.translate(\n 'paymentErrors.callBankForAuthorize',\n ),\n [PaymentMessageE.REQUIRED_3DS]: I18nService.translate('paymentErrors.required3ds'),\n [PaymentMessageE.BLACKLISTED]: I18nService.translate('paymentErrors.blacklisted'),\n [PaymentMessageE.HARD_DECLINE]: I18nService.translate('paymentErrors.hardDecline'),\n [PaymentMessageE.SOFT_DECLINE]: I18nService.translate('paymentErrors.softDecline'),\n [PaymentMessageE.HUMAN_DECLINE]: I18nService.translate('paymentErrors.humanDecline'),\n [PaymentMessageE.INTERNAL]: I18nService.translate('paymentErrors.internal'),\n [PaymentMessageE.INVALID_CARD_TOKENIZE_COUNTRY]: I18nService.translate(\n 'paymentErrors.invalidCardTokenizeCountry',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_ADDRESS]: I18nService.translate(\n 'paymentErrors.invalidCustomerAddress',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_CITY]: I18nService.translate(\n 'paymentErrors.invalidCustomerCity',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_STATE]: I18nService.translate(\n 'paymentErrors.invalidCustomerState',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_ZIP]: I18nService.translate(\n 'paymentErrors.invalidCustomerZip',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_COUNTRY]: I18nService.translate(\n 'paymentErrors.invalidCustomerCountry',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_DOCUMENT]: I18nService.translate(\n 'paymentErrors.invalidCustomerDocument',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_DOCUMENT_NUMBER]: I18nService.translate(\n 'paymentErrors.invalidCustomerDocumentNumber',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_DOCUMENT_TYPE]: I18nService.translate(\n 'paymentErrors.invalidCustomerDocumentType',\n ),\n [PaymentMessageE.INVALID_CHECKOUT_PAYMENT_METHOD]: I18nService.translate(\n 'paymentErrors.invalidCheckoutPaymentMethod',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_ADDRESS]: I18nService.translate(\n 'paymentErrors.requiredCustomerAddress',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_CITY]: I18nService.translate(\n 'paymentErrors.requiredCustomerCity',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_STATE]: I18nService.translate(\n 'paymentErrors.requiredCustomerState',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_ZIP]: I18nService.translate(\n 'paymentErrors.requiredCustomerZip',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_COUNTRY]: I18nService.translate(\n 'paymentErrors.requiredCustomerCountry',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_DOCUMENT]: I18nService.translate(\n 'paymentErrors.requiredCustomerDocument',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_DOCUMENT_NUMBER]: I18nService.translate(\n 'paymentErrors.requiredCustomerDocumentNumber',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_DOCUMENT_TYPE]: I18nService.translate(\n 'paymentErrors.requiredCustomerDocumentType',\n ),\n [PaymentMessageE.EXPIRED_CARD]: I18nService.translate('paymentErrors.expiredCard'),\n [PaymentMessageE.SANDBOX_ERROR]: I18nService.translate('paymentErrors.sandboxError'),\n };\n\n return messageMap[errorMessageKey] || I18nService.translate('paymentErrors.genericError');\n }\n}\n"],"names":["CheckoutStatusE","PaymentMessageE","PAYMENT_METHOD_ENUM","I18nService"],"mappings":";;;;AAGA;AACYA;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EALWA,uBAAe,KAAfA,uBAAe,GAK1B,EAAA,CAAA,CAAA;;ACTWC;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,eAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,eAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC;AACzC,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,gB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,WAAW,CAAC,SAAS,CAAC,4BAA4B,CAAC;;AAE5F;;;;","names":[],"sources":["src/api/entities/checkout/types.ts","src/utils/generate-idempotency-key.ts","src/models/enums/payment-status.enum.ts","src/utils/payment-error-mapper.ts"],"sourcesContent":["import { PaymentMethodNameE } from '../../../models/enums/payment-method-name.enum';\nimport { STATUS_REQ_CHECKOUT_APM } from '../../../models/enums/status-req-checkout-apm.enum';\n\n// Checkout request status\nexport enum CheckoutStatusE {\n PENDING = 'PENDING',\n APPROVED = 'APPROVED',\n REJECTED = 'REJECTED',\n ERROR = 'ERROR',\n}\n\n// APM Transaction interface (based on documentation)\nexport interface APMTransaction {\n name?: { text: string; language: string }[];\n description?: { text: string; language: string }[];\n isPriceFixed?: boolean;\n tiers?: any[];\n plan?: any;\n quantity: number;\n amount?: number;\n currency?: string;\n productId?: string;\n planId?: string;\n couponCode?: string;\n}\n\n// APM Customer interface (based on documentation)\nexport interface APMCustomer {\n firstName: string;\n lastName: string;\n email: string;\n phone: {\n countryCode: string;\n number: string;\n };\n shippingAddress?: APMAddress;\n}\n\n// APM Address interface (based on documentation)\nexport interface APMAddress {\n country: string;\n state: string;\n city: string;\n zipCode: string;\n lineOne: string;\n lineTwo?: string;\n}\n\n// APM Redirect URLs interface (based on documentation)\nexport interface APMRedirect {\n approved: string;\n rejected: string;\n}\n\n// Metadata interface\nexport interface Metadata {\n [key: string]: unknown;\n}\n\n// Create APM checkout request interface (based on documentation)\nexport interface CreateAPMCheckoutRequest {\n transaction: APMTransaction;\n method: PaymentMethodNameE;\n customer?: APMCustomer; // Optional for authenticated users\n billingDetails?: {\n address: {\n lineOne: string;\n lineTwo?: string;\n city: string;\n state: string;\n zipCode: string;\n country: string;\n };\n identification: {\n type: string;\n value: string;\n };\n };\n redirect: APMRedirect;\n paymentMetadata?: Metadata;\n subscriptionMetadata?: Metadata;\n customAttributes?: {\n bank?: string;\n };\n targetCurrency?: string;\n}\n\n// Legacy interfaces for backward compatibility\nexport interface Transaction {\n amount: number;\n currency: string;\n description: string;\n}\n\nexport interface Customer {\n email: string;\n name: string;\n phone: string;\n documentType?: string;\n documentNumber?: string;\n shippingAddress: Address;\n}\n\nexport interface Address {\n lineOne: string;\n lineTwo?: string;\n city: string;\n state: string;\n zipCode: string;\n country: string;\n}\n\nexport interface Redirect {\n successUrl: string;\n failureUrl: string;\n cancelUrl: string;\n}\n\nexport interface CreateCardCheckoutRequest {\n transaction: {\n quantity: number;\n currency?: string;\n amount?: number;\n couponCode?: string;\n };\n installments?: number;\n cardTokenId?: string | null; // Optional, if card is saved\n cardId?: string | null; // Optional, if card is saved\n customer?: {\n firstName: string;\n lastName: string;\n email: string;\n phone: {\n countryCode: string;\n number: string;\n };\n };\n billingDetails?: {\n address: {\n lineOne: string;\n lineTwo?: string;\n city: string;\n state: string;\n zipCode: string;\n country: string;\n };\n identification: {\n type: string;\n value: string;\n };\n };\n paymentMetadata?: {\n bankCode?: string;\n };\n customAttributes?: {\n deviceId?: string;\n };\n saveCard?: boolean;\n}\nexport interface CreateCardCheckoutResponse {\n traceId: string;\n date: string;\n result?: {\n paymentId: string;\n status: CheckoutStatusE;\n subscriptionId: string;\n cardId: string;\n cardLastFour: string;\n customerId: string;\n statusDetail?: string;\n type?: string;\n };\n error: {\n traceId: string;\n date: string;\n error: {\n message: string;\n type: string;\n };\n statusCode: number;\n };\n}\nexport interface Card {\n cardHolderName: string;\n cardExpirationMonth: string;\n cardExpirationYear: string;\n securityCode: string;\n number: string;\n identification: {\n type: string;\n value: string;\n };\n saveCard: boolean;\n}\n// Instruction interface for payment reference\nexport interface PaymentInstruction {\n text: string;\n language: string;\n}\n\n// Bank transfer data interface\nexport interface BankTransferData {\n bbvAccountNumber?: string;\n account: string; // CLABE\n bankName: string;\n reference: string;\n}\n\n// Checkout data interface (provider-specific)\nexport interface CheckoutData {\n // For QR codes\n qrCode?: string;\n\n // For barcodes\n barcode?: string;\n\n // For bank transfer payments (new - multiple data sets)\n bankTransferData?: BankTransferData[];\n\n // For reference payments\n referenceId?: string;\n instructions?: PaymentInstruction[];\n\n // For redirect payments\n url?: string;\n message?: string;\n // For vouchers\n voucherUrl?: string;\n\n // Additional provider-specific data\n [key: string]: any;\n}\n\n// Checkout result interface\nexport interface CheckoutResult {\n checkoutRequestId: string;\n status: CheckoutStatusE;\n data: CheckoutData;\n}\n\n// Error interface\nexport interface CheckoutError {\n message: string;\n type: string;\n}\n\n// Bank interface for PSE payments\nexport interface Bank {\n code: string;\n name: string;\n}\n\n// Required fields request interface\nexport interface RequiredFieldsRequest {\n currency: string;\n method: string;\n bin?: number;\n}\n\n// Required fields response interface\nexport type RequiredFieldsResponse = {\n name: string;\n values?: {\n code: string;\n name: string;\n }[];\n}[];\n\n// Create APM checkout response interface\nexport interface CreateAPMCheckoutResponse {\n traceId: string;\n date: string;\n result?: CheckoutResult;\n error?: CheckoutError;\n}\n\nexport interface PaymentMethod {\n name: string;\n type: string;\n}\n\nexport interface TrackingData {\n locale: string;\n utmTerm: string;\n referrer: string;\n ipAddress: string;\n}\nexport interface Source {\n source: string;\n version: string;\n}\n\nexport interface APMSession {\n country: string;\n createdAt: string;\n deviceId: string;\n email: string | null;\n expiresAt: string;\n id: string;\n isCreatedDuringCheckout: boolean;\n metadata: Record<string, unknown>;\n organizationId: string;\n paymentLinkId: string;\n paymentMethods: PaymentMethod[];\n planId: string;\n priceId: string;\n productId: string | null;\n providerKey: string;\n source: Source;\n status: string;\n trackingData: TrackingData;\n updatedAt: string;\n}\n\nexport interface CheckoutRequestPayment {\n id: string;\n createdAt: string;\n updatedAt: string;\n organizationId: string;\n amount: number;\n currency: string;\n customer: {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n phoneNumbers: {\n number: string;\n countryCode: string;\n }[];\n };\n status: string;\n metadata: Record<string, unknown>;\n paymentMethodType: string;\n paymentMethodMetadata: Record<string, unknown>;\n card: {\n id: string;\n name: string;\n expiration: {\n month: string;\n year: string;\n };\n lastFour: string;\n brand: string;\n };\n quantity: number;\n paymentProviderReference: string | null;\n paymentProviderDescription: string | null;\n installments: number | null;\n priceFixedIn: string | null;\n conversionRate: number | null;\n couponId: string | null;\n description: [\n {\n text: string;\n language: string;\n },\n ];\n processingMode: string;\n processingFee: number | null;\n country: string;\n timezone: string;\n}\n\nexport interface CheckoutRequestPaymentAPM {\n checkoutRequestId: string;\n status: STATUS_REQ_CHECKOUT_APM;\n type: string;\n data: {\n message: string;\n url: string;\n };\n session: APMSession;\n payment: CheckoutRequestPayment | null;\n}\n","export const generateIdempotencyKey = () => {\n return `idmp_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;\n};\n","export enum PaymentMessageE {\n PENDING = 'pending',\n APPROVED = 'approved',\n REJECTED = 'rejected',\n DECLINED = 'declined',\n ERROR = 'error',\n REFUNDED = 'refunded',\n CANCELLED = 'cancelled',\n PARTIALLY_REFUNDED = 'partially_refunded',\n EXPIRED = 'expired',\n GENERIC_REJECT = 'generic_reject',\n INVALID_CARD = 'invalid_card',\n INVALID_CARD_NUMBER = 'invalid_card_number',\n INVALID_CARD_HOLDER_NAME = 'invalid_card_holder_name',\n INVALID_CARD_EXPIRATION_DATE = 'invalid_card_expiration_date',\n INVALID_CARD_CVC = 'invalid_card_cvc',\n INSUFFICIENT_FUNDS = 'insufficient_funds',\n\n BLACKLISTED_CARD = 'blacklisted_card',\n INVALID_CUSTOMER_EMAIL = 'invalid_customer_email',\n INVALID_CUSTOMER_PHONE = 'invalid_customer_phone',\n INVALID_CUSTOMER_BILLING_ADDRESS = 'invalid_customer_billing_address',\n REQUIRED_CUSTOMER_EMAIL = 'required_customer_email',\n REQUIRED_CUSTOMER_PHONE = 'required_customer_phone',\n REQUIRED_CUSTOMER_BILLING_ADDRESS = 'required_customer_billing_address',\n INVALID_CHECKOUT_REQUEST = 'invalid_checkout_request',\n UNAVAILABLE_PAYMENT_METHOD = 'unavailable_payment_method',\n INVALID_AMOUNT = 'invalid_amount',\n INVALID_CURRENCY = 'invalid_currency',\n INVALID_COUNTRY = 'invalid_country',\n MAX_ATTEMPTS = 'max_attempts',\n PAYMENT_EXPIRED = 'payment_expired',\n FRAUD_HIGH_RISK = 'fraud_high_risk',\n INTERNAL_ERROR = 'internal_error',\n INVALID_SESSION = 'invalid_session',\n APM_MESSAGE_ERROR = 'apm_message_error',\n APM_ERROR_GENERIC = 'apm_error_generic',\n APM_ERROR_BANK_TRANSFER = 'apm_error_bank_transfer',\n PROVIDER_ERROR = 'provider_error',\n BANK_REJECTED = 'bank_rejected',\n CALL_BANK_FOR_AUTHORIZE = 'call_bank_for_authorize',\n REQUIRED_3DS = 'required_3ds',\n BLACKLISTED = 'blacklisted',\n HARD_DECLINE = 'hard-decline',\n SOFT_DECLINE = 'soft-decline',\n HUMAN_DECLINE = 'human-decline',\n INTERNAL = 'internal',\n INVALID_CARD_TOKENIZE_COUNTRY = 'invalid_card_tokenize_country',\n INVALID_CUSTOMER_ADDRESS = 'invalid_customer_address',\n INVALID_CUSTOMER_CITY = 'invalid_customer_city',\n INVALID_CUSTOMER_STATE = 'invalid_customer_state',\n INVALID_CUSTOMER_ZIP = 'invalid_customer_zip',\n INVALID_CUSTOMER_COUNTRY = 'invalid_customer_country',\n INVALID_CUSTOMER_DOCUMENT = 'invalid_customer_document',\n INVALID_CUSTOMER_DOCUMENT_NUMBER = 'invalid_customer_document_number',\n INVALID_CUSTOMER_DOCUMENT_TYPE = 'invalid_customer_document_type',\n INVALID_CHECKOUT_PAYMENT_METHOD = 'invalid_checkout_payment_method',\n REQUIRED_CUSTOMER_ADDRESS = 'required_customer_address',\n REQUIRED_CUSTOMER_CITY = 'required_customer_city',\n REQUIRED_CUSTOMER_STATE = 'required_customer_state',\n REQUIRED_CUSTOMER_ZIP = 'required_customer_zip',\n REQUIRED_CUSTOMER_COUNTRY = 'required_customer_country',\n REQUIRED_CUSTOMER_DOCUMENT = 'required_customer_document',\n REQUIRED_CUSTOMER_DOCUMENT_NUMBER = 'required_customer_document_number',\n REQUIRED_CUSTOMER_DOCUMENT_TYPE = 'required_customer_document_type',\n EXPIRED_CARD = 'expired_card',\n SANDBOX_ERROR = 'sandbox_error',\n}\n","import { I18nService } from '../i18n/i18n.service';\nimport { PAYMENT_METHOD_ENUM } from '../models/enums/payment-methods.enum';\nimport { PaymentMessageE } from '../models/enums/payment-status.enum';\n\nexport interface AlertErrorKeys {\n alertTitle?: PaymentMessageE;\n message: PaymentMessageE;\n}\n\n//currency country\n\nexport class PaymentErrorMapper {\n static getErrorMessage(\n errorMessageKey: AlertErrorKeys['message'] | null,\n paymentMethod: PAYMENT_METHOD_ENUM,\n currencyCountry?: string,\n ): string {\n if (\n !errorMessageKey ||\n !Object.values(PaymentMessageE).includes(errorMessageKey as PaymentMessageE) ||\n errorMessageKey === PaymentMessageE.GENERIC_REJECT\n ) {\n if (paymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n return I18nService.translate('paymentErrors.genericErrorCard');\n }\n if (paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER) {\n if (currencyCountry === 'BR') {\n return I18nService.translate('paymentErrors.genericErrorMessagePIX');\n }\n if (currencyCountry === 'AR') {\n return I18nService.translate('paymentErrors.genericErrorMessageQR');\n }\n if (currencyCountry === 'CO') {\n return I18nService.translate('paymentErrors.genericErrorMessagePSE');\n }\n return I18nService.translate('paymentErrors.genericErrorMessageBankTransfer');\n }\n return I18nService.translate('paymentErrors.genericErrorMessage');\n }\n return PaymentErrorMapper.getMessage(errorMessageKey);\n }\n\n static getErrorTitle(\n paymentMethod: PAYMENT_METHOD_ENUM,\n currencyCountry: string,\n errorTitleKey?: AlertErrorKeys['alertTitle'],\n ): string {\n if (errorTitleKey && !(errorTitleKey in PaymentMessageE)) {\n return PaymentErrorMapper.getMessage(errorTitleKey);\n }\n if (paymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n return I18nService.translate('paymentErrors.genericErrorTitleCard');\n }\n if (paymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER) {\n if (currencyCountry === 'BR') {\n return I18nService.translate('paymentErrors.genericErrorTitlePIX');\n }\n if (currencyCountry === 'AR') {\n return I18nService.translate('paymentErrors.genericErrorTitleQR');\n }\n if (currencyCountry === 'CO') {\n return I18nService.translate('paymentErrors.genericErrorTitlePSE');\n }\n }\n return I18nService.translate('paymentErrors.genericErrorTitleBankTransfer');\n }\n\n private static getMessage(errorMessageKey: PaymentMessageE): string {\n const messageMap: Record<PaymentMessageE, string> = {\n [PaymentMessageE.PENDING]: I18nService.translate('paymentErrors.pending'),\n [PaymentMessageE.APPROVED]: I18nService.translate('paymentErrors.approved'),\n [PaymentMessageE.REJECTED]: I18nService.translate('paymentErrors.rejected'),\n [PaymentMessageE.DECLINED]: I18nService.translate('paymentErrors.declined'),\n [PaymentMessageE.ERROR]: I18nService.translate('paymentErrors.error'),\n [PaymentMessageE.REFUNDED]: I18nService.translate('paymentErrors.refunded'),\n [PaymentMessageE.CANCELLED]: I18nService.translate('paymentErrors.cancelled'),\n [PaymentMessageE.PARTIALLY_REFUNDED]: I18nService.translate(\n 'paymentErrors.partiallyRefunded',\n ),\n [PaymentMessageE.EXPIRED]: I18nService.translate('paymentErrors.expired'),\n [PaymentMessageE.GENERIC_REJECT]: I18nService.translate('paymentErrors.genericReject'),\n [PaymentMessageE.INVALID_CARD]: I18nService.translate('paymentErrors.invalidCard'),\n [PaymentMessageE.INVALID_CARD_NUMBER]: I18nService.translate(\n 'paymentErrors.invalidCardNumber',\n ),\n [PaymentMessageE.INVALID_CARD_HOLDER_NAME]: I18nService.translate(\n 'paymentErrors.invalidCardHolderName',\n ),\n [PaymentMessageE.INVALID_CARD_EXPIRATION_DATE]: I18nService.translate(\n 'paymentErrors.invalidCardExpirationDate',\n ),\n [PaymentMessageE.INVALID_CARD_CVC]: I18nService.translate('paymentErrors.invalidCardCvc'),\n [PaymentMessageE.INSUFFICIENT_FUNDS]: I18nService.translate(\n 'paymentErrors.insufficientFunds',\n ),\n [PaymentMessageE.BLACKLISTED_CARD]: I18nService.translate('paymentErrors.blacklistedCard'),\n [PaymentMessageE.INVALID_CUSTOMER_EMAIL]: I18nService.translate(\n 'paymentErrors.invalidCustomerEmail',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_PHONE]: I18nService.translate(\n 'paymentErrors.invalidCustomerPhone',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_BILLING_ADDRESS]: I18nService.translate(\n 'paymentErrors.invalidCustomerBillingAddress',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_EMAIL]: I18nService.translate(\n 'paymentErrors.requiredCustomerEmail',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_PHONE]: I18nService.translate(\n 'paymentErrors.requiredCustomerPhone',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_BILLING_ADDRESS]: I18nService.translate(\n 'paymentErrors.requiredCustomerBillingAddress',\n ),\n [PaymentMessageE.INVALID_CHECKOUT_REQUEST]: I18nService.translate(\n 'paymentErrors.invalidCheckoutRequest',\n ),\n [PaymentMessageE.UNAVAILABLE_PAYMENT_METHOD]: I18nService.translate(\n 'paymentErrors.unavailablePaymentMethod',\n ),\n [PaymentMessageE.INVALID_AMOUNT]: I18nService.translate('paymentErrors.invalidAmount'),\n [PaymentMessageE.INVALID_CURRENCY]: I18nService.translate('paymentErrors.invalidCurrency'),\n [PaymentMessageE.INVALID_COUNTRY]: I18nService.translate('paymentErrors.invalidCountry'),\n [PaymentMessageE.MAX_ATTEMPTS]: I18nService.translate('paymentErrors.maxAttempts'),\n [PaymentMessageE.PAYMENT_EXPIRED]: I18nService.translate('paymentErrors.paymentExpired'),\n\n [PaymentMessageE.INTERNAL_ERROR]: I18nService.translate('paymentErrors.internalError'),\n [PaymentMessageE.INVALID_SESSION]: I18nService.translate('paymentErrors.invalidSession'),\n [PaymentMessageE.APM_MESSAGE_ERROR]: I18nService.translate('paymentErrors.APMMessageError'),\n [PaymentMessageE.APM_ERROR_GENERIC]: I18nService.translate('paymentErrors.APMErrorGeneric'),\n [PaymentMessageE.APM_ERROR_BANK_TRANSFER]: I18nService.translate(\n 'paymentErrors.APMErrorBankTransfer',\n ),\n [PaymentMessageE.PROVIDER_ERROR]: I18nService.translate('paymentErrors.providerError'),\n [PaymentMessageE.BANK_REJECTED]: I18nService.translate('paymentErrors.bankRejected'),\n\n [PaymentMessageE.FRAUD_HIGH_RISK]: I18nService.translate('paymentErrors.fraudHighRisk'),\n [PaymentMessageE.CALL_BANK_FOR_AUTHORIZE]: I18nService.translate(\n 'paymentErrors.callBankForAuthorize',\n ),\n [PaymentMessageE.REQUIRED_3DS]: I18nService.translate('paymentErrors.required3ds'),\n [PaymentMessageE.BLACKLISTED]: I18nService.translate('paymentErrors.blacklisted'),\n [PaymentMessageE.HARD_DECLINE]: I18nService.translate('paymentErrors.hardDecline'),\n [PaymentMessageE.SOFT_DECLINE]: I18nService.translate('paymentErrors.softDecline'),\n [PaymentMessageE.HUMAN_DECLINE]: I18nService.translate('paymentErrors.humanDecline'),\n [PaymentMessageE.INTERNAL]: I18nService.translate('paymentErrors.internal'),\n [PaymentMessageE.INVALID_CARD_TOKENIZE_COUNTRY]: I18nService.translate(\n 'paymentErrors.invalidCardTokenizeCountry',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_ADDRESS]: I18nService.translate(\n 'paymentErrors.invalidCustomerAddress',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_CITY]: I18nService.translate(\n 'paymentErrors.invalidCustomerCity',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_STATE]: I18nService.translate(\n 'paymentErrors.invalidCustomerState',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_ZIP]: I18nService.translate(\n 'paymentErrors.invalidCustomerZip',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_COUNTRY]: I18nService.translate(\n 'paymentErrors.invalidCustomerCountry',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_DOCUMENT]: I18nService.translate(\n 'paymentErrors.invalidCustomerDocument',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_DOCUMENT_NUMBER]: I18nService.translate(\n 'paymentErrors.invalidCustomerDocumentNumber',\n ),\n [PaymentMessageE.INVALID_CUSTOMER_DOCUMENT_TYPE]: I18nService.translate(\n 'paymentErrors.invalidCustomerDocumentType',\n ),\n [PaymentMessageE.INVALID_CHECKOUT_PAYMENT_METHOD]: I18nService.translate(\n 'paymentErrors.invalidCheckoutPaymentMethod',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_ADDRESS]: I18nService.translate(\n 'paymentErrors.requiredCustomerAddress',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_CITY]: I18nService.translate(\n 'paymentErrors.requiredCustomerCity',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_STATE]: I18nService.translate(\n 'paymentErrors.requiredCustomerState',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_ZIP]: I18nService.translate(\n 'paymentErrors.requiredCustomerZip',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_COUNTRY]: I18nService.translate(\n 'paymentErrors.requiredCustomerCountry',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_DOCUMENT]: I18nService.translate(\n 'paymentErrors.requiredCustomerDocument',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_DOCUMENT_NUMBER]: I18nService.translate(\n 'paymentErrors.requiredCustomerDocumentNumber',\n ),\n [PaymentMessageE.REQUIRED_CUSTOMER_DOCUMENT_TYPE]: I18nService.translate(\n 'paymentErrors.requiredCustomerDocumentType',\n ),\n [PaymentMessageE.EXPIRED_CARD]: I18nService.translate('paymentErrors.expiredCard'),\n [PaymentMessageE.SANDBOX_ERROR]: I18nService.translate('paymentErrors.sandboxError'),\n };\n\n return messageMap[errorMessageKey] || I18nService.translate('paymentErrors.genericError');\n }\n}\n"],"version":3}