ordering-ui-react-native 0.23.46 → 0.23.48
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
|
@@ -568,6 +568,14 @@ const CartUI = (props: any) => {
|
|
|
568
568
|
/>
|
|
569
569
|
</View>
|
|
570
570
|
)}
|
|
571
|
+
{!cart?.valid_address && cart?.status !== 2 && (
|
|
572
|
+
<OText
|
|
573
|
+
color={theme.colors.error}
|
|
574
|
+
size={12}
|
|
575
|
+
>
|
|
576
|
+
{t('INVALID_CART_ADDRESS', 'Selected address is invalid, please select a closer address.')}
|
|
577
|
+
</OText>
|
|
578
|
+
)}
|
|
571
579
|
{(!isMultiCheckout || !cart?.business_id) && (
|
|
572
580
|
<>
|
|
573
581
|
{cart?.valid_products ? (
|
|
@@ -177,7 +177,7 @@ const CheckoutUI = (props: any) => {
|
|
|
177
177
|
const [isGiftCardCart, setIsGiftCardCart] = useState(!cart?.business_id)
|
|
178
178
|
const containerRef = useRef<any>()
|
|
179
179
|
const cardsMethods = ['credomatic']
|
|
180
|
-
const stripePaymethods: any = ['stripe', '
|
|
180
|
+
const stripePaymethods: any = ['stripe', 'stripe_connect', 'stripe_redirect']
|
|
181
181
|
const notFields = ['coupon', 'driver_tip', 'mobile_phone', 'address', 'zipcode', 'address_notes', 'comments']
|
|
182
182
|
|
|
183
183
|
const checkoutFields = useMemo(() => checkoutFieldsState?.fields?.filter((field: any) => field.order_type_id === options?.type), [checkoutFieldsState, options])
|
|
@@ -351,13 +351,13 @@ const CheckoutUI = (props: any) => {
|
|
|
351
351
|
const checkGuestValidationFields = () => {
|
|
352
352
|
const userSelected = user
|
|
353
353
|
const _requiredFields = checkoutFieldsState?.fields
|
|
354
|
-
.filter((field
|
|
354
|
+
.filter((field: any) => (field?.order_type_id === options?.type) && field?.enabled && field?.required_with_guest &&
|
|
355
355
|
!notFields.includes(field?.validation_field?.code) &&
|
|
356
356
|
field?.validation_field?.code !== 'email' &&
|
|
357
357
|
userSelected && !userSelected[field?.validation_field?.code])
|
|
358
|
-
const requiredFieldsCode = _requiredFields.map((item
|
|
359
|
-
const guestCheckoutCellPhone = checkoutFieldsState?.fields?.find((field
|
|
360
|
-
const guestCheckoutEmail = checkoutFieldsState?.fields?.find((field
|
|
358
|
+
const requiredFieldsCode = _requiredFields.map((item: any) => item?.validation_field?.code)
|
|
359
|
+
const guestCheckoutCellPhone = checkoutFieldsState?.fields?.find((field: any) => field.order_type_id === options?.type && field?.validation_field?.code === 'mobile_phone')
|
|
360
|
+
const guestCheckoutEmail = checkoutFieldsState?.fields?.find((field: any) => field.order_type_id === options?.type && field?.validation_field?.code === 'email')
|
|
361
361
|
if (
|
|
362
362
|
userSelected &&
|
|
363
363
|
!userSelected?.guest_cellphone &&
|
|
@@ -185,7 +185,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
185
185
|
formState.changes?.cellphone === null &&
|
|
186
186
|
((validationFields?.fields?.checkout?.cellphone?.enabled &&
|
|
187
187
|
validationFields?.fields?.checkout?.cellphone?.required) ||
|
|
188
|
-
configs?.verification_phone_required?.value === '1')
|
|
188
|
+
(configs?.verification_phone_required?.value === '1' && !user?.guest_id))
|
|
189
189
|
) {
|
|
190
190
|
content = content + `${t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Phone Number is required.',)}\n`
|
|
191
191
|
showToast(ToastType.Error, content);
|