@bigz-app/booking-widget 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9343,6 +9343,7 @@
9343
9343
  // Main PaymentForm component that handles payment intent creation and Elements wrapper
9344
9344
  function PaymentForm({ config, eventDetails, formData, totalAmount, discountCode, onSuccess, onError, systemConfig, stripePromise, stripeAppearance, }) {
9345
9345
  const [clientSecret, setClientSecret] = d$1(null);
9346
+ const [paymentIntentId, setPaymentIntentId] = d$1(null);
9346
9347
  const [isCreatingPaymentIntent, setIsCreatingPaymentIntent] = d$1(false);
9347
9348
  const [paymentError, setPaymentError] = d$1(null);
9348
9349
  // Create payment intent when component mounts or when relevant data changes
@@ -9382,6 +9383,7 @@
9382
9383
  customerEmail: formData.customerEmail?.trim(),
9383
9384
  customerPhone: formData.customerPhone?.trim(),
9384
9385
  comment: formData.comment?.trim(),
9386
+ ...(paymentIntentId && { paymentIntentId }), // Include existing payment intent ID if available
9385
9387
  };
9386
9388
  // Validate required fields
9387
9389
  if (!requestData.eventInstanceId) {
@@ -9407,6 +9409,7 @@
9407
9409
  const data = await response.json();
9408
9410
  if (response.ok) {
9409
9411
  setClientSecret(data.clientSecret);
9412
+ setPaymentIntentId(data.paymentIntentId); // Save payment intent ID for future updates
9410
9413
  }
9411
9414
  else {
9412
9415
  console.error("[PAYMENT_FORM] Payment intent creation failed:", {
@@ -9682,6 +9685,7 @@
9682
9685
  customerPhone: stringType().optional(),
9683
9686
  participants: arrayType(participantSchema).min(1, "Mindestens ein Teilnehmer erforderlich"),
9684
9687
  discountCode: stringType().optional(),
9688
+ comment: stringType().optional(),
9685
9689
  acceptTerms: booleanType()
9686
9690
  .refine((val) => val === true, "Bitte akzeptiere die Allgemeinen Geschäftsbedingungen"),
9687
9691
  });
@@ -9697,6 +9701,7 @@
9697
9701
  defaultValues: {
9698
9702
  participants: [{ name: "", age: undefined }],
9699
9703
  discountCode: "",
9704
+ comment: "",
9700
9705
  acceptTerms: false,
9701
9706
  },
9702
9707
  });
@@ -10083,6 +10088,36 @@
10083
10088
  backdropFilter: "blur(4px)",
10084
10089
  borderRadius: "var(--bw-border-radius)",
10085
10090
  padding: "var(--bw-spacing)",
10091
+ }, children: [u$2("label", { htmlFor: "booking-comment", style: {
10092
+ fontSize: "var(--bw-font-size)",
10093
+ fontWeight: "500",
10094
+ color: "var(--bw-text-color)",
10095
+ fontFamily: "var(--bw-font-family)",
10096
+ display: "block",
10097
+ marginBottom: "8px",
10098
+ }, children: "Kommentar (optional)" }), u$2("textarea", { id: "booking-comment", ...form.register("comment"), placeholder: "Zus\u00E4tzliche Anmerkungen zu Ihrer Buchung...", rows: 3, style: {
10099
+ width: "100%",
10100
+ padding: "12px",
10101
+ border: `1px solid var(--bw-border-color)`,
10102
+ borderRadius: "var(--bw-border-radius)",
10103
+ fontSize: "var(--bw-font-size)",
10104
+ fontFamily: "var(--bw-font-family)",
10105
+ backgroundColor: "var(--bw-input-bg)",
10106
+ color: "var(--bw-text-color)",
10107
+ resize: "vertical",
10108
+ minHeight: "80px",
10109
+ outline: "none",
10110
+ transition: "border-color 0.2s ease",
10111
+ }, onFocus: (e) => {
10112
+ e.target.style.borderColor = "var(--bw-highlight-color)";
10113
+ }, onBlur: (e) => {
10114
+ e.target.style.borderColor = "var(--bw-border-color)";
10115
+ } })] }), u$2("div", { style: {
10116
+ backgroundColor: "var(--bw-surface-color)",
10117
+ border: `1px solid var(--bw-border-color)`,
10118
+ backdropFilter: "blur(4px)",
10119
+ borderRadius: "var(--bw-border-radius)",
10120
+ padding: "var(--bw-spacing)",
10086
10121
  }, children: [u$2("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [u$2("input", { id: "acceptTerms", ...form.register("acceptTerms"), type: "checkbox", style: {
10087
10122
  marginTop: "4px",
10088
10123
  width: "20px",