1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2a848826-62b7-42ca-b3c2-a975cde4f431",e._sentryDebugIdIdentifier="sentry-dbid-2a848826-62b7-42ca-b3c2-a975cde4f431")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8236],{15560:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/test",function(){return t(80738)}])},80738:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>a});var r=t(74848),s=t(96540);let a=()=>{let[e,n]=(0,s.useState)(null),[t,a]=(0,s.useState)(""),[i,c]=(0,s.useState)(!1),[o,u]=(0,s.useState)(!1),[l,d]=(0,s.useState)({name:"",number:"",expiryMonth:"",expiryYear:"",cvc:"",amount:"14000",currency:"MXN"});(0,s.useEffect)(()=>{let e=document.createElement("script");return e.src="https://cdn.kushkipagos.com/kushki.min.js",e.async=!0,e.onload=()=>{n(new window.Kushki({merchantId:"f07002b90ced43e5abf9627c702b607d",inTestEnvironment:!0}))},document.body.appendChild(e),()=>{document.body.removeChild(e)}},[]);let m=e=>{let{name:n,value:t}=e.target;d(e=>({...e,[n]:t}))},y=e=>{c(!1),e.code?(console.error("3DS Error:",e),a("â 3DS authentication failed")):(console.log("3DS Validation Success:",e),a("â
3DS authentication successful"))};return(0,r.jsx)("div",{className:"min-h-screen bg-gray-100 flex items-center justify-center px-4",children:(0,r.jsxs)("div",{className:"w-full max-w-md bg-white rounded-xl shadow-lg p-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-gray-800 mb-4",children:"3DS Payment Test"}),(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"Cardholder Name"}),(0,r.jsx)("input",{type:"text",name:"name",onChange:m,className:"w-full border rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 outline-none",placeholder:"John Doe"})]}),(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"Card Number"}),(0,r.jsx)("input",{type:"text",name:"number",onChange:m,className:"w-full border rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 outline-none",placeholder:"4456 5280 8038 9860"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"MM"}),(0,r.jsx)("input",{type:"text",name:"expiryMonth",onChange:m,className:"w-full border rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 outline-none",placeholder:"07"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"YY"}),(0,r.jsx)("input",{type:"text",name:"expiryYear",onChange:m,className:"w-full border rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 outline-none",placeholder:"27"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"CVC"}),(0,r.jsx)("input",{type:"password",name:"cvc",onChange:m,className:"w-full border rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 outline-none",placeholder:"***"})]})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"Amount (MXN)"}),(0,r.jsx)("input",{type:"number",name:"amount",value:l.amount,onChange:m,className:"w-full border rounded-lg px-3 py-2 focus:ring-2 focus:ring-indigo-500 outline-none"})]}),(0,r.jsxs)("div",{className:"mb-4 flex items-center space-x-2",children:[(0,r.jsx)("input",{type:"checkbox",checked:o,onChange:()=>u(!o),id:"saveCard",className:"w-4 h-4 text-indigo-600 border-gray-300 rounded focus:ring-indigo-500"}),(0,r.jsx)("label",{htmlFor:"saveCard",className:"text-sm text-gray-700",children:"Save card for future payments"})]}),(0,r.jsx)("button",{onClick:()=>{e&&(c(!0),a(""),o?e.requestSubscriptionToken({card:{name:l.name,number:l.number,expiryMonth:l.expiryMonth,expiryYear:l.expiryYear,cvc:l.cvc},amount:l.amount,currency:l.currency},n=>{if(console.log("Subscription Response:",n),n.code){c(!1),a("â Saving card failed");return}if(n.security&&n.security.authRequired){e.requestValidate3DS({secureId:n.secureId,security:{acsURL:n.security.acsURL,authenticationTransactionId:n.security.authenticationTransactionId,paReq:n.security.paReq,specificationVersion:n.security.specificationVersion,authRequired:n.security.authRequired}},y);return}c(!1),a("â
Card saved successfully");let t={cardholderName:l.name,token:n.token,amount:l.amount,currency:l.currency,timestamp:new Date().toISOString()};localStorage.setItem("kushki_subscription_data",JSON.stringify(t))}):e.requestToken({card:{name:l.name,number:l.number,expiryMonth:l.expiryMonth,expiryYear:l.expiryYear,cvc:l.cvc},amount:l.amount,currency:l.currency},n=>{if(console.log("Token Response:",n),n.code){c(!1),a("â Token creation failed");return}if(!n.security||!1===n.security.authRequired){c(!1),console.log("Non-3DS Token Success:",n),a("â
Payment token created (Non-3DS)");return}e.requestValidate3DS({secureId:n.secureId,security:{acsURL:n.security.acsURL,authenticationTransactionId:n.security.authenticationTransactionId,paReq:n.security.paReq,specificationVersion:n.security.specificationVersion,authRequired:n.security.authRequired}},y)}))},disabled:i,className:"w-full py-2 rounded-lg text-white font-medium transition ".concat(i?"bg-gray-400 cursor-not-allowed":"bg-indigo-600 hover:bg-indigo-700"),children:i?"Processing...":o?"Save Card":"Pay with 3DS"}),t&&(0,r.jsx)("p",{className:"mt-4 text-center text-sm font-medium",children:t})]})})}}},e=>{var n=n=>e(e.s=n);e.O(0,[636,6593,8792],()=>n(15560)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.