@ticketboothapp/booking 1.2.68 → 1.2.70

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticketboothapp/booking",
3
- "version": "1.2.68",
3
+ "version": "1.2.70",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -4511,6 +4511,10 @@ export function AdminChangeBookingFlow({
4511
4511
  previousReturnAvailabilityId: initialValues?.returnAvailabilityId ?? null,
4512
4512
  },
4513
4513
  });
4514
+ const refAfterChange = initialValues?.bookingReference?.trim();
4515
+ if (refAfterChange) {
4516
+ onSuccess?.({ reservationReference: refAfterChange });
4517
+ }
4514
4518
  setLoading(false);
4515
4519
  return;
4516
4520
  }
@@ -4832,22 +4836,31 @@ export function AdminChangeBookingFlow({
4832
4836
  reservationExpiration: undefined,
4833
4837
  customerLastName: lastName.trim(),
4834
4838
  bookingDate: datePart,
4835
- // Paid change: always return to stable ref+lastName + explicit intent (not reservationRef).
4836
- // /manage-booking runs bounded refresh only when `from=change_payment` (see manage-booking page).
4839
+ // Paid change: customer site returns to /manage-booking with change_payment intent.
4840
+ // Provider dashboard embed uses getSuccessUrl (same as main booking tab) so Stripe does not 404 on /manage-booking.
4837
4841
  successUrlOverride:
4838
4842
  isCustomerSelfServeChange && changeBookingReferenceForPaidFlow
4839
- ? (() => {
4840
- const origin = typeof window !== 'undefined' ? window.location.origin : '';
4841
- const ref = encodeURIComponent(
4842
- formatBookingRefForDisplay(changeBookingReferenceForPaidFlow) || changeBookingReferenceForPaidFlow,
4843
- );
4844
- const ln = encodeURIComponent(lastName.trim());
4845
- const fromQ = `${MANAGE_BOOKING_QUERY_FROM}=${encodeURIComponent(MANAGE_BOOKING_FROM_CHANGE_PAYMENT)}`;
4846
- const intentQ = changeIntentIdForCheckout
4847
- ? `&changeIntentId=${encodeURIComponent(changeIntentIdForCheckout)}`
4848
- : '';
4849
- return `${origin}/manage-booking?ref=${ref}&lastName=${ln}&${fromQ}${intentQ}`;
4850
- })()
4843
+ ? bookingAppMode === 'provider-dashboard' && getSuccessUrl
4844
+ ? getSuccessUrl({
4845
+ reservationRef:
4846
+ formatBookingRefForDisplay(changeBookingReferenceForPaidFlow) ||
4847
+ changeBookingReferenceForPaidFlow,
4848
+ lastName: lastName.trim(),
4849
+ focusDate: datePart,
4850
+ })
4851
+ : (() => {
4852
+ const origin = typeof window !== 'undefined' ? window.location.origin : '';
4853
+ const ref = encodeURIComponent(
4854
+ formatBookingRefForDisplay(changeBookingReferenceForPaidFlow) ||
4855
+ changeBookingReferenceForPaidFlow,
4856
+ );
4857
+ const ln = encodeURIComponent(lastName.trim());
4858
+ const fromQ = `${MANAGE_BOOKING_QUERY_FROM}=${encodeURIComponent(MANAGE_BOOKING_FROM_CHANGE_PAYMENT)}`;
4859
+ const intentQ = changeIntentIdForCheckout
4860
+ ? `&changeIntentId=${encodeURIComponent(changeIntentIdForCheckout)}`
4861
+ : '';
4862
+ return `${origin}/manage-booking?ref=${ref}&lastName=${ln}&${fromQ}${intentQ}`;
4863
+ })()
4851
4864
  : undefined,
4852
4865
  ticketLines: ticketLinesForModal,
4853
4866
  feeLineItems: feeLineItemsWithAddOns,
@@ -4988,6 +5001,7 @@ export function AdminChangeBookingFlow({
4988
5001
  previousAvailabilityId: initialValues?.availabilityId ?? null,
4989
5002
  previousReturnAvailabilityId: initialValues?.returnAvailabilityId ?? null,
4990
5003
  },
5004
+ deferPaymentToBalance: true,
4991
5005
  });
4992
5006
  const bookRef = initialValues?.bookingReference?.trim() || adminChoiceData.reservationReference;
4993
5007
  setShowAdminPaymentChoice(false);
@@ -28,6 +28,11 @@ export type ProviderDashboardChangeBookingPayload = {
28
28
  previousAvailabilityId?: string | null;
29
29
  previousReturnAvailabilityId?: string | null;
30
30
  } | null;
31
+ /**
32
+ * When true, apply the change now but do not run an immediate card charge: record the amount still
33
+ * owed (e.g. pending charge on file) and update the receipt. Provider /change API must support this.
34
+ */
35
+ deferPaymentToBalance?: boolean;
31
36
  };
32
37
 
33
38
  /** Seeds the flow when opening provider change-booking (matches TicketBooth `BookingWidget` `initialBooking`). */