PageSourceSearch

https://www.appopener.in/static/js/6011.bba9b94b.chunk.js

js appopener.in collected 2026-10-07 00:50:39 UTC 6,062 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkao_react_app||=[]).push([[6011],{16011(e,n,t){t.r(n),t.d(n,{default:()=>u});var r=t(9950),a=t(78201),s=t(93047),i=t(99163),o=t(90990);const l=new Set(["pa","pn","cu","am","tn","tr"]),c=/[\u0000-\u001f\u007f\u202a-\u202e\u2066-\u2069]/;function d(e){var n;if(!0!==(null===e||void 0===e?void 0:e.success)||200!==(null===e||void 0===e||null===(n=e.smartUrl)||void 0===n?void 0:n.status)||!e.smartUrl.data||e.smartUrl.data.error)throw new Error("This payment link is unavailable.");return function(e){if("string"!==typeof e||e.length>2048||c.test(e)||!/^upi:\/\/pay\?/i.test(e))throw new Error("Unsupported payment instructions.");let n;try{decodeURIComponent(e),n=new URL(e)}catch{throw new Error("Invalid payment instructions.")}if("upi:"!==n.protocol||"pay"!==n.hostname.toLowerCase()||n.pathname||n.port||n.username||n.password||n.hash)throw new Error("Unsupported payment destination.");const t=[...n.searchParams],r=new Set;for(const[m,y]of t){if(!l.has(m)||r.has(m)||c.test(y))throw new Error("Ambiguous payment instructions.");r.add(m)}const a=n.searchParams.get("pa"),s=n.searchParams.get("pn"),i=n.searchParams.get("cu");if(!a||!/^[A-Za-z0-9._-]{1,256}@[A-Za-z0-9][A-Za-z0-9.-]{1,63}$/.test(a)||!s||s!==s.trim()||s.length>100||"INR"!==i)throw new Error("The payment details are incomplete or unsupported.");const o=n.searchParams.get("am");let d=null;if(null!==o){if(!/^(?:0|[1-9]\d{0,8})(?:\.\d{1,2})?$/.test(o))throw new Error("Invalid requested amount.");const[e,n=""]=o.split(".");if(d=100*Number(e)+Number(n.padEnd(2,"0")),!Number.isSafeInteger(d)||d<=0)throw new Error("Invalid requested amount.")}const p=n.searchParams.get("tn")||"",u=n.searchParams.get("tr")||"";if(p.length>200||u.length>100)throw new Error("Unsupported payment details.");const h=new URLSearchParams({pa:a,pn:s,cu:i});return null!==o&&h.set("am",o),p&&h.set("tn",p),u&&h.set("tr",u),Object.freeze({uri:`upi://pay?${h}`,payee:a,name:s,currency:i,amountPaise:d,note:p,reference:u})}(e.smartUrl.data.originalURL)}var p=t(44414);function u(){const{shorturl:e}=(0,a.useParams)(),[n,t]=(0,r.useState)(null),[l,c]=(0,r.useState)(null),[u,h]=(0,r.useState)(0),[m,y]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let n=!0;const r=new AbortController;t(null),c(null),y(!1);const a=setTimeout(()=>{n&&(n=!1,r.abort(),c({id:e,message:"The payment link is taking longer to load. Retry this 
1same address."}))},1e4);return async function(e){let{signal:n,fetchImpl:t=fetch}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!==typeof(r=e)||"undefined"===r||!/^[a-z0-9]{9}$/.test(r))throw new Error("This payment-link address is invalid.");var r;const a=await t(`https://appopener-backend-1klr.onrender.com/goto/pay/${e}?light=1`,{method:"POST",credentials:"omit",redirect:"error",cache:"no-store",signal:n,headers:{"Content-Type":"application/json",Accept:"application/json"},body:"{}"});if(!a.ok||a.redirected||!(a.headers.get("content-type")||"").includes("application/json"))throw new Error("The payment-link service could not return this address.");return d(await a.json())}(e,{signal:r.signal}).then(r=>{n&&t({id:e,payment:r})}).catch(()=>{n&&c({id:e,message:"We could not load valid payment details for this address. No payment has been started."})}).finally(()=>clearTimeout(a)),()=>{n=!1,clearTimeout(a),r.abort()}},[e,u]);const f=(null===n||void 0===n?void 0:n.id)===e?n.payment:null,j=(null===l||void 0===l?void 0:l.id)===e?l.message:"";return(0,p.jsxs)("main",{className:"upi-link-page",children:[(0,p.jsxs)(s.N_,{className:"upi-link-brand",to:"/","aria-label":"AppOpener home",children:[(0,p.jsx)("img",{src:o,alt:""}),(0,p.jsx)("span",{children:"AppOpener"})]}),(0,p.jsxs)("section",{className:"upi-link-card","aria-labelledby":"upi-link-title",children:[(0,p.jsx)("span",{className:"upi-link-kicker",children:"Shared UPI payment link"}),(0,p.jsx)("h1",{id:"upi-link-title",children:"Review before you pay."}),f?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("dl",{className:"upi-link-details",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("dt",{children:"Recipient name on this link"}),(0,p.jsx)("dd",{children:f.name})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("dt",{children:"UPI ID"}),(0,p.jsx)("dd",{className:"upi-link-address",children:f.payee})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("dt",{children:"Amount"}),(0,p.jsx)("dd",{children:(w=f.amountPaise,null===w?"Choose in your UPI app":new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2,maximumFractionDigits:2}).format(w/100))})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("dt",{children:"Currency"}),(0,p.jsx)("dd",{children:f.currency})]}),f.note&&(0,p.jsxs)("div",{children:[(0,p.jsx)("dt",{children:"Note"}),(0,p.jsx)("dd",{children:f.note})]}),f.reference&&(0,p.jsxs)("div",{children:[(0,p.jsx)("dt",{children:"Reference"}),(0,p.jsx)("dd",{children:f.reference})]})]}),(0,p.jsx)("p",{children:"Check the recipient and amount again in your UPI app. The name shown here comes from the shared link."}),(0,p.jsx)("a",{className:"upi-link-open",href:f.uri,onClick:()=>y(!0),children:"Open your UPI app \u2197"}),(0,p.jsxs)("div",{className:"upi-link-qr",children:[(0,p.jsx)(i.h,{value:f.uri,size:184,marginSize:4,level:"M",title:"Scan these payment details with your UPI app"}),(0,p.jsx)("span",{children:"On a computer? Scan with your UPI app."})]}),m&&(0,p.jsx)("p",{className:"upi-link-notice",role:"status",children:"If an app did not open, scan the QR with another device. AppOpener cannot confirm whether you paid; check your UPI app for the final status."}),(0,p.jsx)("p",{className:"upi-link-footnote",children:"You authorize any payment inside your UPI app. This shared link is not an AppOpener checkout or payment receipt."})]}):j?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("p",{role:"alert",children:j}),(0,p.jsx)("button",{className:"upi-link-open",type:"button",onClick:()=>h(e=>e+1),children:"Retry this link"})]}):(0,p.jsx)("p",{role:"status",children:"Loading the recipient\u2019s payment details\u2026"})]})]});var w}}}]);

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.