@spot-flow/checkout-inline-js 0.1.36 → 0.1.37
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.
|
@@ -29749,6 +29749,7 @@ class Hd {
|
|
|
29749
29749
|
this.currentStep = 7;
|
|
29750
29750
|
return;
|
|
29751
29751
|
}
|
|
29752
|
+
this.currentStep = 10;
|
|
29752
29753
|
}
|
|
29753
29754
|
}).catch((a) => {
|
|
29754
29755
|
P.track("verify_payment", {
|
|
@@ -29834,6 +29835,7 @@ class Hd {
|
|
|
29834
29835
|
this.cardResponse = l, this.currentStep = 3;
|
|
29835
29836
|
return;
|
|
29836
29837
|
}
|
|
29838
|
+
this.currentStep = 10;
|
|
29837
29839
|
}
|
|
29838
29840
|
}).catch((l) => {
|
|
29839
29841
|
this.currentStep = 4, P.track("verify_payment", {
|
|
@@ -29862,7 +29864,7 @@ class Hd {
|
|
|
29862
29864
|
this.rdtCode,
|
|
29863
29865
|
this.url
|
|
29864
29866
|
).then(({ data: o, headers: a }) => {
|
|
29865
|
-
var l, d, b, v, g, f, y
|
|
29867
|
+
var l, d, b, v, g, f, y;
|
|
29866
29868
|
if (o.status === "failed")
|
|
29867
29869
|
this.currentStep = 4, P.track("verify_payment", {
|
|
29868
29870
|
payment_method: "Card",
|
|
@@ -29884,15 +29886,11 @@ class Hd {
|
|
|
29884
29886
|
(b = o == null ? void 0 : o.authorization) != null && b.redirectUrl && this.redirectTo3DS((v = o == null ? void 0 : o.authorization) == null ? void 0 : v.redirectUrl), (g = o == null ? void 0 : o.authorization) != null && g.embeddedHtml && this.redirectToPreciumDoc((f = o == null ? void 0 : o.authorization) == null ? void 0 : f.embeddedHtml);
|
|
29885
29887
|
return;
|
|
29886
29888
|
}
|
|
29887
|
-
if (((y = o == null ? void 0 : o.authorization) == null ? void 0 : y.mode) === "
|
|
29888
|
-
this.cardResponse = o, this.currentStep = 3;
|
|
29889
|
-
return;
|
|
29890
|
-
}
|
|
29891
|
-
if (((k = o == null ? void 0 : o.authorization) == null ? void 0 : k.mode) === "avs") {
|
|
29889
|
+
if (((y = o == null ? void 0 : o.authorization) == null ? void 0 : y.mode) === "avs") {
|
|
29892
29890
|
this.currentStep = 7;
|
|
29893
29891
|
return;
|
|
29894
29892
|
}
|
|
29895
|
-
this.currentStep =
|
|
29893
|
+
this.currentStep = 10;
|
|
29896
29894
|
}
|
|
29897
29895
|
}).catch((o) => {
|
|
29898
29896
|
this.currentStep = 4, P.track("verify_payment", {
|
|
@@ -34590,8 +34588,7 @@ const ou = `<div class="flex items-center justify-center md:justify-between w-fu
|
|
|
34590
34588
|
<div class="flex justify-between items-center">
|
|
34591
34589
|
<span class="text-tone-60 font-medium text-sm">Number</span>
|
|
34592
34590
|
<div class="flex items-center gap-1">
|
|
34593
|
-
<span data-copy-value="4111112000062555" class="text-tone-100 text-sm font-medium">
|
|
34594
|
-
2555 </span>
|
|
34591
|
+
<span data-copy-value="4111112000062555" class="text-tone-100 text-sm font-medium">4111112000062555</span>
|
|
34595
34592
|
<button class="copy-btn p-1 hover:opacity-80 transition-opacity">
|
|
34596
34593
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
34597
34594
|
<path
|
|
@@ -34775,7 +34772,7 @@ const ou = `<div class="flex items-center justify-center md:justify-between w-fu
|
|
|
34775
34772
|
<span class="text-tone-60 font-medium text-sm">Number</span>
|
|
34776
34773
|
<div class="flex items-center gap-1">
|
|
34777
34774
|
<span data-copy-value="5555558684543932"
|
|
34778
|
-
class="text-tone-100 text-sm font-medium">
|
|
34775
|
+
class="text-tone-100 text-sm font-medium">5555577124976817 </span>
|
|
34779
34776
|
<button class="copy-btn p-1 hover:opacity-80 transition-opacity">
|
|
34780
34777
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
34781
34778
|
xmlns="http://www.w3.org/2000/svg">
|
package/dist/checkout-inline.js
CHANGED
|
@@ -853,7 +853,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
853
853
|
<path
|
|
854
854
|
d="M62 32C62 38.6156 59.8132 45.0457 55.78 50.2897C51.7468 55.5336 46.0932 59.2974 39.6992 60.9952C33.3052 62.693 26.5293 62.2297 20.4258 59.6774C14.3224 57.1251 9.2338 52.6268 5.95186 46.8827C2.66993 41.1385 1.37873 34.4707 2.2792 27.9166C3.17967 21.3626 6.22129 15.29 10.9308 10.6438C15.6402 5.9976 21.7534 3.0384 28.3191 2.22668C34.8847 1.41496 41.5345 2.79623 47.2337 6.15557"
|
|
855
855
|
stroke="black" stroke-width="4" stroke-linejoin="round" />
|
|
856
|
-
</svg>`),o&&o.classList.add("hidden"),li(this.token,i,this.rdtCode,this.url).then(({data:a,headers:l})=>{var d,v,p,g,f,y,w;if(a.status==="failed")P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN"}),this.currentStep=4,a.providerMessage?this.warningScreen.setPaymentError(a.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(a.status))this.currentStep=5,this.redirectTo(a,l,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"});else{if(((d=a==null?void 0:a.authorization)==null?void 0:d.mode)==="3DS"){(v=a==null?void 0:a.authorization)!=null&&v.redirectUrl&&this.redirectTo3DS((p=a==null?void 0:a.authorization)==null?void 0:p.redirectUrl),(g=a==null?void 0:a.authorization)!=null&&g.embeddedHtml&&this.redirectToPreciumDoc((f=a==null?void 0:a.authorization)==null?void 0:f.embeddedHtml);return}if(((y=a==null?void 0:a.authorization)==null?void 0:y.mode)==="otp"){this.cardResponse=a,this.currentStep=3;return}if(((w=a==null?void 0:a.authorization)==null?void 0:w.mode)==="avs"){this.currentStep=7;return}}}).catch(a=>{P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"PIN"}),this.currentStep=4,a.message?this.warningScreen.setPaymentError(a.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()})},300)}}showLoader(){this.pageLoader=new De(this.contents),this.pageLoader.mountLoader()}pinErrorStates(e,i,t){const o=this.container.querySelector("#pin-error");o&&(o.innerHTML=e||"Payment Failed"),t&&t.classList.remove("hidden"),i&&(i.innerHTML="")}setPaymentError(e){const i=this.container.querySelector("#payment-warning-text"),t=this.container.querySelector(".warning-list");i&&(i.textContent=e),t&&[{text:"Try again with your card",action:"go-to-card"},{text:"Try again with transfer",action:"go-to-transfer"}].forEach(({action:s,text:a})=>{const l=document.createElement("button");l.textContent=a,l.setAttribute("id",s),l.classList.add("warning-button");const d=document.createElement("div");d.appendChild(l),t.appendChild(d)})}validatedAVS(e,i){e.stopPropagation(),e.preventDefault();const t=this.container.querySelector(".spinner"),o=this.container.querySelector("#avs-form-button-text"),s={authorization:{avs:{state:i==null?void 0:i.state,city:i==null?void 0:i.city,country:i==null?void 0:i.country,address:i==null?void 0:i.address,zipCode:(i==null?void 0:i.code)||"-"}},reference:this.activeRef};P.track("input_address",{payment_method:"Card",authentication_type:"AVS"}),t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),li(this.token,s,this.rdtCode,this.url).then(({data:l,headers:d})=>{var v,p,g,f,y,w,C;if(l.status==="failed")this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"AVS"}),l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(l.status))["success","successful"].includes(l.status)&&(this.currentStep=5,this.redirectTo(l,d,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"AVS"}));else{if(((v=l==null?void 0:l.authorization)==null?void 0:v.mode)==="pin"){this.currentStep=2;return}if(((p=l==null?void 0:l.authorization)==null?void 0:p.mode)==="3DS"){(g=l==null?void 0:l.authorization)!=null&&g.redirectUrl&&this.redirectTo3DS((f=l==null?void 0:l.authorization)==null?void 0:f.redirectUrl),(y=l==null?void 0:l.authorization)!=null&&y.embeddedHtml&&this.redirectToPreciumDoc((w=l==null?void 0:l.authorization)==null?void 0:w.embeddedHtml);return}if(((C=l==null?void 0:l.authorization)==null?void 0:C.mode)==="otp"){this.cardResponse=l,this.currentStep=3;return}}}).catch(l=>{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"AVS"}),l.message?this.warningScreen.setPaymentError(l.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}submitOtp(e,i){e.preventDefault();const t={authorization:{otp:i},reference:this.activeRef};this.currentStep=6,this.showLoader(),P.track("input_cardOTP",{payment_method:"Card",authentication_type:"PIN+0TP"}),li(this.token,t,this.rdtCode,this.url).then(({data:s,headers:a})=>{var l,d,v,p,g,f,y,w;if(s.status==="failed")this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN+0TP"}),s.providerMessage?this.warningScreen.setPaymentError(s.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(s.status))["success","successful"].includes(s.status)&&(this.currentStep=5,this.redirectTo(s,a,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN+0TP"}));else{if(this.activeRef=s.reference,((l=s==null?void 0:s.authorization)==null?void 0:l.mode)==="pin"){this.currentStep=2;return}if(((d=s==null?void 0:s.authorization)==null?void 0:d.mode)==="3DS"){(v=s==null?void 0:s.authorization)!=null&&v.redirectUrl&&this.redirectTo3DS((p=s==null?void 0:s.authorization)==null?void 0:p.redirectUrl),(g=s==null?void 0:s.authorization)!=null&&g.embeddedHtml&&this.redirectToPreciumDoc((f=s==null?void 0:s.authorization)==null?void 0:f.embeddedHtml);return}if(((y=s==null?void 0:s.authorization)==null?void 0:y.mode)==="otp"){this.cardResponse=s,this.currentStep=3;return}if(((w=s==null?void 0:s.authorization)==null?void 0:w.mode)==="avs"){this.currentStep=7;return}this.currentStep=9}}).catch(s=>{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN+0TP"}),s.message?this.warningScreen.setPaymentError(s.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()})}redirectTo3DS(e){const i=window.open("","_blank");if(!i){alert("Please enable popups for this site to complete the authentication.");return}i.location.href=e,P.track("auth_redirect",{payment_method:"Card",authentication_type:"3DS"}),this.currentStep=6,this.showLoader();const t=setInterval(()=>{i.closed&&(clearInterval(t),this.verifyPayment(({data:o,headers:s})=>{this.currentStep=5,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"3DS"}),this.redirectTo(o,s,"success")},({data:o})=>{this.currentStep=4,o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue(),P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"3DS"})}))},2e3)}redirectToPreciumDoc(e){const i=atob(e),t=new Blob([i],{type:"text/html"}),o=URL.createObjectURL(t),s=window.open(o,"_blank");if(s){s.document.close(),P.track("auth_redirect",{payment_method:"Card",authentication_type:"3DS"}),this.currentStep=6,this.showLoader();const a=setInterval(()=>{s.closed&&(clearInterval(a),this.verifyPayment(({data:l,headers:d})=>{this.currentStep=5,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"3DS"}),this.redirectTo(l,d,"success")},({data:l})=>{this.currentStep=4,l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue(),P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"3DS"})}))},2e3)}else alert("Please enable popups for this site to complete the authentication.")}async verifyPayment(e,i){try{const t=await sn(this.token,this.activeRef,void 0,this.rdtCode,this.url);t.data.status==="failed"?i(t):(["success","successful"].includes(t.data.status)&&e(t),t.data.status==="inProgress"&&(this.currentStep=10))}catch{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"3DS"}),this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue()}}async verifyPaymentProcess(){try{const e=await sn(this.token,this.reference,void 0,this.rdtCode,this.url);this.cardResponse=e.data,this.cardResponseHeader=e.headers}catch{this.currentStep=4}}goBackToMerchant(){this.redirectTo(this.cardResponse,this.cardResponseHeader,this.callBackUrl)}renderCardContent(e){var t,o;e&&(this.merchantPlanDetail=e);const i=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),i==null||i.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents){switch(this.currentStep){case 1:this.cardDetailForm=new Rt({container:this.contents,onAction:a=>l=>this.submitCardDetails.bind(this)(a,l),merchantName:this.merchantPlanDetail.merchantName,currency:this.localCurrency!==this.currency?this.localCurrency:this.currency}),this.cardDetailForm.renderContent();break;case 2:this.cardPinForm=new qs({container:this.contents,onClose:this.onClose,onAction:a=>this.handlePinRequest.bind(this)(a)}),this.cardPinForm.renderComponent();break;case 3:this.cardOtpValidationForm=new zs({container:this.contents,onClose:this.onClose,onAction:a=>l=>this.submitOtp.bind(this)(a,l),otpMessage:((t=this.cardResponse)==null?void 0:t.providerMessage)||"Please enter your OTP sent to your phone"}),this.cardOtpValidationForm.renderComponent();break;case 4:this.warningScreen=new gn({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this.currentStep=8}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 5:this.successScreen=new Fn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(o=this.merchantPlanDetail)==null?void 0:o.rate.rate}),this.successScreen.renderComponent();break;case 6:this.pageLoader=new De(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 7:this.avsForm=new Js({container:this.contents,onAction:a=>l=>this.validatedAVS.bind(this)(a,l)}),this.avsForm.renderComponent();break;case 8:this.transactionIssuesScreen=new hi({container:this.contents,onAction:()=>{var a;this.currentStep=4,this.warningScreen.setPaymentError(((a=this.cardResponse)==null?void 0:a.providerMessage)||"Payment failed")},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"card",callBackUrl:this.callBackUrl,paymentResponse:this.cardResponse,paymentResponseHeaders:this.cardResponseHeader}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;case 9:this.confirmationEnd=new Wo({container:this.contents,onAction:a=>{this.currentStep=a},ref:this.reference,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.cardResponse,paymentResponseHeaders:this.cardResponseHeader}),this.confirmationEnd.renderComponent();break;case 10:this.confirmationProgress=new zr({container:this.contents,onAction:a=>{this.currentStep=a},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(a,l)=>{this.cardResponse=a,this.cardResponseHeader=l},step:{failed:4,success:5,end:9},paymentMethod:"Card"}),this.confirmationProgress.renderComponent();break;default:this.cardDetailForm=new Rt({container:this.contents,onAction:a=>l=>this.submitCardDetails.bind(this)(a,l),merchantName:this.merchantPlanDetail.merchantName,currency:this.localCurrency?this.localCurrency:this.currency}),this.cardDetailForm.renderContent();break}this.displayButtonText();const s=this.container.querySelector("#card-currency");s&&(s.textContent=`${this.localCurrency?this.localCurrency:this.currency} Card`)}}redirectTo(e,i,t){const o=i.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",e.status),s.searchParams.append("reference",e.reference),window.location.href=s.toString()},1800):t==="success"&&this.onSuccess(e)}displayButtonText(e){var t,o,s,a;const i=this.container.querySelector("#details-form-button-text");if(i){const l=this.currency,d=l==="USD"?(o=(t=this.merchantPlanDetail)==null?void 0:t.rate)==null?void 0:o.from:l;e?i.textContent=e:i.textContent=`Continue to pay ${d} ${xe(this.totalAmount!==this.amount?this.totalAmount:(this.amount||0)*(l==="USD"?(a=(s=this.merchantPlanDetail)==null?void 0:s.rate)==null?void 0:a.rate:1),2)}`}}}const qr=`<div>
|
|
856
|
+
</svg>`),o&&o.classList.add("hidden"),li(this.token,i,this.rdtCode,this.url).then(({data:a,headers:l})=>{var d,v,p,g,f,y,w;if(a.status==="failed")P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN"}),this.currentStep=4,a.providerMessage?this.warningScreen.setPaymentError(a.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(a.status))this.currentStep=5,this.redirectTo(a,l,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"});else{if(((d=a==null?void 0:a.authorization)==null?void 0:d.mode)==="3DS"){(v=a==null?void 0:a.authorization)!=null&&v.redirectUrl&&this.redirectTo3DS((p=a==null?void 0:a.authorization)==null?void 0:p.redirectUrl),(g=a==null?void 0:a.authorization)!=null&&g.embeddedHtml&&this.redirectToPreciumDoc((f=a==null?void 0:a.authorization)==null?void 0:f.embeddedHtml);return}if(((y=a==null?void 0:a.authorization)==null?void 0:y.mode)==="otp"){this.cardResponse=a,this.currentStep=3;return}if(((w=a==null?void 0:a.authorization)==null?void 0:w.mode)==="avs"){this.currentStep=7;return}this.currentStep=10}}).catch(a=>{P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"PIN"}),this.currentStep=4,a.message?this.warningScreen.setPaymentError(a.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()})},300)}}showLoader(){this.pageLoader=new De(this.contents),this.pageLoader.mountLoader()}pinErrorStates(e,i,t){const o=this.container.querySelector("#pin-error");o&&(o.innerHTML=e||"Payment Failed"),t&&t.classList.remove("hidden"),i&&(i.innerHTML="")}setPaymentError(e){const i=this.container.querySelector("#payment-warning-text"),t=this.container.querySelector(".warning-list");i&&(i.textContent=e),t&&[{text:"Try again with your card",action:"go-to-card"},{text:"Try again with transfer",action:"go-to-transfer"}].forEach(({action:s,text:a})=>{const l=document.createElement("button");l.textContent=a,l.setAttribute("id",s),l.classList.add("warning-button");const d=document.createElement("div");d.appendChild(l),t.appendChild(d)})}validatedAVS(e,i){e.stopPropagation(),e.preventDefault();const t=this.container.querySelector(".spinner"),o=this.container.querySelector("#avs-form-button-text"),s={authorization:{avs:{state:i==null?void 0:i.state,city:i==null?void 0:i.city,country:i==null?void 0:i.country,address:i==null?void 0:i.address,zipCode:(i==null?void 0:i.code)||"-"}},reference:this.activeRef};P.track("input_address",{payment_method:"Card",authentication_type:"AVS"}),t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),li(this.token,s,this.rdtCode,this.url).then(({data:l,headers:d})=>{var v,p,g,f,y,w,C;if(l.status==="failed")this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"AVS"}),l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(l.status))["success","successful"].includes(l.status)&&(this.currentStep=5,this.redirectTo(l,d,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"AVS"}));else{if(((v=l==null?void 0:l.authorization)==null?void 0:v.mode)==="pin"){this.currentStep=2;return}if(((p=l==null?void 0:l.authorization)==null?void 0:p.mode)==="3DS"){(g=l==null?void 0:l.authorization)!=null&&g.redirectUrl&&this.redirectTo3DS((f=l==null?void 0:l.authorization)==null?void 0:f.redirectUrl),(y=l==null?void 0:l.authorization)!=null&&y.embeddedHtml&&this.redirectToPreciumDoc((w=l==null?void 0:l.authorization)==null?void 0:w.embeddedHtml);return}if(((C=l==null?void 0:l.authorization)==null?void 0:C.mode)==="otp"){this.cardResponse=l,this.currentStep=3;return}this.currentStep=10}}).catch(l=>{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"AVS"}),l.message?this.warningScreen.setPaymentError(l.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}submitOtp(e,i){e.preventDefault();const t={authorization:{otp:i},reference:this.activeRef};this.currentStep=6,this.showLoader(),P.track("input_cardOTP",{payment_method:"Card",authentication_type:"PIN+0TP"}),li(this.token,t,this.rdtCode,this.url).then(({data:s,headers:a})=>{var l,d,v,p,g,f,y;if(s.status==="failed")this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN+0TP"}),s.providerMessage?this.warningScreen.setPaymentError(s.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(s.status))["success","successful"].includes(s.status)&&(this.currentStep=5,this.redirectTo(s,a,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN+0TP"}));else{if(this.activeRef=s.reference,((l=s==null?void 0:s.authorization)==null?void 0:l.mode)==="pin"){this.currentStep=2;return}if(((d=s==null?void 0:s.authorization)==null?void 0:d.mode)==="3DS"){(v=s==null?void 0:s.authorization)!=null&&v.redirectUrl&&this.redirectTo3DS((p=s==null?void 0:s.authorization)==null?void 0:p.redirectUrl),(g=s==null?void 0:s.authorization)!=null&&g.embeddedHtml&&this.redirectToPreciumDoc((f=s==null?void 0:s.authorization)==null?void 0:f.embeddedHtml);return}if(((y=s==null?void 0:s.authorization)==null?void 0:y.mode)==="avs"){this.currentStep=7;return}this.currentStep=10}}).catch(s=>{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN+0TP"}),s.message?this.warningScreen.setPaymentError(s.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()})}redirectTo3DS(e){const i=window.open("","_blank");if(!i){alert("Please enable popups for this site to complete the authentication.");return}i.location.href=e,P.track("auth_redirect",{payment_method:"Card",authentication_type:"3DS"}),this.currentStep=6,this.showLoader();const t=setInterval(()=>{i.closed&&(clearInterval(t),this.verifyPayment(({data:o,headers:s})=>{this.currentStep=5,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"3DS"}),this.redirectTo(o,s,"success")},({data:o})=>{this.currentStep=4,o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue(),P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"3DS"})}))},2e3)}redirectToPreciumDoc(e){const i=atob(e),t=new Blob([i],{type:"text/html"}),o=URL.createObjectURL(t),s=window.open(o,"_blank");if(s){s.document.close(),P.track("auth_redirect",{payment_method:"Card",authentication_type:"3DS"}),this.currentStep=6,this.showLoader();const a=setInterval(()=>{s.closed&&(clearInterval(a),this.verifyPayment(({data:l,headers:d})=>{this.currentStep=5,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"3DS"}),this.redirectTo(l,d,"success")},({data:l})=>{this.currentStep=4,l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue(),P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"3DS"})}))},2e3)}else alert("Please enable popups for this site to complete the authentication.")}async verifyPayment(e,i){try{const t=await sn(this.token,this.activeRef,void 0,this.rdtCode,this.url);t.data.status==="failed"?i(t):(["success","successful"].includes(t.data.status)&&e(t),t.data.status==="inProgress"&&(this.currentStep=10))}catch{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"3DS"}),this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue()}}async verifyPaymentProcess(){try{const e=await sn(this.token,this.reference,void 0,this.rdtCode,this.url);this.cardResponse=e.data,this.cardResponseHeader=e.headers}catch{this.currentStep=4}}goBackToMerchant(){this.redirectTo(this.cardResponse,this.cardResponseHeader,this.callBackUrl)}renderCardContent(e){var t,o;e&&(this.merchantPlanDetail=e);const i=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),i==null||i.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents){switch(this.currentStep){case 1:this.cardDetailForm=new Rt({container:this.contents,onAction:a=>l=>this.submitCardDetails.bind(this)(a,l),merchantName:this.merchantPlanDetail.merchantName,currency:this.localCurrency!==this.currency?this.localCurrency:this.currency}),this.cardDetailForm.renderContent();break;case 2:this.cardPinForm=new qs({container:this.contents,onClose:this.onClose,onAction:a=>this.handlePinRequest.bind(this)(a)}),this.cardPinForm.renderComponent();break;case 3:this.cardOtpValidationForm=new zs({container:this.contents,onClose:this.onClose,onAction:a=>l=>this.submitOtp.bind(this)(a,l),otpMessage:((t=this.cardResponse)==null?void 0:t.providerMessage)||"Please enter your OTP sent to your phone"}),this.cardOtpValidationForm.renderComponent();break;case 4:this.warningScreen=new gn({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this.currentStep=8}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 5:this.successScreen=new Fn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(o=this.merchantPlanDetail)==null?void 0:o.rate.rate}),this.successScreen.renderComponent();break;case 6:this.pageLoader=new De(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 7:this.avsForm=new Js({container:this.contents,onAction:a=>l=>this.validatedAVS.bind(this)(a,l)}),this.avsForm.renderComponent();break;case 8:this.transactionIssuesScreen=new hi({container:this.contents,onAction:()=>{var a;this.currentStep=4,this.warningScreen.setPaymentError(((a=this.cardResponse)==null?void 0:a.providerMessage)||"Payment failed")},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"card",callBackUrl:this.callBackUrl,paymentResponse:this.cardResponse,paymentResponseHeaders:this.cardResponseHeader}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;case 9:this.confirmationEnd=new Wo({container:this.contents,onAction:a=>{this.currentStep=a},ref:this.reference,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.cardResponse,paymentResponseHeaders:this.cardResponseHeader}),this.confirmationEnd.renderComponent();break;case 10:this.confirmationProgress=new zr({container:this.contents,onAction:a=>{this.currentStep=a},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(a,l)=>{this.cardResponse=a,this.cardResponseHeader=l},step:{failed:4,success:5,end:9},paymentMethod:"Card"}),this.confirmationProgress.renderComponent();break;default:this.cardDetailForm=new Rt({container:this.contents,onAction:a=>l=>this.submitCardDetails.bind(this)(a,l),merchantName:this.merchantPlanDetail.merchantName,currency:this.localCurrency?this.localCurrency:this.currency}),this.cardDetailForm.renderContent();break}this.displayButtonText();const s=this.container.querySelector("#card-currency");s&&(s.textContent=`${this.localCurrency?this.localCurrency:this.currency} Card`)}}redirectTo(e,i,t){const o=i.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",e.status),s.searchParams.append("reference",e.reference),window.location.href=s.toString()},1800):t==="success"&&this.onSuccess(e)}displayButtonText(e){var t,o,s,a;const i=this.container.querySelector("#details-form-button-text");if(i){const l=this.currency,d=l==="USD"?(o=(t=this.merchantPlanDetail)==null?void 0:t.rate)==null?void 0:o.from:l;e?i.textContent=e:i.textContent=`Continue to pay ${d} ${xe(this.totalAmount!==this.amount?this.totalAmount:(this.amount||0)*(l==="USD"?(a=(s=this.merchantPlanDetail)==null?void 0:s.rate)==null?void 0:a.rate:1),2)}`}}}const qr=`<div>
|
|
857
857
|
<div class="container-center h-[40vh] hidden" id="loader">
|
|
858
858
|
<img src="" alt="loader gif" />
|
|
859
859
|
</div>
|
|
@@ -1334,8 +1334,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
1334
1334
|
<div class="flex justify-between items-center">
|
|
1335
1335
|
<span class="text-tone-60 font-medium text-sm">Number</span>
|
|
1336
1336
|
<div class="flex items-center gap-1">
|
|
1337
|
-
<span data-copy-value="4111112000062555" class="text-tone-100 text-sm font-medium">
|
|
1338
|
-
2555 </span>
|
|
1337
|
+
<span data-copy-value="4111112000062555" class="text-tone-100 text-sm font-medium">4111112000062555</span>
|
|
1339
1338
|
<button class="copy-btn p-1 hover:opacity-80 transition-opacity">
|
|
1340
1339
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1341
1340
|
<path
|
|
@@ -1519,7 +1518,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
1519
1518
|
<span class="text-tone-60 font-medium text-sm">Number</span>
|
|
1520
1519
|
<div class="flex items-center gap-1">
|
|
1521
1520
|
<span data-copy-value="5555558684543932"
|
|
1522
|
-
class="text-tone-100 text-sm font-medium">
|
|
1521
|
+
class="text-tone-100 text-sm font-medium">5555577124976817 </span>
|
|
1523
1522
|
<button class="copy-btn p-1 hover:opacity-80 transition-opacity">
|
|
1524
1523
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
1525
1524
|
xmlns="http://www.w3.org/2000/svg">
|