@uptrademedia/site-kit 1.0.37 → 1.0.38

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.
@@ -293,14 +293,15 @@ async function createCheckoutSession(optionsOrOfferingId, legacyOptions) {
293
293
  });
294
294
  if (!response.ok) {
295
295
  const text = await response.text();
296
- let error = {};
296
+ let body = {};
297
297
  try {
298
- error = JSON.parse(text);
298
+ body = JSON.parse(text);
299
299
  } catch {
300
300
  }
301
- const message = (typeof error?.message === "string" ? error.message : null) || (typeof error?.error === "string" ? error.error : null) || "Payment could not be processed. Please try again or use a different card.";
301
+ const errObj = body?.error && typeof body.error === "object" ? body.error : body;
302
+ const message = (typeof body?.message === "string" ? body.message : null) || (typeof errObj?.message === "string" ? errObj.message : null) || (typeof errObj?.detail === "string" ? errObj.detail : null) || (typeof body?.error === "string" ? body.error : null) || "Payment could not be processed. Please try again or use a different card.";
302
303
  if (typeof console !== "undefined" && console.error) {
303
- console.error("[Commerce] Checkout failed:", response.status, message, error);
304
+ console.error("[Commerce] Checkout failed:", response.status, message, body);
304
305
  }
305
306
  return { success: false, error: message };
306
307
  }
@@ -4074,5 +4075,5 @@ exports.getSpotsRemaining = getSpotsRemaining;
4074
4075
  exports.isEventSoldOut = isEventSoldOut;
4075
4076
  exports.registerForEvent = registerForEvent;
4076
4077
  exports.useEventModal = useEventModal;
4077
- //# sourceMappingURL=chunk-EWXFDSZP.js.map
4078
- //# sourceMappingURL=chunk-EWXFDSZP.js.map
4078
+ //# sourceMappingURL=chunk-MVNUEXP3.js.map
4079
+ //# sourceMappingURL=chunk-MVNUEXP3.js.map