1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1634],{28639:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/paidy_payment",function(){return t(7819)}])},5141:function(e,a,t){"use strict";var s=t(67294);a.Z=function(){let[e,a]=(0,s.useState)(.24);return(0,s.useEffect)(()=>{(null==window?void 0:window.nativeBridge)&&window.nativeBridge.callNativeFunction("getStatusBarHeight",null,e=>{a(parseFloat(e)/100)})},[]),e}},7819:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return y}});var s=t(85893),n=t(67294),l=t(9008),i=t.n(l),c=t(45697),r=t.n(c),o=t(36200),d=t.n(o),m=t(5141);function u(e){let{isDev:a}=e,t=(0,m.Z)(),[l,c]=(0,n.useState)(null),[r,o]=(0,n.useState)(null),[u,_]=(0,n.useState)(!1),[y,p]=(0,n.useState)({amount:5e3,currency:"JPY",store_name:"CoCome",buyer:{name1:"dfa",name2:"fee",email:null,phone:null},buyer_data:{user_id:"",account_registration_date:"2023-01-01"},order:{items:[{name:"CoCome Premium",description:"Premium membership",quantity:1,unit_price:5e3}]},shipping_address:{line1:"AXISãã« 10F",line2:"å
æ¬æ¨4-22-1",city:"港åº",state:"æ±äº¬é½",zip:"106-2004"}}),h=(0,n.useCallback)(()=>{(null==window?void 0:window.nativeBridge)&&window.nativeBridge.callNativeFunction("goBack",null)},[]),x=(0,n.useCallback)(async e=>{console.log("Payment successful:",e);try{let a=await fetch("/api/payment/confirm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e.id,amount:y.amount,currency:y.currency,buyer:y.buyer,order:y.order,metadata:{source:"cocome_web",version:"1.0",order_type:"premium_membership",platform:"web"}})});if(a.ok){let e=await a.json();console.log("Payment confirmed on backend:",e)}else{let e=await a.json();console.error("Backend confirmation failed:",e)}o({paymentId:e.id,amount:e.amount,currency:e.currency,createdAt:e.created_at,status:e.status})}catch(e){console.error("Error confirming payment:",e),alert("æ¯ä»æåï¼ä½ç¡®è®¤è¿ç¨ä¸åºç°é误ï¼è¯·è系客æ")}},[y]),j=(0,n.useCallback)(()=>{console.log("Payment cancelled"),alert("æ¯ä»å·²åæ¶ï¼æ¨å¯ä»¥éæ°å°è¯æ¯ä»")},[]),b=(0,n.useCallback)(()=>{if(window.Paidy)try{let e=window.Paidy.configure({api_key:a?"pk_test_3ek62u315lk4qhrja50l60bulm":"pk_live_000000000000000",on_close(e){console.log("Paidy checkout closed:",e),"authorized"===e.status?x(e):j()},metadata:{source:"cocome_web",version:"1.0"}});c(e)}catch(e){console.error("Paidy configuration error:",e)}},[a,x,j]);(0,n.useEffect)(()=>{(()=>{if(window.Paidy)window.Paidy&&b();else{let e=document.createElement("script");e.src="https://apps.paidy.com/",e.async=!0,e.onload=()=>{console.log("Paidy script loaded"),b()},e.onerror=()=>{console.error("Failed to load Paidy script")},document.head.appendChild(e)}})()},[b]);let v=()=>{let e=[];return y.buyer.name1&&""!==y.buyer.name1.trim()||e.push("请填åå§åï¼æ±åï¼"),y.amount<=0&&e.push("æ¯ä»éé¢å¿
须大äº0"),e},N=()=>{var e;if(!l){alert("Paidyæªåå§åï¼è¯·ç¨åéè¯");return}let a=v();if(a.length>0){alert("请修æ£ä»¥ä¸é误ï¼\n".concat(a.join("\n")));return}let t={...y,buyer:{name1:y.buyer.name1.trim(),name2:(null===(e=y.buyer.name2)||void 0===e?void 0:e.trim())||""},description:"CoCome Premiumä¼å - \xa5".concat(y.amount),metadata:{...y.metadata,order_type:"premium_membership",platform:"web"}};try{console.log("Launching Paidy payment with data:",t),l.launch(t)}catch(e){console.error("Paidy launch error:",e),alert("å¯å¨æ¯ä»å¤±è´¥ï¼è¯·éè¯ã妿é®é¢æç»åå¨ï¼è¯·è系客æã")}},f=(e,a)=>{p(t=>({...t,buyer:{...t.buyer,[e]:a}}))},g=async()=>{try{await navigator.clipboard.writeText(r.paymentId),_(!0),setTimeout(()=>_(!1),2e3)}catch(a){console.error("Failed to copy payment ID:",a);let e=document.createElement("textarea");e.value=r.paymentId,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),_(!0),setTimeout(()=>_(!1),2e3)}},w=async()=>{let e={title:"CoCome Premium æ¯æãå®äº",text:"CoCome Premiumã®æ¯æããå®äºãã¾ããï¼æ¯æãID: ".concat(r.paymentId),url:window.location.origin};try{if(navigator.share&&navigator.canShare&&navigator.canShare(e))await navigator.share(e);else{let a="".concat(e.title,"\n").concat(e.text,"\n").concat(e.url);await navigator.clipboard.writeText(a),alert("æ¯æãæ
å ±ãã¯ãªãããã¼ãã«ã³ãã¼ãã¾ããï¼")}}catch(e){console.error("Failed to share:",e)}};return r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:"æ¯ä»æå - CoCome"}),(0,s.jsx)("meta",{name:"description",content:"æ¯ä»æå确认页é¢"})]}),(0,s.jsx)("div",{className:d().root,children:(0,s.jsxs)("div",{className:d().successContainer,children:[(0,s.jsx)("div",{className:d().particles,children:[...Array(6)].map((e,a)=>(0,s.jsx)("div",{className:"".concat(d().particle," ").concat(d()["particle".concat(a+1)])},"particle-".concat(a+1)))}),(0,s.jsx)("div",{className:d().successIcon,children:(0,s.jsx)("div",{className:d().checkmark,children:"â"})}),(0,s.jsx)("h1",{className:d().successTitle,children:"ãããã¨ããããã¾ã"}),(0,s.jsx)("p",{className:d().successSubtitle,children:"ãæ¯æããå®äºãã¾ãã"}),(0,s.jsxs)("div",{className:d().paymentDetails,children:[(0,s.jsxs)("div",{className:d().detailItem,children:[(0,s.jsx)("span",{className:d().detailLabel,children:"æ¯æãID:"}),(0,s.jsxs)("div",{className:d().paymentIdContainer,children:[(0,s.jsx)("span",{className:d().detailValue,children:r.paymentId}),(0,s.jsx)("button",{onClick:g,className:d().copyButton,title:"æ¯æãIDãã³ãã¼",children:u?"â":"\uD83D\uDCCB"})]})]}),(0,s.jsxs)("div",{className:d().detailItem,children:[(0,s.jsx)("span",{className:d().detailLabel,children:"éé¡:"}),(0,s.jsxs)("span",{className:d().detailValue,children:["\xa5",r.amount.toLocaleStr
1ing()]})]}),(0,s.jsxs)("div",{className:d().detailItem,children:[(0,s.jsx)("span",{className:d().detailLabel,children:"ã¹ãã¼ã¿ã¹:"}),(0,s.jsx)("span",{className:"".concat(d().detailValue," ").concat(d().statusBadge),children:"authorized"===r.status?"æ¿èªæ¸ã¿":r.status})]}),(0,s.jsxs)("div",{className:d().detailItem,children:[(0,s.jsx)("span",{className:d().detailLabel,children:"å®äºæ¥æ:"}),(0,s.jsx)("span",{className:d().detailValue,children:new Date(r.createdAt).toLocaleString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),(0,s.jsxs)("div",{className:d().detailItem,children:[(0,s.jsx)("span",{className:d().detailLabel,children:"åå:"}),(0,s.jsx)("span",{className:d().detailValue,children:"CoCome Premium"})]})]}),(0,s.jsxs)("div",{className:d().successMessage,children:[(0,s.jsx)("p",{children:"ãå©ç¨ããã ãããããã¨ããããã¾ããã"}),(0,s.jsx)("p",{children:"確èªã¡ã¼ã«ããéããããã¾ãã"})]}),(0,s.jsxs)("div",{className:d().successActions,children:[(0,s.jsx)("button",{onClick:h,className:d().backButton,children:"æ»ã"}),(0,s.jsx)("button",{onClick:w,className:d().shareButton,title:"æ¯æãå®äºãã·ã§ã¢",children:"\uD83D\uDCE4 ã·ã§ã¢"}),(0,s.jsx)("button",{onClick:()=>o(null),className:d().newPaymentButton,children:"æ°ããæ¯æã"})]})]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:"Paidyæ¯ä» - CoCome"}),(0,s.jsx)("meta",{name:"description",content:"使ç¨Paidyè¿è¡å®å
¨ä¾¿æ·çæ¯ä»"})]}),(0,s.jsxs)("div",{className:d().root,children:[(0,s.jsxs)("div",{onClick:h,className:d().navBar,style:{to
1p:"".concat(t,"rem")},children:[(0,s.jsx)("div",{className:d().backArrow}),(0,s.jsx)("div",{className:d().title,children:"Paidyæ¯ä»"})]}),(0,s.jsxs)("div",{className:d().content,children:[(0,s.jsxs)("div",{className:d().paymentInfo,children:[(0,s.jsx)("h2",{className:d().sectionTitle,children:"订åä¿¡æ¯"}),(0,s.jsxs)("div",{className:d().orderItem,children:[(0,s.jsx)("div",{className:d().itemName,children:"CoCome Premium"}),(0,s.jsxs)("div",{className:d().itemPrice,children:["\xa5",y.amount]})]}),(0,s.jsxs)("div",{className:d().totalAmount,children:[(0,s.jsx)("span",{children:"æ»è®¡ï¼"}),(0,s.jsxs)("span",{className:d().amount,children:["\xa5",y.amount]})]})]}),(0,s.jsxs)("div",{className:d().buyerInfo,children:[(0,s.jsx)("h2",{className:d().sectionTitle,children:"è´ä¹°è
ä¿¡æ¯"}),(0,s.jsxs)("div",{className:d().formGroup,children:[(0,s.jsx)("label",{children:"å§åï¼æ±åï¼*"}),(0,s.jsx)("input",{type:"text",value:y.buyer.name1,onChange:e=>f("name1",e.target.value),placeholder:"ä¾ï¼å±±ç° 太é",className:d().input})]}),(0,s.jsxs)("div",{className:d().formGroup,children:[(0,s.jsx)("label",{children:"å§åï¼çååï¼"}),(0,s.jsx)("input",{type:"text",value:y.buyer.name2,onChange:e=>f("name2",e.target.value),placeholder:"ä¾ï¼ã¤ãã ã¿ãã¦",className:d().input})]}),(0,s.jsxs)("div",{className:d().formGroup,children:[(0,s.jsx)("label",{children:"é®ç®±å°å*"}),(0,s.jsx)("input",{type:"email",value:y.buyer.email,onChange:e=>f("email",e.target.value),placeholder:"[email protected]",className:d().input})]}),(0,s.jsxs)("div",{className:d().formGroup,children:[(0,s.jsx)("label",{children:"ææºå·ç "}),(0,s.jsx)("input",{type:"tel",value:y.buyer.phone,onChange:e=>f("phone",e.target.value),placeholder:"09012345678",className:d().input})]})]}),(0,s.jsx)("div",{className:d().paymentButton,children:(0,s.jsx)("button",{onClick:N,className:d().paidyButton,disabled:!l,children:l?"使ç¨Paidyæ¯ä»":"æ£å¨åå§å..."})}),(0,s.jsx)("div",{className:d().paidyInfo,children:(0,s.jsx)("p",{className:d().infoText,children:"Paidyæä¾å®å
¨ä¾¿æ·çæ¯ä»æå¡ï¼æ¯æææºå·ç åé®ç®±éªè¯ã æ¯ä»è¿ç¨ä¸ä¼åééªè¯ç å°æ¨çææºã"})})]})]})]})}u.propTypes={isDev:r().bool.isRequired};var _=t(57080),y=e=>{let{isDev:a}=(0,_.Z)();return(0,s.jsx)(u,{...e,isDev:a})}},36200:function(e){e.exports={root:"style_root__SFKkX",navBar:"style_navBar__ag6L1",backArrow:"style_backArrow__JJ6fh",title:"style_title__KZOPy",content:"style_content__Wsb24",paymentInfo:"style_paymentInfo__C1_M7",sectionTitle:"style_sectionTitle__s8YqY",orderItem:"style_orderItem__MK086",itemName:"style_itemName__rtu3j",itemPrice:"style_itemPrice__M1iAV",totalAmount:"style_totalAmount__bSjfK",amount:"style_amount__BqZhG",buyerInfo:"style_buyerInfo__cB1Zf",formGroup:"style_formGroup__c3Od1",input:"style_input__srRyV",paymentButton:"style_paymentButton__s1pOZ",paidyButton:"style_paidyButton__dzria",paidyInfo:"style_paidyInfo__eqigm",infoText:"style_infoText__XmewL",successContainer:"style_successContainer__tSPoa",backgroundFloat:"style_backgroundFloat__BMb8j",particles:"style_particles__dNrLr",particle:"style_particle__dBcI1",particleFloat:"style_particleFloat__J7IN4",particle1:"style_particle1__st7_l",particle2:"style_particle2__B_a9v",particle3:"style_particle3__NzTr9",particle4:"style_particle4__Rc9_l",particle5:"style_particle5__1tjDn",particle6:"style_particle6__ZQWRn",successIcon:"style_successIcon__h56oO",successPulse:"style_successPulse__NheS2",checkmark:"style_checkmark__V_lD8",checkmarkDraw:"style_checkmarkDraw__bKQFv",successTitle:"style_successTitle__KDeHD",fadeInUp:"style_fadeInUp__eFVLO",successSubtitle:"style_successSubtitle__nrL5X",paymentDetails:"style_paymentDetails__5fIn_",detailItem:"style_detailItem__D9qAb",detailLabel:"style_detailLabel__abO_4",detailValue:"style_detailValue__4uFbj",statusBadge:"style_statusBadge__dL54h",successMessage:"style_successMessage__glOmp",paymentIdContainer:"style_paymentIdContainer__Rzmb5",copyButton:"style_copyButton___kTLf",successActions:"style_successActions__VYyGY",backButton:"style_backButton__y98C7",shareButton:"style_shareButton__RPdH7",newPaymentButton:"style_newPaymentButton__4CVQi"}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=28639)}),_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.