Paid event types
An event type can require payment through Stripe. The remote configuration then contains stripeConfig, and the booking becomes a three-step sequence: reserve the slot, take the payment, confirm.
WARNING
Paying requires Zaptime's Stripe publishable key and Stripe Elements on your page. The key is baked into the @zaptime/vue3 bundle but is not part of @zaptime/core. If you do not have it, embed ZaptimeCalendar for paid event types and keep the headless UI for the free ones.
useStripeConfig
import { useStripeConfig } from "@zaptime/core";
const { stripeConfig, setStripeConfig } = useStripeConfig(calendarId?);
setStripeConfig(remote.stripeConfig); // during initialization
stripeConfig.value; // { price: number; currency: string; stripeAccountId: string } | undefinedstripeConfig.value !== undefined means the event type is paid.
useBillingAddress
Holds the billing details collected for the payment.
import { useBillingAddress } from "@zaptime/core";
const { billingAddress, updateBillingAddressField, setBillingAddress } = useBillingAddress(calendarId?);
updateBillingAddressField("country", "DE");Payment sequence
reserve({ ...collectFormValues(), calendarId, location })→res.data.uuid.POST {apiBaseUrl}api/reservations/{uuid}/paymentswithAuthorization: Bearer {token}and the billing fields (email,name,countryare required) →data.clientSecret.stripe.confirmCardPayment(clientSecret, { payment_method: { card, billing_details } }), wherestripe = Stripe(publishableKey, { stripeAccount: stripeConfig.stripeAccountId }).confirm({ calendarId }).
On any failure after step 1 call cancel(calendarId) to release the slot.
The labels for the billing form live in locale.confirmationForm.payments (price, cardNumber, name, email, company, address, city, zip, country, vatId, crn, showBillingDetails).
