mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
🇲🇽 Add Mexico-specific logic for the new UI
This commit is contained in:
parent
82af3c07c9
commit
6738f80efc
22 changed files with 456 additions and 87 deletions
|
@ -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 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue