mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Add online card payments conditionally
This commit is contained in:
parent
b500e3452a
commit
91454b64d0
1 changed files with 19 additions and 15 deletions
|
@ -3,7 +3,7 @@ import { useCallback } from '@wordpress/element';
|
||||||
|
|
||||||
import SettingsCard from '../../../ReusableComponents/SettingsCard';
|
import SettingsCard from '../../../ReusableComponents/SettingsCard';
|
||||||
import { PaymentMethodsBlock } from '../../../ReusableComponents/SettingsBlocks';
|
import { PaymentMethodsBlock } from '../../../ReusableComponents/SettingsBlocks';
|
||||||
import { PaymentHooks } from '../../../../data';
|
import { CommonHooks, PaymentHooks } from '../../../../data';
|
||||||
import { useActiveModal } from '../../../../data/common/hooks';
|
import { useActiveModal } from '../../../../data/common/hooks';
|
||||||
import Modal from '../Components/Payment/Modal';
|
import Modal from '../Components/Payment/Modal';
|
||||||
|
|
||||||
|
@ -45,6 +45,8 @@ const TabPaymentMethods = () => {
|
||||||
[ changePaymentSettings, setActiveModal, setPersistent ]
|
[ changePaymentSettings, setActiveModal, setPersistent ]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const merchant = CommonHooks.useMerchant();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="ppcp-r-payment-methods">
|
<div className="ppcp-r-payment-methods">
|
||||||
<PaymentMethodCard
|
<PaymentMethodCard
|
||||||
|
@ -58,20 +60,22 @@ const TabPaymentMethods = () => {
|
||||||
methods={ methods.paypal }
|
methods={ methods.paypal }
|
||||||
onTriggerModal={ setActiveModal }
|
onTriggerModal={ setActiveModal }
|
||||||
/>
|
/>
|
||||||
<PaymentMethodCard
|
{ merchant.isBusinessSeller && (
|
||||||
id="ppcp-card-payments-card"
|
<PaymentMethodCard
|
||||||
title={ __(
|
id="ppcp-card-payments-card"
|
||||||
'Online Card Payments',
|
title={ __(
|
||||||
'woocommerce-paypal-payments'
|
'Online Card Payments',
|
||||||
) }
|
'woocommerce-paypal-payments'
|
||||||
description={ __(
|
) }
|
||||||
'Select your preferred card payment options for efficient payment processing.',
|
description={ __(
|
||||||
'woocommerce-paypal-payments'
|
'Select your preferred card payment options for efficient payment processing.',
|
||||||
) }
|
'woocommerce-paypal-payments'
|
||||||
icon="icon-checkout-online-methods.svg"
|
) }
|
||||||
methods={ methods.cardPayment }
|
icon="icon-checkout-online-methods.svg"
|
||||||
onTriggerModal={ setActiveModal }
|
methods={ methods.cardPayment }
|
||||||
/>
|
onTriggerModal={ setActiveModal }
|
||||||
|
/>
|
||||||
|
) }
|
||||||
<PaymentMethodCard
|
<PaymentMethodCard
|
||||||
id="ppcp-alternative-payments-card"
|
id="ppcp-alternative-payments-card"
|
||||||
title={ __(
|
title={ __(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue