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 { PaymentMethodsBlock } from '../../../ReusableComponents/SettingsBlocks';
|
||||
import { PaymentHooks } from '../../../../data';
|
||||
import { CommonHooks, PaymentHooks } from '../../../../data';
|
||||
import { useActiveModal } from '../../../../data/common/hooks';
|
||||
import Modal from '../Components/Payment/Modal';
|
||||
|
||||
|
@ -45,6 +45,8 @@ const TabPaymentMethods = () => {
|
|||
[ changePaymentSettings, setActiveModal, setPersistent ]
|
||||
);
|
||||
|
||||
const merchant = CommonHooks.useMerchant();
|
||||
|
||||
return (
|
||||
<div className="ppcp-r-payment-methods">
|
||||
<PaymentMethodCard
|
||||
|
@ -58,6 +60,7 @@ const TabPaymentMethods = () => {
|
|||
methods={ methods.paypal }
|
||||
onTriggerModal={ setActiveModal }
|
||||
/>
|
||||
{ merchant.isBusinessSeller && (
|
||||
<PaymentMethodCard
|
||||
id="ppcp-card-payments-card"
|
||||
title={ __(
|
||||
|
@ -72,6 +75,7 @@ const TabPaymentMethods = () => {
|
|||
methods={ methods.cardPayment }
|
||||
onTriggerModal={ setActiveModal }
|
||||
/>
|
||||
) }
|
||||
<PaymentMethodCard
|
||||
id="ppcp-alternative-payments-card"
|
||||
title={ __(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue