tf-checkout-react 1.7.23 → 1.7.30

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.
@@ -9,4 +9,5 @@ export interface ICheckoutPageConfigs {
9
9
  free_ticket: boolean;
10
10
  collect_optional_wallet_address: boolean;
11
11
  collect_mandatory_wallet_address: boolean;
12
+ addon_max_quantity_groups?: number | null;
12
13
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.23",
2
+ "version": "1.7.30",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
package/src/api/index.ts CHANGED
@@ -132,6 +132,7 @@ export interface AttributesConfig {
132
132
  collect_mandatory_instagram: boolean;
133
133
  collect_optional_instagram: boolean;
134
134
  skip_billing_page: boolean;
135
+ addon_max_quantity_groups: number | null;
135
136
  cart: ICart[];
136
137
  }
137
138
 
@@ -50,7 +50,6 @@ export const usePaymentRedirect = ({
50
50
  const clientSecret = urlParams.get('payment_intent_client_secret')
51
51
 
52
52
  if (isPaymentReturn && clientSecret && stripeRef.current) {
53
- console.log('Detected payment redirect return, checking status')
54
53
  setLoading(true)
55
54
 
56
55
  try {
@@ -68,7 +67,6 @@ export const usePaymentRedirect = ({
68
67
  )
69
68
 
70
69
  if (paymentIntent?.status === 'succeeded') {
71
- console.log('Payment succeeded after redirect, continuing flow')
72
70
 
73
71
  // Clean up stored context
74
72
  localStorage.removeItem('stripe_payment_context')
@@ -495,6 +495,7 @@ const BillingInfoContainer = React.memo(
495
495
  const collectMandatoryBusinessCategory = configs?.collect_mandatory_business_category
496
496
  const collectOptionalBusinessCategory = configs?.collect_optional_business_category
497
497
  const eventHasAddons = configs?.has_add_on
498
+ const addonMaxQuantityGroups = configs?.addon_max_quantity_groups ?? undefined
498
499
  const hideBusinessCategoryField =
499
500
  !collectMandatoryBusinessCategory && !collectOptionalBusinessCategory
500
501
 
@@ -636,8 +637,6 @@ const BillingInfoContainer = React.memo(
636
637
  is_from_resale: additionalConfigs?.resale,
637
638
  },
638
639
  })
639
- console.log('Stripe in [useEffect] fetchCheckoutUpdate', checkoutUpdateResponse)
640
-
641
640
  if (checkoutUpdateResponse.success) {
642
641
  const checkoutAttributes = checkoutUpdateResponse.data.attributes
643
642
  const cartPriceBreakdown = _get(
@@ -649,10 +648,6 @@ const BillingInfoContainer = React.memo(
649
648
  'checkoutData',
650
649
  JSON.stringify({ hash: '', total: _get(cartPriceBreakdown, 'total', 0) })
651
650
  )
652
- console.log(
653
- 'Stripe in [useEffect] fetchCheckoutUpdate | checkoutAttributes',
654
- checkoutAttributes
655
- )
656
651
  setCheckoutUpdateData(checkoutAttributes)
657
652
  onCheckoutUpdateSuccess({ expires_at: expirationTime, ...cartPriceBreakdown })
658
653
  }
@@ -923,7 +918,6 @@ const BillingInfoContainer = React.memo(
923
918
  },
924
919
  [eventId, isSinglePageCheckout, onCheckoutUpdateError, onCheckoutUpdateSuccess]
925
920
  )
926
- console.log({ checkoutData })
927
921
 
928
922
  const handleAddOnSelect = useCallback(
929
923
  async (selectedAddOns: { [key: string]: number }) => {
@@ -1150,11 +1144,6 @@ const BillingInfoContainer = React.memo(
1150
1144
  is_from_resale: additionalConfigs?.resale,
1151
1145
  },
1152
1146
  })
1153
- console.log(
1154
- 'Stripe checkoutUpdateResponse in billing-info-container',
1155
- checkoutUpdateResponse
1156
- )
1157
-
1158
1147
  setCheckoutUpdateData(checkoutUpdateResponse.data.attributes)
1159
1148
 
1160
1149
  let paymentResponse = null
@@ -1167,7 +1156,6 @@ const BillingInfoContainer = React.memo(
1167
1156
 
1168
1157
  if (paymentDataResponse.success) {
1169
1158
  const { attributes } = paymentDataResponse.data
1170
- console.log('Stripe confirmPayment success in billing-info-container')
1171
1159
  setReviewData(attributes)
1172
1160
 
1173
1161
  const { order_details, cart } = attributes
@@ -1196,9 +1184,6 @@ const BillingInfoContainer = React.memo(
1196
1184
  const isFreeTickets =
1197
1185
  (!Number(total) && !Number(updatedOrderData.total)) ||
1198
1186
  !Number(updatedOrderData?.pay_now || 0)
1199
- const paymentMethod = attributes.payment_method || {}
1200
- const paymentPlanAvailable = paymentMethod.stripe_payment_plan_enabled
1201
- console.log({ paymentPlanAvailable })
1202
1187
  // Process payment using the hook
1203
1188
  paymentResponse = await processPayment(
1204
1189
  paymentDataResponse,
@@ -1353,6 +1338,7 @@ const BillingInfoContainer = React.memo(
1353
1338
  addOnDataWithCustomFields={addOnDataWithCustomFields}
1354
1339
  configs={configs}
1355
1340
  onAddOnSelect={onAddOnSelect}
1341
+ addonMaxQuantityGroups={addonMaxQuantityGroups}
1356
1342
  />
1357
1343
  ) : !addOnsIncludedOnInvitation &&
1358
1344
  includeAddons &&
@@ -20,10 +20,9 @@ import _get from 'lodash/get'
20
20
  import _identity from 'lodash/identity'
21
21
  import _isEmpty from 'lodash/isEmpty'
22
22
  import _map from 'lodash/map'
23
- import { nanoid } from 'nanoid'
24
23
  import React, { useCallback, useEffect, useMemo, useState } from 'react'
25
24
 
26
- import { getConditions, getPaymentData } from '../../api'
25
+ import { getPaymentData } from '../../api'
27
26
  import { FEES_STYLES } from '../../constants'
28
27
  import { usePixel } from '../../hooks/usePixel'
29
28
  import { createFixedFloatNormalizer, currencyNormalizerCreator } from '../../normalizers'
@@ -177,7 +176,6 @@ export const PaymentContainer = ({
177
176
  const [error, setError] = useState(null)
178
177
  const [paymentIsLoading, setPaymentIsLoading] = useState(false)
179
178
  const [paymentDataIsLoading, setPaymentDataIsLoading] = useState(true)
180
- const [conditions, setConditions] = useState<{ id: string, text: string }[]>([])
181
179
  const [currency, setCurrency] = useState('')
182
180
  const [showPaymentPlanSection, setShowPaymentPlanSection] = useState(false)
183
181
 
@@ -201,7 +199,6 @@ export const PaymentContainer = ({
201
199
  const pageUrl = isBrowser ? window.location.href.split('?')[0] : ''
202
200
  usePixel(eventId, { page: 'review', pageUrl })
203
201
 
204
- console.log({ conditions })
205
202
 
206
203
  useEffect(() => {
207
204
  const fetchPaymentData = async () => {
@@ -270,27 +267,6 @@ export const PaymentContainer = ({
270
267
  onGetPaymentDataSuccess,
271
268
  ])
272
269
 
273
- //just once
274
- useEffect(() => {
275
- // fetch conditions data
276
- const fetchConditions = async () => {
277
- if (eventId) {
278
- const conditionsResponse = await getConditions(eventId)
279
- const conditionsInfo = conditionsResponse.data.attributes
280
- setConditions(
281
- conditionsInfo
282
- ? conditionsInfo.map((item: { text: any }) => ({
283
- id: nanoid(),
284
- text: item.text,
285
- checked: false,
286
- }))
287
- : []
288
- )
289
- }
290
- }
291
- fetchConditions()
292
- }, [eventId])
293
-
294
270
  const showPaymentForm = () => {
295
271
  if (hidePaymentForm) {
296
272
  return false
@@ -375,10 +351,6 @@ export const PaymentContainer = ({
375
351
 
376
352
  useEffect(() => {
377
353
  const paymentMethod = reviewData.payment_method || {}
378
- console.log({
379
- paymentMethod,
380
- enablePaymentPlan,
381
- })
382
354
  const paymentPlanAvailable =
383
355
  paymentMethod.stripe_payment_plan_enabled && enablePaymentPlan
384
356
  setPaymentPlanIsAvailable(paymentPlanAvailable)
@@ -114,7 +114,6 @@ export const RegistrationForm: FC<IRegistrationProps> = ({
114
114
  onRegisterAccountSuccess(profileRes)
115
115
  } catch (e) {
116
116
  if (axios.isAxiosError(e)) {
117
- console.log(e)
118
117
  const errorMessage = _get(e, 'response.data.message') || 'Error'
119
118
  onRegisterAccountError(e)
120
119
  setshowErrorModal(true)
@@ -9,4 +9,5 @@ export interface ICheckoutPageConfigs {
9
9
  free_ticket: boolean;
10
10
  collect_optional_wallet_address: boolean;
11
11
  collect_mandatory_wallet_address: boolean;
12
+ addon_max_quantity_groups?: number | null;
12
13
  }