1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[196,7815],{21:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(7876),l=n(4232),s=n(1902);let r=({clientSecret:e})=>{let t=(0,s.useStripe)(),n=(0,s.useElements)(),[r,o]=(0,l.useState)(null),[i,c]=(0,l.useState)(!1),[d,m]=(0,l.useState)(null),[p,u]=(0,l.useState)(!1),[g,x]=(0,l.useState)(!1),f=async e=>{if(e.preventDefault(),console.log("Form submission prevented!"),!t||!n)return void console.warn("Stripe.js has not loaded yet.");x(!0);var a=document.querySelector('input[id="fullName"]').value,l=document.querySelector('input[id="email"]').value;try{let{error:e,paymentIntent:s}=await t.confirmPayment({elements:n,confirmParams:{payment_method_data:{billing_details:{name:a,email:l}},return_url:"http://business-registration.com.au/payment-status"}});console.log(s,"payment_intentttt"),e?(console.error("Payment Error:",e),m(e.message||"An unexpected error occurred.")):s?.status==="succeeded"&&(console.log("Payment Success:",s),c(!0),m("Payment successful!"),console.log("Before removing:",localStorage.getItem("clientSecret"),localStorage.getItem("intentId")),console.log("Trying to clear local storage").cancelAbnData.forEach(e=>{localStorage.getItem(e)&&localStorage.removeItem(e)}),console.log("After removing:",localStorage.getItem("clientSecret"),localStorage.getItem("intentId")))}catch(e){console.error("Payment processing error:",e),m("Something went wrong. Please try again.")}x(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("form",{onSubmit:f,className:"w-full max-w-lg p-8 rounded-lg shadow-lg space-y-4 hidden",children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold text-gray-700 mb-4 text-center",children:"Enter Payment Details"}),(0,a.jsx)("div",{className:"p-4 border border-gray-300 rounded-md bg-white mb-4",children:(0,a.jsx)(s.CardElement,{options:{style:{base:{fontSize:"16px",color:"#424770",lineHeight:"24px",padding:"10px 15px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#e3342f"}}}})}),(0,a.jsx)("button",{type:"submit",disabled:!t||p,className:"w-full bg-indigo-600 text-white py-3 rounded-md disabled:bg-gray-400 transition-all hover:bg-indigo-700",children:p?"Processing...":"Confirm & pay"}),r&&(0,a.jsx)("p",{className:"text-red-500 mt-3 text-center",children:r}),i&&(0,a.jsx)("p",{className:"text-green-500 mt-3 text-center",children:"Payment Successful!"})]}),(0,a.jsxs)("div",{className:"flex flex-col w-full",children:[(0,a.jsxs)("form",{id:"payment-form",className:" w-full bg-[#ffff]",onSubmit:f,children:[(0,a.jsx)(s.PaymentElement,{id:"payment-element",options:{layout:"accordion"}}),d&&(0,a.jsx)("div",{id:"payment-message",children:d}),i&&(0,a.jsx)("p",{className:"text-green-500 mt-3 text-center",children:"Payment Successful!"})]}),(0,a.jsx)("p",{className:"mt-[10px] px-[5px] text-[#939ebf]",children:(0,a.jsx)("b",{children:"Please note: A payment processing fee of 1.25% is added to card payments. This doesn't apply to payments made with direct debit."})}),(0,a.jsx)("br",{}),(0,a.jsx)("button",{disabled:g||!t||!n,type:"submit",onClick:f,className:"px-14 py-3 h-[50px] text-white bg-[#3b9de1] rounded-xl",children:(0,a.jsx)("span",{id:"button-text",children:g?(0,a.jsx)("div",{className:"spinner",id:"spinner"}):"Confirm & Pay"})})]})]})}},196:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var a=n(7876),l=n(4232),s=n(1902),r=n(4241),o=n(21);let i=(0,r.c)("pk_live_51SPy9MAQBXgwPOM0zZfZgwpEisTjpwRcc5lPCUibIvPdYvZLa8YTcJ2DM47IF40tHdLyNzAlTI8m9VPj4AfizNx400enuMKjjf");console.log(i,"stripePromise");let c=({submittedData:e})=>{let[t,n]=(0,l.useState)(!1),[r,c]=(0,l.useState)(null),[d,m]=(0,l.useState)(null);console.log("checkiut page",e);let p=async()=>{if(e?.data?.id){console.log("submittedData----\x3e",e);let t=localStorage.getItem("clientSecret"),n=localStorage.getItem("intentId");if(localStorage.getItem("formData"),t&&n&&void 0!==n)c(t),m(n);else{let t=n||"";await fetch("https://api.business-registration.com.au/apistripe/create-payment-secret",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({form_id:e?.data?.id,intent_id:t})}).then(e=>e.json()).then(e=>{console.log("/stripe/create-payment-secret",e),c(e.clientSecret),m(e.intent_id),localStorage.setItem("clientSecret",e?.clientSecret),localStorage.setItem("intentId",e?.intent_id)}).catch(e=>console.error("Error fetching payment intent:",e))}}};return(0,l.useEffect)(()=>{p()},[e?.data]),console.log(r,"clientSecret"),(0,a.jsx)("div",{className:"flex justify-center items-center ",children:r&&(0,a.jsx)(s.Elements,{options:{clientSecret:r,appearance:{theme:"stripe"}},stripe:i,children:(0,a.jsx)(o.A,{})})})}}}]);
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.