PageSourceSearch

https://team-game.de/assets/CheckoutTest-McQjEXzY.js

js team-game.de collected 2026-10-05 09:48:17 UTC 5,321 bytes, 6 lines download raw bytes

1import{k as y,p as N,S as k,r as l,j as e,s as C}from"./index-dtxnbBb6.js";import{I as a}from"./input-DMNTCw8C.js";import{L as c}from"./label-CErcyEBS.js";import{B as o}from"./button-CGJYuuJd.js";import{C as b}from"./circle-check-big-C_NPeb0r.js";import{L as w}from"./loader-circle-CSjaa-Wg.js";import"./check-BNMyQ1bd.js";import"./index-BRW2w5II.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const S=y("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),R=()=>{N({title:"Checkout Test – Team Game",description:"Checkout Test",noindex:!0});const[i]=k(),p=i.get("success")==="true",g=i.get("canceled")==="true",m=i.get("session_id"),[t,j]=l.useState({email:"",name:"",company:"",street:"",zip:"",city:"",amount:"29.90"}),[d,u]=l.useState(!1),[h,x]=l.useState(null),r=(s,n)=>{j(v=>({...v,[s]:n}))},f=async()=>{u(!0),x(null);try{const{data:s,error:n}=await C.functions.invoke("create-checkout-session",{body:{email:t.email,name:t.name,company:t.company||void 0,street:t.street||void 0,zip:t.zip||void 0,city:t.city||void 0,amount:parseFloat(t.amount)}});if(n)throw n;if(s!=null&&s.error)throw new Error(s.error);if(!(s!=null&&s.url))throw new Error("Keine Checkout-URL erhalten");window.location.href=s.url}catch(s){x(s.message||"Unbekannter Fehler"),u(!1)}};return p?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-6",children:e.jsxs("div",{className:"max-w-md w-full text-center space-y-4",children:[e.jsx(b,{className:"w-16 h-16 text-emerald-500 mx-auto"}),e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Zahlung erfolgreich!"}),e.jsx("p",{className:"text-muted-foreground",children:"Die Stripe Checkout Session wurde abgeschlossen."}),m&&e.jsxs("p",{className:"text-xs text-muted-foreground font-mono break-all",children:["Session: ",m]}),e.jsx(o,{onClick:()=>window.location.href="/checkout-test",variant:"outline",children:"Neuer Test"})]})}):g?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-6",children:e.jsxs("div",{className:"max-w-md w-full text-center space-y-4",children:[e.jsx(S,{className:"w-16 h-16 text-destructive mx-auto"}),e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Zahlung abgebrochen"}),e.jsx("p",{className:"text-muted-foreground",children:"Du hast den Checkout abgebrochen."}),e.jsx(o,{onClick:()=>window.location.href="/checkout-test",variant:"outline",children:"Erneut versuchen"})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-6",children:e.jsxs("div",{className:"max-w-md w-full space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Stripe Checkout Test"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Isolierte Test-Seite – erstellt eine Checkout Session mit automatischer Rechnung."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{htmlFor:"email",children:"E-Mail *"}),e.jsx(a,{id:"email",type:"email",required:!0,value:t.email,onChange:s=>r("email",s.target.value),placeholder:"[email protected]"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{htmlFor:"name",children:"Name"}),e.jsx(a,{id:"name",value:t.name,onChange:s=>r("name",s.target.value),placeholder:"Max Mustermann"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{htmlFor:"amount",children:"Betrag (€)"}),e.jsx(a,{id:"amount",type:"number",step:"0.01",min:"0.50",value:t.amount,onChange:s=>r("amount",s.target.value)})]}),e.jsxs("details",{className:"text-sm",children:[e.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground transition-colors",children:"Rechnungsadresse (optional)"}),e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{htmlFor:"company",children:"Firma"}),e.jsx(a,{id:"company",value:t.company,onChange:s=>r("company",s.target.value),placeholder:"Muster GmbH"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{htmlFor:"street",children:"Straße"}),e.jsx(a,{id:"street",value:t.street,onChange:s=>r("street",s.target.value),placeholder:"Musterstraße 1"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{htmlFor:"zip",children:"PLZ"}),e.jsx(a,{id:"zip",value:t.zip,onChange:s=>r("zip",s.target.value),placeholder:"96047"})]}),e.jsxs("div",{className:"col-span-2 space-y-1.5",children:[e.jsx(c,{htmlFor:"city",children:"Ort"}),e.jsx(a,{id:"city",value:t.city,onChange:s=>r("city",s.target.value),placeholder:"Bamberg"})]})]})]})]}),h&&e.jsx("p",{className:"text-sm text-destructive",children:h}),e.jsx(o,{onClick:f,disabled:d||!t.email,className:"w-full",children:d?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"w-4 h-4 mr-2 animate-spin"}),"Weiterleitung…"]}):"Zur Stripe Checkout Seite →"})]}),e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Test-Modus · Keine echte Buchung · Stripe erstellt automatisch eine Invoice"})]})})};export{R as default};

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.