@uptrademedia/site-kit 1.0.36 → 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.
@@ -292,10 +292,16 @@ async function createCheckoutSession(optionsOrOfferingId, legacyOptions) {
292
292
  })
293
293
  });
294
294
  if (!response.ok) {
295
- const error = await response.json().catch(() => ({}));
296
- const message = error?.message || (typeof error?.error === "string" ? error.error : null) || "Checkout failed";
295
+ const text = await response.text();
296
+ let body = {};
297
+ try {
298
+ body = JSON.parse(text);
299
+ } catch {
300
+ }
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.";
297
303
  if (typeof console !== "undefined" && console.error) {
298
- console.error("[Commerce] Checkout failed:", response.status, message, error);
304
+ console.error("[Commerce] Checkout failed:", response.status, message, body);
299
305
  }
300
306
  return { success: false, error: message };
301
307
  }
@@ -4069,5 +4075,5 @@ exports.getSpotsRemaining = getSpotsRemaining;
4069
4075
  exports.isEventSoldOut = isEventSoldOut;
4070
4076
  exports.registerForEvent = registerForEvent;
4071
4077
  exports.useEventModal = useEventModal;
4072
- //# sourceMappingURL=chunk-WTMMXY7S.js.map
4073
- //# sourceMappingURL=chunk-WTMMXY7S.js.map
4078
+ //# sourceMappingURL=chunk-MVNUEXP3.js.map
4079
+ //# sourceMappingURL=chunk-MVNUEXP3.js.map