@tellescope/react-components 1.244.3 → 1.244.4

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": "@tellescope/react-components",
3
- "version": "1.244.3",
3
+ "version": "1.244.4",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -51,13 +51,13 @@
51
51
  "@reduxjs/toolkit": "1.9.0",
52
52
  "@stripe/react-stripe-js": "2.9.0",
53
53
  "@stripe/stripe-js": "1.52.1",
54
- "@tellescope/constants": "1.244.3",
55
- "@tellescope/sdk": "1.244.3",
56
- "@tellescope/types-client": "1.244.3",
57
- "@tellescope/types-models": "1.244.3",
58
- "@tellescope/types-utilities": "1.244.3",
59
- "@tellescope/utilities": "1.244.3",
60
- "@tellescope/validation": "1.244.3",
54
+ "@tellescope/constants": "1.244.4",
55
+ "@tellescope/sdk": "1.244.4",
56
+ "@tellescope/types-client": "1.244.4",
57
+ "@tellescope/types-models": "1.244.4",
58
+ "@tellescope/types-utilities": "1.244.4",
59
+ "@tellescope/utilities": "1.244.4",
60
+ "@tellescope/validation": "1.244.4",
61
61
  "css-to-react-native": "3.0.0",
62
62
  "draft-js": "0.11.7",
63
63
  "draftjs-to-html": "0.9.1",
@@ -84,7 +84,7 @@
84
84
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
85
85
  "react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
86
86
  },
87
- "gitHead": "af55a139b881ba782bb99ed493e8c1ba2a0112e6",
87
+ "gitHead": "838dd43ad5ba465b2f0fcbeda4808b38cb20c2f7",
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  }
@@ -5198,9 +5198,19 @@ export const ChargeebeeInput = ({ field, value, onChange, setCustomerId, respons
5198
5198
  ? addressResponse.answer.value as { addressLineOne?: string, addressLineTwo?: string, city?: string, state?: string, zipCode?: string }
5199
5199
  : undefined
5200
5200
 
5201
+ const PUBLIC_FORM_ADDRESS_ERROR = 'A complete address question is required before a Chargebee payment field on public forms'
5202
+
5201
5203
  session.api.form_responses.chargebee_details({ fieldId: field.id, billingAddress })
5202
5204
  .then(({ url }) => setUrl(url ?? ''))
5203
- .catch(setError)
5205
+ .catch((err: any) => {
5206
+ const message = typeof err === 'string' ? err : (err?.message ?? err?.toString() ?? '')
5207
+ if (message === PUBLIC_FORM_ADDRESS_ERROR) {
5208
+ setError(PUBLIC_FORM_ADDRESS_ERROR)
5209
+ } else {
5210
+ console.error('[ChargebeeInput] failed to load checkout:', err)
5211
+ setError('Something went wrong loading the payment form. Please try again.')
5212
+ }
5213
+ })
5204
5214
  }, [session])
5205
5215
 
5206
5216
  const loadAnswerRef = useRef(false)
@@ -5243,6 +5253,7 @@ export const ChargeebeeInput = ({ field, value, onChange, setCustomerId, respons
5243
5253
  </Grid>
5244
5254
  )
5245
5255
  }
5256
+ if (!url && error) return <Typography color="error">{error}</Typography>
5246
5257
  if (!url) return <LinearProgress />
5247
5258
  return (
5248
5259
  <>