🇲🇽 Add Mexico-specific logic for the new UI

This commit is contained in:
Daniel Dudzic 2025-05-21 12:45:15 +02:00
parent 82af3c07c9
commit 6738f80efc
No known key found for this signature in database
GPG key ID: 31B40D33E3465483
22 changed files with 456 additions and 87 deletions

View file

@ -10,13 +10,13 @@ import PaymentFlow from '../Components/PaymentFlow';
const StepPaymentMethods = () => {
const { optionalMethods, setOptionalMethods } =
OnboardingHooks.useOptionalPaymentMethods();
const { ownBrandOnly } = CommonHooks.useWooSettings();
const { ownBrandOnly, storeCountry } = CommonHooks.useWooSettings();
const { isCasualSeller } = OnboardingHooks.useBusiness();
const { canUseCardPayments } = OnboardingHooks.useFlags();
const optionalMethodTitle = useMemo( () => {
// The BCDC flow does not show a title. !acdc does not show a title.
if ( isCasualSeller || ! canUseCardPayments ) {
// The BCDC flow does not show a title. !acdc does not show a title. Mexico does not show a title.
if ( isCasualSeller || ! canUseCardPayments || 'MX' === storeCountry ) {
return null;
}
@ -24,7 +24,7 @@ const StepPaymentMethods = () => {
'Available with additional application',
'woocommerce-paypal-payments'
);
}, [ isCasualSeller, canUseCardPayments ] );
}, [ isCasualSeller, canUseCardPayments, storeCountry ] );
const methodChoices = [
{
@ -34,7 +34,7 @@ const StepPaymentMethods = () => {
},
{
title:
ownBrandOnly || ! canUseCardPayments
ownBrandOnly || ! canUseCardPayments || 'MX' === storeCountry
? __(
'No thanks, I prefer to use a different provider for local payment methods',
'woocommerce-paypal-payments'
@ -87,7 +87,9 @@ const OptionalMethodDescription = () => {
return (
<PaymentFlow
onlyOptional={ true }
useAcdc={ ! isCasualSeller && canUseCardPayments }
useAcdc={
! isCasualSeller && canUseCardPayments && 'MX' !== storeCountry
}
isFastlane={ true }
isPayLater={ true }
ownBrandOnly={ ownBrandOnly }