rebill-web-components-sdk 1.8.21 → 1.8.22
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.
- package/dist/cjs/apm-checkout_19.cjs.entry.js +1 -1
- package/dist/cjs/index-C-VTnc0I.js.map +1 -1
- package/dist/cjs/rebill-checkout.cjs.entry.js +1 -1
- package/dist/cjs/rebill-renewal.cjs.entry.js +1 -1
- package/dist/cjs/{required-fields-mappers-U6myFlpn.js → required-fields-mappers-DWU2V-eY.js} +3 -2
- package/dist/cjs/{required-fields-mappers-U6myFlpn.js.map → required-fields-mappers-DWU2V-eY.js.map} +1 -1
- package/dist/collection/components/checkout/payment-button/payment-button.js +1 -1
- package/dist/collection/components/checkout/payment-button/payment-button.js.map +1 -1
- package/dist/collection/utils/required-fields-mappers.js +1 -0
- package/dist/collection/utils/required-fields-mappers.js.map +1 -1
- package/dist/components/p-8BpuJ_V5.js.map +1 -1
- package/dist/components/{p-BI62ypLw.js → p-BRI7iMx8.js} +3 -2
- package/dist/components/p-BRI7iMx8.js.map +1 -0
- package/dist/components/{p-aO8Az5Xi.js → p-DZKiNnX2.js} +3 -3
- package/dist/components/{p-aO8Az5Xi.js.map → p-DZKiNnX2.js.map} +1 -1
- package/dist/components/payment-button.js +1 -1
- package/dist/components/rebill-checkout.js +2 -2
- package/dist/components/rebill-renewal.js +2 -2
- package/dist/esm/apm-checkout_19.entry.js +1 -1
- package/dist/esm/index-D8cwEAmw.js.map +1 -1
- package/dist/esm/rebill-checkout.entry.js +1 -1
- package/dist/esm/rebill-renewal.entry.js +1 -1
- package/dist/esm/{required-fields-mappers-BOaTKbNe.js → required-fields-mappers-BErrHwHk.js} +3 -2
- package/dist/esm/{required-fields-mappers-BOaTKbNe.js.map → required-fields-mappers-BErrHwHk.js.map} +1 -1
- package/dist/rebill-web-components-sdk/{p-ea3de987.entry.js → p-4a8ad442.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-b306912b.entry.js → p-6bcff3c5.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-b616775b.entry.js → p-9afddef2.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-Bz-GsiI3.js → p-BP5Qpv7O.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-Bz-GsiI3.js.map → p-BP5Qpv7O.js.map} +1 -1
- package/dist/rebill-web-components-sdk/p-D8cwEAmw.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
- package/dist/types/utils/required-fields-mappers.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/p-BI62ypLw.js.map +0 -1
- /package/dist/rebill-web-components-sdk/{p-ea3de987.entry.js.map → p-4a8ad442.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-b306912b.entry.js.map → p-6bcff3c5.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-b616775b.entry.js.map → p-9afddef2.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-D8cwEAmw.js";import{c as s}from"./p-MMCcKmy_.js";import{a as n}from"./p-CTo1s54i.js";import{m as a,g as o,P as r,C as l,i as c,a as h,b as d}from"./p-Bz-GsiI3.js";import{s as u,S as m,I as p,a as f,i as y,P as b,o as g,b as w}from"./p-DrG7nhj2.js";import{S as k}from"./p-vsLqF4hk.js";import{B as x,g as v,i as C}from"./p-Do_vNuMa.js";import{P as I,G as P}from"./p-Dn4NTa9d.js";import"./p-E-ZsRS8r.js";import"./p-D339jHg4.js";const S={checkoutSummary:true,submitButton:true,billingAddress:true,customerInformation:true,discountCode:true,logo:true,footer:true,sandboxMode:true,processingPayment:true,successPage:true,errorMessage:true};var M;(function(t){t["BAMBOO"]="bamboo_payment";t["FISERV"]="fiserv";t["KUSHKI"]="kushki";t["PAYWAY"]="payway";t["DOCK"]="dock";t["KLAP"]="klap";t["MOVII"]="movii";t["STRIPE"]="stripe";t["DECIDIR"]="decidir"})(M||(M={}));const N=async(t,i,e)=>{const s=await n.checkout.getRequiredFields({currency:t,method:i},e);return{fields:a(s.data),original:s.data}};const j=async()=>{const t=u.data?.itemInformation?.paymentMethods;const i=t.map((async t=>{try{const i=I.mapToAPMPaymentMethod(t,u.data?.pricing?.country);const e=await N(u.data.pricing.currency,i,u.data.organization.id);return{paymentMethod:t,...e}}catch(i){console.error(`Error getting required fields for ${t}:`,i);return{paymentMethod:t,fields:[],original:[]}}}));const e=await Promise.all(i);const s={};e.forEach((t=>{s[t.paymentMethod]={fields:t.fields,original:t.original}}));return s};const D=(t,i)=>{const e=i[t];if(e){return e}else{return{fields:[],original:[]}}};const R=t=>typeof t==="string"?JSON.parse(t):t;const T=t=>R(t);const z=()=>"190.188.127.250";const q=async({publicKey:t,instantProduct:i,instantPlan:e})=>{const s=R(i?i:e);const a=await n.sessions.createSDKInstantSessionRequest(s,o(),z(),t);const r={...a.data,...a.data.plan&&{plan:{...a.data.plan,description:s.description||[]}},...a.data.product&&{product:{...a.data.product,description:s.description||[]}}};const l=r;return l};const A=async({publicKey:t,productId:i,planId:e})=>{const s=await n.sessions.createSDKItemSessionRequest({...i?{productId:i}:{},...e?{planId:e}:{},idempotencyKey:o(),deviceId:"123123123",clientIP:z(),publicKey:t});const a=s.data;return a};const E=async({publicKey:t,checkoutLandingSession:i,instantProduct:e,instantPlan:s,productId:n,planId:a})=>{if(i){const t=await T(i);return{session:t,type:m.CHECKOUT_LANDING}}if(e||s){const i=await q({publicKey:t,instantProduct:e,instantPlan:s});return{session:i,type:m.INSTANT}}if(n||a){const i=await A({publicKey:t,productId:n,planId:a});return{session:i,type:m.SDK_ITEM}}};const O="@media (max-width: 1024px){.rebill-checkout{width:100%;flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section-checkout .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%}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}.rebill-checkout.full-width-layout .left-section{width:100%}.rebill-checkout.full-width-layout .left-section-container{max-width:none;width:100%}}@media (min-width: 1025px){.rebill-checkout{width:100%;min-height:600px;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-checkout{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;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%}.rebill-checkout.full-width-layout .left-section{width:100%;justify-content:stretch}.rebill-checkout.full-width-layout .left-section-container{max-width:none;min-width:auto;width:100%;margin:2.5rem 2rem 1.5rem 2rem}.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 F=class{constructor(e){t(this,e);this.error=i(this,"error");this.success=i(this,"success");this.successRedirect=i(this,"successRedirect");this.formChange=i(this,"formChange");this.paymentMethodSelected=i(this,"paymentMethodSelected")}productId;planId;publicKey;instantProduct;instantPlan;display;customerInformation;oneClickCheckout=true;css;language;async handleLanguageChange(t,i){if(t&&t!==i){try{await p.changeLanguage(t);f.changeLanguage(t);console.log(`[RebillCheckout] Language changed from ${i} to ${t}`)}catch(t){console.error("[RebillCheckout] Failed to change language:",t)}}}error;success;successRedirect;formChange;checkoutLandingSession;externalPayment;rejectedPaymentCard=false;rejectedPaymentAPM=false;countries=[];currentPaymentMethod;checkoutResponse=null;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;isAPMSubmitting=false;isAPMSuccess=false;storedCheckoutResults=new Map;alertErrorKeys=null;currentApmPaymentMethod=null;breakpoint=x.DESKTOP;showRefreshModal=false;cardError={showCardInvalid:false,type:null};initialData={};allRequiredFields={};currentRequiredFields=[];customerExists=false;showOtp=false;otpVerified=false;responseCheckoutCard=null;cardMode=null;formElement;emailDebounceTimeout=null;injectedStyleElement=null;get displayConfig(){if(!this.display){return S}if(typeof this.display==="string"){try{const t=JSON.parse(this.display);return{...S,...t}}catch(t){console.warn("Invalid display configuration string, using defaults:",t);return S}}return{...S,...this.display}}get parsedCustomerInformation(){if(!this.customerInformation){return null}if(typeof this.customerInformation==="string"){try{return JSON.parse(this.customerInformation)}catch(t){console.warn("Invalid customerInformation configuration string, ignoring:",t);return null}}return this.customerInformation}get filteredPaymentMethods(){const t=u.data?.itemInformation?.paymentMethods||[];const i=this.displayConfig.excludePaymentMethods;if(!i||i.length===0){return t}return t.filter((t=>!i.includes(t)))}getCombinedUserData(t={}){const i=u.data.userInformation;const e=this.parsedCustomerInformation;return{email:t?.email||e?.email||i.email,fullName:t?.fullName||e?.fullName||i.fullName,countryCodePhoneNumber:t?.countryCodePhoneNumber||e?.phoneNumber?.countryCode||e?.countryCode||i.countryCode,phoneNumber:t?.phoneNumber||e?.phoneNumber?.number||i.phoneNumber,documentType:t?.documentType||e?.documentType||i.documentType,documentNumber:t?.documentNumber||e?.documentNumber||i.documentNumber,"billing-country":t?.["billing-country"]||e?.address?.billingAddress?.country||i.address?.billingAddress?.country,"billing-state":t?.["billing-state"]||e?.address?.billingAddress?.state||i.address?.billingAddress?.state,"billing-address":t?.["billing-address"]||e?.address?.billingAddress?.address||i.address?.billingAddress?.address,"billing-city":t?.["billing-city"]||e?.address?.billingAddress?.city||i.address?.billingAddress?.city,"billing-zip":t?.["billing-zip"]||e?.address?.billingAddress?.zip||i.address?.billingAddress?.zip}}injectCustomCSS(){if(!this.css){return}this.cleanupInjectedCSS();const t=`rebill-checkout-css-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;if(this.css.startsWith("http://")||this.css.startsWith("https://")||this.css.startsWith("//")){const i=document.createElement("link");i.rel="stylesheet";i.href=this.css;i.id=t;i.setAttribute("data-rebill-injected","true");document.head.appendChild(i);this.injectedStyleElement=i}else{const i=document.createElement("style");i.id=t;i.setAttribute("data-rebill-injected","true");i.textContent=this.css;document.head.appendChild(i);this.injectedStyleElement=i}}cleanupInjectedCSS(){if(this.injectedStyleElement){try{this.injectedStyleElement.remove()}catch(t){console.warn("Error removing injected CSS:",t)}this.injectedStyleElement=null}}timeToRedirectAPM=5e3;resizeHandler=()=>{const t=v(window.innerWidth);if(t!==this.breakpoint){this.breakpoint=t}};disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler);if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout);this.emailDebounceTimeout=null}this.cleanupInjectedCSS()}async componentWillLoad(){try{this.resizeHandler();window.addEventListener("resize",this.resizeHandler);this.injectCustomCSS();if(this.language){await p.changeLanguage(this.language)}else{y()}const{session:t,type:i}=await E({publicKey:this.publicKey,checkoutLandingSession:this.checkoutLandingSession,instantProduct:this.instantProduct,instantPlan:this.instantPlan,productId:this.productId,planId:this.planId});f.initializeSession({session:t,type:i,payment:typeof this.externalPayment==="string"?JSON.parse(this.externalPayment):this.externalPayment});if(u.sessionRefreshed){this.showRefreshModal=true}P.loadGoogleMapsScript();const e=await n.data.getCountries();this.countries=e.data;this.initialData=this.getInitialData();this.allRequiredFields=await j();if(this.filteredPaymentMethods.length>0){if(u.data.paymentStatus===r.REJECTED||u.data.paymentStatus===r.APPROVED&&this.filteredPaymentMethods.includes(b.BANK_TRANSFER)){const t=this.filteredPaymentMethods.find((t=>t===b.BANK_TRANSFER));if(t){this.changePaymentMethod(t);f.setPaymentMethodSelected(t)}}else{this.changePaymentMethod(this.filteredPaymentMethods[0])}}if(this.oneClickCheckout){n.customers.exists({email:u.data?.prefilledData?.email},this.publicKey).then((t=>{this.customerExists=t.data.exists}))}this.cardMode=u.cardMode;g("cardMode",(()=>{this.cardMode=u.cardMode}))}catch(t){console.error("Error initializing checkout:",t)}}componentWillUpdate(){this.injectCustomCSS()}async changePaymentMethod(t){if(t!==this.currentPaymentMethod&&this.filteredPaymentMethods.includes(t)){if(this.checkoutResponse){this.checkoutResponse=null;f.clearCheckoutResponse()}this.currentPaymentMethod=t;f.setPaymentMethodSelected(t);if(t!==b.CARD){this.cardMode="input";f.setCardMode("input")}this.isSubmitting=false;this.currentApmPaymentMethod=I.mapToAPMPaymentMethod(t,u.data?.pricing?.country);if(t!==b.CASH&&t!==b.BANK_TRANSFER){this.checkoutResponse=null;f.clearCheckoutResponse()}else{this.checkoutResponse=null;f.clearCheckoutResponse()}this.paymentMethodSelected.emit(t);try{this.currentRequiredFields=D(t,this.allRequiredFields).fields;const i=await n.sessions.updateCurrentSessionPaymentMethod(u.data.sessionId,{paymentMethodName:I.mapToAPMPaymentMethod(t,u.data.pricing.country),paymentMethodType:t,currency:u.data.pricing.currency});f.setProviderKey(i.providerKey);if(i.providerKey===M.DECIDIR||u.data.providerKey===M.DECIDIR){const t=crypto.randomUUID();const i=await n.fingerPrint.getFingerPrint(t);u.deviceId=t;const e=i.result.script;const s=document.createElement("script");s.innerHTML=e;document.body.appendChild(s)}}catch(t){console.error("Failed to update payment method or get required fields:",t)}}}get currentPaymentError(){if(this.currentPaymentMethod===b.CARD){return this.rejectedPaymentCard}else if(this.currentPaymentMethod===b.CASH||this.currentPaymentMethod===b.BANK_TRANSFER){return this.rejectedPaymentAPM}return false}paymentMethodSelected;async handlePaymentMethodSelected(t){t.stopPropagation();const i=t.detail;this.changePaymentMethod(i);if(this.formElement){this.formElement.resetValidation()}}async handleSubmit(t){if(this.isSubmitting){return}this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false;if(this.currentPaymentMethod===b.CARD){this.handleSubmitCard(t)}else if(this.currentPaymentMethod===b.CASH||this.currentPaymentMethod===b.BANK_TRANSFER){this.handleSubmitAPM(t)}}handleFormChange(t){const i=t.detail;let e=true;let s={};if(this.formElement?.errors){s=this.formElement.errors;e=Object.keys(s).length===0}this.formChange.emit({data:i,isValid:e,errors:Object.keys(s).length>0?s:undefined})}async handleSubmitCard(t){const i=t.detail;const e=this.getCombinedUserData(i);if(!u.data.cardTokenId&&!u.data.cardId){this.cardError={showCardInvalid:true,type:"card_error"};return}if(!u.data.cardInformation&&!u.data.cardId){this.cardError={showCardInvalid:true,type:"tokenization_error"};return}this.cardError={showCardInvalid:false,type:null};const s={transaction:{quantity:1,...u.data.discount.couponCode&&{couponCode:u.data.discount.couponCode}},installments:Number(i.installments||u.data.cardInformation?.installments?.selectedInstallment?.installment),...u.data.cardTokenId&&{cardTokenId:u.data.cardTokenId,...u.data?.itemInformation?.type!==w.PLAN&&{saveCard:u.saveCard}},...u.data.cardId&&{cardId:u.data.cardId},...(!this.otpVerified||this.cardMode==="input")&&{customer:{firstName:e.fullName?.split(" ")[0],lastName:e.fullName?.split(" ").slice(1).join(" "),email:e.email,phone:{countryCode:e.countryCodePhoneNumber,number:e.phoneNumber}}},billingDetails:{address:{lineOne:e["billing-address"],city:e["billing-city"],state:e["billing-state"],country:e["billing-country"],zipCode:e["billing-zip"]},identification:{type:e.documentType,value:e.documentNumber}},customAttributes:{...u.deviceId&&{deviceId:u.deviceId}},...u.metadata&&{paymentMetadata:u.metadata}};const a=o();this.isSubmitting=true;this.isCardSubmitting=true;try{const t=await n.checkout.createCardCheckoutRequest(u.data.sessionId,a,s,u.data.accessToken||undefined);f.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;if(t.data.result?.status.toUpperCase()===l.APPROVED){this.isCardSuccess=true;f.setPaymentStatus(r.APPROVED);this.success.emit({paymentMethod:this.currentPaymentMethod,data:t.data});u.data.cardInformation.lastFour=t.data.result?.cardLastFour}else{this.error.emit({paymentMethod:this.currentPaymentMethod,data:t.data});f.setCheckoutResponse(t.data);this.rejectedPaymentCard=true;this.alertErrorKeys={message:t.data.result?.statusDetail.toLowerCase()??t.data.error?.error?.message?.toLowerCase()}}}catch(t){this.error.emit({paymentMethod:this.currentPaymentMethod,data:t.data});f.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;this.rejectedPaymentCard=true;this.alertErrorKeys={message:t.data?.error?.type?.toLowerCase()??t.data?.result?.statusDetail?.toLowerCase()}}finally{this.isSubmitting=false;this.isCardSubmitting=false}}async handleSubmitAPM(t){console.log("handleSubmitAPM",this.currentPaymentMethod);if(this.currentPaymentMethod!==b.CASH&&this.currentPaymentMethod!==b.BANK_TRANSFER){return}this.isSubmitting=true;const i=t.detail;const e=this.getCombinedUserData(i);try{const t={address:{country:e["billing-country"]||"",state:e["billing-state"]||"",city:e["billing-city"]||"",zipCode:e["billing-zip"]||"",lineOne:e["billing-address"]||""},identification:{type:e.documentType,value:e.documentNumber}};const s=this.currentApmPaymentMethod||I.mapToAPMPaymentMethod(this.currentPaymentMethod,u.data?.pricing?.country);const a={transaction:{quantity:1,...u.data.discount.couponCode&&{couponCode:u.data.discount.couponCode}},method:s,billingDetails:t,redirect:{approved:window.location.origin+"/payment/success",rejected:window.location.origin+"/payment/failure"},paymentMetadata:u.metadata,customAttributes:{bank:i.bankId||u.data?.bankId?.code}};{a.customer={firstName:e.fullName?.split(" ")[0]||"",lastName:e.fullName?.split(" ").slice(1).join(" ")||"",email:e.email,phone:{countryCode:e.countryCodePhoneNumber||"",number:e.phoneNumber||""}}}const r=o();const l=await n.checkout.createAPMCheckoutRequest(u.data.sessionId,r,a);this.isSubmitting=false;this.checkoutResponse=l.data;this.storedCheckoutResults.set(this.currentPaymentMethod,l.data);if(l.data?.date){u.data.paymentDate=l.data.date;u.createdAt=l.data.date}if(l.data?.traceId){u.data.paymentReference=l.data.traceId}}catch(t){this.isSubmitting=false;this.checkoutResponse=t.data;this.alertErrorKeys={message:t.data?.error?.type?.toLowerCase()??t.data?.result?.statusDetail?.toLowerCase()};this.rejectedPaymentAPM=true}}async submit(){if(this.formElement&&typeof this.formElement.submit==="function"){this.formElement.submit()}else{await this.handleSubmit({detail:{}})}}handlePaymentStatusChange=t=>{if(t.isCompleted){if(t.status===k.APPROVED){f.setPaymentStatus(r.APPROVED);this.success.emit({paymentMethod:this.currentPaymentMethod,data:this.checkoutResponse})}else if(t.status===k.REJECTED){f.setPaymentStatus(r.REJECTED);this.alertErrorKeys={alertTitle:r.APM_ERROR_GENERIC,message:r.APM_MESSAGE_ERROR}}}};async handleInputChange(t){if(t?.detail?.id==="email"&&this.oneClickCheckout){if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout)}if(!t.detail.value||t.detail.value.trim()===""){this.customerExists=false;f.clearCustomerIdAndToken();return}this.emailDebounceTimeout=setTimeout((async()=>{try{const t=await n.customers.exists({email:u.data.userInformation.email},this.publicKey);this.customerExists=t.data.exists}catch(t){this.customerExists=false}}),500)}}validationSchema={email:s().when([],{is:()=>!this.otpVerified,then:t=>t.email("validation.emailInvalid").matches(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"validation.emailInvalid").required("validation.emailRequired"),otherwise:t=>t.notRequired()}),fullName:s().when([],{is:()=>!this.otpVerified,then:t=>t.required("validation.fullNameRequired").matches(/^[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}\s+[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}$/,"validation.fullNameInvalid"),otherwise:t=>t.notRequired()}),isValidPhoneNumber:s().when([],{is:()=>c("phoneNumber",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.equals(["true"],"validation.phoneRequired"),otherwise:t=>t.notRequired()}),"billing-country":s().when([],{is:()=>c("billing-country",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.countryRequired"),otherwise:t=>t.notRequired()}),"billing-state":s().when([],{is:()=>c("billing-state",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.stateRequired"),otherwise:t=>t.notRequired()}),"billing-address":s().when([],{is:()=>c("billing-address",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.addressRequired"),otherwise:t=>t.notRequired()}),"billing-city":s().when([],{is:()=>c("billing-city",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.cityRequired"),otherwise:t=>t.notRequired()}),"billing-zip":s().when([],{is:()=>c("billing-zip",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.zipRequired"),otherwise:t=>t.notRequired()}),bankId:s().when([],{is:()=>c("bankId",this.currentRequiredFields),then:t=>t.required("validation.bankRequired"),otherwise:t=>t.notRequired()}),installments:s().when([],{is:()=>this.currentPaymentMethod===b.CARD&&u.data.cardInformation.installments.isAvailableInstallments&&u.data.cardInformation?.installments?.installments.length>0&&u.data.itemInformation.type!==w.PLAN,then:t=>t.required("validation.installmentsRequired"),otherwise:t=>t.notRequired()}),documentType:s().when([],{is:()=>c("documentType",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.documentTypeRequired"),otherwise:t=>t.notRequired()}),documentNumber:s().when([],{is:()=>c("documentNumber",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.documentNumberRequired").min(7,"validation.documentInvalid"),otherwise:t=>t.notRequired()})};getInitialData=()=>({email:u.data.userInformation.email||"",fullName:u.data.userInformation.fullName||"",phoneNumber:u.data.userInformation.phoneNumber?.number||"",countryCodePhoneNumber:u.data.userInformation.countryCode||"",documentType:"",documentNumber:"","billing-country":u.data.userInformation.address?.billingAddress?.country||"","billing-state":u.data.userInformation?.address?.billingAddress?.state||"","billing-address":u.data.userInformation?.address?.billingAddress?.address||"","billing-city":u.data.userInformation?.address?.billingAddress?.city||"","billing-zip":u.data.userInformation?.address?.billingAddress?.zip||"",bankId:u.data.bankId?.code||"",card:"",installments:u.data.cardInformation?.installments?.selectedInstallment?.installment?.toString()||""});hasPrefilledAddress=()=>{const t=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return t.some((t=>{const i=this.initialData[t];return i&&i.trim()!==""}))};get isQrCodeVisible(){return!!this.checkoutResponse?.result?.data?.qrCode}get isBankTransferVisible(){return!!this.checkoutResponse?.result?.data?.account&&!!this.checkoutResponse?.result?.data?.bankName&&!!this.checkoutResponse?.result?.data?.reference}isPaymentApproved=()=>{if(u.data.paymentStatus===r.APPROVED){return true}return false};handleRebillAccountClick(t){this.showOtp=t.detail}handleReturnForm(t){this.showOtp=t.detail;f.clearCustomerIdAndToken()}handleSignOut(){this.showOtp=false;this.otpVerified=false;if(!u?.data?.prefilledData?.email){this.customerExists=false}f.clearCustomerIdAndToken();f.clearUserInformation();this.cardError={showCardInvalid:false,type:null};this.alertErrorKeys=null;this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false}handleCodeVerified(){this.otpVerified=true;this.showOtp=false;this.rejectedPaymentCard=false;this.alertErrorKeys=null;this.cardError={showCardInvalid:false,type:null};if(this.formElement){this.formElement.resetValidation()}}isPaymentRejected(){return u.data.paymentStatus===r.REJECTED&&this.currentPaymentMethod===b.BANK_TRANSFER}render(){const t=this.countries.map((t=>({label:t.country,value:t.isoCountryCode})));const i=(t={})=>e("rebill-summary",{key:"889ee4307f38fbed3dd973d68d4e71979519b971",totalAmount:u.data.pricing.total,currency:u.data.pricing.currency,itemTitle:u._session?.getTitle(),itemDescription:u._session?.getDescription(),itemAmount:u.data.pricing.subtotal,subtotal:u.data.pricing.subtotal,allowCoupon:u._session?.getAllowCoupon(this.displayConfig),currentBreakpoint:this.breakpoint,planFrequency:u._session?.getPlanFrequency(),planFrequencyCount:u._session?.getPlanFrequencyCount(),discountType:u.data.discount.discountType,discountedPercentage:u.data.discount.discountedPercentage,discountDuration:u.data.discount.discountDuration,discountAmount:u.data.discount.discountAmount,...t});return u.isInitialized&&e(e.Fragment,null,this.showRefreshModal&&e("rebill-modal-overlay",{key:"ab3333710743b424ad676702aba95f4c2ea83f92"}),this.displayConfig.processingPayment&&e("rebill-processing-payment",{key:"30e84979156a983056fe59ed1d684dafc0adc1d9",style:{display:this.isCardSubmitting?"block":"none"}}),this.displayConfig.successPage&&this.isPaymentApproved()&&u.isInitialized?e("success-page",{typePaymentMethod:u.data.paymentMethodSelected,paymentMethodName:I.mapToAPMPaymentMethod(u.data.paymentMethodSelected||u.data.payment?.paymentMethodType,u.data?.pricing?.country),country:u.data?.pricing?.country,bank:u.data.payment?.paymentMethodMetadata?.bank||u.data.payment?.paymentMethodMetadata?.bank,cardLastFour:this.responseCheckoutCard?.result?.cardLastFour||u.data.cardInformation?.lastFour,paymentDate:u.data.paymentDate||this.responseCheckoutCard?.date||u.data.payment?.createdAt||this.checkoutResponse?.result?.data?.createdAt,referenceNumber:u.data.paymentReference||u.data.payment?.traceId||this.responseCheckoutCard?.traceId,onSuccessRedirect:t=>{this.successRedirect.emit(t.detail)},trialPeriodDays:u.data?.itemInformation?.trial?.trialPeriodDays,debitDay:u.data?.itemInformation?.debitDay,planAmount:u.data?.pricing?.planAmount}):e(e.Fragment,null,this.displayConfig.sandboxMode&&u.isSandbox&&u.data.sessionType===m.CHECKOUT_LANDING&&C(this.breakpoint,x.DESKTOP)&&e("div",{class:"mode-sandbox-mobile-container",style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"}},e("rebill-mode-sandbox-mobile",null)),e("rebill-checkout-form",{ref:t=>this.formElement=t,style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:t=>this.handleSubmit(t),onChange:t=>this.handleFormChange(t),renderForm:({submit:s,formData:n,errors:a})=>{const o=!this.isCardSuccess&&this.checkoutResponse?.result&&(this.currentPaymentMethod===b.CASH||this.currentPaymentMethod===b.BANK_TRANSFER);return e("div",{class:`rebill-checkout ${!this.displayConfig.checkoutSummary?"full-width-layout":""}`},e("div",{class:"left-section"},e("div",{class:"left-section-container"},this.displayConfig.logo&&e("organization-logo",{organization:u.data.organization}),e("div",{class:"otp-container",style:{display:this.showOtp?"block":"none"}},e("otp-component",null)),e("div",{style:{display:this.showOtp?"none":"block"}},e("div",{class:"checkout-form-section"},this.displayConfig.checkoutSummary&&e("div",{class:"summary-mobile-tablet",style:{display:C(this.breakpoint,x.DESKTOP)?"block":"none"}},i({displayedComponents:["totalAmount","discount","timelineFreeTrial","timelineDebitDay","itemDetails"]})),!this.otpVerified&&this.displayConfig.customerInformation&&e("user-information",{customerExists:this.customerExists,disabled:this.isSubmitting,errors:{email:a.email,fullName:a.fullName}}),this.otpVerified&&this.displayConfig.customerInformation&&e("user-information-static",{variant:"otp",userInfo:{customerName:u.data.userInformation.fullName?.split(" ")[0],customerEmail:u.data.userInformation.email}}),e("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},e("payment-method-selector",{enabledPaymentMethods:this.filteredPaymentMethods,defaultSelected:this.currentPaymentMethod,disabled:this.isSubmitting,errorComponent:{showErrorComponent:this.displayConfig.errorMessage&&(this.currentPaymentError||this.isPaymentRejected()),alertTitle:h.getErrorTitle(this.currentPaymentMethod,u.data?.pricing?.country||"",this.alertErrorKeys?.alertTitle),message:h.getErrorMessage(this.alertErrorKeys?.message,this.currentPaymentMethod,u.data?.pricing?.country)},country:u.data?.pricing?.country,installmentsError:a.installments,showDocument:(!this.otpVerified||this.otpVerified&&this.cardMode==="input")&&!o&&!this.isQrCodeVisible&&(c("documentNumber",this.currentRequiredFields)||c("documentType",this.currentRequiredFields)),documentTypeError:a.documentType,documentNumberError:a.documentNumber,cardError:this.cardError,customCSS:this.css}),!o&&(()=>{const t=c("bankId",this.currentRequiredFields);return t})()&&e("div",{class:"animated-component fade-in"},e("rebill-bank-selector",{banks:d("bank",this.allRequiredFields[this.currentPaymentMethod].original)||[],defaultSelectedBankId:n.bankId||"",error:a?.bankId,disabled:this.isSubmitting}))),!o&&(!this.otpVerified||this.cardMode==="input")&&e(e.Fragment,null,this.displayConfig.billingAddress&&(c("billing-country",this.currentRequiredFields)||c("billing-state",this.currentRequiredFields)||c("billing-address",this.currentRequiredFields)||c("billing-city",this.currentRequiredFields)||c("billing-zip",this.currentRequiredFields))&&e("div",{class:"animated-component slide-in"},e("rebill-address",{disabled:this.isSubmitting,countryOptions:t,billingView:this.hasPrefilledAddress()?"form":"search",errors:{"billing-country":a["billing-country"],"billing-state":a["billing-state"],"billing-address":a["billing-address"],"billing-city":a["billing-city"],"billing-zip":a["billing-zip"]}})),this.displayConfig.customerInformation&&c("phoneNumber",this.currentRequiredFields)&&e("div",{class:"animated-component fade-in"},e("user-information-phone",{disabled:this.isSubmitting,error:a?.phoneNumber,countryCode:u.data.userInformation?.countryCode||u.data.country}))),o&&e("apm-checkout",{paymentMethod:this.currentPaymentMethod,referenceId:this.currentPaymentMethod===b.CASH?this.checkoutResponse?.result?.data?.referenceId:undefined,qrCodeData:this.currentPaymentMethod===b.BANK_TRANSFER?this.checkoutResponse?.result?.data?.qrCode:undefined,checkoutRequestId:this.checkoutResponse?.result?.checkoutRequestId,providerName:u.data.providerKey,expirationDate:(()=>{const t=new Date;t.setDate(t.getDate()+30);return t.toISOString()})(),onPaymentStatusChange:t=>this.handlePaymentStatusChange(t.detail),country:u.data?.pricing?.country,redirectUrl:this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,bearerToken:this.checkoutResponse?.result?.data?.bearerToken,bankTransferData:this.checkoutResponse?.result?.data?.account&&this.checkoutResponse?.result?.data?.bankName&&this.checkoutResponse?.result?.data?.reference?{account:this.checkoutResponse.result.data.account,bankName:this.checkoutResponse.result.data.bankName,reference:this.checkoutResponse.result.data.reference}:undefined}),this.displayConfig.checkoutSummary&&e("div",{class:"summary-price-details",style:{display:C(this.breakpoint,x.DESKTOP)?"block":"none"}},i({displayedComponents:["priceDetails"]})),this.displayConfig.submitButton&&!(o&&(this.isQrCodeVisible||this.isBankTransferVisible))&&e("div",{class:"payment-button-container"},e("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,trialPeriodDays:u.data?.itemInformation?.trial?.trialPeriodDays,onSubmit:()=>{s()},redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,isDisabled:u.data.fetchingInstallments,country:u.data?.pricing?.country}),e("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:p.translate("otp.secureMessage")}))),this.displayConfig.sandboxMode&&u.isSandbox&&u.data.sessionType===m.CHECKOUT_LANDING&&!C(this.breakpoint,x.DESKTOP)&&e("rebill-mode-sandbox",null)),this.displayConfig.footer&&e("rebill-footer",{style:{marginTop:C(this.breakpoint,x.DESKTOP)?"24px":"auto"}}))),this.displayConfig.checkoutSummary&&e("div",{class:"right-section-checkout"},e("div",{class:"checkout-summary-section"},e("div",{class:"summary-desktop",style:{display:!C(this.breakpoint,x.DESKTOP)?"block":"none"}},i()))))}})))}static get watchers(){return{language:["handleLanguageChange"]}}};F.style=O;export{F as rebill_checkout};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-D8cwEAmw.js";import{c as s}from"./p-MMCcKmy_.js";import{a as n}from"./p-CTo1s54i.js";import{m as a,g as o,P as r,C as l,i as c,a as h,b as d}from"./p-BP5Qpv7O.js";import{s as u,S as m,I as p,a as f,i as y,P as b,o as g,b as w}from"./p-DrG7nhj2.js";import{S as k}from"./p-vsLqF4hk.js";import{B as x,g as v,i as C}from"./p-Do_vNuMa.js";import{P as I,G as P}from"./p-Dn4NTa9d.js";import"./p-E-ZsRS8r.js";import"./p-D339jHg4.js";const S={checkoutSummary:true,submitButton:true,billingAddress:true,customerInformation:true,discountCode:true,logo:true,footer:true,sandboxMode:true,processingPayment:true,successPage:true,errorMessage:true};var M;(function(t){t["BAMBOO"]="bamboo_payment";t["FISERV"]="fiserv";t["KUSHKI"]="kushki";t["PAYWAY"]="payway";t["DOCK"]="dock";t["KLAP"]="klap";t["MOVII"]="movii";t["STRIPE"]="stripe";t["DECIDIR"]="decidir"})(M||(M={}));const N=async(t,i,e)=>{const s=await n.checkout.getRequiredFields({currency:t,method:i},e);return{fields:a(s.data),original:s.data}};const j=async()=>{const t=u.data?.itemInformation?.paymentMethods;const i=t.map((async t=>{try{const i=I.mapToAPMPaymentMethod(t,u.data?.pricing?.country);const e=await N(u.data.pricing.currency,i,u.data.organization.id);return{paymentMethod:t,...e}}catch(i){console.error(`Error getting required fields for ${t}:`,i);return{paymentMethod:t,fields:[],original:[]}}}));const e=await Promise.all(i);const s={};e.forEach((t=>{s[t.paymentMethod]={fields:t.fields,original:t.original}}));return s};const D=(t,i)=>{const e=i[t];if(e){return e}else{return{fields:[],original:[]}}};const R=t=>typeof t==="string"?JSON.parse(t):t;const T=t=>R(t);const q=()=>"190.188.127.250";const z=async({publicKey:t,instantProduct:i,instantPlan:e})=>{const s=R(i?i:e);const a=await n.sessions.createSDKInstantSessionRequest(s,o(),q(),t);const r={...a.data,...a.data.plan&&{plan:{...a.data.plan,description:s.description||[]}},...a.data.product&&{product:{...a.data.product,description:s.description||[]}}};const l=r;return l};const A=async({publicKey:t,productId:i,planId:e})=>{const s=await n.sessions.createSDKItemSessionRequest({...i?{productId:i}:{},...e?{planId:e}:{},idempotencyKey:o(),deviceId:"123123123",clientIP:q(),publicKey:t});const a=s.data;return a};const E=async({publicKey:t,checkoutLandingSession:i,instantProduct:e,instantPlan:s,productId:n,planId:a})=>{if(i){const t=await T(i);return{session:t,type:m.CHECKOUT_LANDING}}if(e||s){const i=await z({publicKey:t,instantProduct:e,instantPlan:s});return{session:i,type:m.INSTANT}}if(n||a){const i=await A({publicKey:t,productId:n,planId:a});return{session:i,type:m.SDK_ITEM}}};const O="@media (max-width: 1024px){.rebill-checkout{width:100%;flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section-checkout .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%}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}.rebill-checkout.full-width-layout .left-section{width:100%}.rebill-checkout.full-width-layout .left-section-container{max-width:none;width:100%}}@media (min-width: 1025px){.rebill-checkout{width:100%;min-height:600px;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-checkout{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;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%}.rebill-checkout.full-width-layout .left-section{width:100%;justify-content:stretch}.rebill-checkout.full-width-layout .left-section-container{max-width:none;min-width:auto;width:100%;margin:2.5rem 2rem 1.5rem 2rem}.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 F=class{constructor(e){t(this,e);this.error=i(this,"error");this.success=i(this,"success");this.successRedirect=i(this,"successRedirect");this.formChange=i(this,"formChange");this.paymentMethodSelected=i(this,"paymentMethodSelected")}productId;planId;publicKey;instantProduct;instantPlan;display;customerInformation;oneClickCheckout=true;css;language;async handleLanguageChange(t,i){if(t&&t!==i){try{await p.changeLanguage(t);f.changeLanguage(t);console.log(`[RebillCheckout] Language changed from ${i} to ${t}`)}catch(t){console.error("[RebillCheckout] Failed to change language:",t)}}}error;success;successRedirect;formChange;checkoutLandingSession;externalPayment;rejectedPaymentCard=false;rejectedPaymentAPM=false;countries=[];currentPaymentMethod;checkoutResponse=null;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;isAPMSubmitting=false;isAPMSuccess=false;storedCheckoutResults=new Map;alertErrorKeys=null;currentApmPaymentMethod=null;breakpoint=x.DESKTOP;showRefreshModal=false;cardError={showCardInvalid:false,type:null};initialData={};allRequiredFields={};currentRequiredFields=[];customerExists=false;showOtp=false;otpVerified=false;responseCheckoutCard=null;cardMode=null;formElement;emailDebounceTimeout=null;injectedStyleElement=null;get displayConfig(){if(!this.display){return S}if(typeof this.display==="string"){try{const t=JSON.parse(this.display);return{...S,...t}}catch(t){console.warn("Invalid display configuration string, using defaults:",t);return S}}return{...S,...this.display}}get parsedCustomerInformation(){if(!this.customerInformation){return null}if(typeof this.customerInformation==="string"){try{return JSON.parse(this.customerInformation)}catch(t){console.warn("Invalid customerInformation configuration string, ignoring:",t);return null}}return this.customerInformation}get filteredPaymentMethods(){const t=u.data?.itemInformation?.paymentMethods||[];const i=this.displayConfig.excludePaymentMethods;if(!i||i.length===0){return t}return t.filter((t=>!i.includes(t)))}getCombinedUserData(t={}){const i=u.data.userInformation;const e=this.parsedCustomerInformation;return{email:t?.email||e?.email||i.email,fullName:t?.fullName||e?.fullName||i.fullName,countryCodePhoneNumber:t?.countryCodePhoneNumber||e?.phoneNumber?.countryCode||e?.countryCode||i.countryCode,phoneNumber:t?.phoneNumber||e?.phoneNumber?.number||i.phoneNumber,documentType:t?.documentType||e?.documentType||i.documentType,documentNumber:t?.documentNumber||e?.documentNumber||i.documentNumber,"billing-country":t?.["billing-country"]||e?.address?.billingAddress?.country||i.address?.billingAddress?.country,"billing-state":t?.["billing-state"]||e?.address?.billingAddress?.state||i.address?.billingAddress?.state,"billing-address":t?.["billing-address"]||e?.address?.billingAddress?.address||i.address?.billingAddress?.address,"billing-city":t?.["billing-city"]||e?.address?.billingAddress?.city||i.address?.billingAddress?.city,"billing-zip":t?.["billing-zip"]||e?.address?.billingAddress?.zip||i.address?.billingAddress?.zip}}injectCustomCSS(){if(!this.css){return}this.cleanupInjectedCSS();const t=`rebill-checkout-css-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;if(this.css.startsWith("http://")||this.css.startsWith("https://")||this.css.startsWith("//")){const i=document.createElement("link");i.rel="stylesheet";i.href=this.css;i.id=t;i.setAttribute("data-rebill-injected","true");document.head.appendChild(i);this.injectedStyleElement=i}else{const i=document.createElement("style");i.id=t;i.setAttribute("data-rebill-injected","true");i.textContent=this.css;document.head.appendChild(i);this.injectedStyleElement=i}}cleanupInjectedCSS(){if(this.injectedStyleElement){try{this.injectedStyleElement.remove()}catch(t){console.warn("Error removing injected CSS:",t)}this.injectedStyleElement=null}}timeToRedirectAPM=5e3;resizeHandler=()=>{const t=v(window.innerWidth);if(t!==this.breakpoint){this.breakpoint=t}};disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler);if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout);this.emailDebounceTimeout=null}this.cleanupInjectedCSS()}async componentWillLoad(){try{this.resizeHandler();window.addEventListener("resize",this.resizeHandler);this.injectCustomCSS();if(this.language){await p.changeLanguage(this.language)}else{y()}const{session:t,type:i}=await E({publicKey:this.publicKey,checkoutLandingSession:this.checkoutLandingSession,instantProduct:this.instantProduct,instantPlan:this.instantPlan,productId:this.productId,planId:this.planId});f.initializeSession({session:t,type:i,payment:typeof this.externalPayment==="string"?JSON.parse(this.externalPayment):this.externalPayment});if(u.sessionRefreshed){this.showRefreshModal=true}P.loadGoogleMapsScript();const e=await n.data.getCountries();this.countries=e.data;this.initialData=this.getInitialData();this.allRequiredFields=await j();if(this.filteredPaymentMethods.length>0){if(u.data.paymentStatus===r.REJECTED||u.data.paymentStatus===r.APPROVED&&this.filteredPaymentMethods.includes(b.BANK_TRANSFER)){const t=this.filteredPaymentMethods.find((t=>t===b.BANK_TRANSFER));if(t){this.changePaymentMethod(t);f.setPaymentMethodSelected(t)}}else{this.changePaymentMethod(this.filteredPaymentMethods[0])}}if(this.oneClickCheckout){n.customers.exists({email:u.data?.prefilledData?.email},this.publicKey).then((t=>{this.customerExists=t.data.exists}))}this.cardMode=u.cardMode;g("cardMode",(()=>{this.cardMode=u.cardMode}))}catch(t){console.error("Error initializing checkout:",t)}}componentWillUpdate(){this.injectCustomCSS()}async changePaymentMethod(t){if(t!==this.currentPaymentMethod&&this.filteredPaymentMethods.includes(t)){if(this.checkoutResponse){this.checkoutResponse=null;f.clearCheckoutResponse()}this.currentPaymentMethod=t;f.setPaymentMethodSelected(t);if(t!==b.CARD){this.cardMode="input";f.setCardMode("input")}this.isSubmitting=false;this.currentApmPaymentMethod=I.mapToAPMPaymentMethod(t,u.data?.pricing?.country);if(t!==b.CASH&&t!==b.BANK_TRANSFER){this.checkoutResponse=null;f.clearCheckoutResponse()}else{this.checkoutResponse=null;f.clearCheckoutResponse()}this.paymentMethodSelected.emit(t);try{this.currentRequiredFields=D(t,this.allRequiredFields).fields;const i=await n.sessions.updateCurrentSessionPaymentMethod(u.data.sessionId,{paymentMethodName:I.mapToAPMPaymentMethod(t,u.data.pricing.country),paymentMethodType:t,currency:u.data.pricing.currency});f.setProviderKey(i.providerKey);if(i.providerKey===M.DECIDIR||u.data.providerKey===M.DECIDIR){const t=crypto.randomUUID();const i=await n.fingerPrint.getFingerPrint(t);u.deviceId=t;const e=i.result.script;const s=document.createElement("script");s.innerHTML=e;document.body.appendChild(s)}}catch(t){console.error("Failed to update payment method or get required fields:",t)}}}get currentPaymentError(){if(this.currentPaymentMethod===b.CARD){return this.rejectedPaymentCard}else if(this.currentPaymentMethod===b.CASH||this.currentPaymentMethod===b.BANK_TRANSFER){return this.rejectedPaymentAPM}return false}paymentMethodSelected;async handlePaymentMethodSelected(t){t.stopPropagation();const i=t.detail;this.changePaymentMethod(i);if(this.formElement){this.formElement.resetValidation()}}async handleSubmit(t){if(this.isSubmitting){return}this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false;if(this.currentPaymentMethod===b.CARD){this.handleSubmitCard(t)}else if(this.currentPaymentMethod===b.CASH||this.currentPaymentMethod===b.BANK_TRANSFER){this.handleSubmitAPM(t)}}handleFormChange(t){const i=t.detail;let e=true;let s={};if(this.formElement?.errors){s=this.formElement.errors;e=Object.keys(s).length===0}this.formChange.emit({data:i,isValid:e,errors:Object.keys(s).length>0?s:undefined})}async handleSubmitCard(t){const i=t.detail;const e=this.getCombinedUserData(i);if(!u.data.cardTokenId&&!u.data.cardId){this.cardError={showCardInvalid:true,type:"card_error"};return}if(!u.data.cardInformation&&!u.data.cardId){this.cardError={showCardInvalid:true,type:"tokenization_error"};return}this.cardError={showCardInvalid:false,type:null};const s={transaction:{quantity:1,...u.data.discount.couponCode&&{couponCode:u.data.discount.couponCode}},installments:Number(i.installments||u.data.cardInformation?.installments?.selectedInstallment?.installment),...u.data.cardTokenId&&{cardTokenId:u.data.cardTokenId,...u.data?.itemInformation?.type!==w.PLAN&&{saveCard:u.saveCard}},...u.data.cardId&&{cardId:u.data.cardId},...(!this.otpVerified||this.cardMode==="input")&&{customer:{firstName:e.fullName?.split(" ")[0],lastName:e.fullName?.split(" ").slice(1).join(" "),email:e.email,phone:{countryCode:e.countryCodePhoneNumber,number:e.phoneNumber}}},billingDetails:{address:{lineOne:e["billing-address"],city:e["billing-city"],state:e["billing-state"],country:e["billing-country"],zipCode:e["billing-zip"]},identification:{type:e.documentType,value:e.documentNumber}},customAttributes:{...u.deviceId&&{deviceId:u.deviceId}},...u.metadata&&{paymentMetadata:u.metadata}};const a=o();this.isSubmitting=true;this.isCardSubmitting=true;try{const t=await n.checkout.createCardCheckoutRequest(u.data.sessionId,a,s,u.data.accessToken||undefined);f.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;if(t.data.result?.status.toUpperCase()===l.APPROVED){this.isCardSuccess=true;f.setPaymentStatus(r.APPROVED);this.success.emit({paymentMethod:this.currentPaymentMethod,data:t.data});u.data.cardInformation.lastFour=t.data.result?.cardLastFour}else{this.error.emit({paymentMethod:this.currentPaymentMethod,data:t.data});f.setCheckoutResponse(t.data);this.rejectedPaymentCard=true;this.alertErrorKeys={message:t.data.result?.statusDetail.toLowerCase()??t.data.error?.error?.message?.toLowerCase()}}}catch(t){this.error.emit({paymentMethod:this.currentPaymentMethod,data:t.data});f.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;this.rejectedPaymentCard=true;this.alertErrorKeys={message:t.data?.error?.type?.toLowerCase()??t.data?.result?.statusDetail?.toLowerCase()}}finally{this.isSubmitting=false;this.isCardSubmitting=false}}async handleSubmitAPM(t){console.log("handleSubmitAPM",this.currentPaymentMethod);if(this.currentPaymentMethod!==b.CASH&&this.currentPaymentMethod!==b.BANK_TRANSFER){return}this.isSubmitting=true;const i=t.detail;const e=this.getCombinedUserData(i);try{const t={address:{country:e["billing-country"]||"",state:e["billing-state"]||"",city:e["billing-city"]||"",zipCode:e["billing-zip"]||"",lineOne:e["billing-address"]||""},identification:{type:e.documentType,value:e.documentNumber}};const s=this.currentApmPaymentMethod||I.mapToAPMPaymentMethod(this.currentPaymentMethod,u.data?.pricing?.country);const a={transaction:{quantity:1,...u.data.discount.couponCode&&{couponCode:u.data.discount.couponCode}},method:s,billingDetails:t,redirect:{approved:window.location.origin+"/payment/success",rejected:window.location.origin+"/payment/failure"},paymentMetadata:u.metadata,customAttributes:{bank:i.bankId||u.data?.bankId?.code}};{a.customer={firstName:e.fullName?.split(" ")[0]||"",lastName:e.fullName?.split(" ").slice(1).join(" ")||"",email:e.email,phone:{countryCode:e.countryCodePhoneNumber||"",number:e.phoneNumber||""}}}const r=o();const l=await n.checkout.createAPMCheckoutRequest(u.data.sessionId,r,a);this.isSubmitting=false;this.checkoutResponse=l.data;this.storedCheckoutResults.set(this.currentPaymentMethod,l.data);if(l.data?.date){u.data.paymentDate=l.data.date;u.createdAt=l.data.date}if(l.data?.traceId){u.data.paymentReference=l.data.traceId}}catch(t){this.isSubmitting=false;this.checkoutResponse=t.data;this.alertErrorKeys={message:t.data?.error?.type?.toLowerCase()??t.data?.result?.statusDetail?.toLowerCase()};this.rejectedPaymentAPM=true}}async submit(){if(this.formElement&&typeof this.formElement.submit==="function"){this.formElement.submit()}else{await this.handleSubmit({detail:{}})}}handlePaymentStatusChange=t=>{if(t.isCompleted){if(t.status===k.APPROVED){f.setPaymentStatus(r.APPROVED);this.success.emit({paymentMethod:this.currentPaymentMethod,data:this.checkoutResponse})}else if(t.status===k.REJECTED){f.setPaymentStatus(r.REJECTED);this.alertErrorKeys={alertTitle:r.APM_ERROR_GENERIC,message:r.APM_MESSAGE_ERROR}}}};async handleInputChange(t){if(t?.detail?.id==="email"&&this.oneClickCheckout){if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout)}if(!t.detail.value||t.detail.value.trim()===""){this.customerExists=false;f.clearCustomerIdAndToken();return}this.emailDebounceTimeout=setTimeout((async()=>{try{const t=await n.customers.exists({email:u.data.userInformation.email},this.publicKey);this.customerExists=t.data.exists}catch(t){this.customerExists=false}}),500)}}validationSchema={email:s().when([],{is:()=>!this.otpVerified,then:t=>t.email("validation.emailInvalid").matches(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"validation.emailInvalid").required("validation.emailRequired"),otherwise:t=>t.notRequired()}),fullName:s().when([],{is:()=>!this.otpVerified,then:t=>t.required("validation.fullNameRequired").matches(/^[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}\s+[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}$/,"validation.fullNameInvalid"),otherwise:t=>t.notRequired()}),isValidPhoneNumber:s().when([],{is:()=>c("phoneNumber",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.equals(["true"],"validation.phoneRequired"),otherwise:t=>t.notRequired()}),"billing-country":s().when([],{is:()=>c("billing-country",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.countryRequired"),otherwise:t=>t.notRequired()}),"billing-state":s().when([],{is:()=>c("billing-state",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.stateRequired"),otherwise:t=>t.notRequired()}),"billing-address":s().when([],{is:()=>c("billing-address",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.addressRequired"),otherwise:t=>t.notRequired()}),"billing-city":s().when([],{is:()=>c("billing-city",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.cityRequired"),otherwise:t=>t.notRequired()}),"billing-zip":s().when([],{is:()=>c("billing-zip",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.zipRequired"),otherwise:t=>t.notRequired()}),bankId:s().when([],{is:()=>c("bankId",this.currentRequiredFields),then:t=>t.required("validation.bankRequired"),otherwise:t=>t.notRequired()}),installments:s().when([],{is:()=>this.currentPaymentMethod===b.CARD&&u.data.cardInformation.installments.isAvailableInstallments&&u.data.cardInformation?.installments?.installments.length>0&&u.data.itemInformation.type!==w.PLAN,then:t=>t.required("validation.installmentsRequired"),otherwise:t=>t.notRequired()}),documentType:s().when([],{is:()=>c("documentType",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.documentTypeRequired"),otherwise:t=>t.notRequired()}),documentNumber:s().when([],{is:()=>c("documentNumber",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.documentNumberRequired").min(7,"validation.documentInvalid"),otherwise:t=>t.notRequired()})};getInitialData=()=>({email:u.data.userInformation.email||"",fullName:u.data.userInformation.fullName||"",phoneNumber:u.data.userInformation.phoneNumber?.number||"",countryCodePhoneNumber:u.data.userInformation.countryCode||"",documentType:"",documentNumber:"","billing-country":u.data.userInformation.address?.billingAddress?.country||"","billing-state":u.data.userInformation?.address?.billingAddress?.state||"","billing-address":u.data.userInformation?.address?.billingAddress?.address||"","billing-city":u.data.userInformation?.address?.billingAddress?.city||"","billing-zip":u.data.userInformation?.address?.billingAddress?.zip||"",bankId:u.data.bankId?.code||"",card:"",installments:u.data.cardInformation?.installments?.selectedInstallment?.installment?.toString()||""});hasPrefilledAddress=()=>{const t=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return t.some((t=>{const i=this.initialData[t];return i&&i.trim()!==""}))};get isQrCodeVisible(){return!!this.checkoutResponse?.result?.data?.qrCode}get isBankTransferVisible(){return!!this.checkoutResponse?.result?.data?.account&&!!this.checkoutResponse?.result?.data?.bankName&&!!this.checkoutResponse?.result?.data?.reference}isPaymentApproved=()=>{if(u.data.paymentStatus===r.APPROVED){return true}return false};handleRebillAccountClick(t){this.showOtp=t.detail}handleReturnForm(t){this.showOtp=t.detail;f.clearCustomerIdAndToken()}handleSignOut(){this.showOtp=false;this.otpVerified=false;if(!u?.data?.prefilledData?.email){this.customerExists=false}f.clearCustomerIdAndToken();f.clearUserInformation();this.cardError={showCardInvalid:false,type:null};this.alertErrorKeys=null;this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false}handleCodeVerified(){this.otpVerified=true;this.showOtp=false;this.rejectedPaymentCard=false;this.alertErrorKeys=null;this.cardError={showCardInvalid:false,type:null};if(this.formElement){this.formElement.resetValidation()}}isPaymentRejected(){return u.data.paymentStatus===r.REJECTED&&this.currentPaymentMethod===b.BANK_TRANSFER}render(){const t=this.countries.map((t=>({label:t.country,value:t.isoCountryCode})));const i=(t={})=>e("rebill-summary",{key:"889ee4307f38fbed3dd973d68d4e71979519b971",totalAmount:u.data.pricing.total,currency:u.data.pricing.currency,itemTitle:u._session?.getTitle(),itemDescription:u._session?.getDescription(),itemAmount:u.data.pricing.subtotal,subtotal:u.data.pricing.subtotal,allowCoupon:u._session?.getAllowCoupon(this.displayConfig),currentBreakpoint:this.breakpoint,planFrequency:u._session?.getPlanFrequency(),planFrequencyCount:u._session?.getPlanFrequencyCount(),discountType:u.data.discount.discountType,discountedPercentage:u.data.discount.discountedPercentage,discountDuration:u.data.discount.discountDuration,discountAmount:u.data.discount.discountAmount,...t});return u.isInitialized&&e(e.Fragment,null,this.showRefreshModal&&e("rebill-modal-overlay",{key:"ab3333710743b424ad676702aba95f4c2ea83f92"}),this.displayConfig.processingPayment&&e("rebill-processing-payment",{key:"30e84979156a983056fe59ed1d684dafc0adc1d9",style:{display:this.isCardSubmitting?"block":"none"}}),this.displayConfig.successPage&&this.isPaymentApproved()&&u.isInitialized?e("success-page",{typePaymentMethod:u.data.paymentMethodSelected,paymentMethodName:I.mapToAPMPaymentMethod(u.data.paymentMethodSelected||u.data.payment?.paymentMethodType,u.data?.pricing?.country),country:u.data?.pricing?.country,bank:u.data.payment?.paymentMethodMetadata?.bank||u.data.payment?.paymentMethodMetadata?.bank,cardLastFour:this.responseCheckoutCard?.result?.cardLastFour||u.data.cardInformation?.lastFour,paymentDate:u.data.paymentDate||this.responseCheckoutCard?.date||u.data.payment?.createdAt||this.checkoutResponse?.result?.data?.createdAt,referenceNumber:u.data.paymentReference||u.data.payment?.traceId||this.responseCheckoutCard?.traceId,onSuccessRedirect:t=>{this.successRedirect.emit(t.detail)},trialPeriodDays:u.data?.itemInformation?.trial?.trialPeriodDays,debitDay:u.data?.itemInformation?.debitDay,planAmount:u.data?.pricing?.planAmount}):e(e.Fragment,null,this.displayConfig.sandboxMode&&u.isSandbox&&u.data.sessionType===m.CHECKOUT_LANDING&&C(this.breakpoint,x.DESKTOP)&&e("div",{class:"mode-sandbox-mobile-container",style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"}},e("rebill-mode-sandbox-mobile",null)),e("rebill-checkout-form",{ref:t=>this.formElement=t,style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:t=>this.handleSubmit(t),onChange:t=>this.handleFormChange(t),renderForm:({submit:s,formData:n,errors:a})=>{const o=!this.isCardSuccess&&this.checkoutResponse?.result&&(this.currentPaymentMethod===b.CASH||this.currentPaymentMethod===b.BANK_TRANSFER);return e("div",{class:`rebill-checkout ${!this.displayConfig.checkoutSummary?"full-width-layout":""}`},e("div",{class:"left-section"},e("div",{class:"left-section-container"},this.displayConfig.logo&&e("organization-logo",{organization:u.data.organization}),e("div",{class:"otp-container",style:{display:this.showOtp?"block":"none"}},e("otp-component",null)),e("div",{style:{display:this.showOtp?"none":"block"}},e("div",{class:"checkout-form-section"},this.displayConfig.checkoutSummary&&e("div",{class:"summary-mobile-tablet",style:{display:C(this.breakpoint,x.DESKTOP)?"block":"none"}},i({displayedComponents:["totalAmount","discount","timelineFreeTrial","timelineDebitDay","itemDetails"]})),!this.otpVerified&&this.displayConfig.customerInformation&&e("user-information",{customerExists:this.customerExists,disabled:this.isSubmitting,errors:{email:a.email,fullName:a.fullName}}),this.otpVerified&&this.displayConfig.customerInformation&&e("user-information-static",{variant:"otp",userInfo:{customerName:u.data.userInformation.fullName?.split(" ")[0],customerEmail:u.data.userInformation.email}}),e("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},e("payment-method-selector",{enabledPaymentMethods:this.filteredPaymentMethods,defaultSelected:this.currentPaymentMethod,disabled:this.isSubmitting,errorComponent:{showErrorComponent:this.displayConfig.errorMessage&&(this.currentPaymentError||this.isPaymentRejected()),alertTitle:h.getErrorTitle(this.currentPaymentMethod,u.data?.pricing?.country||"",this.alertErrorKeys?.alertTitle),message:h.getErrorMessage(this.alertErrorKeys?.message,this.currentPaymentMethod,u.data?.pricing?.country)},country:u.data?.pricing?.country,installmentsError:a.installments,showDocument:(!this.otpVerified||this.otpVerified&&this.cardMode==="input")&&!o&&!this.isQrCodeVisible&&(c("documentNumber",this.currentRequiredFields)||c("documentType",this.currentRequiredFields)),documentTypeError:a.documentType,documentNumberError:a.documentNumber,cardError:this.cardError,customCSS:this.css}),!o&&(()=>{const t=c("bankId",this.currentRequiredFields);return t})()&&e("div",{class:"animated-component fade-in"},e("rebill-bank-selector",{banks:d("bank",this.allRequiredFields[this.currentPaymentMethod].original)||[],defaultSelectedBankId:n.bankId||"",error:a?.bankId,disabled:this.isSubmitting}))),!o&&(!this.otpVerified||this.cardMode==="input")&&e(e.Fragment,null,this.displayConfig.billingAddress&&(c("billing-country",this.currentRequiredFields)||c("billing-state",this.currentRequiredFields)||c("billing-address",this.currentRequiredFields)||c("billing-city",this.currentRequiredFields)||c("billing-zip",this.currentRequiredFields))&&e("div",{class:"animated-component slide-in"},e("rebill-address",{disabled:this.isSubmitting,countryOptions:t,billingView:this.hasPrefilledAddress()?"form":"search",errors:{"billing-country":a["billing-country"],"billing-state":a["billing-state"],"billing-address":a["billing-address"],"billing-city":a["billing-city"],"billing-zip":a["billing-zip"]}})),this.displayConfig.customerInformation&&c("phoneNumber",this.currentRequiredFields)&&e("div",{class:"animated-component fade-in"},e("user-information-phone",{disabled:this.isSubmitting,error:a?.phoneNumber,countryCode:u.data.userInformation?.countryCode||u.data.country}))),o&&e("apm-checkout",{paymentMethod:this.currentPaymentMethod,referenceId:this.currentPaymentMethod===b.CASH?this.checkoutResponse?.result?.data?.referenceId:undefined,qrCodeData:this.currentPaymentMethod===b.BANK_TRANSFER?this.checkoutResponse?.result?.data?.qrCode:undefined,checkoutRequestId:this.checkoutResponse?.result?.checkoutRequestId,providerName:u.data.providerKey,expirationDate:(()=>{const t=new Date;t.setDate(t.getDate()+30);return t.toISOString()})(),onPaymentStatusChange:t=>this.handlePaymentStatusChange(t.detail),country:u.data?.pricing?.country,redirectUrl:this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,bearerToken:this.checkoutResponse?.result?.data?.bearerToken,bankTransferData:this.checkoutResponse?.result?.data?.account&&this.checkoutResponse?.result?.data?.bankName&&this.checkoutResponse?.result?.data?.reference?{account:this.checkoutResponse.result.data.account,bankName:this.checkoutResponse.result.data.bankName,reference:this.checkoutResponse.result.data.reference}:undefined}),this.displayConfig.checkoutSummary&&e("div",{class:"summary-price-details",style:{display:C(this.breakpoint,x.DESKTOP)?"block":"none"}},i({displayedComponents:["priceDetails"]})),this.displayConfig.submitButton&&!(o&&(this.isQrCodeVisible||this.isBankTransferVisible))&&e("div",{class:"payment-button-container"},e("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,trialPeriodDays:u.data?.itemInformation?.trial?.trialPeriodDays,onSubmit:()=>{s()},redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,isDisabled:u.data.fetchingInstallments,country:u.data?.pricing?.country}),e("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:p.translate("otp.secureMessage")}))),this.displayConfig.sandboxMode&&u.isSandbox&&u.data.sessionType===m.CHECKOUT_LANDING&&!C(this.breakpoint,x.DESKTOP)&&e("rebill-mode-sandbox",null)),this.displayConfig.footer&&e("rebill-footer",{style:{marginTop:C(this.breakpoint,x.DESKTOP)?"24px":"auto"}}))),this.displayConfig.checkoutSummary&&e("div",{class:"right-section-checkout"},e("div",{class:"checkout-summary-section"},e("div",{class:"summary-desktop",style:{display:!C(this.breakpoint,x.DESKTOP)?"block":"none"}},i()))))}})))}static get watchers(){return{language:["handleLanguageChange"]}}};F.style=O;export{F as rebill_checkout};
|
|
2
|
+
//# sourceMappingURL=p-9afddef2.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{P as r,I as e}from"./p-DrG7nhj2.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["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.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")}}const o={"customer.email":"email","customer.first_name":"fullName","customer.last_name":"fullName","customer.identification":"documentNumber","customer.identification_type":"documentType","address.line_one":"billing-address","address.zip_code":"billing-zip","address.state":"billing-state","address.city":"billing-city","address.country":"billing-country","phone.number":"phoneNumber","phone.country_code":"countryCodePhoneNumber",bank:"bankId"};const s=r=>{if(!r||!Array.isArray(r)){return[]}const e=new Set;r.forEach((r=>{const n=o[r.name];if(n){e.add(n)}else{e.add(r.name)}}));return Array.from(e)};const
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{P as r,I as e}from"./p-DrG7nhj2.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["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.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")}}const o={"customer.email":"email","customer.first_name":"fullName","customer.last_name":"fullName","customer.identification":"documentNumber","customer.identification_type":"documentType","address.line_one":"billing-address","address.line_two":"billing-address","address.zip_code":"billing-zip","address.state":"billing-state","address.city":"billing-city","address.country":"billing-country","phone.number":"phoneNumber","phone.country_code":"countryCodePhoneNumber",bank:"bankId"};const s=r=>{if(!r||!Array.isArray(r)){return[]}const e=new Set;r.forEach((r=>{const n=o[r.name];if(n){e.add(n)}else{e.add(r.name)}}));return Array.from(e)};const d=(r,e)=>{if(!e||!Array.isArray(e)){return false}return e.includes(r)};const m=(r,e)=>{if(!e||!Array.isArray(e)){return null}const n=e.find((e=>e.name===r));return n?.values||null};export{n as C,t as P,i as a,m as b,a as g,d as i,s as m};
|
|
2
|
+
//# sourceMappingURL=p-BP5Qpv7O.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-Bz-GsiI3.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","src/utils/required-fields-mappers.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 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 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","export interface RequiredField {\n name: string;\n values?: {\n code: string;\n name: string;\n }[];\n}\n\nconst requiredFieldsMapper = {\n 'customer.email': 'email',\n 'customer.first_name': 'fullName',\n 'customer.last_name': 'fullName',\n 'customer.identification': 'documentNumber',\n 'customer.identification_type': 'documentType',\n\n 'address.line_one': 'billing-address',\n 'address.zip_code': 'billing-zip',\n 'address.state': 'billing-state',\n 'address.city': 'billing-city',\n 'address.country': 'billing-country',\n\n 'phone.number': 'phoneNumber',\n 'phone.country_code': 'countryCodePhoneNumber',\n\n 'bank': 'bankId',\n};\n\nexport const mapRequiredFields = (apiFields: RequiredField[]): string[] => {\n if (!apiFields || !Array.isArray(apiFields)) {\n return [];\n }\n\n const uniqueFields = new Set<string>();\n\n apiFields.forEach(field => {\n const mappedField = requiredFieldsMapper[field.name];\n if (mappedField) {\n uniqueFields.add(mappedField);\n } else {\n uniqueFields.add(field.name);\n }\n });\n\n return Array.from(uniqueFields);\n};\n\nexport const isFieldRequired = (fieldName: string, mappedFields: string[]): boolean => {\n if (!mappedFields || !Array.isArray(mappedFields)) {\n return false;\n }\n return mappedFields.includes(fieldName);\n};\n\nexport const getFieldValues = (\n fieldName: string,\n requiredFields: RequiredField[],\n): Array<{ code: string; name: string }> | null => {\n if (!requiredFields || !Array.isArray(requiredFields)) {\n return null;\n }\n\n const field = requiredFields.find(f => f.name === fieldName);\n return field?.values || null;\n};\n\nexport const hasFieldValues = (fieldName: string, requiredFields: RequiredField[]): boolean => {\n const values = getFieldValues(fieldName, requiredFields);\n return values !== null && values.length > 0;\n};\n\nexport default requiredFieldsMapper;\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;AACvB,IAAA,eAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC;AACzC,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjC,IAAA,eAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AA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B,cAA+B,KACiB;IAChD,IAAI,CAAC,cAAc,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;AACrD,QAAA,OAAO,IAAI;;AAGb,IAAA,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;AAC5D,IAAA,OAAO,KAAK,EAAE,MAAM,IAAI,IAAI;AAC9B;;;;"}
|
|
1
|
+
{"version":3,"file":"p-BP5Qpv7O.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","src/utils/required-fields-mappers.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 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 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","export interface RequiredField {\n name: string;\n values?: {\n code: string;\n name: string;\n }[];\n}\n\nconst requiredFieldsMapper = {\n 'customer.email': 'email',\n 'customer.first_name': 'fullName',\n 'customer.last_name': 'fullName',\n 'customer.identification': 'documentNumber',\n 'customer.identification_type': 'documentType',\n\n 'address.line_one': 'billing-address',\n 'address.line_two': 'billing-address',\n 'address.zip_code': 'billing-zip',\n 'address.state': 'billing-state',\n 'address.city': 'billing-city',\n 'address.country': 'billing-country',\n\n 'phone.number': 'phoneNumber',\n 'phone.country_code': 'countryCodePhoneNumber',\n\n 'bank': 'bankId',\n};\n\nexport const mapRequiredFields = (apiFields: RequiredField[]): string[] => {\n if (!apiFields || !Array.isArray(apiFields)) {\n return [];\n }\n\n const uniqueFields = new Set<string>();\n\n apiFields.forEach(field => {\n const mappedField = requiredFieldsMapper[field.name];\n if (mappedField) {\n uniqueFields.add(mappedField);\n } else {\n uniqueFields.add(field.name);\n }\n });\n\n return Array.from(uniqueFields);\n};\n\nexport const isFieldRequired = (fieldName: string, mappedFields: string[]): boolean => {\n if (!mappedFields || !Array.isArray(mappedFields)) {\n return false;\n }\n return mappedFields.includes(fieldName);\n};\n\nexport const getFieldValues = (\n fieldName: string,\n requiredFields: RequiredField[],\n): Array<{ code: string; name: string }> | null => {\n if (!requiredFields || !Array.isArray(requiredFields)) {\n return null;\n }\n\n const field = requiredFields.find(f => f.name === fieldName);\n return field?.values || null;\n};\n\nexport const hasFieldValues = (fieldName: string, requiredFields: RequiredField[]): boolean => {\n const values = getFieldValues(fieldName, requiredFields);\n return values !== null && values.length > 0;\n};\n\nexport default requiredFieldsMapper;\n"],"names":[],"mappings":";;AAGA;AACY,IAAA;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,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